Module menu

Functions for interacting with the ML menu.

Functions

get(menu, entry) Get the value of some existing ML menu entry.
set(menu, entry, value) Set the value of some existing ML menu entry.
open([menu[, entry]]) Open ML menu.
close() Close ML menu.
block(enabled) Block the ML menu from redrawing (if you wand to do custom drawing).
new(definition) Creates a new menu item.

Fields

visible Get whether or not the ML menu is visible.

Class menu

menu.value Current value of the menu item.
menu.name Name for the menu item.
menu.help Help text for the menu item (line 1).
menu.help2 Help text for the menu item (line 2).
menu.advanced Advanced setting in submenus.
menu.depends_on Dependencies for this menu item.
menu.edit_mode Editing mode for the menu item.
menu.icon_type The type of icon to use for this menu item (override only if the default choice is not good).
menu.max The maximum value the menu item can have.
menu.min The minimum value the menu item can have.
menu.selected Whether or not the menu is selected.
menu.hidden Hidden from menu.
menu.submenu_height Submenu Height.
menu.submenu_width Submenu Width.
menu.unit The unit for the menu item's value.
menu.works_best_in Suggested operating mode for this menu item.
menu:select(delta) Function called when menu is toggled.
menu:update() Function called when menu is displayed.
menu:info() Function called when menu is displayed.
menu:rinfo() Function called when menu is displayed.
menu:warning() Function called when menu is displayed.
menu.choices List of strings to display as choices in the menu item.
menu.submenu Table of more menu tables that define a submenu.
menu:remove() Removes this menu entry.


Functions

get(menu, entry)
Get the value of some existing ML menu entry.

Parameters:

  • menu string name of the parent menu ('Audio', 'Expo', 'Overlay', 'Shoot', 'Movie', etc)
  • entry string name of the menu entry

Returns:

    int the value of the menu entry (current selection)
set(menu, entry, value)
Set the value of some existing ML menu entry.

Parameters:

  • menu string name of the parent menu ('Audio', 'Expo', 'Overlay', 'Shoot', 'Movie', etc).
  • entry string name of the menu entry.
  • value int or string the value to set.

Returns:

    bool whether or not the call was sucessful.
open([menu[, entry]])
Open ML menu.

Optionally, it may also select the requested menu.

Parameters:

  • menu name of the parent menu ('Audio', 'Expo', 'Overlay', 'Shoot', 'Movie', etc) (optional)
  • entry name of the menu entry (optional)
close()
Close ML menu.
block(enabled)
Block the ML menu from redrawing (if you wand to do custom drawing).

Parameters:

  • enabled bool
new(definition)
Creates a new menu item.

Parameters:

Returns:

    a menu object

Usage:

    mymenu = menu.new
    {
        parent  = "Movie",
        name    = "Lua Test Script",
        help    = "Some help for this script.",
        submenu =
        {
            {
                name    = "Run",
                help    = "Run some action.",
                update  = "",
            },
            {
                name    = "Parameter Example",
                help    = "Help for Parameter Example",
                min     = 0,
                max     = 100,
                unit    = UNIT.DEC,
                warning = function(this) if this.value == 5 then return "this value is not supported" end end,
            },
            {
                name    = "Choices Example",
                choices = { "choice1", "choice2", "choice3" },
            }
        },
        update = function(this) return this.submenu["Choices Example"].value end,
    }
    
    mymenu.submenu["Run"].select = function()
        print("Parameter Example= "..mymenu.submenu["Parameter Example"].value)
        print("Choices Example= "..mymenu.submenu["Choices Example"].value)
    end

Fields

visible
Get whether or not the ML menu is visible.
  • visible bool

Class menu

Represents a menu item.
menu.value
Current value of the menu item.
menu.name
Name for the menu item.
menu.help
Help text for the menu item (line 1).
menu.help2
Help text for the menu item (line 2).
menu.advanced
Advanced setting in submenus.
  • advanced bool
menu.depends_on
Dependencies for this menu item. If the dependecies are not met, the item will be greyed out and a warning will appear at the bottom of the screen.
menu.edit_mode
Editing mode for the menu item.
  • edit_mode int
menu.icon_type
The type of icon to use for this menu item (override only if the default choice is not good).
menu.max
The maximum value the menu item can have.
  • max int
menu.min
The minimum value the menu item can have.
  • min int
menu.selected
Whether or not the menu is selected.
  • selected int
menu.hidden
Hidden from menu.
  • hidden bool
menu.submenu_height
Submenu Height.
  • submenu_height int
menu.submenu_width
Submenu Width.
  • submenu_width int[opt] (override if needed)
menu.unit
The unit for the menu item's value.
menu.works_best_in
Suggested operating mode for this menu item.
menu:select(delta)
Function called when menu is toggled.

Parameters:

  • delta int
menu:update()
Function called when menu is displayed. Return a string to be displayed.

Returns:

    string
menu:info()
Function called when menu is displayed. Return a string to be displayed in the info area (in green).

Returns:

    string
menu:rinfo()
Function called when menu is displayed. Return a string to be displayed on the right side of the menu item.

Returns:

    string
menu:warning()
Function called when menu is displayed. Return a string when there is a warning (menu will be greyed out).

Returns:

    string
menu.choices
List of strings to display as choices in the menu item.
menu.submenu
Table of more menu tables that define a submenu.
menu:remove()
Removes this menu entry.
generated by LDoc 1.4.3 Last updated 2017-03-26 09:33:46