Sol.config.SetupDropdown

From Runes of Magic Wiki - The Runes of Magic

Jump to: navigation, search
Sol.config.SetupDropdown = function(dropdown, values, selectedIndex, width, onSelectScript)


Initializes a dropdown with the specified values and makes sure it functions
correctly.

Parameters:
+ dropdown       - The dropdown frame to setup
+ values         - A table of values to use in the dropdown; can be either a list of
                   strings or of tables. In the latter case, the tables must have a 
                   name field
+ selectedIndex  - Which value to select initially; doesn't matter if you use
                   Sol.config.LoadConfig afterwards (and your naming is as described
                   in Sol.config.SaveConfig). Defaults to the first item
+ width          - Width of the dropdown frame; defaults to 100
+ onSelectScript - Custom script to run when an item is selected. Signature:
                   onSelectScript = function(dropdown, selectedIndex, selectedValue)
                   
POST: dropdown is initialized with values, its width and selected item are set, and
clicking an item will check it in the dropdown and optionally call onSelectScript
Personal tools