From 5f5242cdca74242f34e344e6ac24ff8c6a3e40fb Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 17 Aug 2002 23:41:05 +0000 Subject: [PATCH] fixed setcolor for streamed components git-svn-id: trunk@2178 - --- lcl/controls.pp | 6 +++++- lcl/include/wincontrol.inc | 22 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lcl/controls.pp b/lcl/controls.pp index 71a0866329..375e13cfa6 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -754,7 +754,7 @@ type { TWinControl } - TWinControlFlag = (wcfClientRectNeedsUpdate); + TWinControlFlag = (wcfClientRectNeedsUpdate,wcfColorChanged); TWinControlFlags = set of TWinControlFlag; TWinControl = class(TControl) @@ -847,6 +847,7 @@ type procedure CreateHandle; virtual; procedure CreateWnd; virtual; //creates the window procedure InitializeWnd; virtual; //gets called after the window is created + procedure Loaded; override; procedure DestroyWnd; virtual; procedure UpdateShowing; virtual; procedure ShowControl(AControl: TControl); virtual; @@ -1438,6 +1439,9 @@ end. { ============================================================================= $Log$ + Revision 1.101 2003/01/01 13:01:01 mattias + fixed setcolor for streamed components + Revision 1.100 2002/12/28 12:42:38 mattias focus fixes, reduced lpi size diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index a06d5a1cd3..79afcd71bc 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -938,7 +938,10 @@ begin if Value=Color then exit; inherited SetColor(Value); if HandleAllocated and (not (csLoading in ComponentState)) then - CNSendMessage(LM_SETCOLOR, Self, nil); + CNSendMessage(LM_SETCOLOR, Self, nil) + else + Include(FFlags,wcfColorChanged); +writeln('TWinControl.SetColor ',Name,':',ClassName,' ',wcfColorChanged in FFlags); end; procedure TWinControl.PaintHandler(var TheMessage: TLMPaint); @@ -2295,6 +2298,7 @@ begin CNSendMessage(LM_SETSIZE, Self, @R); CNSendMessage(LM_SHOWHIDE, Self, nil); CNSendMessage(LM_SETCOLOR, Self, nil); + Exclude(FFlags,wcfColorChanged); EnableWindow(Handle, Enabled); @@ -2305,6 +2309,19 @@ begin SetProp(Handle,'Control',TControl(Self)); end; +{------------------------------------------------------------------------------ + procedure TWinControl.Loaded; + ------------------------------------------------------------------------------} +procedure TWinControl.Loaded; +begin + inherited Loaded; + if wcfColorChanged in FFlags then begin +writeln('TWinControl.Loaded ',Name,':',ClassName); + CNSendMessage(LM_SETCOLOR, Self, nil); + Exclude(FFlags,wcfColorChanged); + end; +end; + {------------------------------------------------------------------------------ Method: TWinControl.DestroyWnd Params: None @@ -2563,6 +2580,9 @@ end; { ============================================================================= $Log$ + Revision 1.113 2003/01/01 13:01:01 mattias + fixed setcolor for streamed components + Revision 1.112 2002/12/29 18:13:38 mattias identifier completion: basically working, still hidden