Method toolbar.Menu(+ 1 overload)
Overload
Adds button with drop-down menu.
public TBItem Menu(string text, Action<popupMenu> menu, MTImage image = default, int l_ = 0, string f_ = null)
Parameters
text (string)
Text. Or |
menu (Action<popupMenu>)
Action that adds menu items. Called whenever the button clicked. |
image (MTImage)
Image. Read here: MTBase. |
l_ (int) |
f_ (string) |
Returns
Remarks
The submenu is a popupMenu object. It inherits these properties of this toolbar: MTBase.ExtractIconPathFromCode, MTBase.ActionException, MTBase.ActionThread, MTBase.PathInTooltip.
Examples
tb.Menu("Menu", m => {
m["M1"]=o=>print.it(o);
m["M2"]=o=>print.it(o);
});
Overload(top)
Adds button with drop-down menu.
public TBItem Menu(string text, Func<popupMenu> menu, MTImage image = default, int l_ = 0, string f_ = null)
Parameters
text (string)
Text. Or |
menu (Func<popupMenu>)
Func that returns the menu. Called whenever the button clicked. |
image (MTImage)
Image. Read here: MTBase. |
l_ (int) |
f_ (string) |
Returns
Remarks
The caller creates the menu (creates the popupMenu object and adds items) and can reuse it many times. Other overload does not allow to create popupMenu and reuse same object. The submenu does not inherit properties of this toolbar.
Examples
var m = new popupMenu(); m.AddCheck("C1"); m.AddCheck("C2");
t.Menu("Menu", () => m);