From 2368d8ad9a1a1586fbd251d3d38ca4f6aec1ff10 Mon Sep 17 00:00:00 2001 From: juha Date: Wed, 25 Mar 2015 21:21:19 +0000 Subject: [PATCH] IdeIntf: Prevent invalid shortcut entries in TCustomShortCutGrabBox. Issue #27705, patch from Howard Page-Clark. git-svn-id: trunk@48506 - --- components/ideintf/propedits.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index 24da13a43d..b6fb9a6ad0 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -1509,6 +1509,7 @@ type FShiftState: TShiftState; FCheckBoxes: array[TShiftStateEnum] of TCheckBox; FGrabForm: TForm; + function GetKey: Word; function GetShiftCheckBox(Shift: TShiftStateEnum): TCheckBox; procedure SetAllowedShifts(const AValue: TShiftState); procedure SetKey(const AValue: Word); @@ -1528,7 +1529,7 @@ type constructor Create(TheOwner: TComponent); override; function GetDefaultShiftButtons: TShiftState; property ShiftState: TShiftState read FShiftState write SetShiftState; - property Key: Word read FKey write SetKey; + property Key: Word read GetKey write SetKey; property ShiftButtons: TShiftState read FShiftButtons write SetShiftButtons; property AllowedShifts: TShiftState read FAllowedShifts write SetAllowedShifts; property KeyComboBox: TComboBox read FKeyComboBox; @@ -6715,6 +6716,13 @@ begin Result:=FCheckBoxes[Shift]; end; +function TCustomShortCutGrabBox.GetKey: Word; +begin + Result:=FKey; + if (FKey = 0) then + FShiftState:=[]; +end; + procedure TCustomShortCutGrabBox.SetAllowedShifts(const AValue: TShiftState); begin if FAllowedShifts=AValue then exit;