Skip to content

Commit

Permalink
Introduced a new form that allows to search for commands in the ribbo…
Browse files Browse the repository at this point in the history
…n designer. It works similar to the procedure list of GExperts and can be used to located commands by their name (or part of their name). (issue #101)
  • Loading branch information
SaschaSchaefer committed Aug 17, 2018
1 parent ea8913b commit 0674c90
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 52 deletions.
Binary file modified Designer/Bin/RibbonDesigner.exe
Binary file not shown.
113 changes: 63 additions & 50 deletions Designer/FCommands.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ object FrameCommands: TFrameCommands
Left = 0
Top = 0
Width = 451
Height = 304
Height = 305
Align = alClient
TabOrder = 0
object SplitterCommands: TSplitter
Left = 225
Left = 281
Top = 0
Height = 304
Height = 305
ResizeStyle = rsUpdate
end
object PanelCommands: TPanel
Left = 0
Top = 0
Width = 225
Height = 304
Width = 281
Height = 305
Align = alLeft
BevelOuter = bvNone
TabOrder = 0
object ToolBarCommands: TToolBar
Left = 0
Top = 0
Width = 225
Width = 281
Height = 22
AutoSize = True
ButtonWidth = 58
ButtonWidth = 60
Caption = 'ToolBarCommands'
Color = clBtnFace
Images = ImageListToolbars
Expand Down Expand Up @@ -58,12 +58,17 @@ object FrameCommands: TFrameCommands
Action = ActionMoveDown
AutoSize = True
end
object ButtonSearchCommand: TToolButton
Left = 214
Top = 0
Action = ActionSearchCommand
end
end
object ListViewCommands: TListView
Left = 0
Top = 22
Width = 225
Height = 282
Width = 281
Height = 283
Align = alClient
Columns = <
item
Expand All @@ -87,10 +92,10 @@ object FrameCommands: TFrameCommands
end
end
object PanelCommandProperties: TPanel
Left = 228
Left = 284
Top = 0
Width = 223
Height = 304
Width = 167
Height = 305
Align = alClient
BevelOuter = bvNone
ParentBackground = False
Expand All @@ -99,7 +104,7 @@ object FrameCommands: TFrameCommands
object LabelHeader: TLabel
Left = 0
Top = 0
Width = 223
Width = 167
Height = 22
Align = alTop
AutoSize = False
Expand All @@ -118,7 +123,7 @@ object FrameCommands: TFrameCommands
object PanelProps: TPanel
Left = 0
Top = 22
Width = 223
Width = 167
Height = 256
Align = alTop
BevelOuter = bvNone
Expand Down Expand Up @@ -551,7 +556,7 @@ object FrameCommands: TFrameCommands
object PanelImages: TPanel
Left = 0
Top = 278
Width = 223
Width = 167
Height = 47
Align = alTop
BevelOuter = bvNone
Expand Down Expand Up @@ -617,7 +622,7 @@ object FrameCommands: TFrameCommands
object PanelHighContrastImages: TPanel
Left = 0
Top = 325
Width = 223
Width = 167
Height = 236
Align = alClient
BevelOuter = bvNone
Expand Down Expand Up @@ -686,123 +691,123 @@ object FrameCommands: TFrameCommands
Left = 32
Top = 60
Bitmap = {
494C0101040008006C0010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
494C010105000900040010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000002000000001002000000000000020
00000000000000000000000000000000000000000000D6D5D300000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000D7D5D3006E685E00ACA59B000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B6B0A7008E847400ACA5
9B00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000B9B2A9008E84
7400ACA59B000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000B9B2
A9008E847400A8A2980000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000B2ADA400756F6600C2C0BF00DFDDD800B0ACA000B5AEA000B4AEA000B0AC
A000DFDDD8000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000E2E0DC00A09A8F00B3A99400F0E1CA00FFF0DB00FFF2E000F0E7
D800B3AC9C00C6C3BB0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000E1DFDA00AFA48C00FFE9CA00FFEBCF00FFEDD400FFEFDA00FFF1
DF00FFF4E500B2AC9C00DFDDD800000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B3AFA300EFD7B600FFE6C400FFE8C800FFEACE00FFECD300FFEF
D800FFF1DD00F0E6D500B0ACA000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B6AD9C00FFE5C100FFE5C100FFE6C300FFE7C700FFEACC00FFEC
D100FFEED700FFF0DC00B4AD9F00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B8AF9F00FFE6C500FFE5C100FFE5C000FFE5C200FFE7C600FFE9
CB00FFEBD000FFEDD500B4AD9F00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B9B3A700ECD9BD00FFE7C500FFE5C100FFE5C000FFE5C000FFE6
C400FFE8C900F0DFC400B0ACA000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000E6E4E000AEA69000FEE9CD00FFE7C500FFE5C100FFE4BF00FFE4
BF00FFE6C300B2A89100DFDDD800000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000D0CDC500AEA69000EDDABE00FFE6C500FFE5C000EFD7
B300AFA38B00C7C3BB0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000E6E4E000B9B3A700B9AF9F00B7AE9C00B3AF
A300E1DFDA000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down Expand Up @@ -946,11 +951,11 @@ object FrameCommands: TFrameCommands
0000281B0A77A56515FFA56515FFA56515FFA56515FFA56515FF291D0C770000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000200000000100010000000000000100000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000FFFFFF00BFFF0000000000001FFF000000000000
8FFF000000000000C7FF000000000000E3FF000000000000F007000000000000
F803000000000000F801000000000000F801000000000000F801000000000000
F801000000000000F801000000000000F801000000000000FC03000000000000
FE07000000000000FFFF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down Expand Up @@ -994,6 +999,14 @@ object FrameCommands: TFrameCommands
OnExecute = ActionMoveDownExecute
OnUpdate = ActionUpdate
end
object ActionSearchCommand: TAction
Category = 'Commands'
Caption = 'Search'
ImageIndex = 4
ShortCut = 16454
OnExecute = ActionSearchCommandExecute
OnUpdate = ActionUpdate
end
end
object PopupMenuList: TPopupMenu
Images = ImageListToolbars
Expand Down
27 changes: 26 additions & 1 deletion Designer/FCommands.pas
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ TFrameCommands = class(TFrame)
MenuMoveDown: TMenuItem;
MenuMoveUp: TMenuItem;
BtnGenerateID: TButton;
ButtonSearchCommand: TToolButton;
ActionSearchCommand: TAction;
procedure ListViewCommandsSelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure EditNameChange(Sender: TObject);
Expand Down Expand Up @@ -143,6 +145,7 @@ TFrameCommands = class(TFrame)
procedure ListViewCommandsColumnClick(Sender: TObject; Column: TListColumn);
procedure ListViewCommandsCompare(Sender: TObject; Item1, Item2: TListItem;
Data: Integer; var Compare: Integer);
procedure ActionSearchCommandExecute(Sender: TObject);
private
{ Private declarations }
FDocument: TRibbonDocument;
Expand Down Expand Up @@ -183,7 +186,7 @@ implementation
uses
UITypes,
FMain,
System.Generics.Collections;
System.Generics.Collections, FCommandsSearch;

{ TFrameCommands }

Expand Down Expand Up @@ -235,6 +238,28 @@ procedure TFrameCommands.ActionMoveUpExecute(Sender: TObject);
MoveCommand(-1);
end;

procedure TFrameCommands.ActionSearchCommandExecute(Sender: TObject);
var
lCommandSearchForm: TCommandSearchForm;
lItem: TListItem;
begin
lCommandSearchForm := TCommandSearchForm.Create(Self, ListViewCommands);
try
if lCommandSearchForm.ShowModal = mrOK then
begin
if not Assigned(lCommandSearchForm.ListViewCommands.Selected) then
exit;
for lItem in Self.ListViewCommands.Items do
begin
if lItem.Data = lCommandSearchForm.ListViewCommands.Selected.Data then
Self.ListViewCommands.Selected := lItem;
end; //for lItem
end; //if ShowModal
finally
lCommandSearchForm.Release;
end;
end;

procedure TFrameCommands.Activate;
begin
ActionDeleteCommand.ShortCut := ShortCut(VK_DELETE, [ssCtrl]);
Expand Down
Loading

0 comments on commit 0674c90

Please sign in to comment.