Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/widget/menu-button.hpp"
A button that displays a menu when clicked on.
Definition at line 46 of file menu-button.hpp.
Public Member Functions | |
MenuButton () | |
Create an empty button. More... | |
MenuButton (StockID const &stock_id) | |
Creates a new Button containing the image and text from a stock item. More... | |
MenuButton (cuString &label, bool mnemonic=false) | |
Creates a simple Push Button with label. More... | |
void | append (uString &slug, uString &title, sigc::slot< void > &callback, bool toggle=false) |
Append a Menu Item to the Menu. More... | |
void | append (const char *slug, const char *title, sigc::slot< void > &callback, bool toggle=false) |
Append a Menu Item to the Menu. More... | |
void | appendSeparator () |
Append a Gtk::SeparatorMenuItem to the Menu. | |
Gtk::Widget * | get (uString slug) |
Get an object from the Menu. More... | |
Menu & | get_menu () |
Gets the menu which will be displayed when the button is clicked on. More... | |
void | popup () |
Pops up the menu. More... | |
Protected Member Functions | |
void | on_menu_deactivated () |
An event handler for when the menu is closed. | |
void | on_pressed () |
An event handler for when the button is pressed. | |
void | setupButton () |
An internal method which sets up the button at create time. | |
Private Member Functions | |
void | on_menu_position (int &x, int &y, bool &push_in) |
callback function used to determine the correct position for the popup menu. More... | |
Private Attributes | |
Glib::RefPtr< ActionGroup > | actions |
Arrow | arrow |
The arrow widget that will be displayed to hint the user that this button is a drop-down. | |
Label | caption |
caption text label to show on the button. More... | |
HBox | hBox |
hBox for the layout of an image, caption and arrow. More... | |
Image | image |
The image that will optionally display an icon. More... | |
Menu | menu |
The internal menu object which is the popup menu of this widget. | |
Glib::RefPtr< UIManager > | uimanager |
MenuButton | ( | ) |
Create an empty button.
Definition at line 51 of file menu-button.cpp.
MenuButton | ( | StockID const & | stock_id | ) |
Creates a new Button containing the image and text from a stock item.
Stock::OK
and Stock::APPLY
. Definition at line 61 of file menu-button.cpp.
MenuButton | ( | cuString & | label, |
bool | mnemonic = false |
||
) |
Creates a simple Push Button with label.
Definition at line 75 of file menu-button.cpp.
Menu & get_menu | ( | ) |
Gets the menu which will be displayed when the button is clicked on.
Definition at line 96 of file menu-button.cpp.
Referenced by MenuButton::popup().
void append | ( | uString & | slug, |
uString & | title, | ||
sigc::slot< void > & | callback, | ||
bool | toggle = false |
||
) |
Append a Menu Item to the Menu.
slug | Unique identifier in the UI Manager |
title | The title of the item |
callback | The signal handler when clicked |
toggle |
Definition at line 108 of file menu-button.cpp.
void append | ( | const char * | slug, |
const char * | title, | ||
sigc::slot< void > & | callback, | ||
bool | toggle = false |
||
) |
Append a Menu Item to the Menu.
slug | Unique identifier in the UI Manager |
title | The title of the item |
callback | The signal handler when clicked |
toggle |
Definition at line 125 of file menu-button.cpp.
Gtk::Widget * get | ( | uString | slug | ) |
Get an object from the Menu.
slug | The slug that created the object |
MenuButton::get_menu()
to get the menu as a whole Definition at line 86 of file menu-button.cpp.
Referenced by WrappedStandardExeBuilder::__call__().
void popup | ( | ) |
Pops up the menu.
Definition at line 146 of file menu-button.cpp.
References MenuButton::get_menu(), and MenuButton::on_menu_position().
Referenced by MenuButton::on_pressed().
|
private |
callback function used to determine the correct position for the popup menu.
x | The x-coordinate to display the menu in root window coordinates. |
y | The y-coordinate to display the menu in root window coordinates. |
push_in | This value is set to true if the menu should be pushed in if it collides with the edge of the screen. |
Definition at line 195 of file menu-button.cpp.
Referenced by MenuButton::popup().
|
private |
hBox for the layout of an image, caption and arrow.
Definition at line 149 of file menu-button.hpp.
|
private |
The image that will optionally display an icon.
Definition at line 152 of file menu-button.hpp.
|
private |
caption text label to show on the button.
Definition at line 155 of file menu-button.hpp.