Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UMenu Class Reference

UMenu: pulldown or cascaded menu. More...

#include <umenu.hpp>

Inheritance diagram for UMenu:

UWin UBox UGroup UPopmenu List of all members.

Public Member Functions

 UMenu (const UArgs &a=UArgs::none)
virtual const UStylegetStyle (UContext *) const
 returns the contextual UStyle of this object
virtual UGroupgetBrowsingGroup ()
 [impl].
virtual void open ()
 opens the menu (use this method instead of show(true) in the general case).
virtual void close (int status=0)
 closes the menu (use this method instead of show(false) in the general case).
virtual void setPlacement (const class UPlacement *)
virtual void setPlacement (const class UPlacement &)
 specifies automatic placement rules (see UPlacement).
virtual bool realize ()
 [impl.

Static Public Member Functions

static const UStylemakeStyle ()
 creates the Style of this object.

Static Public Attributes

static UStylestyle = null
 corresponding Ubit UStyle

Friends

UMenuumenu (const UArgs &a=UArgs::none)
 creator shortcut that is equivalent to: *new UMenu().

Detailed Description

UMenu: pulldown or cascaded menu.

Notes:

See also classes: UWin, UMenubar, UPopmenu.

Example:

   umenubar( ubutton("Menu 1"
                     + umenu( ubutton("aaa") + ubutton("bbb") ))
            + ubutton("Menu 2"
                     + umenu( ulabel("xxx") + ucheckbox("ccc") ))
           )
 


Member Function Documentation

void UMenu::close int  status = 0  )  [virtual]
 

closes the menu (use this method instead of show(false) in the general case).

There is usually no need to call this function explicitely as menus are automatically closed

the close() method 1) ungrabs the mouse, 2) hides this menu and its cascaded children

See also: UWin::close()

Reimplemented from UWin.

virtual const UStyle& UMenu::getStyle UContext *   )  const [virtual]
 

returns the contextual UStyle of this object

This virtual function calls the makeStyle() static function that was redefined for this specific class

Reimplemented from UWin.

Reimplemented in UPopmenu.

const UStyle & UMenu::makeStyle  )  [static]
 

creates the Style of this object.

This static function is redefined by each class that derives from UGroup. It is called by the virtual function UGroup::getStyle()

Reimplemented from UWin.

Reimplemented in UPopmenu.

void UMenu::open  )  [virtual]
 

opens the menu (use this method instead of show(true) in the general case).

Notes:

  • there is usually no need to call this method explicitely when using UMenu objects (but it must be called when using UPopmenu objects)
  • this method implicitely calls the (inherited) show() method

Details: the open() method:

  • grabs the mouse
  • closes menus that are already opened (except if they are cascaded parents of this menu)
  • enforces an autoclose behavior for this menu (it will be automatically closed when a button child is clicked)

bool UMenu::realize  )  [virtual]
 

[impl.

] initializes the window and its children. creates the associated graphics context and native window if this is a "hard window".

this fct. is automatically called when the window is shown for the first time (so that unused windows won't consume unnecessary resources)

Implements UWin.

virtual void UMenu::setPlacement const class UPlacement  )  [virtual]
 

specifies automatic placement rules (see UPlacement).

Details:

  • null argument --> default placement rules
  • data given as an argument can be freed at any time by client
  • update() must be called to enforce new rules


The documentation for this class was generated from the following files:
Generated on Fri Jun 3 03:30:17 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.2