From 2d5dbe02a67013a1e1812e0c030b6938b467ba51 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 29 Oct 2010 17:07:49 +0200 Subject: 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). --- src/gui/fpg_button.pas | 6 ++++-- 1 file 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; -- cgit v1.2.3-70-g09d2