Difference between revisions of "UI Widgets"
Zen Linden (talk | contribs) |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
Documentation of the current XUI xml format as used in the Second Life viewer for its UI elements. | Documentation of the current XUI xml format as used in the Second Life viewer for its UI elements. | ||
===Widget List=== | ===Widget List=== | ||
These are some of the widgets at your disposal: | |||
<b>LLTextBox</b> - a holder of displayed text | |||
<b>LLSlider</b> - a knob you can move horizontally to control a value | |||
<b>LLRadioGroup</b> - a group of radio buttons for choosing a particular setting | |||
<b>LLLineEditor</b> - a means of inputing text | |||
<b>LLCheckBoxCtrl</b> - a check box for turning something on or off | |||
<b>LLButton</b> - a button to press | |||
<b>LLComboBox</b> - a drop down list with a single line text box | |||
===Widget Options=== | ===Widget Options=== | ||
Line 10: | Line 24: | ||
<b>Control Name</b> | <b>Control Name</b> | ||
* control_name=" | * control_name="MySavedSetting" | ||
Lets you associate check box and slider values with particular saved settings without writing any C++ code. Very useful. When you load a floater or other XUI element containing a check box or slider with that tag, it will take it's initial value from the named saved setting and automatically saves back out modified values as the user interacts with those controls. | |||
This is extremely powerful and should let you create a custom panel to control any of the boolean or real valued settings that you see in the [[Debug_Settings]] floater. See beacons.xml for examples. | |||
<b>Width and Height</b> | <b>Width and Height</b> | ||
Line 29: | Line 46: | ||
** Note: Use bottom *or* bottom_delta, never both. | ** Note: Use bottom *or* bottom_delta, never both. | ||
** | <b>Font</b> | ||
* font="SanSerifSmall" // sets the font used for any text used by the widget. 99% of these in the viewer are SanSerif and SanSerifSmall | |||
<b>Enabled</b> | |||
* enabled="true" // sets whether the widget is grayed out or accessible |
Latest revision as of 08:23, 22 June 2009
Documentation of the current XUI xml format as used in the Second Life viewer for its UI elements.
Widget List
These are some of the widgets at your disposal:
LLTextBox - a holder of displayed text
LLSlider - a knob you can move horizontally to control a value
LLRadioGroup - a group of radio buttons for choosing a particular setting
LLLineEditor - a means of inputing text
LLCheckBoxCtrl - a check box for turning something on or off
LLButton - a button to press
LLComboBox - a drop down list with a single line text box
Widget Options
You will see the following information in XML files as you go. Here's what all the options mean.
Name
- name="SuperWidget" // name of the widget. You will use this name in the code to identify your widget when you need it
Control Name
- control_name="MySavedSetting"
Lets you associate check box and slider values with particular saved settings without writing any C++ code. Very useful. When you load a floater or other XUI element containing a check box or slider with that tag, it will take it's initial value from the named saved setting and automatically saves back out modified values as the user interacts with those controls.
This is extremely powerful and should let you create a custom panel to control any of the boolean or real valued settings that you see in the Debug_Settings floater. See beacons.xml for examples.
Width and Height
- width="100" // sets the width of the widget to be 100 pixels
- Note: This is the entire width of the widget, not just the label.
- height="20" // sets the height of the widget to be 20 pixels
- Note: This is the entire width of the widget, not just the label.
Left
- left="10" // sets the horizontal position of the left edge of the widget to be 10 pixels from the left edge of the panel or floater
- left_delta="100" // sets the horizontal position of the left edge of the widget to be 100 pixels from the left edge of previously listed widget
- Note: Use left *or* left_delta, never both.
Bottom
- bottom="300" // sets the vertical position of the bottom edge of the widget to be 300 pixels from the bottom edge of the panel or floater
- bottom="-30" // sets the vertical position of the bottom edge of the widget to be 30 pixels from the top edge of the panel or floater
- bottom_delta="-30" // sets the vertical position of the bottom edge of widget to be 30 pixels from the bottom edge of previously listed widget
- Note: Use bottom *or* bottom_delta, never both.
Font
- font="SanSerifSmall" // sets the font used for any text used by the widget. 99% of these in the viewer are SanSerif and SanSerifSmall
Enabled
- enabled="true" // sets whether the widget is grayed out or accessible