diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-06-08 16:49:45 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-06-08 16:49:45 +0200 |
commit | b0e1a5fffbf05c6e2b4c91d9d87d318cae86138e (patch) | |
tree | 584349a534b7983af618cbce154f9bf7ae355e6d /src | |
parent | f080fc0ac65c07198cbe3fe804332ffed8bb482e (diff) | |
download | fpGUI-b0e1a5fffbf05c6e2b4c91d9d87d318cae86138e.tar.xz |
Fixed the keyMenu handling in BasicEdit components.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpg_widget.pas | 5 | ||||
-rw-r--r-- | src/gui/fpg_edit.pas | 18 | ||||
-rw-r--r-- | src/gui/fpg_form.pas | 1 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index 604b2d11..4c8e1875 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -744,9 +744,8 @@ begin } keyMenu: begin - { TODO : We could improve the X,Y coordinates. Not really sure how - Menu Key should handle that. } - HandleRMouseDown(Width div 2, Height div 2, []); + // ssExtra1 is a signal that keyMenu was used. + HandleRMouseDown(Width div 2, Height div 2, [ssExtra1]); end; end; diff --git a/src/gui/fpg_edit.pas b/src/gui/fpg_edit.pas index 80c35ae1..6417574b 100644 --- a/src/gui/fpg_edit.pas +++ b/src/gui/fpg_edit.pas @@ -98,6 +98,7 @@ type procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: Boolean); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; + procedure HandleRMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleRMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleDoubleClick(x, y: integer; button: word; shiftstate: TShiftState); override; @@ -724,8 +725,7 @@ begin inherited HandleKeyChar(AText, shiftstate, consumed); end; -procedure TfpgBaseEdit.HandleKeyPress(var keycode: word; - var shiftstate: TShiftState; var consumed: boolean); +procedure TfpgBaseEdit.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); var hasChanged: boolean; @@ -739,7 +739,6 @@ begin hasChanged := False; fpgApplication.HideHint; - Consumed := True; case CheckClipBoardKey(keycode, shiftstate) of ckCopy: @@ -762,7 +761,6 @@ begin Consumed := False; end; - if not Consumed then begin // checking for movement keys: @@ -864,7 +862,7 @@ begin if consumed then RePaint else - inherited; + inherited HandleKeyPress(keycode, shiftstate, consumed); if hasChanged then if Assigned(FOnChange) then @@ -890,6 +888,16 @@ begin RePaint; end; +procedure TfpgBaseEdit.HandleRMouseDown(x, y: integer; + shiftstate: TShiftState); +begin + // keyMenu was pressed + if shiftstate = [ssExtra1] then + HandleRMouseUp(x, y, []) + else + inherited HandleRMouseDown(x, y, shiftstate); +end; + procedure TfpgBaseEdit.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); begin inherited HandleRMouseUp(x, y, shiftstate); diff --git a/src/gui/fpg_form.pas b/src/gui/fpg_form.pas index 85ce5b49..20aad60e 100644 --- a/src/gui/fpg_form.pas +++ b/src/gui/fpg_form.pas @@ -35,7 +35,6 @@ type TFormCloseEvent = procedure(Sender: TObject; var CloseAction: TCloseAction) of object; TFormCloseQueryEvent = procedure(Sender: TObject; var CanClose: boolean) of object; - { TfpgBaseForm } TfpgBaseForm = class(TfpgWidget) private |