Show / Hide Table of Contents

Method AutotextTriggerArgs.Menu


Overload

Creates and shows a menu below the text cursor (caret) or mouse cursor, and calls AutotextTriggerArgs.Replace.

public void Menu(params TAMenuItem[] items)
Parameters
items  (TAMenuItem[])

Menu items. An item can be specified as:

  • string - the replacement text. Also it's the menu item label.
  • TAMenuItem - allows to set custom label and the replacement text and/or HTML.
  • null - separator.
    Label can contain tooltip like "Text\0 Tooltip". Replacement text can contain [[|]] to move the caret there (see AutotextTriggerArgs.Replace).

Remarks

Keyboard:

  • Esc - close the menu.
  • Enter, Tab - select the focused or the first item.
  • Down, Up, End, Home, PageDown, PageUp - focus menu items.
  • Also to select menu items can type the number characters displayed at the right.
  • Other keys close the menu and are passed to the active window.

Examples

Code in file Autotext triggers.

//var tt = Triggers.Autotext;
tt["m1"] = o => o.Menu([
	"https://www.example.com",
	"<tag>[[|]]</tag>",
	new("Label example", "TEXT1"),
	null,
	new("HTML example", "TEXT2", "<b>TEXT2</b>"),
	new(null, "TEXT3"),
	]);

See Also

AutotextTriggers.MenuOptions
popupMenu.defaultFont
popupMenu.defaultMetrics