diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-10-12 17:41:04 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-10-12 17:41:04 +0100 |
commit | a05db065882603308edbdac2587f981c1d19b07e (patch) | |
tree | 25daa1666a841c503da00bfcc7018acff0078636 /src/gui | |
parent | 8d934b2bf8596c217ac4596004c988692f708d31 (diff) | |
download | fpGUI-a05db065882603308edbdac2587f981c1d19b07e.tar.xz |
ESC key now cancels the InputQuery dialog.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/inputquerydialog.inc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/inputquerydialog.inc b/src/gui/inputquerydialog.inc index 094a58e2..6330d02c 100644 --- a/src/gui/inputquerydialog.inc +++ b/src/gui/inputquerydialog.inc @@ -31,6 +31,8 @@ type {@VFD_HEAD_END: fpgQueryDialog} procedure SetupCaptions; procedure edtTextKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + protected + procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; public procedure AfterCreate; override; end; @@ -71,6 +73,15 @@ begin btnOK.Click; end; +procedure TfpgQueryDialog.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); +begin + if KeyCode = keyEscape then + begin + consumed := True; + ModalResult := mrCancel; + end; +end; + procedure TfpgQueryDialog.AfterCreate; begin {%region 'Auto-generated GUI code' -fold} |