WoW:Using UIDropDownMenu: Difference between revisions

m
Move page script moved page Using UIDropDownMenu to WoW:Using UIDropDownMenu without leaving a redirect
No edit summary
m (Move page script moved page Using UIDropDownMenu to WoW:Using UIDropDownMenu without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[UI Object UIDropDownMenu|UIDropDownMenu]] can be used to display a basic drop down menu or a series of complex menus such as those that occur when you right click a chat tab. This tutorial explains both.
{{wow/uihowto}}
'''UIDropDownMenu''' is a [[FrameXML]] Frame template that can be used to create contextual menus and dropdown boxes in World of Warcraft. This tutorial explains how to use it in your addon.
 
== Provided functionality ==
The template can be used to create two UI elements: drop-down lists and context menus, shown below. The differences between the two are mostly cosmetic; both allow a multi-level menu to be displayed to the user.
{|
! align="center" | Drop-down list
! align="center" | Context menu
|-
| [[Image:UIDropDownMenu-NoMenu.png]]
| [[Image:UIDropDownMenu-Menu.png|162px]]
|}
Menu items may be disabled, checked, show a color picker swatch, or be styled as a title. The template automatically creates a drop-down box, as well as any list buttons as necessary.
 


== Step 1 : The Button ==
== Step 1 : The Button ==
Line 19: Line 32:


* The standard drop down menu.
* The standard drop down menu.
:[[Image:WoWiki_Example_UIDropDownMenu_NoMenu.jpg|The standard drop down menu.]]
: [[Image:UIDropDownMenu-Example NoMenu.jpg|The standard drop down menu.]]


* Using the "MENU" keyword.
* Using the "MENU" keyword.
: [[Image:WoWiki_Example_UIDropDownMenu_Menu.jpg|Using the "MENU" keyword.]]
: [[Image:UIDropDownMenu-Example_Menu.jpg|Using the "MENU" keyword.]]


== Step 2 : The Menu ==
== Step 2 : The Menu ==
Line 30: Line 43:
         <Scripts>
         <Scripts>
             <OnLoad>
             <OnLoad>
                 UIDropDownMenu_Initialize(this, MyDropDownMenu_OnLoad, "MENU");
                 UIDropDownMenu_Initialize(self, MyDropDownMenu_OnLoad, "MENU");
             </OnLoad>
             </OnLoad>
         </Scripts>
         </Scripts>
Line 45: Line 58:
                 <Scripts>
                 <Scripts>
                     <OnLoad>
                     <OnLoad>
                         UIDropDownMenu_Initialize(this, MyDropDownMenu_OnLoad);
                         UIDropDownMenu_Initialize(self, MyDropDownMenu_OnLoad);
                     </OnLoad>
                     </OnLoad>
                  
                  
Line 82: Line 95:
[[API_ToggleDropDownMenu|Click here]] for more information on [[API_ToggleDropDownMenu|ToggleDropDownMenu]].
[[API_ToggleDropDownMenu|Click here]] for more information on [[API_ToggleDropDownMenu|ToggleDropDownMenu]].


[[Category:HOWTOs|Use UIDropDownMenu]]


== HOWTO: nested submenu structures with UIDropDownMenu ==
== HOWTO: nested submenu structures with UIDropDownMenu ==
Line 144: Line 156:
   ToggleDropDownMenu(1, nil, dropdown, self, -20, 0);
   ToggleDropDownMenu(1, nil, dropdown, self, -20, 0);


== See Also ==  
== See also ==
*[[UI Object UIDropDownMenu]]
* [[UI Object UIDropDownMenu]]: template documentation.
*[[API EasyMenu]]
* [[API EasyMenu]]: a table-based interface for dropdowns
[[Category:HOWTOs|Use UIDropDownMenu]]
Anonymous user