<div dir="ltr"><div class="gmail_quote">On Tue, Aug 17, 2010 at 8:03 AM, Felipe Monteiro de Carvalho <span dir="ltr"><<a href="mailto:felipemonteiro.carvalho@gmail.com">felipemonteiro.carvalho@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div id=":wi">MoveWindowOrg is very problematic under Windows CE, it basically<br>
destroys all native drawing of controls if overused.</div></blockquote></div><br>Yes it is WinCE issue, i have tested with native API, ClipRect not moved to new coordinates, but MoveWindowOrg worked in WinCE <br><br>--------------------------------------------------------<br>
procedure TForm1.Paint;<br>var<br> R: TRect;<br> sdc: Integer;<br>begin<br> inherited Paint;<br> Windows.GetClipBox(Canvas.Handle, @R);<br> Log(PrintRect(R));<br> sdc := SaveDC(Canvas.Handle);<br> MoveWindowOrg(Canvas.Handle, 100, 100);<br>
Windows.GetClipBox(Canvas.Handle, @R);<br> Log(PrintRect(R));<br> RestoreDC(Canvas.Handle, sdc);<br> Windows.GetClipBox(Canvas.Handle, @R);<br> Log(PrintRect(R));<br>end; <br>--------------------------------------------------------<br>
<br><br>The next example it used to test MoveWindowOrg and it is worked,<br>--------------------------------------------------------<br>procedure TForm1.Button3Click(Sender: TObject);<br>var<br> R: TRect;<br>begin<br> R:= Rect(10, 100, 60, 150);<br>
Canvas.Brush.Style := bsClear;<br> Canvas.Pen.Color := clGreen;<br> Canvas.Rectangle(R);<br> MyMoveWindowOrg(Canvas.Handle, 50, 50);<br> Canvas.Brush.Style := bsClear;<br> Canvas.Pen.Color := clGreen;<br> Canvas.Rectangle(R);<br>
end;<br>--------------------------------------------------------<br><br>What if implement the GetClipRect in WinCE wedgetset to offset the rect depenf on the new coordinaed by call GetWindowsOrgEx, I will test it<br clear="all">
<br>function TWinCEWidgetSet.GetClipBox(DC : hDC; lpRect : PRect) : Longint;<br>var<br> P: TPoint;<br>begin<br> Result := Windows.GetClipBox(DC, Windows.LPRECT(lpRect));<br> LCLIntf.GetWindowOrgEx(DC, @P);<br> OffsetRect(lpRect^, -P.x, -P.y);<br>
end; <br><br>Thanks<br>-- <br>Zaher Dirkey<br>
</div>