diff --git a/lcl/include/customstatictext.inc b/lcl/include/customstatictext.inc index 2611754e26..e59369bbfd 100644 --- a/lcl/include/customstatictext.inc +++ b/lcl/include/customstatictext.inc @@ -105,8 +105,10 @@ procedure TCustomStaticText.SetShowAccelChar(Val: boolean); begin if Val <> FShowAccelChar then begin FShowAccelChar:= Val; - if HandleAllocated then + if HandleAllocated then begin TWSWinControlClass(WidgetSetClass).SetText(Self,Caption); + InvalidatePreferredSize; + end; end; end; @@ -144,6 +146,9 @@ end; { ============================================================================= $Log$ + Revision 1.15 2005/06/25 01:42:38 mattias + moved InvalidatePreferredSize from gtk intf to lcl + Revision 1.14 2005/06/24 14:03:33 mattias added some anchorside autosizing, activated new generic autosizing, removed old special DoAutoSize methods diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index ace8c4b024..fcd76914ad 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -3885,8 +3885,10 @@ begin EnableWindow(Handle, Enabled); // Delay the setting of text until it is completely loaded - if not (csLoading in ComponentState) - then TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption); + if not (csLoading in ComponentState) then begin + TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption); + InvalidatePreferredSize; + end; // send pending resize event Resize; @@ -3957,7 +3959,8 @@ begin then begin // Set cached caption TWSWinControlClass(WidgetSetClass).SetText(Self, FCaption); - + InvalidatePreferredSize; + if [wcfColorChanged,wcfFontChanged]*FWinControlFlags<>[] then begin TWSWinControlClass(WidgetSetClass).SetColor(Self); @@ -4390,7 +4393,10 @@ procedure TWinControl.RealSetText(const AValue: TCaption); begin if HandleAllocated and (not (csLoading in ComponentState)) - then TWSWinControlClass(WidgetSetClass).SetText(Self, AValue); + then begin + TWSWinControlClass(WidgetSetClass).SetText(Self, AValue); + InvalidatePreferredSize; + end; inherited RealSetText(AValue); end; @@ -4507,6 +4513,9 @@ end; { ============================================================================= $Log$ + Revision 1.327 2005/06/25 01:42:38 mattias + moved InvalidatePreferredSize from gtk intf to lcl + Revision 1.326 2005/06/24 14:03:33 mattias added some anchorside autosizing, activated new generic autosizing, removed old special DoAutoSize methods diff --git a/lcl/interfaces/gtk/gtkwsbuttons.pp b/lcl/interfaces/gtk/gtkwsbuttons.pp index c51cd64097..7e39431d27 100644 --- a/lcl/interfaces/gtk/gtkwsbuttons.pp +++ b/lcl/interfaces/gtk/gtkwsbuttons.pp @@ -178,7 +178,6 @@ var begin if not WSCheckHandleAllocated(AWincontrol, 'SetText') then Exit; - AWinControl.InvalidatePreferredSize; BtnWidget := PGtkButton(AWinControl.Handle); {$IFDEF GTK2}