# plugins.core.preferences.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.preferences.manager.panel.new(params, manager) -> cp.core.preferences.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.preferences.manager.panel object
Notes None
Examples None
Source src/plugins/core/preferences/manager/panel.lua line 16

# Methods

# addButton

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 304

# addCheckbox

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 198

# addContent

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 107

# addHandler

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

# addHeading

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 237

# addParagraph

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 183

# addPassword

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 277

# addSelect

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 333

# addTextbox

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 250

# getToolbarItem

Signature plugins.core.preferences.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/preferences/manager/panel.lua line 44