# plugins.core.setup.panel

CommandPost Setup Window Panel.


# API Overview

Constants - Useful values which cannot be changed

  • WEBVIEW_LABEL

Functions - API calls offered directly by the extension

  • panelCount
  • panelNumber
  • panelQueue

Constructors - API calls which return an object, typically one that offers API methods

  • new

Methods - API calls which can only be made on an object returned by a constructor

  • addButton
  • addCheckbox
  • addContent
  • addFooter
  • addHandler
  • addHeading
  • addIcon
  • addParagraph
  • addPassword
  • addSelect
  • addSubHeading
  • addTextbox
  • getHandler

# API Documentation

# Constants

# WEBVIEW_LABEL

Signature plugins.core.setup.panel.WEBVIEW_LABEL -> string
Type Constant
Description The ID for the Webview
Notes None
Source src/plugins/core/setup/panel.lua line 17

# Functions

# panelCount

Signature plugins.core.setup.panelCount() -> number
Type Function
Description The number of panels currently being processed in this session. This includes panels already processed, the current panel, and remaining panels.
Parameters
  • None
Returns
  • The number of panels.
Notes None
Examples None
Source src/plugins/core/setup/init.lua line 147

# panelNumber

Signature plugins.core.setup.panelNumber() -> number
Type Function
Description The number of the panel currently being viewed.
Parameters
  • None
Returns
  • the current panel number, or 0 if no panels are registered.
Notes None
Examples None
Source src/plugins/core/setup/init.lua line 160

# panelQueue

Signature plugins.core.setup.panelQueue() -> table of panels
Type Function
Description The table of panels remaining to be processed. Panels are removed from the queue one at a time and displayed in the window via the nextPanel() function.
Parameters
  • None
Returns
  • The table of panels remaining to be processed.
Notes None
Examples None
Source src/plugins/core/setup/init.lua line 173

# Constructors

# new

Signature plugins.core.setup.panel.new(id, priority) -> plugins.core.setup.panel
Type Constructor
Description Constructs a new panel with the specified priority and ID.
Parameters
  • priority - Defines the order in which the panel appears.
  • id - The unique ID for the panel.
Returns
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 22

    # Methods

    # addButton

    Signature plugins.core.setup.panel:addButton(params) -> panel
    Type Method
    Description Adds a button to the panel.
    Parameters
    • params - The list of parameters.
    Returns
    • The same panel.
    Notes
    • The params table may contain:
    • ** id - (optional) the unique ID for the button. If none is provided, one is generated.
    • ** value - The value of the button. This is sent to the onclick function.
    • ** label - The text label for the button. Defaults to the value if not provided.
    • ** width - The width of the button in pixels.
    • ** onclick - the function to execute when the button is clicked. The function should have the signature of function(id, value), where id is the id of the button that was clicked, and value is the value of the button.
    Examples None
    Source src/plugins/core/setup/panel.lua line 352

    # addCheckbox

    Signature plugins.core.setup.panel:addCheckbox(params) -> panel
    Type Method
    Description Adds a checkbox to the panel with the specified params.
    Parameters
    • params - The set of parameters for the checkbox.
    Returns
    • The panel object.
    Notes
    • The params can contain the following fields:
    • ** id - (optional) The unique ID. If none is provided, one will be generated.
    • ** name - (optional) The name of the checkbox field.
    • ** label - (optional) The text label to display after the checkbox.
    • ** onchange - (optional) a function that will get called when the checkbox value changes. It will be passed two parameters, id and params, the latter of which is a table containing the value and checked values of the checkbox.
    • ** class - (optional) the CSS class list to apply to the checkbox.
    Examples None
    Source src/plugins/core/setup/panel.lua line 182

    # addContent

    Signature plugins.core.setup.panel:addContent(content[, escaped]) -> panel
    Type Method
    Description Adds the specified content to the panel.
    Parameters
    • content - a value that can be converted to a string.
    • escaped - if true, the content will not be escaped. Defaults to true.
    Returns
    • The panel.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 72

    # addFooter

    Signature plugins.core.setup.panel:addFooter(content, unescaped) -> panel
    Type Method
    Description Adds the specified content to the panel's footer.
    Parameters
    • content - a value that can be converted to a string.
    • unescaped - if true, the content will not be escaped. Defaults to true.
    Returns
    • The panel.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 87

    # addHandler

    Signature plugins.core.setup.panel:addHandler(event, id, handlerFn, keys) -> none
    Type Method
    Description Gets a handler from an Handler ID
    Parameters
    • event - The event
    • id - the Handler ID
    • handlerFn - The Handler function
    • keys - Keys
    Returns
    • None
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 115

    # addHeading

    Signature plugins.core.setup.panel:addHeading(text) -> panel
    Type Method
    Description Adds a heading to the panel
    Parameters
    • text - The text of the heading as a string
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 220

    # addIcon

    Signature plugins.core.setup.panel:addIcon(src) -> panel
    Type Method
    Description Adds an icon to the panel.
    Parameters
    • src - Location of the icon.
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 331

    # addParagraph

    Signature plugins.core.setup.panel:addParagraph(content[, escaped[, class]]) -> panel
    Type Method
    Description Adds a Paragraph to the panel
    Parameters
    • content - The content as a string
    • escaped - Whether or not the HTML should be escaped as a boolean
    • class - The class as a string
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 167

    # addPassword

    Signature plugins.core.setup.panel:addPassword(params) -> panel
    Type Method
    Description Adds a password text-box to the panel.
    Parameters
    • params - A table of parameters
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 273

    # addSelect

    Signature plugins.core.setup.panel:addSelect(params) -> panel
    Type Method
    Description Adds a select to the panel.
    Parameters
    • params - A table of parameters
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 300

    # addSubHeading

    Signature plugins.core.setup.panel:addSubHeading(text) -> panel
    Type Method
    Description Adds a sub-heading to the panel
    Parameters
    • text - The text of the sub-heading as a string
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 233

    # addTextbox

    Signature plugins.core.setup.panel:addTextbox(params) -> panel
    Type Method
    Description Adds a text-box to the panel
    Parameters
    • params - A table of parameters
    Returns
    • The panel object.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 246

    # getHandler

    Signature plugins.core.setup.panel:getHandler(id) -> handler
    Type Method
    Description Gets a handler from an Handler ID
    Parameters
    • id - the Handler ID
    Returns
    • A handler.
    Notes None
    Examples None
    Source src/plugins/core/setup/panel.lua line 102