A struct containing methods to save and load rollout settings, such as size, position, control states, items, etc
to a preferences file, as well as methods to accomplish UI control tasks for example keeping one spinner higher or lower
than another when editing ranges.
To manage a rollout or dialog, you simply:
- create a struct instance
- initialize it with a reference to a rollout
- Manage the rollout by calling the struct's methods
In code, that's as easy as this:
ui = uiManager() ui.initialize roTools ui.loadPosition()
All settings are saved to an .ini file named after the rollout title, so in this case, an ini file named "Tools.ini" would be saved to your max installation's /plugcfg folder.
This is a work in progress, and will be updated from time to time with new methods.
- savePosition - save the dialog position
- loadPosition - load the dialog position
- saveSize - save the dialog size
- loadSize - restore the dialog size
- autoSizeFloater - resize the floater to exactly the size of all open rollouts
- toggleRollout - set one or several rollouts open
- loadRolloutStates - save all rolled-up / down states (not yet implemented)
- saveRolloutStates - load all rolled-up / down states (not yet implemented)
- updateSpinnerPair - ensure that spinners react as a pair, eg one can never go higher than the other
- moveListboxItem – move selected Listbox items up or down, and have them remain selected
- moveMultiListboxItems – move multiple MultiListbox selections up or down, and have them remain selected
- getValue - abstract function to get a control's value (not yet implimented)
- setValue - abstract function to set a controls's value (not yet implimented)
Preference functions (WIP)
- saveValue - save a control's value
- loadValue - load a control's value
- saveAllValues - save all controls' values
- loadAllValues - load all controls' values
Download uiManager0.52.ms. Place in your scripts/startup directory, or just include the file when you need it.
These example files will get you started: