summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-09-05 16:59:36 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-09-05 16:59:36 +0200
commit823bd4c35e69fc8fba8c563d729a2ca248c18744 (patch)
tree36742565241548cbb496246b3ec41ad5b6ff75ea
parentf26a89e535ecfb1bcdbed1b64b31d5839f381b52 (diff)
downloadfpGUI-823bd4c35e69fc8fba8c563d729a2ca248c18744.tar.xz
Input Query Dialog: let it respond to Enter keypress as if OK button was clicked.
-rw-r--r--src/gui/inputquerydialog.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/inputquerydialog.inc b/src/gui/inputquerydialog.inc
index 5b063233..e7769246 100644
--- a/src/gui/inputquerydialog.inc
+++ b/src/gui/inputquerydialog.inc
@@ -30,6 +30,7 @@ type
btnCancel: TfpgButton;
{@VFD_HEAD_END: fpgQueryDialog}
procedure SetupCaptions;
+ procedure edtTextKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean);
public
procedure AfterCreate; override;
end;
@@ -62,6 +63,12 @@ begin
btnCancel.Text := rsCancel;
end;
+procedure TfpgQueryDialog.edtTextKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean);
+begin
+ if KeyCode = keyEnter then
+ btnOK.Click;
+end;
+
procedure TfpgQueryDialog.AfterCreate;
begin
{%region 'Auto-generated GUI code' -fold}
@@ -94,6 +101,7 @@ begin
TabOrder := 2;
Text := '';
FontDesc := '#Edit1';
+ OnKeyPress := @edtTextKeyPressed;
end;
btnOK := TfpgButton.Create(self);