Skip to content
This repository was archived by the owner on Dec 11, 2018. It is now read-only.
Bruno Herfst edited this page Jan 22, 2018 · 5 revisions

Widget

An GUI widget (SUI Group) containing a dropdown loaded with presets, load/save button, and all functionality needed. This group can be loaded into a SUI Window, Dialog, Group or Panel.

attachTo ( SUI_Group )

Usage: Creates a new Widget into given SUI element
Example: Pm.Widget.attachTo( Window, listKeyID, DataPort, *options* )
Returns object: Success: Boolean, comment: String

Parameters

Window: SUI Window, Dialog, Panel or Group

listKeyID: The key or id to to use when filling the dropdown created by the widget.

DataPort: An object that references two SUI functions { getData: functionRef, renderData: functionRef }:

  1. getData: function to get preset from SUI
  2. renderData: function that takes a preset as parameter and uses this to populates SUI

options: An object to set custom options including: lockChar, newName, buttonTextSave, buttonTextClear

get ( )

Usage: Get SUI_Preset
Returns object: An unsaved Preset as presented in SUI.

getLockChars ( )

Usage: Get the text
Returns array: Opening and closing preset locking characters ["-","-"]

getNewPresetName ( )

Usage: Get name of "New Preset" as present in the drop-down (without locking characters) Returns string: Name of new preset New Preset

getLastUsedPresetName ( )

Usage: Get name of preset that was last used, as present in the drop-down (without locking characters) Returns string: Name of last used preset Last Used

activateNew ( )

Usage: Reset Presets Dropdown to [New Preset] without changing any SUI data
Returns boolean: Success

activateLastUsed ( )

Usage: Reset Presets Dropdown to [Last Used] updating any SUI data
Returns boolean: Success

loadIndex ( index )

Usage: Load Presets[index] in UiPreset and update UI Returns boolean: Success

saveUiPreset ( )

Usage: Save SUI data to UiPreset
Returns boolean: true

savePreset ( /object/ options )

Usage: Save SUI data as Preset to Presets Returns boolean: true

Parameters

Options: An optional object to set options:

  1. updateProps: Array of property names to be updated before saving. ([name:'New Name'])
  2. position: Integer The position to which to save the Preset in Presets

overwritePreset ( /String/ key, /Anything/ val, /Object/ options)

Usage: Overwrite UiPreset where Key:val matches in Presets Returns boolean: true
Note: This function saves Presets to disk.

Parameters

Options: An optional object to set options:

  1. position: Integer The position/index to be overwritten in Presets

Clone this wiki locally