View Issue Details

IDProjectCategoryView StatusLast Update
0024107LazarusLCLpublic2015-02-06 18:12
ReporterSven Barth Assigned ToStephano  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformARMOSWinCE 
Product Version1.0.4 
Summary0024107: WinCE: ClipRect of controls not working correctly
DescriptionAs seen in issue 0024106 a control can draw beyond it's Canvas. To workaround this I had the idea to use Clipping and ClipRect, but that had it's one share of problems, because it seems that the clipping region is anchored on the form's upper right instead of the control's upper right (so I need to move the clipping region by the control's position to get the correct one).
Additional InformationAttached is an example which draws a red rectangle into a PaintBox surrounded by a frame. This rectangle is created by setting the ClipRect and then drawing a rectangle for the complete size of the Canvas. On Win32 this results in a rectangle that starts at 10,10 of the control and contiues to its center. On WinCE howver the control starts at 0,0 of the control and stops somewhere in between.
If you now check the CheckBox which tells the OnPaint handler to offset the clipping rect by the PaintBox's coordinates then the rectangle is drawn to the correct position.
Tagscliprect, wince
Fixed in Revision
LazTarget-
WidgetsetWinCE
Attached Files

Relationships

related to 0017249 closedFelipe Monteiro de Carvalho ClipRect, ExcludeClipRect not work after SetWindowOrgExt 
related to 0024106 assignedStephano WinCE: TGraphicControl can draw beyond it's Canvas 

Activities

Sven Barth

2013-03-21 17:26

manager  

clippingtest.zip (128,465 bytes)

Zaher Dirkey

2013-03-31 09:38

reporter   ~0066658

It is related to this old solved bugs
http://bugs.freepascal.org/view.php?id=17249 [^]

Zaher Dirkey

2013-03-31 10:08

reporter   ~0066659

I have tested it with my device, yes this bug is return.

Zaher Dirkey

2013-03-31 10:36

reporter   ~0066661

Last edited: 2013-03-31 10:40

View 2 revisions

http://comments.gmane.org/gmane.comp.ide.lazarus.general/43722
http://comments.gmane.org/gmane.comp.ide.lazarus.general/40976

http://www.lazarus.freepascal.org/index.php?topic=10237.0

http://bugs.freepascal.org/view.php?id=17451&nbn=7

http://msdn.microsoft.com/en-us/library/aa924507.aspx

Zaher Dirkey

2013-04-03 20:48

reporter   ~0066787

Please open lazarus\lcl\interfaces\wince\wincewinapi.inc

Find and remove commenting from it the to be like this

function TWinCEWidgetSet.IntersectClipRect(dc: hdc;
  Left, Top, Right, Bottom: Integer): Integer;
begin
  Result := Windows.IntersectClipRect(DC, Left, Top, Right, Bottom);
end;

Please test it and other bugs related to it.

Zaher Dirkey

2013-04-03 22:00

reporter   ~0066788

Last edited: 2013-04-04 16:15

View 2 revisions

Maybe IntersectClipRect not supported with older WinCE, but it is work in Wince5
we can omit it with define like
{$ifndef OLDWINCE}
Result := Windows.IntersectClipRect(DC, Left, Top, Right, Bottom);
{$endif OLDWINCE}

Issue History

Date Modified Username Field Change
2013-03-21 17:26 Sven Barth New Issue
2013-03-21 17:26 Sven Barth File Added: clippingtest.zip
2013-03-31 09:30 Zaher Dirkey Tag Attached: wince
2013-03-31 09:38 Zaher Dirkey Note Added: 0066658
2013-03-31 10:08 Zaher Dirkey Note Added: 0066659
2013-03-31 10:36 Zaher Dirkey Note Added: 0066661
2013-03-31 10:40 Zaher Dirkey Note Edited: 0066661 View Revisions
2013-03-31 14:01 Zaher Dirkey Tag Attached: cliprect
2013-04-03 20:48 Zaher Dirkey Note Added: 0066787
2013-04-03 22:00 Zaher Dirkey Note Added: 0066788
2013-04-04 16:15 Zaher Dirkey Note Edited: 0066788 View Revisions
2013-04-13 16:57 Felipe Monteiro de Carvalho Relationship added related to 0017249
2013-04-13 16:58 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2013-04-13 16:58 Felipe Monteiro de Carvalho Status new => assigned
2013-04-13 16:59 Felipe Monteiro de Carvalho Relationship added related to 0024106
2015-02-06 18:12 Juha Manninen Assigned To Felipe Monteiro de Carvalho => Stephano