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

UPopmenu Class Reference

UPopmenu: Contextual Menu. More...

#include <umenu.hpp>

Inheritance diagram for UPopmenu:

UMenu UWin UBox UGroup List of all members.

Public Member Functions

 UPopmenu (const UArgs &a=UArgs::none)
virtual void autoOpens (UBox &opener, u_id button_mask, u_id keysym, bool children_open_menu=false)
virtual void autoOpens (UBox &opener, const std::vector< InputCond > &, bool children_open_menu)
 this 'opener' will automatically open the menu.
virtual const UStylegetStyle (UContext *) const
 returns the contextual UStyle of this object

Static Public Member Functions

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

Static Public Attributes

static UStylestyle = null
 corresponding Ubit UStyle

Protected Member Functions

virtual bool autoOpenCheck (UEvent &)
virtual void autoOpenImpl (UEvent &)
 function called by autoOpens() when the menu pops up.

Protected Attributes

std::vector< InputCond > input_conds

Friends

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

Detailed Description

UPopmenu: Contextual Menu.

UPopmenu objects are NOT automatically OPENED by their parent(s). There a two ways for opening Popmenus:

Note: as other Ubit UBricks, menus MUST HAVE at least one parent.

See also classes: UWin, UMenu.

Example (see also method: autoOpens()) :

  opener.addlist(menu + UOn::mpress / ucall(&menu, openMenu))

  void openMenu(UEvent& e, UPopmenu* pop) {
       popmenu->move(e, 0, 0);  // move the menu to Event location
       popmenu->open();         // open the menu
   }
 


Member Function Documentation

void UPopmenu::autoOpens UBox opener,
const std::vector< InputCond > &  ,
bool  children_open_menu
[virtual]
 

this 'opener' will automatically open the menu.

Arguments:

  • 'button_mask' indicate which mouse buttons open the menu when pressed. It's an ORed combination of UEvent::MButton1, UEvent::MButton2, etc.
  • if 'keysym' is not null it indicates which X keysym (= which logical key on the keyboard) opens the menu when pressed.
  • 'children_open_menu' means that the menu is always opened, even if the event is located inside a child of the opener (default is false).

virtual const UStyle& UPopmenu::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 UMenu.

const UStyle & UPopmenu::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 UMenu.


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