diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-08-09 18:27:19 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-08-09 18:27:19 +0100 |
commit | 7ee7fdc34ac81b6fa8384cbc3f6b4698d5694c73 (patch) | |
tree | 7d859d591db1456c091d4b922e34ed7029418bee /examples | |
parent | 641f24b2cbccbb3b8c8629f89b1b9d61196ae950 (diff) | |
download | fpGUI-7ee7fdc34ac81b6fa8384cbc3f6b4698d5694c73.tar.xz |
maximus: ESC key now cancels the Project Options dialog.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/apps/ide/src/frm_configureide.pas | 4 | ||||
-rw-r--r-- | examples/apps/ide/src/frm_projectoptions.pas | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/examples/apps/ide/src/frm_configureide.pas b/examples/apps/ide/src/frm_configureide.pas index fad0418f..51061a42 100644 --- a/examples/apps/ide/src/frm_configureide.pas +++ b/examples/apps/ide/src/frm_configureide.pas @@ -1,7 +1,7 @@ { fpGUI IDE - Maximus - Copyright (C) 2012 - 2013 Graeme Geldenhuys + Copyright (C) 2012 - 2014 Graeme Geldenhuys See the file COPYING.modifiedLGPL, included in this distribution, for details about redistributing fpGUI. @@ -229,7 +229,6 @@ constructor TConfigureIDEForm.Create(AOwner: TComponent); begin inherited Create(AOwner); FInternalMacroList := TIDEMacroList.Create; - OnKeyPress := @FormKeyPressed; end; destructor TConfigureIDEForm.Destroy; @@ -248,6 +247,7 @@ begin Hint := ''; ShowHint := True; WindowPosition := wpOneThirdDown; + OnKeyPress := @FormKeyPressed; btnCancel := TfpgButton.Create(self); with btnCancel do diff --git a/examples/apps/ide/src/frm_projectoptions.pas b/examples/apps/ide/src/frm_projectoptions.pas index 1e1c318a..a3e43d6a 100644 --- a/examples/apps/ide/src/frm_projectoptions.pas +++ b/examples/apps/ide/src/frm_projectoptions.pas @@ -1,7 +1,7 @@ { fpGUI IDE - Maximus - Copyright (C) 2012 - 2013 Graeme Geldenhuys + Copyright (C) 2012 - 2014 Graeme Geldenhuys See the file COPYING.modifiedLGPL, included in this distribution, for details about redistributing fpGUI. @@ -103,6 +103,7 @@ type procedure CleanupCompilerDirs; procedure CleanupUserMacrosGrid; procedure SaveToMacroList(AList: TIDEMacroList); + procedure FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -582,6 +583,12 @@ begin // AList.SetValue(cMacro_FPCSrcDir, edtFPCSrcDir.Directory); end; +procedure TProjectOptionsForm.FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyEscape then + Close; +end; + constructor TProjectOptionsForm.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -603,6 +610,7 @@ begin WindowTitle := 'Project Options'; Hint := ''; ShowHint := True; + OnKeyPress := @FormKeyPressed; btnCancel := TfpgButton.Create(self); with btnCancel do |