diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-29 17:07:49 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-29 17:07:49 +0200 |
commit | 2d5dbe02a67013a1e1812e0c030b6938b467ba51 (patch) | |
tree | b33f15812f44f6e609736facb2c84b34cc0bebe8 /src | |
parent | f7309898d2b80ac84b6acc694dbd6585603df370 (diff) | |
download | fpGUI-2d5dbe02a67013a1e1812e0c030b6938b467ba51.tar.xz |
bugfix: button click via keyboard was broken.
When I changed the DoubleClick and SingleClick behaviour I accidently
broke the 'click via keyboard' (Enter or SpaceBar).
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_button.pas | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas index cc9866c3..b2468cf5 100644 --- a/src/gui/fpg_button.pas +++ b/src/gui/fpg_button.pas @@ -45,7 +45,7 @@ type FImageName: string; FClicked: Boolean; FShowImage: Boolean; - FClickOnPush: Boolean; + FClickOnPush: Boolean; { Used for group buttons where click happens on "down" state. Normal buttons, the click happens on "release" state } FGroupIndex: integer; FAllowAllUp: boolean; FModalResult: TfpgModalResult; @@ -695,6 +695,7 @@ procedure TfpgBaseButton.HandleKeyPress(var keycode: word; var shiftstate: TShif begin if (keycode = keyReturn) or (keycode = keySpace) or (keycode = keyPEnter) then begin + FOnClickPending := True; DoPush; Consumed := True; end @@ -706,8 +707,9 @@ procedure TfpgBaseButton.HandleKeyRelease(var keycode: word; var shiftstate: TSh begin if (keycode = keyReturn) or (keycode = keySpace) or (keycode = keyPEnter) then begin - DoRelease(1, 1); // fake co-ordinates to it executes the Click + DoRelease(1, 1); // fake co-ordinates so it executes the Click Consumed := True; + FOnClickPending := False; end else inherited; |