User Guide
Ruby Component
Drop Lists
For selecting from a discrete list of options we have the drop list control. You can create one using the createDropList method:
createDropList input, id, pos, items, [checked [,style [,disabled]]]
The inputs to the method are as follows:
input - reference to the input View connector (name or index)
id - an id that you can use on the callback so you know which list is reporting
pos - top left corner of the drop list
items - comma separated string of item names
checked - index of the item you want to show as checked [OPTIONAL]
style - "scroll", "autocol" or number of items per column [OPTIONAL]
disabled - the index of the item you want to show as disabled [OPTIONAL]
Once the drop list control is created it will report back to the Ruby component once a selection has been made. You can capture the reported
information by implementing the following method:
def dropListFinished id, index, name
end
The id input is the id of the drop list that is reporting (the one you supplied when you created it). The index is the index of the item that was
selected and name is the name of the item as displayed in the list.
Here's an example of a drop list control in action. In this example we've clicked on the UI so the mouseLDown method has already been
called and created the control.
154 of 212