Difference between revisions of "Skinning How To/Edit a menu"
Line 1: | Line 1: | ||
= | = Introduction = | ||
* All menu options are set in menu_viewer.xml | * All viewer menu options are set in menu_viewer.xml except for the Advanced/Admin menus (see [https://jira.secondlife.com/browse/VWR-2896 VWR-2896]). | ||
* Width/height/bottom/left/top are irrelevant. The viewer constructs | * Width/height/bottom/left/top are irrelevant in the menu files. The viewer constructs menus based on the xml file's organization and ignores these parameters. | ||
* Example menu structure: | * Example menu structure: | ||
Line 20: | Line 20: | ||
</menu></pre> | </menu></pre> | ||
== | == Menu files == | ||
Viewer menu: '''menu_viewer.xml'''<br> | |||
Inventory menu: '''floater_inventory.xml'''<br> | |||
Inventory item menu when right clicked: '''menu_inventory.xml'''<br> | |||
Landmark menu when right clicked: '''menu_slurl.xml'''<br> | |||
Menu at the login screen: '''menu_login.xml'''<br> | |||
Pie menu when you right click: | |||
* An object: '''menu_pie_object.xml''' | |||
* Yourself: '''menu_pie_self.xml''' | |||
* Land: '''menu_pie_land.xml''' | |||
* Someone else: '''menu_pie_avatar.xml''' | |||
* An attachment: '''menu_pie_attachment.xml''' | |||
= Tags = | |||
== <menu> == | |||
Top level menu. Flyout menu when nested. | Top level menu. Flyout menu when nested. | ||
== <menu_item_call> == | |||
Menu item that tells the viewer to execute a specific function. | Menu item that tells the viewer to execute a specific function. | ||
== <on_click> == | |||
Nested in a menu item. Sets the function when clicked. | Nested in a menu item. Sets the function when clicked. | ||
== <on_enable> == | |||
Nested in a menu item. Sets the function when option is enabled. | Nested in a menu item. Sets the function when option is enabled. | ||
== <menu_item_separator> == | |||
Draws a separator between menu options. | Draws a separator between menu options. | ||
== <menu_item_check> == | |||
Menu item that toggles whether something is active or inactive (set via an X next to the name). | Menu item that toggles whether something is active or inactive (set via an X next to the name). | ||
== <on_check> == | |||
Nested in a menu item. Sets the function when checked. | Nested in a menu item. Sets the function when checked. | ||
== <tearoff_menu> == | |||
Does nothing. Assumed to be a legacy setting. | Does nothing. Assumed to be a legacy setting. | ||
= Parameters = | |||
== enabled == | |||
Sets whether or not a menu is enabled or not. Use in <menu>. | Sets whether or not a menu is enabled or not. Use in <menu>. | ||
Boolean: <code>enabled="true"</code> | Boolean: <code>enabled="true"</code> | ||
Line 56: | Line 69: | ||
Sets the name the user sees. Necessary for <menu> and menu items. | Sets the name the user sees. Necessary for <menu> and menu items. | ||
String: <code>name="Awesome Menu"</code> | String: <code>name="Awesome Menu"</code> | ||
== label == | |||
Sets the name the viewer sees. Necessary for <menu> and menu items. | Sets the name the viewer sees. Necessary for <menu> and menu items. | ||
String: <code>name="LabelMenuAwesome"</code> | String: <code>name="LabelMenuAwesome"</code> | ||
* Changing the label for the Tools menu will make it not auto-hide. | * Changing the label for the Tools menu will make it not auto-hide. | ||
== tear_off == | |||
''Optional''. Sets whether or not the menu can be torn off (the double bars at the top of a menu). Use in <menu>. | ''Optional''. Sets whether or not the menu can be torn off (the double bars at the top of a menu). Use in <menu>. | ||
Boolean: <code>tear_off="true"</code> | Boolean: <code>tear_off="true"</code> | ||
== opaque == | |||
''Optional''. Sets whether or not the menu is opaque (setting a stop level menu to false will turn the entire menu transparent unless torn off and reattached. Setting the menu bar to false will turn it transparent per settings in colors.xml). Use in <menu>. | ''Optional''. Sets whether or not the menu is opaque (setting a stop level menu to false will turn the entire menu transparent unless torn off and reattached. Setting the menu bar to false will turn it transparent per settings in colors.xml). Use in <menu>. | ||
Boolean: <code>opaque="true"</code> | Boolean: <code>opaque="true"</code> | ||
== mouse_opaque == | |||
== drop_shadow == | |||
== create_jump_keys == | |||
== userdata == | |||
''Optional''. Any data sent to the function. Use in <on_click>, etc. | ''Optional''. Any data sent to the function. Use in <on_click>, etc. | ||
String: <code>userdata="800,600"</code> | String: <code>userdata="800,600"</code> | ||
== function == | |||
Associates a function with a menu item and action. Use in <on_click>, etc. | Associates a function with a menu item and action. Use in <on_click>, etc. | ||
String: <code>function="Tools.SelectedScriptAction"</code> | String: <code>function="Tools.SelectedScriptAction"</code> | ||
== shortcut == | |||
''Optional''. Sets the keyboard shortcut for a menu item. Each key is separated by pipes. | ''Optional''. Sets the keyboard shortcut for a menu item. Each key is separated by pipes. | ||
String: <code>shortcut="control|alt|T"</code> | String: <code>shortcut="control|alt|T"</code> | ||
= Changing | = Changing a menu = | ||
* Any number of top level menus, flyout menus, and menu items can be set. | * Any number of top level menus, flyout menus, and menu items can be set. | ||
* Renaming part of the menu is fine as long as it calls a working function. | * Renaming part of the menu is fine as long as it calls a working function. |
Revision as of 18:35, 15 May 2008
Introduction
- All viewer menu options are set in menu_viewer.xml except for the Advanced/Admin menus (see VWR-2896).
- Width/height/bottom/left/top are irrelevant in the menu files. The viewer constructs menus based on the xml file's organization and ignores these parameters.
- Example menu structure:
<menu> <menu_item_call> <on_click> </menu_item_call> <menu> <menu_item_check> <on_check> </menu_item_check> <menu_item_call> <on_click> <on_enable> </menu_item_call> </menu> </menu>
Menu files
Viewer menu: menu_viewer.xml
Inventory menu: floater_inventory.xml
Inventory item menu when right clicked: menu_inventory.xml
Landmark menu when right clicked: menu_slurl.xml
Menu at the login screen: menu_login.xml
Pie menu when you right click:
- An object: menu_pie_object.xml
- Yourself: menu_pie_self.xml
- Land: menu_pie_land.xml
- Someone else: menu_pie_avatar.xml
- An attachment: menu_pie_attachment.xml
Tags
Top level menu. Flyout menu when nested.
Menu item that tells the viewer to execute a specific function.
<on_click>
Nested in a menu item. Sets the function when clicked.
<on_enable>
Nested in a menu item. Sets the function when option is enabled.
Draws a separator between menu options.
Menu item that toggles whether something is active or inactive (set via an X next to the name).
<on_check>
Nested in a menu item. Sets the function when checked.
Does nothing. Assumed to be a legacy setting.
Parameters
enabled
Sets whether or not a menu is enabled or not. Use in <menu>.
Boolean: enabled="true"
name
Sets the name the user sees. Necessary for <menu> and menu items.
String: name="Awesome Menu"
label
Sets the name the viewer sees. Necessary for <menu> and menu items.
String: name="LabelMenuAwesome"
- Changing the label for the Tools menu will make it not auto-hide.
tear_off
Optional. Sets whether or not the menu can be torn off (the double bars at the top of a menu). Use in <menu>.
Boolean: tear_off="true"
opaque
Optional. Sets whether or not the menu is opaque (setting a stop level menu to false will turn the entire menu transparent unless torn off and reattached. Setting the menu bar to false will turn it transparent per settings in colors.xml). Use in <menu>.
Boolean: opaque="true"
mouse_opaque
drop_shadow
create_jump_keys
userdata
Optional. Any data sent to the function. Use in <on_click>, etc.
String: userdata="800,600"
function
Associates a function with a menu item and action. Use in <on_click>, etc.
String: function="Tools.SelectedScriptAction"
shortcut
Optional. Sets the keyboard shortcut for a menu item. Each key is separated by pipes.
String: shortcut="control|alt|T"
- Any number of top level menus, flyout menus, and menu items can be set.
- Renaming part of the menu is fine as long as it calls a working function.
- If you're adding a shortcut, make sure it isn't used by another item first.
- Don't worry about width/height/bottom/left/top. As said above, these don't do anything.
- If you want to add a new menu item you need to edit the source. See Adding_a_menu_item.