@@ -57,14 +57,15 @@ public static IEnumerable<ToolStripItem> CreateToolStripButtons(Action<Type> han
57
57
58
58
return CreateToolStripItems ( t =>
59
59
{
60
- GetNodeInfoFromType ( t , out var label , out var icon ) ;
60
+ GetNodeInfoFromType ( t , out var label , out var icon , out var shortcutKeys ) ;
61
61
62
- var item = new TypeToolStripButton
62
+ var item = new TypeToolStripMenuItem
63
63
{
64
64
Value = t ,
65
65
ToolTipText = label ,
66
66
DisplayStyle = ToolStripItemDisplayStyle . Image ,
67
- Image = icon
67
+ Image = icon ,
68
+ ShortcutKeys = shortcutKeys ,
68
69
} ;
69
70
item . Click += clickHandler ;
70
71
return item ;
@@ -74,7 +75,7 @@ public static IEnumerable<ToolStripItem> CreateToolStripButtons(Action<Type> han
74
75
Image = p . Icon
75
76
} , t =>
76
77
{
77
- GetNodeInfoFromType ( t , out var label , out var icon ) ;
78
+ GetNodeInfoFromType ( t , out var label , out var icon , out var shortcutKeys ) ;
78
79
79
80
var item = new TypeToolStripMenuItem
80
81
{
@@ -95,13 +96,14 @@ public static IEnumerable<ToolStripItem> CreateToolStripMenuItems(Action<Type> h
95
96
96
97
var items = CreateToolStripItems ( t =>
97
98
{
98
- GetNodeInfoFromType ( t , out var label , out var icon ) ;
99
+ GetNodeInfoFromType ( t , out var label , out var icon , out var shortcutKeys ) ;
99
100
100
101
var item = new TypeToolStripMenuItem
101
102
{
102
103
Value = t ,
103
104
Text = label ,
104
- Image = icon
105
+ Image = icon ,
106
+ ShortcutKeys = shortcutKeys ,
105
107
} ;
106
108
item . Click += clickHandler ;
107
109
return item ;
@@ -166,10 +168,12 @@ private static IEnumerable<ToolStripItem> CreateToolStripItems(Func<Type, ToolSt
166
168
return items ;
167
169
}
168
170
169
- private static void GetNodeInfoFromType ( Type nodeType , out string label , out Image icon )
171
+ private static void GetNodeInfoFromType ( Type nodeType , out string label , out Image icon , out Keys shortcutKeys )
170
172
{
171
173
Contract . Requires ( nodeType != null ) ;
172
174
175
+ shortcutKeys = Program . Settings . GetShortcutKeyForNodeType ( nodeType ) ;
176
+
173
177
var node = BaseNode . CreateInstanceFromType ( nodeType , false ) ;
174
178
if ( node == null )
175
179
{
0 commit comments