summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/gfxbase.pas6
-rw-r--r--src/gui/gui_basegrid.pas5
-rw-r--r--src/gui/gui_customgrid.pas2
-rw-r--r--src/gui/gui_grid.pas4
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.