# plugins.core.utilities.manager.panel

CommandPost Preferences Panel.


# API Overview

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
  • addHandler
  • addHeading
  • addParagraph
  • addPassword
  • addSelect
  • addTextbox
  • getToolbarItem

# API Documentation

# Constructors

# new

Signature plugins.core.utilities.manager.panel.new(params, manager) -> cp.core.utilities.manager.panel
Type Constructor
Description Constructs a new panel with the specified priority and ID.
Parameters
  • params - Table of parameters
  • manager - The manager
Returns
  • A cp.core.utilities.manager.panel object
Notes None
Examples None
Source src/plugins/core/toolbox/manager/panel.lua line 16

# Methods

# addButton

Signature plugins.core.utilities.manager.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/toolbox/manager/panel.lua line 303

# addCheckbox

Signature plugins.core.utilities.manager.panel:addCheckbox(priority, params) -> panel
Type Method
Description Adds a checkbox to the panel with the specified priority and params.
Parameters
  • priority - The priority number for the checkbox.
  • params - The set of parameters for the checkbox.
Returns
  • The panel.
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/toolbox/manager/panel.lua line 198

# addContent

Signature plugins.core.utilities.manager.panel:addContent(priority, content[, escaped]) -> panel
Type Method
Description Adds the specified content to the panel, with the specified priority order.
Parameters
  • priority - the priority order of the content.
  • content - a value that can be converted to a string.
  • escaped - if true, the content will be escaped.
Returns
  • The panel.
Notes None
Examples None
Source src/plugins/core/toolbox/manager/panel.lua line 107

# addHandler

Signature plugins.core.utilities.manager.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/toolbox/manager/panel.lua line 130

# addHeading

Signature plugins.core.utilities.manager.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/toolbox/manager/panel.lua line 236

# addParagraph

Signature plugins.core.utilities.manager.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. Defaults to true for simple text.
  • class - The class as a string
Returns
  • The panel object.
Notes None
Examples None
Source src/plugins/core/toolbox/manager/panel.lua line 183

# addPassword

Signature plugins.core.utilities.manager.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/toolbox/manager/panel.lua line 276

# addSelect

Signature plugins.core.utilities.manager.panel:addSelect(priority, params) -> panel
Type Method
Description Adds a select to the panel.
Parameters
  • priority - Priority of the item as number.
  • params - A table of parameters
Returns
  • The panel object.
Notes None
Examples None
Source src/plugins/core/toolbox/manager/panel.lua line 332

# addTextbox

Signature plugins.core.utilities.manager.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/toolbox/manager/panel.lua line 249

# getToolbarItem

Signature plugins.core.utilities.manager.panel:getToolbarItem() -> table
Type Method
Description Gets the Tool Bar as a table
Parameters
  • None
Returns
  • The toolbar item as a table.
Notes None
Examples None
Source src/plugins/core/toolbox/manager/panel.lua line 44