diff --git a/docs/DesignGuidelines.txt b/docs/DesignGuidelines.txt index a321600313..860957be00 100644 --- a/docs/DesignGuidelines.txt +++ b/docs/DesignGuidelines.txt @@ -8,7 +8,10 @@ Coding style: - Try to avoid unit circles. This makes it easier to navigate and when unit is growing allows to split it. - Minimize the number of calls from Interfaces to LCL, when performing an - action requested by the LCL. + action requested by the LCL. The interfaces only notify the LCL, never forces + something. The LCL decides. + Naming convention: + Notifications for TControl decendants should be named CNxxx. - All code must work with all checks (range, io, overflow, stack) on. Beside that this helps debugging, some users put these checks into their fpc.cfg, so they are applied to whole lazarus. Including packages and examples. diff --git a/lcl/controls.pp b/lcl/controls.pp index 7ca7543c55..847ff2edd8 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -1049,6 +1049,7 @@ type Lock: boolean); virtual; procedure GetPreferredSize(var PreferredWidth, PreferredHeight: integer; Raw: boolean); virtual; + procedure CNPreferredSizeChanged; procedure InvalidatePreferredSize; virtual; public constructor Create(TheOwner: TComponent);override; @@ -2911,6 +2912,9 @@ end. { ============================================================================= $Log$ + Revision 1.300 2005/06/25 14:17:57 mattias + added notification method CNPreferredSizeChanged + Revision 1.299 2005/06/22 17:37:06 mattias implemented TMouse.SetCursorPos from Andrew diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 5a59ce64dd..9561218d1a 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -3460,9 +3460,14 @@ begin end; end; +procedure TControl.CNPreferredSizeChanged; +begin + InvalidatePreferredSize; +end; + {------------------------------------------------------------------------------ procedure TControl.InvalidatePreferredSize; - + Invalidate the cache of the preferred size of this and all parent controls. ------------------------------------------------------------------------------} procedure TControl.InvalidatePreferredSize; @@ -3536,6 +3541,9 @@ end; { ============================================================================= $Log$ + Revision 1.260 2005/06/25 14:17:57 mattias + added notification method CNPreferredSizeChanged + Revision 1.259 2005/06/22 23:04:44 mattias implemented default height for gtk TStatusBar and set TStatusBar.AutoSize to true diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index f6f3bb3960..7c4fe6011e 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -232,7 +232,7 @@ begin end; if TheWinControl<>nil then begin - TheWinControl.InvalidatePreferredSize; + TheWinControl.CNPreferredSizeChanged; SetCursor(TheWinControl, crDefault); ConnectInternalWidgetsSignals(MainWidget,TheWinControl); UpdateWidgetStyleOfControl(TheWinControl); @@ -2986,6 +2986,9 @@ end; { ============================================================================= $Log$ + Revision 1.280 2005/06/25 14:17:57 mattias + added notification method CNPreferredSizeChanged + Revision 1.279 2005/06/03 20:58:23 mattias fixed focussing modal forms on gtk intf