mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 05:29:38 +02:00
IDE: show already grabbed shortcut key in the filter GUI.
git-svn-id: trunk@42238 -
This commit is contained in:
parent
74327375f3
commit
d5bc11ca07
@ -245,13 +245,22 @@ end;
|
||||
|
||||
procedure TEditorKeymappingOptionsFrame.FindKeyButtonClick(Sender: TObject);
|
||||
var
|
||||
KeyFilter: TIDEShortCut;
|
||||
ShortCutDialog: TShortCutDialog;
|
||||
begin
|
||||
if ShowKeyMappingGrabForm(KeyFilter) = mrOK then begin
|
||||
KeyMapKeyFilter := KeyFilter;
|
||||
UpdateKeyFilterButton;
|
||||
FilterEdit.Filter:=''; // Allow only one of the filters to be active.
|
||||
FilterEdit.InvalidateFilter;
|
||||
ShortCutDialog := TShortCutDialog.Create(nil);
|
||||
try
|
||||
ShortCutDialog.ShowSecondary:=False;
|
||||
ShortCutDialog.ShowSequence:=False;
|
||||
ShortCutDialog.Caption:=lisChooseAKey;
|
||||
ShortCutDialog.PrimaryShortCut := KeyMapKeyFilter;
|
||||
if ShortCutDialog.ShowModal = mrOK then begin
|
||||
KeyMapKeyFilter := ShortCutDialog.PrimaryShortCut;
|
||||
UpdateKeyFilterButton;
|
||||
FilterEdit.Filter:=''; // Allow only one of the filters to be active.
|
||||
FilterEdit.InvalidateFilter;
|
||||
end;
|
||||
finally
|
||||
ShortCutDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -547,7 +556,7 @@ end;
|
||||
procedure TEditorKeymappingOptionsFrame.UpdateKeyFilterButton;
|
||||
begin
|
||||
if IDEShortCutEmpty(KeyMapKeyFilter) then
|
||||
FindKeyButton.Caption:=lisFindKeyCombination
|
||||
FindKeyButton.Caption := lisFindKeyCombination
|
||||
else
|
||||
FindKeyButton.Caption:=
|
||||
Format(lisFilter3, [KeyAndShiftStateToEditorKeyString(KeyMapKeyFilter)]);
|
||||
|
@ -84,7 +84,6 @@ type
|
||||
|
||||
function ShowKeyMappingEditForm(Index: integer;
|
||||
AKeyCommandRelationList: TKeyCommandRelationList): TModalResult;
|
||||
function ShowKeyMappingGrabForm(out Key: TIDEShortCut; AllowSequence: boolean = false): TModalResult;
|
||||
|
||||
implementation
|
||||
|
||||
@ -106,22 +105,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function ShowKeyMappingGrabForm(out Key: TIDEShortCut; AllowSequence: boolean): TModalResult;
|
||||
var
|
||||
ShortCutDialog: TShortCutDialog;
|
||||
begin
|
||||
ShortCutDialog:=TShortCutDialog.Create(nil);
|
||||
try
|
||||
ShortCutDialog.ShowSecondary:=false;
|
||||
ShortCutDialog.ShowSequence:=AllowSequence;
|
||||
ShortCutDialog.Caption:=lisChooseAKey;
|
||||
Result:=ShortCutDialog.ShowModal;
|
||||
Key:=ShortCutDialog.PrimaryShortCut;
|
||||
finally
|
||||
ShortCutDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{ TShortCutDialog }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user