ubit::UMenu Class Reference

UMenu: pulldown or cascaded menu. More...

#include <umenu.hpp>

Inheritance diagram for ubit::UMenu:

ubit::UWin ubit::UBox ubit::UGroup ubit::UControl ubit::UBrick ubit::UObject ubit::UPopmenu ubit::UPiemenu ubit::UCtlmenu ubit::UCtlmenu3d List of all members.

Public Member Functions

 UMenu (const UArgs &a=UArgs::none)
 creates a new pulldown (or cascaded) Menu.
virtual class UMenumenuCast ()
 dynamic cast.
virtual void show (bool state, UDisp *)
virtual void show (bool state=true)
 shows/hides the menu.
virtual void show (UMouseEvent &, float x=0, float y=0)
 moves the menu to the event location then shows it ( show(bool state)).
virtual void open (UMouseEvent &e)
 non-overloaded synonym for show(UMouseEvent&,x,y).
virtual void setPlacement (const UPlacement &)
 specifies automatic placement rules (see UPlacement).
virtual bool realize ()
 [impl] initializes the window and its children.

Static Public Member Functions

static UStylecreateStyle ()
 < important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!).

Friends

UMenuumenu (const UArgs &args=UArgs::none)
 shortcut that returns *new UMenu(args).

Detailed Description

UMenu: pulldown or cascaded menu.

use subclass UPopmenu to create contextual menus.

A UMenu is automatically opened when the mouse is pressed in one of its parents. This rule does not apply to UPopmenu instances: they must be opened by calling one of their show() methods.

Note that most methods are inherited from UWin and that a UMenu must have at least one realized parent (as for other Ubit widgets).

See also:
: UWin, UMenubar, UPopmenu.
Example:
   umenubar( ubutton("Menu 1"
                     + umenu( ubutton("aaa") + ubutton("bbb") ))
            + ubutton("Menu 2"
                     + umenu( ulabel("xxx") + ucheckbox("ccc") ))
           )
 


Member Function Documentation

UStyle * ubit::UMenu::createStyle (  )  [static]

< important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!).

this macro defines the UClass that corresponds to this class and:

Reimplemented from ubit::UWin.

Reimplemented in ubit::UCtlmenu, ubit::UPopmenu, and ubit::UPiemenu.

bool ubit::UMenu::realize (  )  [virtual]

[impl] initializes the window and its children.

this function called when the window is shown for the first time

Reimplemented from ubit::UWin.

void ubit::UMenu::setPlacement ( const UPlacement  )  [virtual]

specifies automatic placement rules (see UPlacement).

update() must be called to enforce new rules

virtual void ubit::UMenu::show ( bool  state = true  )  [virtual]

shows/hides the menu.

Note that:

Note: show(true) grabs the mouse. The application can be launched with option --no-grab to disable this behavior (this is mostly useful for debugging)

Reimplemented from ubit::UWin.

Reimplemented in ubit::UPiemenu.


The documentation for this class was generated from the following files:
Generated on Mon Jan 29 00:20:52 2007 for Ubit by  doxygen 1.4.7