-
Notifications
You must be signed in to change notification settings - Fork 20
CommonProperties
Different control types accept different properties to configure their appearance, however there are some properties which are shared between some of them.
The type property determines which controls get generated when the panel is opened for the first time.
Required: yes
Type: string
Accepted values: submenu, header, description, texture, divider, checkbox, slider, editbox, dropdown, iconpicker, colorpicker, panel, button, custom
Used by: Submenu, Header, Description, Texture, Divider, Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Panel, Button, Custom
The name property contains the label for the control. The actual look and position depends on the control type, but at least for all input controls it is in the same line on the left side of the panel.
Required: yes
Type: string, number, function
Accepted values: Any string, string id accepted by GetString or function returning a string
Used by: Submenu, Header, Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Panel, Button
When this property is set, a tooltip with the resolved text will appear when the user moves the mouse over the label of the control. The text is resolved whenever the tooltip appears.
Required: no
Type: string, number, function
Accepted values: Any string, string id accepted by GetString or function returning a string
Used by: Submenu, Texture, Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Button
Determines whether the control is rendered over the full or half width of the panel. If two controls with half width are added directly one after another, they both get placed in the same line.
Required: no
Type: string
Accepted values: full, half
Used by: Header, Description, Texture, Divider, Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Button, Custom
LAM does not set names for setting menu controls, which greatly reduces global namespace pollution, but also makes it hard to access the controls from outside of LAM. This property allows to specify a control name which can be used to access it from addon code.
Required: no
Type: string
Accepted values: any valid variable name that is not already in use in the global scope
Used by: Submenu, Header, Description, Texture, Divider, Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Button, Custom
Input controls get their state from this function. It has to return the value type for the specific control type. The most common usage is to return the value from the saved variables, but it can be used in other ways for custom usage outside of the addon menu. The function should not do anything besides returning the value and no assumptions about the amount of times it gets called should be made as it may get called from other parts of LAM besides the input control.
Required: yes
Type: function
Accepted values: a function which returns the expected value type for the control
Used by: Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker
Input controls set their new state with this function. It has to be able to accept the return value from the getFunc. As with the getFunc, no assumptions about the number of calls to it should be made and while it may be desirable to do some additional work when the value changes, it should be taken care that no performance intensive calculations are done directly in the setFunc.
Required: yes
Type: function
Accepted values: a function which accepts the expected value type for the control
Used by: Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker
If this property resolves to true, an input control becomes deactivated and won't accept any user input until it is false again. In order for this to work, the parent panel needs to have its registerForRefresh flag set to true.
Required: no
Type: boolean, function
Accepted values: true and false or a function which returns a boolean value
Used by: Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Button
Shows a warning icon left of the input element and when the mouse enters this icon a tooltip with the warning text is shown.
Required: no
Type: string, number, function
Accepted values: Any string, string id accepted by GetString or function returning a string
Used by: Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker, Button
Appends additional text to the warning text, telling a user that a reload is required when the value changes. In addition it shows a button "Reload UI" at the bottom right of the panel once a change is pending. In case the user uses the reload button in the panel, the previously opened panel will show up again once the UI has finished reloading. Otherwise a will show up once he leaves the addon settings menu, telling him to either reload now or discard the changes that would require the reload. In order for this feature to work, the parent panel needs to have its registerForRefresh flag set to true.
Required: no
Type: boolean
Accepted values: true and false
Used by: Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker
Contains the default value for the control which is used when the panel is reset to its defaults. For this to have any effect, the registerForDefaults flag has to be set on the parent panel.
Required: no
Type: varying
Accepted values: Generally any value that can be passed to setFunc, but details may vary for some controls
Used by: Checkbox, Slider, Editbox, Dropdown, Icon Picker, Color Picker
General
Home
Differences between v1.0 and v2.0
Getting started
LAM2 for the Experienced Author
Reference
Exposed Methods on LAM2
LAM2 callbacks
Details on LAM2 data tables
LAM2 control widgets
Resources
Addons using LAM2
External controls
DatePicker widget
OrderListBox widget
SoundSlider widget
DualListBox widget
MultiSelectDropdown widget