MenuItem.js

Inherits from: Button.js

1 ) function: draw
2 ) function: hideItem
3 ) function: showItem
4 ) function: select
5 ) function: deselect
6 ) function: mouseover
7 ) function: mouseup
8 ) function: showSubTree
9 ) function: hideTree
10 ) function: hideSiblingTree


Object: MenuItem

Object Description:
Example:
Inherits from: CGUI
Revised by: Chris Lewis


Constructor: MenuItem
  • Parameter
    : width - width of button
height - height of button
text - text to display in button
event - function to call on mousedown event

There is documentation/code mismatch


Method: hideItem
Description: Hide the text associated with this button


Method: showItem
Description: Hide the text associated with this button


Method: select
Description: Select this button
Changes the appearance to the "selected" state


Method: deselect
Description: Deselect this button
Changes the appearance to the "deselect" state


Method: mouseover
Description: Extend buttons mouseover event
Now the mouseover will expand existing submenu's


Method: mouseup
Description: Extend buttons mouseup event
Now the mouseup fires eventmup if it is defined


Method: showSubTree
Description: Method is called on mouseover and is mousedown
handler.
Method opens and closes menu's as appropriate.
Behaves as follows:
mousedown unselected menuitem
- close other menu's if open
- select item if not selected
- open submenu if present
- deselect item if selected
- close submenu if present
- fire mouseup event if present


Method: hideTree
Description: Hide menu structure from this point down.


Method: hideSiblingTree
Description: Hide all other menus which are siblings of this
menu.