--- layout: compress --- TinyMCE | tinymce.ui.DropMenu
0 results found

tinymce.ui.DropMenu

Contribute to this page
Namespace tinymce.ui
Class DropMenu
Inheritance DropMenu Menu MenuItem Control

This class is used to create drop menus, a drop menu can be a context menu, or a menu for a list box or a menu bar.

Example

Public Methods

Method Defined By
DropMenu(id:String, s:Object) : Constructs a new drop menu control instance. DropMenu
add(o:Control):Control : Adds a new menu, menu item or sub classes of them to the drop menu. DropMenu
addMenu(o:Object):Menu : Adds a sub menu to the menu. Menu
addSeparator():MenuItem : Adds a menu separator between the menu items. Menu
collapse(d:Boolean):void : Collapses the menu, this will hide the menu and all menu items. DropMenu
createMenu(s:Object):DropMenu : Created a new sub menu for the drop menu control. DropMenu
destroy():void : Destroys the menu. DropMenu
expand(d:Boolean):void : Expands the menu, this will show them menu and all menu items. Menu
hasMenus():Boolean : Returns true/false if the menu has sub menus or not. Menu
hideMenu():void : Hides the displayed menu. DropMenu
isActive():Boolean : Returns true/false if the control is disabled or not. Control
isCollapsed():Boolean : Returns true/false if the menu has been collapsed or not. Menu
isDisabled():Boolean : Returns true/false if the control is disabled or not. Control
isRendered():Boolean : Returns true/false if the control has been rendered or not. Control
isSelected():Boolean : Returns true/false if the control is selected or not. MenuItem
postRender():void : Post render handler. MenuItem
remove(o:Control):Control : Removes a specific sub menu or menu item from the drop menu. DropMenu
removeAll():void : Removes all menu items and sub menu items from the menu. Menu
renderHTML():String : Renders the control as a HTML string. Control
renderNode():Element : Renders the specified menu node to the dom. DropMenu
renderTo(n:Element):void : Renders the control to the specified container element. Control
setActive(s:Boolean):void : Sets the activated state for the control. Control
setDisabled(s:Boolean):void : Sets the disabled state for the control. Control
setSelected(s:Boolean):void : Sets the selected state for the control. MenuItem
setState(c:String, s:Boolean):void : Sets the specified class state for the control. Control
showMenu(x:Number, y:Number, px:Numner):void : Displays the menu at the specified cordinate. DropMenu
update():void : Repaints the menu after new items have been added dynamically. DropMenu

Method details

DropMenu

public function DropMenu(id:String, s:Object)
Constructs a new drop menu control instance.

Parameters

Param Detail
id:String Button control id for the button.
s:Object Optional name/value settings object.

add

public function add(o:Control):Control
Adds a new menu, menu item or sub classes of them to the drop menu.

Parameters

Param Detail
o:Control Menu or menu item to add to the drop menu.

Returns
Control - Same as the input control, the menu or menu item.

collapse

public function collapse(d:Boolean):void
Collapses the menu, this will hide the menu and all menu items.

Parameters

Param Detail
d:Boolean Optional deep state. If this is set to true all children will be collapsed as well.

createMenu

public function createMenu(s:Object):DropMenu
Created a new sub menu for the drop menu control.

Parameters

Param Detail
s:Object Optional name/value settings object.

Returns
DropMenu - New drop menu instance.

destroy

public function destroy():void
Destroys the menu. This will remove the menu from the DOM and any events added to it etc.

hideMenu

public function hideMenu():void
Hides the displayed menu.

remove

public function remove(o:Control):Control
Removes a specific sub menu or menu item from the drop menu.

Parameters

Param Detail
o:Control Menu item or menu to remove from drop menu.

Returns
Control - Control instance or null if it wasn't found.

renderNode

public function renderNode():Element
Renders the specified menu node to the dom.

Returns
Element - Container element for the drop menu.

showMenu

public function showMenu(x:Number, y:Number, px:Numner):void
Displays the menu at the specified cordinate.

Parameters

Param Detail
x:Number Horizontal position of the menu.
y:Number Vertical position of the menu.
px:Numner Optional parent X position used when menus are cascading.

update

public function update():void
Repaints the menu after new items have been added dynamically.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.