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 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

Static Public Member Functions

static const UStylemakeStyle ()

Static Public Attributes

static UStylestyle = null

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).


The documentation for this class was generated from the following files:
Generated on Thu Mar 3 06:36:50 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.1