Skip to content

Commit 0674c90

Browse files
Introduced a new form that allows to search for commands in the ribbon 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)
1 parent ea8913b commit 0674c90

File tree

7 files changed

+317
-52
lines changed

7 files changed

+317
-52
lines changed

Designer/Bin/RibbonDesigner.exe

-3 KB
Binary file not shown.

Designer/FCommands.dfm

Lines changed: 63 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@ object FrameCommands: TFrameCommands
22
Left = 0
33
Top = 0
44
Width = 451
5-
Height = 304
5+
Height = 305
66
Align = alClient
77
TabOrder = 0
88
object SplitterCommands: TSplitter
9-
Left = 225
9+
Left = 281
1010
Top = 0
11-
Height = 304
11+
Height = 305
1212
ResizeStyle = rsUpdate
1313
end
1414
object PanelCommands: TPanel
1515
Left = 0
1616
Top = 0
17-
Width = 225
18-
Height = 304
17+
Width = 281
18+
Height = 305
1919
Align = alLeft
2020
BevelOuter = bvNone
2121
TabOrder = 0
2222
object ToolBarCommands: TToolBar
2323
Left = 0
2424
Top = 0
25-
Width = 225
25+
Width = 281
2626
Height = 22
2727
AutoSize = True
28-
ButtonWidth = 58
28+
ButtonWidth = 60
2929
Caption = 'ToolBarCommands'
3030
Color = clBtnFace
3131
Images = ImageListToolbars
@@ -58,12 +58,17 @@ object FrameCommands: TFrameCommands
5858
Action = ActionMoveDown
5959
AutoSize = True
6060
end
61+
object ButtonSearchCommand: TToolButton
62+
Left = 214
63+
Top = 0
64+
Action = ActionSearchCommand
65+
end
6166
end
6267
object ListViewCommands: TListView
6368
Left = 0
6469
Top = 22
65-
Width = 225
66-
Height = 282
70+
Width = 281
71+
Height = 283
6772
Align = alClient
6873
Columns = <
6974
item
@@ -87,10 +92,10 @@ object FrameCommands: TFrameCommands
8792
end
8893
end
8994
object PanelCommandProperties: TPanel
90-
Left = 228
95+
Left = 284
9196
Top = 0
92-
Width = 223
93-
Height = 304
97+
Width = 167
98+
Height = 305
9499
Align = alClient
95100
BevelOuter = bvNone
96101
ParentBackground = False
@@ -99,7 +104,7 @@ object FrameCommands: TFrameCommands
99104
object LabelHeader: TLabel
100105
Left = 0
101106
Top = 0
102-
Width = 223
107+
Width = 167
103108
Height = 22
104109
Align = alTop
105110
AutoSize = False
@@ -118,7 +123,7 @@ object FrameCommands: TFrameCommands
118123
object PanelProps: TPanel
119124
Left = 0
120125
Top = 22
121-
Width = 223
126+
Width = 167
122127
Height = 256
123128
Align = alTop
124129
BevelOuter = bvNone
@@ -551,7 +556,7 @@ object FrameCommands: TFrameCommands
551556
object PanelImages: TPanel
552557
Left = 0
553558
Top = 278
554-
Width = 223
559+
Width = 167
555560
Height = 47
556561
Align = alTop
557562
BevelOuter = bvNone
@@ -617,7 +622,7 @@ object FrameCommands: TFrameCommands
617622
object PanelHighContrastImages: TPanel
618623
Left = 0
619624
Top = 325
620-
Width = 223
625+
Width = 167
621626
Height = 236
622627
Align = alClient
623628
BevelOuter = bvNone
@@ -686,123 +691,123 @@ object FrameCommands: TFrameCommands
686691
Left = 32
687692
Top = 60
688693
Bitmap = {
689-
494C0101040008006C0010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
694+
494C010105000900040010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
690695
0000000000003600000028000000400000002000000001002000000000000020
696+
00000000000000000000000000000000000000000000D6D5D300000000000000
691697
0000000000000000000000000000000000000000000000000000000000000000
692698
0000000000000000000000000000000000000000000000000000000000000000
693699
0000000000000000000000000000000000000000000000000000000000000000
694700
0000000000000000000000000000000000000000000000000000000000000000
695701
0000000000000000000000000000000000000000000000000000000000000000
696702
0000000000000000000000000000000000000000000000000000000000000000
697703
0000000000000000000000000000000000000000000000000000000000000000
704+
000000000000000000000000000000000000D7D5D3006E685E00ACA59B000000
698705
0000000000000000000000000000000000000000000000000000000000000000
699706
0000000000000000000000000000000000000000000000000000000000000000
700707
0000000000000000000000000000000000000000000000000000000000000000
701708
0000000000000000000000000000000000000000000000000000000000000000
702709
0000000000000000000000000000000000000000000000000000000000000000
703710
0000000000000000000000000000000000000000000000000000000000000000
704711
0000000000000000000000000000000000000000000000000000000000000000
712+
00000000000000000000000000000000000000000000B6B0A7008E847400ACA5
713+
9B00000000000000000000000000000000000000000000000000000000000000
705714
0000000000000000000000000000000000000000000000000000000000000000
706715
0000000000000000000000000000000000000000000000000000000000000000
707716
0000000000000000000000000000000000000000000000000000000000000000
708717
0000000000000000000000000000000000000000000000000000000000000000
709718
0000000000000000000000000000000000000000000000000000000000000000
710719
0000000000000000000000000000000000000000000000000000000000000000
720+
0000000000000000000000000000000000000000000000000000B9B2A9008E84
721+
7400ACA59B000000000000000000000000000000000000000000000000000000
711722
0000000000000000000000000000000000000000000000000000000000000000
712723
0000000000000000000000000000000000000000000000000000000000000000
713724
0000000000000000000000000000000000000000000000000000000000000000
714725
0000000000000000000000000000000000000000000000000000000000000000
715726
0000000000000000000000000000000000000000000000000000000000000000
716727
0000000000000000000000000000000000000000000000000000000000000000
728+
000000000000000000000000000000000000000000000000000000000000B9B2
729+
A9008E847400A8A2980000000000000000000000000000000000000000000000
717730
0000000000000000000000000000000000000000000000000000000000000000
718731
0000000000000000000000000000000000000000000000000000000000000000
719732
0000000000000000000000000000000000000000000000000000000000000000
720733
0000000000000000000000000000000000000000000000000000000000000000
721734
0000000000000000000000000000000000000000000000000000000000000000
722735
0000000000000000000000000000000000000000000000000000000000000000
723736
0000000000000000000000000000000000000000000000000000000000000000
737+
0000B2ADA400756F6600C2C0BF00DFDDD800B0ACA000B5AEA000B4AEA000B0AC
738+
A000DFDDD8000000000000000000000000000000000000000000000000000000
724739
0000000000000000000000000000000000000000000000000000000000000000
725740
0000000000000000000000000000000000000000000000000000000000000000
726741
0000000000000000000000000000000000000000000000000000000000000000
727742
0000000000000000000000000000000000000000000000000000000000000000
728743
0000000000000000000000000000000000000000000000000000000000000000
729744
0000000000000000000000000000000000000000000000000000000000000000
745+
000000000000E2E0DC00A09A8F00B3A99400F0E1CA00FFF0DB00FFF2E000F0E7
746+
D800B3AC9C00C6C3BB0000000000000000000000000000000000000000000000
730747
0000000000000000000000000000000000000000000000000000000000000000
731748
0000000000000000000000000000000000000000000000000000000000000000
732749
0000000000000000000000000000000000000000000000000000000000000000
733750
0000000000000000000000000000000000000000000000000000000000000000
734751
0000000000000000000000000000000000000000000000000000000000000000
735752
0000000000000000000000000000000000000000000000000000000000000000
753+
000000000000E1DFDA00AFA48C00FFE9CA00FFEBCF00FFEDD400FFEFDA00FFF1
754+
DF00FFF4E500B2AC9C00DFDDD800000000000000000000000000000000000000
736755
0000000000000000000000000000000000000000000000000000000000000000
737756
0000000000000000000000000000000000000000000000000000000000000000
738757
0000000000000000000000000000000000000000000000000000000000000000
739758
0000000000000000000000000000000000000000000000000000000000000000
740759
0000000000000000000000000000000000000000000000000000000000000000
741760
0000000000000000000000000000000000000000000000000000000000000000
761+
000000000000B3AFA300EFD7B600FFE6C400FFE8C800FFEACE00FFECD300FFEF
762+
D800FFF1DD00F0E6D500B0ACA000000000000000000000000000000000000000
742763
0000000000000000000000000000000000000000000000000000000000000000
743764
0000000000000000000000000000000000000000000000000000000000000000
744765
0000000000000000000000000000000000000000000000000000000000000000
745766
0000000000000000000000000000000000000000000000000000000000000000
746767
0000000000000000000000000000000000000000000000000000000000000000
747768
0000000000000000000000000000000000000000000000000000000000000000
769+
000000000000B6AD9C00FFE5C100FFE5C100FFE6C300FFE7C700FFEACC00FFEC
770+
D100FFEED700FFF0DC00B4AD9F00000000000000000000000000000000000000
748771
0000000000000000000000000000000000000000000000000000000000000000
749772
0000000000000000000000000000000000000000000000000000000000000000
750773
0000000000000000000000000000000000000000000000000000000000000000
751774
0000000000000000000000000000000000000000000000000000000000000000
752775
0000000000000000000000000000000000000000000000000000000000000000
753776
0000000000000000000000000000000000000000000000000000000000000000
777+
000000000000B8AF9F00FFE6C500FFE5C100FFE5C000FFE5C200FFE7C600FFE9
778+
CB00FFEBD000FFEDD500B4AD9F00000000000000000000000000000000000000
754779
0000000000000000000000000000000000000000000000000000000000000000
755780
0000000000000000000000000000000000000000000000000000000000000000
756781
0000000000000000000000000000000000000000000000000000000000000000
757782
0000000000000000000000000000000000000000000000000000000000000000
758783
0000000000000000000000000000000000000000000000000000000000000000
759784
0000000000000000000000000000000000000000000000000000000000000000
785+
000000000000B9B3A700ECD9BD00FFE7C500FFE5C100FFE5C000FFE5C000FFE6
786+
C400FFE8C900F0DFC400B0ACA000000000000000000000000000000000000000
760787
0000000000000000000000000000000000000000000000000000000000000000
761788
0000000000000000000000000000000000000000000000000000000000000000
762789
0000000000000000000000000000000000000000000000000000000000000000
763790
0000000000000000000000000000000000000000000000000000000000000000
764791
0000000000000000000000000000000000000000000000000000000000000000
765792
0000000000000000000000000000000000000000000000000000000000000000
793+
000000000000E6E4E000AEA69000FEE9CD00FFE7C500FFE5C100FFE4BF00FFE4
794+
BF00FFE6C300B2A89100DFDDD800000000000000000000000000000000000000
766795
0000000000000000000000000000000000000000000000000000000000000000
767796
0000000000000000000000000000000000000000000000000000000000000000
768797
0000000000000000000000000000000000000000000000000000000000000000
769798
0000000000000000000000000000000000000000000000000000000000000000
770799
0000000000000000000000000000000000000000000000000000000000000000
771800
0000000000000000000000000000000000000000000000000000000000000000
801+
00000000000000000000D0CDC500AEA69000EDDABE00FFE6C500FFE5C000EFD7
802+
B300AFA38B00C7C3BB0000000000000000000000000000000000000000000000
772803
0000000000000000000000000000000000000000000000000000000000000000
773804
0000000000000000000000000000000000000000000000000000000000000000
774805
0000000000000000000000000000000000000000000000000000000000000000
775806
0000000000000000000000000000000000000000000000000000000000000000
776807
0000000000000000000000000000000000000000000000000000000000000000
777808
0000000000000000000000000000000000000000000000000000000000000000
778-
0000000000000000000000000000000000000000000000000000000000000000
779-
0000000000000000000000000000000000000000000000000000000000000000
780-
0000000000000000000000000000000000000000000000000000000000000000
781-
0000000000000000000000000000000000000000000000000000000000000000
782-
0000000000000000000000000000000000000000000000000000000000000000
783-
0000000000000000000000000000000000000000000000000000000000000000
784-
0000000000000000000000000000000000000000000000000000000000000000
785-
0000000000000000000000000000000000000000000000000000000000000000
786-
0000000000000000000000000000000000000000000000000000000000000000
787-
0000000000000000000000000000000000000000000000000000000000000000
788-
0000000000000000000000000000000000000000000000000000000000000000
789-
0000000000000000000000000000000000000000000000000000000000000000
790-
0000000000000000000000000000000000000000000000000000000000000000
791-
0000000000000000000000000000000000000000000000000000000000000000
792-
0000000000000000000000000000000000000000000000000000000000000000
793-
0000000000000000000000000000000000000000000000000000000000000000
794-
0000000000000000000000000000000000000000000000000000000000000000
795-
0000000000000000000000000000000000000000000000000000000000000000
796-
0000000000000000000000000000000000000000000000000000000000000000
797-
0000000000000000000000000000000000000000000000000000000000000000
798-
0000000000000000000000000000000000000000000000000000000000000000
799-
0000000000000000000000000000000000000000000000000000000000000000
800-
0000000000000000000000000000000000000000000000000000000000000000
801-
0000000000000000000000000000000000000000000000000000000000000000
802-
0000000000000000000000000000000000000000000000000000000000000000
803-
0000000000000000000000000000000000000000000000000000000000000000
804-
0000000000000000000000000000000000000000000000000000000000000000
805-
0000000000000000000000000000000000000000000000000000000000000000
809+
0000000000000000000000000000E6E4E000B9B3A700B9AF9F00B7AE9C00B3AF
810+
A300E1DFDA000000000000000000000000000000000000000000000000000000
806811
0000000000000000000000000000000000000000000000000000000000000000
807812
0000000000000000000000000000000000000000000000000000000000000000
808813
0000000000000000000000000000000000000000000000000000000000000000
@@ -946,11 +951,11 @@ object FrameCommands: TFrameCommands
946951
0000281B0A77A56515FFA56515FFA56515FFA56515FFA56515FF291D0C770000
947952
000000000000000000000000000000000000424D3E000000000000003E000000
948953
2800000040000000200000000100010000000000000100000000000000000000
949-
000000000000000000000000FFFFFF0000000000000000000000000000000000
950-
0000000000000000000000000000000000000000000000000000000000000000
951-
0000000000000000000000000000000000000000000000000000000000000000
952-
0000000000000000000000000000000000000000000000000000000000000000
953-
0000000000000000000000000000000000000000000000000000000000000000
954+
000000000000000000000000FFFFFF00BFFF0000000000001FFF000000000000
955+
8FFF000000000000C7FF000000000000E3FF000000000000F007000000000000
956+
F803000000000000F801000000000000F801000000000000F801000000000000
957+
F801000000000000F801000000000000F801000000000000FC03000000000000
958+
FE07000000000000FFFF00000000000000000000000000000000000000000000
954959
0000000000000000000000000000000000000000000000000000000000000000
955960
0000000000000000000000000000000000000000000000000000000000000000
956961
0000000000000000000000000000000000000000000000000000000000000000
@@ -994,6 +999,14 @@ object FrameCommands: TFrameCommands
994999
OnExecute = ActionMoveDownExecute
9951000
OnUpdate = ActionUpdate
9961001
end
1002+
object ActionSearchCommand: TAction
1003+
Category = 'Commands'
1004+
Caption = 'Search'
1005+
ImageIndex = 4
1006+
ShortCut = 16454
1007+
OnExecute = ActionSearchCommandExecute
1008+
OnUpdate = ActionUpdate
1009+
end
9971010
end
9981011
object PopupMenuList: TPopupMenu
9991012
Images = ImageListToolbars

Designer/FCommands.pas

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ TFrameCommands = class(TFrame)
106106
MenuMoveDown: TMenuItem;
107107
MenuMoveUp: TMenuItem;
108108
BtnGenerateID: TButton;
109+
ButtonSearchCommand: TToolButton;
110+
ActionSearchCommand: TAction;
109111
procedure ListViewCommandsSelectItem(Sender: TObject; Item: TListItem;
110112
Selected: Boolean);
111113
procedure EditNameChange(Sender: TObject);
@@ -143,6 +145,7 @@ TFrameCommands = class(TFrame)
143145
procedure ListViewCommandsColumnClick(Sender: TObject; Column: TListColumn);
144146
procedure ListViewCommandsCompare(Sender: TObject; Item1, Item2: TListItem;
145147
Data: Integer; var Compare: Integer);
148+
procedure ActionSearchCommandExecute(Sender: TObject);
146149
private
147150
{ Private declarations }
148151
FDocument: TRibbonDocument;
@@ -183,7 +186,7 @@ implementation
183186
uses
184187
UITypes,
185188
FMain,
186-
System.Generics.Collections;
189+
System.Generics.Collections, FCommandsSearch;
187190

188191
{ TFrameCommands }
189192

@@ -235,6 +238,28 @@ procedure TFrameCommands.ActionMoveUpExecute(Sender: TObject);
235238
MoveCommand(-1);
236239
end;
237240

241+
procedure TFrameCommands.ActionSearchCommandExecute(Sender: TObject);
242+
var
243+
lCommandSearchForm: TCommandSearchForm;
244+
lItem: TListItem;
245+
begin
246+
lCommandSearchForm := TCommandSearchForm.Create(Self, ListViewCommands);
247+
try
248+
if lCommandSearchForm.ShowModal = mrOK then
249+
begin
250+
if not Assigned(lCommandSearchForm.ListViewCommands.Selected) then
251+
exit;
252+
for lItem in Self.ListViewCommands.Items do
253+
begin
254+
if lItem.Data = lCommandSearchForm.ListViewCommands.Selected.Data then
255+
Self.ListViewCommands.Selected := lItem;
256+
end; //for lItem
257+
end; //if ShowModal
258+
finally
259+
lCommandSearchForm.Release;
260+
end;
261+
end;
262+
238263
procedure TFrameCommands.Activate;
239264
begin
240265
ActionDeleteCommand.ShortCut := ShortCut(VK_DELETE, [ssCtrl]);

0 commit comments

Comments
 (0)