Zebra API Doc

zebra.ui.Menubar Class

Extends zebra.ui.Menu

Menu bar UI component class. Menu bar can be build in any part of UI application. There is no restriction regarding the placement of the component.

   var canvas = new zebra.ui.zCanvas(300,200);
   canvas.setLayout(new zebra.layout.BorderLayout());

   var mbar = new zebra.ui.Menubar({
       "Item 1": {
           "Subitem 1.1":null,
           "Subitem 1.2":null,
           "Subitem 1.3":null
       },
       "Item 2": {
           "Subitem 2.1":null,
           "Subitem 2.2":null,
           "Subitem 2.3":null
       },
       "Item 3": null
   });

   canvas.root.add(zebra.layout.BOTTOM, mbar);

Constructor

zebra.ui.Menubar

()

Methods

$canceled

(
  • m
)
protected

Inherited from zebra.ui.Menu:

Called when the menu or a sub-menu has been canceled (key ESCAPE has been pressed).

Parameters:

$childMenu

() zebra.ui.Menu protected

Inherited from zebra.ui.Menu:

Get a sub menu that is shown at the given moment.


Return: zebra.ui.Menu

a child sub menu. null if no child sub-menu has been shown

$hideMenu

(
  • triggeredBy
)
protected

Inherited from zebra.ui.Menu:

Hide the menu and all visible sub-menus

Parameters:

  • triggeredBy zebra.ui.Menu

    a menu that has triggered the hiding of menu hierarchy

$showSubMenu

(
  • sub
)
protected

Inherited from zebra.ui.Menu:

Show the given sub menu

Parameters:

$topMenu

() zebra.ui.Menu protected

Inherited from zebra.ui.Menu:

Get the top menu in the given shown popup menu hierarchy


Return: zebra.ui.Menu

a top menu

addDecorative

(
  • c
)

Inherited from zebra.ui.Menu:

Add the specified component as a decorative item of the menu

Parameters:

childCompEvent

(
  • id
  • src
  • p1
  • p2
)

Inherited from zebra.ui.Menu:

Define component events handler.

Parameters:

  • id Integer

    a component event id

  • src zebra.ui,Panel

    a component that triggers the event

  • p1 Object

    a first event parameter.

  • p2 Object

    a second event parameter

getMenuAt

(
  • index
)
zebra.ui.Menu

Inherited from zebra.ui.Menu:

Get a sub menu for the given menu item

Parameters:

  • index Integer

    a menu item index


Return: zebra.ui.Menu

a sub menu or null if no sub menu is defined for the given menu item

getMenuItem

(
  • i
)
zebra.ui.Panel

Inherited from zebra.ui.Menu:

Get a menu item by the given index

Parameters:

  • i Integer

    a menu item index


Return: zebra.ui.Panel

a menu item component

hasSelectableItems

() Boolean

Inherited from zebra.ui.Menu:

Test if the menu has a selectable item


Return: Boolean

true if the menu has at least one selectable item

indexMenuOf

(
  • menu
)
Integer

Inherited from zebra.ui.Menu:

Get the specified sub-menu index

Parameters:


Return: Integer

a sub menu index. -1 if the menu is not a sub menu of the given menu

isDecorative

(
  • i
)
Boolean

Inherited from zebra.ui.Menu:

Test if the given menu item is a decorative (not selectable) menu item. Menu item is considered as decorative if it has been added with addDecorative(...) method or has "$isDecorative" property set to "true"

Parameters:

  • i Integer

    a menu item index


Return: Boolean

true if the given menu item is decorative

keyPressed

(
  • e
)

Inherited from zebra.ui.Menu:

Override key pressed events handler to handle key events according to context menu component requirements

Parameters:

mouseExited

(
  • e
)

Inherited from zebra.ui.Menu:

Define mouse exited events handler

Parameters:

setMenuAt

(
  • i
  • m
)

Inherited from zebra.ui.Menu:

Set the given menu as a sub-menu for the specified menu item

Parameters:

  • i Integer

    an index of a menu item for that a sub menu has to be attached

  • m zebra.ui.Menu

    a sub menu to be attached

Attributes

decoratives

Object { {zebra.ui.Panel}:true } private readonly

Inherited from zebra.ui.Menu:

Dictionary to keep decorative components