From 37f449b8ddb33bda1939d69db4da2674c9abb28d Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 24 Aug 2011 12:09:21 +0200 Subject: ide: Configure IDE dialog now closes when the Esc key is pressed. --- examples/apps/ide/src/frm_configureide.pas | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'examples') diff --git a/examples/apps/ide/src/frm_configureide.pas b/examples/apps/ide/src/frm_configureide.pas index b3fb02da..458c16b0 100644 --- a/examples/apps/ide/src/frm_configureide.pas +++ b/examples/apps/ide/src/frm_configureide.pas @@ -64,6 +64,7 @@ type procedure LoadSettings; procedure SaveSettings; 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; @@ -191,10 +192,17 @@ begin AList.SetValue(cMacro_Target, edtTarget.Text); end; +procedure TConfigureIDEForm.FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); +begin + if KeyCode = keyEscape then + Close; +end; + constructor TConfigureIDEForm.Create(AOwner: TComponent); begin inherited Create(AOwner); FInternalMacroList := TIDEMacroList.Create; + OnKeyPress := @FormKeyPressed; end; destructor TConfigureIDEForm.Destroy; -- cgit v1.2.3-70-g09d2