cwidget 0.5.16
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions

cwidget::widgets::menu Class Reference

Inheritance diagram for cwidget::widgets::menu:
cwidget::widgets::widget trackable

List of all members.

Public Member Functions

bool get_cursorvisible ()
point get_cursorloc ()
int width_request ()
int height_request (int width)
 Calculate the desired height of the widget, given its width.
void append_item (menu_item *newitem)
void remove_item (menu_item *item)
void move_selection_up ()
 Move the selection up, as if Up had been pressed.
void move_selection_down ()
 Move the selection down, as if Down had been pressed.
void move_selection_top ()
 Move the selection to the top of the menu, as if Home had been pressed.
void move_selection_bottom ()
 Move the selection to the bottom of the menu, as if End had been pressed.
virtual bool focus_me ()
virtual void paint (const style &st)
 Display this widget.
virtual void dispatch_mouse (short id, int x, int y, int z, mmask_t bstate)

Static Public Member Functions

static util::ref_ptr< menucreate ()
static util::ref_ptr< menucreate (int x, int y, int w, menu_info *inf)
static void init_bindings ()

Public Attributes

sigc::signal1< void, menu_item * > item_highlighted
sigc::signal0< void > menus_goaway

Static Public Attributes

static config::keybindingsbindings = NULL

Protected Member Functions

virtual bool handle_key (const config::key &k)
 Handles a keypress in this widget.
 menu ()
 Create a blank menu.
 menu (int x, int y, int w, menu_info *inf)

Constructor & Destructor Documentation

cwidget::widgets::menu::menu ( ) [protected]

Create a blank menu.


Member Function Documentation

bool cwidget::widgets::menu::handle_key ( const config::key k) [protected, virtual]

Handles a keypress in this widget.

Parameters:
kthe key that was pressed (see keybindings.h).
Returns:
true if the key was consumed; if false is returned, further processing of the key will be performed.

Reimplemented from cwidget::widgets::widget.

References cwidget::config::key::ch, cwidget::config::keybindings::key_matches(), move_selection_bottom(), move_selection_down(), move_selection_top(), and move_selection_up().

int cwidget::widgets::menu::height_request ( int  width) [virtual]

Calculate the desired height of the widget, given its width.

Parameters:
widththe width of this widget
Returns:
the desired height

Implements cwidget::widgets::widget.

void cwidget::widgets::menu::move_selection_bottom ( )

Move the selection to the bottom of the menu, as if End had been pressed.

References cwidget::toplevel::update().

Referenced by handle_key().

void cwidget::widgets::menu::move_selection_down ( )

Move the selection down, as if Down had been pressed.

References cwidget::toplevel::update().

Referenced by handle_key().

void cwidget::widgets::menu::move_selection_top ( )

Move the selection to the top of the menu, as if Home had been pressed.

References cwidget::toplevel::update().

Referenced by handle_key().

void cwidget::widgets::menu::move_selection_up ( )

Move the selection up, as if Up had been pressed.

References cwidget::toplevel::update().

Referenced by handle_key().

void cwidget::widgets::menu::paint ( const style st) [virtual]

Display this widget.

Parameters:
stthe style environment in which the widget is to be displayed.

Implements cwidget::widgets::widget.

References cwidget::widgets::widget::apply_style(), cwidget::get_style(), cwidget::config::global_bindings, cwidget::config::keybindings::readable_keyname(), and cwidget::style_attrs_on().

int cwidget::widgets::menu::width_request ( ) [virtual]

The documentation for this class was generated from the following files: