diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index e7fdf80e50..b00d562cc7 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -2372,7 +2372,7 @@ end; Procedure TWinControl.Invalidate; Begin if HandleAllocated and ([csDestroying,csLoading]*ComponentState=[]) then - CNSendMessage(LM_Invalidate,Self,Nil); + TWSWinControlClass(WidgetSetClass).Invalidate(Self); end; {------------------------------------------------------------------------------} @@ -3912,6 +3912,9 @@ end; { ============================================================================= $Log$ + Revision 1.278 2004/09/14 15:48:28 micha + convert LM_INVALIDATE message to interface method + Revision 1.277 2004/09/12 19:50:35 micha convert LM_SETSIZE message to new interface method diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index f05d7fb010..dbe78be05f 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -3118,23 +3118,6 @@ begin TLMNotebookEvent(Data^).Page); end; - LM_Invalidate : - begin - Assert(False, 'Trace:Trying to invalidate window... !!!'); - //THIS DOESN'T WORK YET.... - { - Event.thetype := GDK_EXPOSE; - Event.window := PgtkWidget(Handle)^.Window; - Event.Send_Event := 0; - Event.X := 0; - Event.Y := 0; - Event.Width := PgtkWidget((Handle)^.Allocation.Width; - Event.Height := PgtkWidget(Handle)^.Allocation.Height; - gtk_Signal_Emit_By_Name(PgtkObject(Handle),'expose_event',[(Sender as TWinControl).Handle,Sender,@Event]); - Assert(False, 'Trace:Signal Emitted - invalidate window'); } - gtk_widget_queue_draw(PGtkWidget(Handle)); - end; - LM_SETFORMICON : begin if (Sender is TCustomForm) and (TCustomForm(Sender).Parent=nil) then @@ -8228,6 +8211,9 @@ end; { ============================================================================= $Log$ + Revision 1.567 2004/09/14 15:48:28 micha + convert LM_INVALIDATE message to interface method + Revision 1.566 2004/09/14 14:41:17 micha convert LM_INSERTTOOLBUTTON and LM_DELETETOOLBUTTON messages to interface methods; warning: still very ugly code, as if it is "OldToolbar" so probably, obsolete diff --git a/lcl/interfaces/gtk/gtkwscontrols.pp b/lcl/interfaces/gtk/gtkwscontrols.pp index 15549c0787..bdcaf40b5a 100644 --- a/lcl/interfaces/gtk/gtkwscontrols.pp +++ b/lcl/interfaces/gtk/gtkwscontrols.pp @@ -70,6 +70,7 @@ type class procedure SetColor(const AWinControl: TWinControl); override; class procedure SetText(const AWinControl: TWinControl; const AText: string); override; + class procedure Invalidate(const AWinControl: TWinControl); override; class procedure ShowHide(const AWinControl: TWinControl); override; end; @@ -424,6 +425,24 @@ begin Assert(False, Format('trace: [TGtkWidgetSet.SetLabel] %s --> END', [AWinControl.ClassName])); end; +procedure TGtkWSWinControl.Invalidate(const AWinControl: TWinControl); +begin + Assert(false, 'Trace:Trying to invalidate window... !!!'); + //THIS DOESN'T WORK YET.... + { + Event.thetype := GDK_EXPOSE; + Event.window := PgtkWidget(Handle)^.Window; + Event.Send_Event := 0; + Event.X := 0; + Event.Y := 0; + Event.Width := PgtkWidget((Handle)^.Allocation.Width; + Event.Height := PgtkWidget(Handle)^.Allocation.Height; + gtk_Signal_Emit_By_Name(PgtkObject(Handle),'expose_event',[(Sender as TWinControl).Handle,Sender,@Event]); + Assert(False, 'Trace:Signal Emitted - invalidate window'); + } + gtk_widget_queue_draw(PGtkWidget(AWinControl.Handle)); +end; + procedure TGtkWSWinControl.ShowHide(const AWinControl: TWinControl); begin // other methods use ShowHide also, can't move code diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc index b516a48753..80c1c3b3a6 100644 --- a/lcl/interfaces/win32/win32object.inc +++ b/lcl/interfaces/win32/win32object.inc @@ -253,7 +253,6 @@ Var //CBI: COMBOBOXINFO; DC: HDC; Handle: HWND; - SizeRect: TRECT; // used by LM_SETSIZE,LM_INVALIDATE,LM_CLB_SET_CHECKED and LM_REDRAW AMenu: TMenu; AccelTable: HACCEL; @@ -331,12 +330,6 @@ Begin Else Assert(False, Format('Trace:I don''t know how to destroy component %S', [Sender.ClassName])); End; - LM_INVALIDATE: - Begin - Assert(False, 'Trace:Trying to invalidate window... !!!'); - GetClientRect(Handle, SizeRect); - InvalidateRect(Handle, @SizeRect, True); - End; LM_SETFORMICON: Begin SetClassLong(Handle, GCL_HIcon, integer(Data)); @@ -2246,6 +2239,9 @@ End; { $Log$ + Revision 1.259 2004/09/14 15:48:28 micha + convert LM_INVALIDATE message to interface method + Revision 1.258 2004/09/14 14:41:17 micha convert LM_INSERTTOOLBUTTON and LM_DELETETOOLBUTTON messages to interface methods; warning: still very ugly code, as if it is "OldToolbar" so probably, obsolete diff --git a/lcl/interfaces/win32/win32wscontrols.pp b/lcl/interfaces/win32/win32wscontrols.pp index 6ae3bcd8be..984b65a4be 100644 --- a/lcl/interfaces/win32/win32wscontrols.pp +++ b/lcl/interfaces/win32/win32wscontrols.pp @@ -73,6 +73,7 @@ type class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override; class procedure SetText(const AWinControl: TWinControl; const AText: string); override; + class procedure Invalidate(const AWinControl: TWinControl); override; class procedure ShowHide(const AWinControl: TWinControl); override; end; @@ -313,6 +314,11 @@ Begin Assert(False, Format('Trace:[TWin32WidgetSet.SetLabel] %S --> END', [AWinControl.ClassName])); End; +procedure TWin32WSWinControl.Invalidate(const AWinControl: TWinControl); +begin + // lpRect = nil updates entire client area of window + InvalidateRect(AWinControl.Handle, nil, true); +end; procedure TWin32WSWinControl.ShowHide(const AWinControl: TWinControl); begin diff --git a/lcl/lmessages.pp b/lcl/lmessages.pp index a49d3393ed..7c5d5596d1 100644 --- a/lcl/lmessages.pp +++ b/lcl/lmessages.pp @@ -56,7 +56,6 @@ const LM_RESIZECHILDREN = LM_ComUser+13; LM_GetLineCount = LM_ComUser+16; LM_CANVASCREATE = LM_ComUser+19; - LM_Invalidate = LM_ComUser+32; LM_SETPROPERTIES = LM_ComUser+39; // update object to reflect current properties LM_SETVALUE = LM_ComUser+40; // set actual value of object to visual object @@ -826,7 +825,6 @@ begin LM_RESIZECHILDREN :Result:='LM_RESIZECHILDREN'; LM_GetLineCount :Result:='LM_GetLineCount'; LM_CANVASCREATE :Result:='LM_CANVASCREATE'; - LM_Invalidate :Result:='LM_Invalidate'; LM_SETPROPERTIES :Result:='LM_SETPROPERTIES'; LM_SETVALUE :Result:='LM_SETVALUE'; @@ -963,6 +961,9 @@ end. { $Log$ + Revision 1.99 2004/09/14 15:48:28 micha + convert LM_INVALIDATE message to interface method + Revision 1.98 2004/09/14 14:41:17 micha convert LM_INSERTTOOLBUTTON and LM_DELETETOOLBUTTON messages to interface methods; warning: still very ugly code, as if it is "OldToolbar" so probably, obsolete diff --git a/lcl/widgetset/wscontrols.pp b/lcl/widgetset/wscontrols.pp index ae691429df..2c1c23632a 100644 --- a/lcl/widgetset/wscontrols.pp +++ b/lcl/widgetset/wscontrols.pp @@ -77,6 +77,7 @@ type class procedure SetText(const AWinControl: TWinControl; const AText: String); virtual; class procedure SetColor(const AWinControl: TWinControl); virtual; + class procedure Invalidate(const AWinControl: TWinControl); virtual; class procedure ShowHide(const AWinControl: TWinControl); virtual; end; TWSWinControlClass = class of TWSWinControl; @@ -169,6 +170,10 @@ procedure TWSWinControl.SetColor(const AWinControl: TWinControl); begin end; +procedure TWSWinControl.Invalidate(const AWinControl: TWinControl); +begin +end; + procedure TWSWinControl.ShowHide(const AWinControl: TWinControl); begin end;