MMenu

Description

MMenu is a menu in the window's bar (see MWindow). It is a parent for MMenuItem.

A simple example

 1    //Create a bar in the window
 2    MMenu bar = new MMenu(container);
 3
 4    //Adds a menuItem in the bar with a action and no cascade        
 5    MMenuItem item = new MmenuItem (container,bar,"OpenDialog", this,"openDialog");
 6
 7    //Adds another menuItem in the bar in cascade
 8    MMenuItem item1=new MMenuItem(container,bar,"window");
 9
10    //Adds a drop_down menu into the cascade  menuItem         
11    MMenu menu = new MMenu(container,item1);
12
13    //Adds a new item into the drop_down menu        
14    MMenuItem item11 = new MMenuItem(container,menu,"Open");
15    item11.addAction(this, "openDialog");

API

  • Constructors
MMenu(MWindow container) Constructs a new instance of this class given its parent window
MMenu(MWindow container, MMenuItem menuItem) Constructs a new instance of this class given its parent window and a menuitem who would be attached
MMenu(MContainer container) Constructs a new instance of this class given its parent container
MMenu(MContainer container, MMenuItem menuItem) Constructs a new instance of this class given its parent container and a menuitem who would be attached
  • Methods
void setBarStyle() Sets the menu as a bar
void setDropDownStyle() Sets the menu with drop_down style
Menu getMenu() Gets a menu
  • See also superclasses
    • MonoiComponent

MMenu.jpg (11 kB) Frédéric ESNAULT, 02/27/2012 12:48 pm