Class TextMenu

Class for displaying a SimConnect text menu and handling the result.

SimConnect maintains a queue of menus from all of its clients.

When the user closes the window without selecting an item, SimConnect doesn't emit any event, so you have to set a timeout if you want to handle this possibility.

When you call TextMenu:show, the object will be kept alive until a result is received.

Class TextMenu

TextMenu.new(title, prompt, items, timeout, callback) Constructor
TextMenu.new(title, prompt, items, callback) Constructor
TextMenu.new(timeout, callback) Constructor
TextMenu.new(callback) Constructor
TextMenu:show()
TextMenu:setTitle(title)
TextMenu:setItems(items)
TextMenu:setPrompt(prompt)
TextMenu:setItem(index, item)
TextMenu:cancel()


Class TextMenu

TextMenu.new(title, prompt, items, timeout, callback)
Constructor

Parameters:

  • title string
  • prompt string Can be an empty string
  • items table Array of strings
  • timeout int Timeout in seconds. 0 means infinite.
  • callback function

    The function that's going to handle the menu events, with the following parameters:

    1. The result: TextMenuResult.OK, TextMenuResult.Replaced, TextMenuResult.Timeout, TextMenuResult.Removed

    2. The array index of the item

    3. The item itself (string)

    4. The menu

TextMenu.new(title, prompt, items, callback)
Constructor

Parameters:

  • title string
  • prompt string Can be an empty string
  • items table Array of strings
  • callback function Same as above
TextMenu.new(timeout, callback)
Constructor

Parameters:

  • timeout int Timeout in seconds. 0 means infinite.
  • callback function Same as above
TextMenu.new(callback)
Constructor

Parameters:

  • callback function Same as above
TextMenu:show()
TextMenu:setTitle(title)

Parameters:

Returns:

    self
TextMenu:setItems(items)

Parameters:

  • items table Array of strings

Returns:

    self
TextMenu:setPrompt(prompt)

Parameters:

Returns:

    self
TextMenu:setItem(index, item)

Parameters:

  • index int The position of the item
  • item string

Returns:

    self
TextMenu:cancel()
generated by LDoc 1.4.6 Last updated 2021-11-11 17:10:49