summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-19 11:59:54 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-19 11:59:54 +0000
commit84b846870972bc8e8de0a1941097a8939b086c84 (patch)
tree52e24612387b71d1d9d0f65d0d2af68a96ea9c95 /src
parent19fb9140056fa79aac6ccd25018bb5175ccfc0d0 (diff)
downloadfpGUI-84b846870972bc8e8de0a1941097a8939b086c84.tar.xz
* Restore button state if an exception occurs inside the Click event.
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui_button.pas8
-rw-r--r--src/gui/gui_form.pas6
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/gui_button.pas b/src/gui/gui_button.pas
index b1225d50..5d9f9eef 100644
--- a/src/gui/gui_button.pas
+++ b/src/gui/gui_button.pas
@@ -379,6 +379,7 @@ begin
begin
FDown := False;
RePaint;
+ fpgApplication.ProcessMessages;
if PtInRect(r, Point(x, y)) then
Click;
end;
@@ -386,10 +387,13 @@ begin
else
begin
if FDown and FClicked then
+ begin
+ FDown := False;
+ RePaint;
+ fpgApplication.ProcessMessages;
if PtInRect(r, Point(x, y)) then
Click;
- FDown := False;
- RePaint;
+ end;
end;
FClickOnPush := False;
diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas
index abcee416..843345d1 100644
--- a/src/gui/gui_form.pas
+++ b/src/gui/gui_form.pas
@@ -237,7 +237,7 @@ end;
function TfpgForm.ShowModal: integer;
var
- CloseAction: TCloseAction;
+ lCloseAction: TCloseAction;
begin
FWindowType := wtModalForm;
fpgApplication.PushModalForm(self);
@@ -266,8 +266,8 @@ begin
if ModalResult <> 0 then
begin
- CloseAction := caFree; // Dummy variable - we do nothing with it
- DoOnClose(CloseAction); // Simply so the OnClose event fires.
+ lCloseAction := caFree; // Dummy variable - we do nothing with it
+ DoOnClose(lCloseAction); // Simply so the OnClose event fires.
end;
end;