diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-17 09:37:45 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-17 09:37:45 +0000 |
commit | 7c9a454f0e731d16c5b1691152caafbf488f7192 (patch) | |
tree | bd729fedb2b8317b8c665f877978d78444634d04 /prototypes | |
parent | 5d64a196ab40aae5ddf66e984633334f1d40cd45 (diff) | |
download | fpGUI-7c9a454f0e731d16c5b1691152caafbf488f7192.tar.xz |
* Minor fix in TfpgButton where the spacebar key didn't click the button any more.
Diffstat (limited to 'prototypes')
-rw-r--r-- | prototypes/fpgui2/source/core/keys.inc | 1 | ||||
-rw-r--r-- | prototypes/fpgui2/source/gui/gui_button.pas | 13 |
2 files changed, 3 insertions, 11 deletions
diff --git a/prototypes/fpgui2/source/core/keys.inc b/prototypes/fpgui2/source/core/keys.inc index c2c9190a..832a6a16 100644 --- a/prototypes/fpgui2/source/core/keys.inc +++ b/prototypes/fpgui2/source/core/keys.inc @@ -16,6 +16,7 @@ const keyReturn = $0d; keyEscape = $1b; keyDelete = $7f; + keySpace = $20; // special keys diff --git a/prototypes/fpgui2/source/gui/gui_button.pas b/prototypes/fpgui2/source/gui/gui_button.pas index cf8199fa..3867cbb8 100644 --- a/prototypes/fpgui2/source/gui/gui_button.pas +++ b/prototypes/fpgui2/source/gui/gui_button.pas @@ -44,7 +44,6 @@ type procedure SetShowImage(AValue: Boolean); procedure HandlePaint; override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; - procedure HandleKeyChar(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleKeyRelease(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure HandleLMouseDown(X, Y: integer; ShiftState: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; @@ -323,7 +322,7 @@ end; procedure TfpgButton.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); begin - if (keycode = keyReturn) or (keycode = keySelect) then + if (keycode = keyReturn) or (keycode = keySpace) then begin DoPush; Consumed := True; @@ -332,17 +331,9 @@ begin inherited; end; -procedure TfpgButton.HandleKeyChar(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); -begin - if (keycode = keyReturn) or (keycode = keySelect) then - Consumed := True - else - inherited; -end; - procedure TfpgButton.HandleKeyRelease(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); begin - if (keycode = keyReturn) or (keycode = keySelect) then + if (keycode = keyReturn) or (keycode = keySpace) then begin DoRelease; Consumed := True; |