diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-06-12 14:40:49 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-06-12 14:40:49 +0000 |
commit | af854e41c0f98acec4be31efe1d6690cefa60554 (patch) | |
tree | 4f62cc6702eabc20c0cb9a3f1f582fc7068511a1 /src | |
parent | 6b227a12b5233ec4bac8f74e8cce64e49b5858ff (diff) | |
download | fpGUI-af854e41c0f98acec4be31efe1d6690cefa60554.tar.xz |
* Minor fixes to csUpdating ComponentState in Grids.
* fpgApplication now closes all forms created via fpgApplication.CreateForm() before the main form when the application terminates.
* Minor documentation update for fpgfx.pas unit.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gfxbase.pas | 6 | ||||
-rw-r--r-- | src/gui/gui_basegrid.pas | 5 | ||||
-rw-r--r-- | src/gui/gui_customgrid.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_grid.pas | 4 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index 03aae37d..6e419d72 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -1938,7 +1938,13 @@ begin end; procedure TfpgApplicationBase.Terminate; +var + i: integer; begin + // make sure all forms are closed before main form + for i := FormCount - 1 downto 0 do + if Forms[i] <> MainForm then + fpgSendMessage(Self, Forms[i], FPGM_CLOSE); // SendMessage waits for it to complete. Post doesn't. Terminated := True; end; diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas index 4f2382f3..a2ca441c 100644 --- a/src/gui/gui_basegrid.pas +++ b/src/gui/gui_basegrid.pas @@ -95,6 +95,7 @@ type function VisibleHeight: integer; procedure SetFirstRow(const AValue: Integer); protected + property UpdateCount: integer read FUpdateCount; procedure UpdateScrollBars; virtual; function GetHeaderText(ACol: Integer): string; virtual; function GetColumnWidth(ACol: Integer): integer; virtual; @@ -1148,6 +1149,7 @@ end; procedure TfpgBaseGrid.BeginUpdate; begin Inc(FUpdateCount); + Updating; end; procedure TfpgBaseGrid.EndUpdate; @@ -1156,7 +1158,10 @@ begin begin Dec(FUpdateCount); if FUpdateCount = 0 then + begin + Updated; RePaint; + end; end; end; diff --git a/src/gui/gui_customgrid.pas b/src/gui/gui_customgrid.pas index 1ed59e6f..dc2c0631 100644 --- a/src/gui/gui_customgrid.pas +++ b/src/gui/gui_customgrid.pas @@ -298,7 +298,7 @@ begin Result.Backgroundcolor := clBoxcolor; Result.TextColor := TextColor; FColumns.Add(Result); - + if csUpdating in ComponentState then Exit; //==> diff --git a/src/gui/gui_grid.pas b/src/gui/gui_grid.pas index eaeb9ddc..2284bec1 100644 --- a/src/gui/gui_grid.pas +++ b/src/gui/gui_grid.pas @@ -469,7 +469,9 @@ begin for r := 0 to RowCount-1 do Result.Cells.Append(''); - Updated; + + if UpdateCount = 0 then + Updated; // if we called .BeginUpdate then don't clear csUpdating here end; end. |