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 UPopmenu List of all members.

Public Member Functions

 UMenu (const UArgs &a=UArgs::none)
virtual const UStylegetStyle (UContext *) const
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.] initializes the window and its children


Static Public Member Functions

const UStylemakeStyle ()

Static Public Attributes

UStylestyle = null

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.

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 Sat Feb 21 23:28:22 2004 for Ubit[Eric.Lecolinet@enst.fr] by doxygen 1.3.5