About WinCE it is like as Win32 i feel its compatible,
If you like, We can return to the topic, i see ExcludeClipRect in wincontrol.inc in
procedure TWinControl.PaintHandler(var TheMessage: TLMPaint);
if not ControlsNeedsClipping then begin
//DebugLn('[TWinControl.PaintHandler] ',DbgSName(Self),' no clipping ...');
PaintWindow(DC)
end else
begin
SaveIndex := SaveDC(DC);
Clip := SimpleRegion;
for I := 0 to FControls.Count - 1 do begin
CurControl:=TControl(FControls[I]);
if ControlMustBeClipped(CurControl) then
with CurControl do begin
//DebugLn('TWinControl.PaintHandler Exclude Child ',DbgSName(Self),' Control=',DbgSName(CurControl),'(',dbgs(CurControl.BoundsRect),')');
Clip := ExcludeClipRect(DC, Left, Top, Left + Width, Top + Height);
if Clip = NullRegion then Break;
end;
end;
PaintHandler Clip the rect of Child Graph Controls it then paint the window PaintWindow
procedure TWinControl.EraseBackground(DC: HDC);
var
ARect: TRect;
begin
if DC=0 then exit;
ARect:=Rect(0,0,Width,Height);
FillRect(DC,ARect,Brush.Handle)
end;
In this function also must Clip the rect of Controls before FillRect, this will remove flicker, but that can make slow painting, or not work in GTK, and some Graph controls depend on the EraseBackground to paint it self, (maybe can add csClipRect to Control.ControlStyle)
This problem also found in Delphi and i always inherit painting background to remove painting it, and paint the FillRect in the Paint() method (it is happened after clipping the Controls)
I mention Graph controls not All controls because WinControls already clipped by the system if WS_CLIPCHILDREN used