Recent

Author Topic: MoveWindowOrg, and ClipRect, ExcludeClipRect problem  (Read 6373 times)

Zaher

  • Hero Member
  • *****
  • Posts: 601
    • parmaja.com
MoveWindowOrg, and ClipRect, ExcludeClipRect problem
« on: August 19, 2010, 02:13:33 am »
In WinCE there is problem after PaintControls in need to paint the TGraphicControl, Before send the paint, PaintControls move the window org (MoveWindowOrg) to make the TGraphicControl can draw started from 0,0 of it self.
But the problem the Canvas.ClipRect not moved in WinCE that make bug in complex controls used ClipRect.
Also we have the same problem when this control use ExcludeClipRect

the attached file is project have class using the both function and we can see the problem in WinCE compared with Win32, also if define CORRECT by remove the dot in the header if unit1.pas {.$DEFINE CORRECT} we can see how the problem solved.
The Idea to solve the problem by modify GetClipBox in WinCE widgetset
Code: Pascal  [Select][+][-]
  1.  
  2. function TWinCEWidgetSet.GetClipBox(DC : hDC; lpRect : PRect) : Longint;
  3. var
  4.   P: TPoint;
  5. begin
  6.   Result := Windows.GetClipBox(DC, Windows.LPRECT(lpRect));
  7.   LCLIntf.GetWindowOrgEx(DC, @P);
  8.   OffsetRect(lpRect^, -P.x, -P.y);
  9. end;
  10.  
also for ExcludeClipRect, LDtoDP and DPtoLD.

But my ask, why that problem it is appear now, my controls worked in the past perfectly?.

Related bugs
http://bugs.freepascal.org/view.php?id=0014857
http://bugs.freepascal.org/view.php?id=15654
« Last Edit: August 23, 2010, 05:14:52 am by Zaher »

Zaher

  • Hero Member
  • *****
  • Posts: 601
    • parmaja.com
Re: MoveWindowOrg, and ClipRect, ExcludeClipRect problem
« Reply #1 on: August 19, 2010, 02:23:14 am »
In my example, i draw smallbox with green or red color to see the changed, but i draw Lime rect to see the ClipRect, to test run it and press flip, you must see the small box rounded with Lime color rect, in WinCE you can not see the same thing, just after remove the dot and correct the coordinates.

 

TinyPortal © 2005-2018