activated auto complete from search history + shc editor hint

This commit is contained in:
Basile Burg 2016-03-13 20:11:13 +01:00
parent 461b5e0c5c
commit 612d9afcd0
3 changed files with 15 additions and 5 deletions

View File

@ -22,6 +22,8 @@ inherited CESearchWidget: TCESearchWidget
Top = 4
Width = 391
Align = alTop
AutoComplete = True
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchCaseSensitive, cbactSearchAscending]
AutoSize = False
BorderSpacing.Around = 4
ItemHeight = 0
@ -251,6 +253,8 @@ inherited CESearchWidget: TCESearchWidget
Width = 283
Align = alClient
Anchors = [akTop, akLeft, akBottom]
AutoComplete = True
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchCaseSensitive, cbactSearchAscending]
ItemHeight = 0
MaxLength = 128
OnChange = cbReplaceWthChange

View File

@ -64,7 +64,7 @@ object CEShortcutEditor: TCEShortcutEditor
Left = 0
Height = 22
Top = 2
Width = 258
Width = 247
Align = alClient
Alignment = taCenter
BorderSpacing.Top = 2
@ -73,11 +73,11 @@ object CEShortcutEditor: TCEShortcutEditor
TabOrder = 0
end
object shortcutCatcher: TEdit
Left = 310
Left = 299
Height = 22
Hint = 'type a key combination while active'
Top = 2
Width = 109
Width = 120
Align = alRight
BorderSpacing.Top = 1
BorderSpacing.Bottom = 1
@ -89,7 +89,7 @@ object CEShortcutEditor: TCEShortcutEditor
TabOrder = 1
end
object btnActivate: TSpeedButton
Left = 285
Left = 274
Height = 22
Hint = 'enable shortcut capture'
Top = 2
@ -99,7 +99,7 @@ object CEShortcutEditor: TCEShortcutEditor
OnClick = btnActivateClick
end
object btnClear: TSpeedButton
Left = 260
Left = 249
Height = 22
Hint = 'clear shortcut'
Top = 2

View File

@ -263,6 +263,8 @@ begin
if tree.Selected.Data.isNil then exit;
//
shortcutCatcher.Enabled := not shortcutCatcher.Enabled;
if shortcutCatcher.Enabled then
shortcutCatcher.SetFocus;
end;
procedure TCEShortcutEditor.btnClearClick(Sender: TObject);
@ -277,6 +279,7 @@ begin
fHasChanged := true;
end;
//
shortcutCatcher.Enabled := false;
updateEditCtrls;
end;
@ -320,6 +323,7 @@ end;
procedure TCEShortcutEditor.updateEditCtrls;
begin
schrtText.Caption := '';
shortcutCatcher.TextHint := '(Enter shortcut)';
//
if tree.Selected.isNil then exit;
if tree.Selected.Level = 0 then exit;
@ -327,6 +331,8 @@ begin
//
schrtText.Caption := TShortcutItem(tree.Selected.Data).combination;
shortcutCatcher.Text := '';
if schrtText.Caption <> '' then
shortcutCatcher.TextHint := '(' + schrtText.Caption + ')';
end;
function TCEShortcutEditor.findCategory(const aName: string; aData: Pointer): TTreeNode;