Wiki
Clone wikiaequery / ui / container
aeq.ui.Container
new aeq.ui.Container(obj)
aeq.ui.Container
makes it easier to create controls for groups and panels.
Methods
get()
.get()
Description: - Gets the original group or panel object.
set(options)
.set(object)
Description
- Set options on the panel / group
Parameters:
- options
: Object with options.
Example:
grp.set({ alignment: ["fill", "fill"], orientation: "column", spacing: 0, margins: 0 });
addButton(text[, onClick, properties])
addButton(String[, function, object])
addButton(object)
Description
- Creates a button
Parameters:
- text
: The text inside the button
- onClick
: The function that gets called when clicking the button
- properties
: Object with creation properties for the button.
or
- options
: Object with settings for the button.
Returns:
- ScriptUI button
Example:
var clicked = function() { alert("Clicked!"); }; grp.addButton("Click Me!", clicked, {name: "Button"}); grp.addButton({ text: "Click Me!", onClick: clicked, properties: { name: "Button" }, // You can also add other properties when using this style alignment: ["right", "top" ] });
addCheckbox(text[, onClick, properties])
addCheckbox(String[, function, object])
addCheckbox(object)
Description
- Creates a checkbox
Parameters:
- text
: The text beside the checkbox
- onClick
: The function that gets called when clicking the checkbox
- properties
: Object with creation properties for the button.
or
- options
: Object with settings for the checkbox.
Returns:
- ScriptUI checkbox
addDropdownList(items[, onChange, properties])
addDropdownList(Array[, function, object])
addDropdownList(object)
Description
- Creates a dropdownList
Parameters:
- items
: The items inside the list
- onChange
: The function that gets called when changing the value of the dropdownList
- properties
: Object with creation properties for the list.
or
- options
: Object with settings for the dropdownList.
Returns:
- ScriptUI dropdownList
addEditText(text[, onChange, onChanging, properties])
addEditText(String[, function, function, object])
addEditText(object)
Description
- Creates an editText
Parameters:
- text
: The text inside the edittext field.
- onChange
: The function that gets called when the value has changed
- onChanging
: The function that gets called when changing the value
- properties
: Object with creation properties for the field.
or
- options
: Object with settings for the editText.
Returns:
- ScriptUI editText
addGroup([options])
addGroup([object])
Description
- Creates a new group
Parameters:
- options
: Object with settings for the group (alignment, orientation etc.).
Returns:
- aeq.Container
addIconButton(icon[, onClick, properties])
addIconButton(String/File/ScriptUIImage[, function, object])
addIconButton(object)
Description
- Creates an IconButton
Parameters:
- icon
: The icon to use for the button. One of:
- String with path to image file.
- File object that points to the image file.
- ScriptUIImage object with image data.
- onClick
: The function that gets called when the button is clicked
- properties
: Object with creation properties for the button.
or
- options
: Object with settings for the IconButton.
Returns:
- ScriptUI IconButton
addListbox(items[, onChange, onDoubleClick, properties])
addListbox(Array[, function, function, object])
addListbox(object)
Description
- Creates a listBox
Parameters:
- items
: The items inside the list
- onChange
: The function that gets called when changing the value of the listBox
- onDoubleClick
: The function that gets called when doubleclicking an item in the list.
- properties
: Object with creation properties for the listbox.
or
- options
: Object with settings for the listbox.
Returns:
- ScriptUI listBox
addPanel(text, [properties])
addPanel(String, [object])
addPanel(object)
Description
- Creates a new panel group
Parameters:
- text
: The text that is shown around the border of the panel
- properties
: Creation properties for the panel.
or
- options
: Object with settings for the panel group (alignment, orientation etc.).
Returns:
- aeq.Container
addProgressbar(value, maxValue)
addProgressbar(Float, Float)
Description
- Creates a progressbar
Parameters:
- value
: The start value of the progressbar
- maxValue
: The max value of the progressbar
Returns:
- ScriptUI progressbar
addRadioButton(text[, onClick, properties])
addRadioButton(String[, function, object])
addRadioButton(object)
Description
- Creates a RadioButton
Parameters:
- text
: The text beside the RadioButton
- onClick
: The function that gets called when clicking the RadioButton
- properties
: Object with creation properties for the RadioButton.
or
- options
: Object with settings for the RadioButton.
Returns:
- ScriptUI RadioButton
addScrollbar(value, maxValue, onChange, onChanging)
addScrollbar(Float, Float, Function, Function)
Description
- Creates a scrollbar
Parameters:
- value
: The start value of the scrollbar
- maxValue
: The max value of the scrollbar
- onChange
: The function to call when the scrollbar is done changing.
- onChanging
: The function getting called when the scrollbar is adjusted.
Returns:
- ScriptUI scrollbar
addSlider(value, minValue, maxValue, onChange, onChanging)
addSlider(Float, Float, Float, Function, Function)
Description
- Creates a slider
Parameters:
- value
: The start value of the slider
- minValue
: The minimum value of the slider
- maxValue
: The max value of the slider
- onChange
: The function to call when the slider is done changing.
- onChanging
: The function getting called when the slider is adjusted.
Returns:
- ScriptUI slider
addStatictext(text, properties)
addStatictext(String, Object)
addStatictext(Object)
Description
- Creates a Statictext
Parameters:
- text
: The text that is shown
- properties
: Object with creation properties for the Statictext
or
- options
: Object with settings for the Statictext.
Returns:
- ScriptUI Statictext
addTab(text)
addTab(String)
Description
- Creates a tab in a TabbedPanel
Parameters:
- text
: The text that is shown
Returns:
- aeq.Container
addTabbedPanel()
addTabbedPanel()
Description - Creates a new TabbedPanel Parameters: - None. Returns: - aeq.Container
addTreeview(items[, onChange, onDoubleClick, properties])
addTreeview(Array[, function, function, object])
addTreeview(object)
Description
- Creates a treeview
Parameters:
- items
: The items inside the list
- onChange
: The function that gets called when changing the value of the treeview
- properties
: Object with creation properties for the treeview.
or
- options
: Object with settings for the treeview.
Returns:
- ScriptUI treeview
update()
update()
Description - Calls the containers layoutManagers layout and resize methods. Parameters: - None. Returns: - Nothing
remove(obj)
remove(ScriptUI object)
remove(aeq.Container object)
Description - Removes the given object from the container Parameters: - None. Returns: - Nothing
Setter / Getter Methods
These methods gets or sets the coresponding property on the container object. When no arguments are given, the methods returns the current value. When arguments are given it sets the value.
The following can only be set using 1 argument
- enabled
- helpTip
- orientation
- text
- visible
The following can either be set using one argument using an array of 2 elements. Or as 2 arguments.
- alignChildren
- alignment
- location
- maximumSize
- minimumSize
- preferredSize
- size
The following can either be set using one argument using an array of 4 elements. Or as 4 arguments.
- bounds
- margins
Example of 2 arguments
// Using array grp.alignChildren(["left", "top"]); // Using arguments grp.alignChildren("left", "top");
Example of 4 arguments
// Using array grp.margins([5, 2, 5, 2]); // Using arguments grp.margins(5, 2, 5, 2);
Updated