Klipfolio Dashboard 5 API

Object ComboBox

Object
   |
   +--ComboBox

The ComboBox object provides an API to a drop-down single-select combobox component in the Klip's Customize window.

Use myTab.addComboBox() to add a combobox to a tab, where myTab is a Tab object.

Example

The following code creates a new tab called 'New Tab', then adds a combobox with three items.
 function onLoad() {
 
     // Create a new tab
     var tab = Setup.addTab( "New Tab" );
 
     // Add a drop-down combo box to the tab
     comboBox = tab.addComboBox();
   
     // Add three items 
     comboBox.addItem( "1st Item" );
     comboBox.addItem( "2nd Item" );
     comboBox.addItem( "3rd Item" );
 }
 
The above call to Setup.addTab( "New Tab" ) adds a new Tab object to the Klip's Setup array.

Each Tab object in the Setup array corresponds to a tab in a Klip's Customize window. This window is visible when a user right-clicks on a Klip and chooses the command 'Customize Klip...'

Each Tab object can have multiple UI components, and each Klip can have multiple tabs. Use the Button, Checkbox, ComboBox, ListControl, Spacer, Text, TextArea, and TextField objects in a tab to enable users to configure the Klip to their preferences.

Accessing ComboBox as an Array

You can read/write items in the combobox through the array ComboBox[]. Each item in ComboBox[] is a string. For example,
     // Change the second item
     comboBox[1] = "This is a new second item";   
 
If you specify an array index to that is greater than length, Klipfolio Dashboard will disregard the index and append the item to the end of the ComboBox[] array.


Properties Summary
 boolean disabled
          The enabled (true) or disabled (false) state of this combobox.
 integer length
          The number of items in the combobox (read-only).
 integer selected
          The index of the item currently selected by the user.
 String value
          The text of the item currently selected by the user.
   
Function Summary
 function addItem( <String> name )
           Appends a new item to the combobox.
 function clear()
           Clears all items from the combobox.
 Boolean delItem( <String> name | <integer> index )
           Deletes a specified item in the combobox.
 function onChange( [<integer> index] )
           Specifies a Handler Function for Klipfolio Dashboard to call when the user selects an item in the combobox.

Properties Detail

disabled

boolean disabled

length

integer length

selected

integer selected

value

String value

Function Detail

addItem

function addItem( <String> name )

clear

function clear()

delItem

Boolean delItem( <String> name | <integer> index )

onChange

function onChange( [<integer> index] )

Klipfolio Dashboard 5 API

© 2009 Klipfolio Inc. All Rights Reserved.