![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "stage/widget/menu-button.hpp"
A button that displays a menu when clicked on.
Definition at line 37 of file menu-button.hpp.
Public Member Functions | |
| MenuButton () | |
| Create an empty button. | |
| MenuButton (Gtk::StockID const &stock_id) | |
| Creates a new Button containing the image and text from a stock item. | |
| MenuButton (cuString &label, bool mnemonic=false) | |
| Creates a simple Push Button with label. | |
| Gtk::Menu & | get_menu () |
| Gets the menu which will be displayed when the button is clicked on. | |
| void | append (uString &slug, uString &title, sigc::slot< void > &callback, bool toggle=false) |
| Append a Menu Item to the Menu. | |
| void | append (CStr slug, CStr title, sigc::slot< void > &callback, bool toggle=false) |
| Append a Menu Item to the Menu. | |
| void | appendSeparator () |
| Append a Gtk::SeparatorMenuItem to the Menu. | |
| Gtk::Widget * | get (uString slug) |
| Get an object from the Menu. | |
| void | popup () |
| Pops up the menu. | |
Protected Member Functions | |
| void | setupButton () |
| An internal method which sets up the button at create time. | |
| void | on_pressed () |
| An event handler for when the button is pressed. | |
| void | on_menu_deactivated () |
| An event handler for when the menu is closed. | |
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. | |
Private Attributes | |
| Gtk::HBox | hBox_ |
| holds the layout of an image, caption and arrow. | |
| Gtk::Image | image_ |
| can optionally display an icon. | |
| Gtk::Label | caption_ |
| caption text label to show on the button. | |
| Gtk::Arrow | arrow_ |
| arrow widget to be displayed to indicate a drop-down menu | |
| Gtk::Menu | menu_ |
| internal menu object which is the popup menu of this widget. | |
| Glib::RefPtr< Gtk::UIManager > | uimanager_ |
| Glib::RefPtr< Gtk::ActionGroup > | actions_ |
| MenuButton | ( | ) |
Create an empty button.
Definition at line 39 of file menu-button.cpp.
References MenuButton::setupButton().
Here is the call graph for this function:| MenuButton | ( | Gtk::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 49 of file menu-button.cpp.
References MenuButton::caption_, MenuButton::hBox_, MenuButton::image_, and MenuButton::setupButton().
Here is the call graph for this function:| MenuButton | ( | cuString & | label, |
| bool | mnemonic = false |
||
| ) |
Creates a simple Push Button with label.
Definition at line 63 of file menu-button.cpp.
References MenuButton::setupButton().
Here is the call graph for this function:| Gtk::Menu & get_menu | ( | ) |
Gets the menu which will be displayed when the button is clicked on.
Definition at line 84 of file menu-button.cpp.
References POPUP_SLUG, and MenuButton::uimanager_.
Referenced by MenuButton::popup(), and MenuButton::setupButton().
Here is the caller graph for this function: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 95 of file menu-button.cpp.
References MenuButton::actions_, POPUP_SLUG, and MenuButton::uimanager_.
Referenced by MenuButton::append(), and PanelBar::setupPanelButton().
Here is the caller graph for this function: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 117 of file menu-button.cpp.
References _, and MenuButton::append().
Here is the call graph for this function:| void appendSeparator | ( | ) |
Append a Gtk::SeparatorMenuItem to the Menu.
Definition at line 127 of file menu-button.cpp.
References POPUP_SLUG, and MenuButton::uimanager_.
| 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 74 of file menu-button.cpp.
References POPUP_PATH, and MenuButton::uimanager_.
Referenced by WrappedStandardExeBuilder::invokeOriginalBuilder().
Here is the caller graph for this function:| void popup | ( | ) |
Pops up the menu.
Definition at line 138 of file menu-button.cpp.
References MenuButton::get_menu(), and MenuButton::on_menu_position().
Referenced by MenuButton::on_pressed().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
An internal method which sets up the button at create time.
Definition at line 148 of file menu-button.cpp.
References MenuButton::actions_, MenuButton::arrow_, MenuButton::caption_, MenuButton::get_menu(), MenuButton::hBox_, MenuButton::on_menu_deactivated(), POPUP_SLUG, and MenuButton::uimanager_.
Referenced by MenuButton::MenuButton(), MenuButton::MenuButton(), and MenuButton::MenuButton().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
An event handler for when the button is pressed.
Definition at line 176 of file menu-button.cpp.
References MenuButton::popup().
Here is the call graph for this function:
|
protected |
An event handler for when the menu is closed.
Definition at line 183 of file menu-button.cpp.
Referenced by MenuButton::setupButton().
Here is the caller graph for this function:
|
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 190 of file menu-button.cpp.
Referenced by MenuButton::popup().
Here is the caller graph for this function:
|
private |
holds the layout of an image, caption and arrow.
Definition at line 40 of file menu-button.hpp.
Referenced by MenuButton::MenuButton(), and MenuButton::setupButton().
|
private |
can optionally display an icon.
Definition at line 41 of file menu-button.hpp.
Referenced by MenuButton::MenuButton().
|
private |
caption text label to show on the button.
Definition at line 42 of file menu-button.hpp.
Referenced by MenuButton::MenuButton(), and MenuButton::setupButton().
|
private |
arrow widget to be displayed to indicate a drop-down menu
Definition at line 43 of file menu-button.hpp.
Referenced by MenuButton::setupButton().
|
private |
internal menu object which is the popup menu of this widget.
Definition at line 44 of file menu-button.hpp.
|
private |
Definition at line 46 of file menu-button.hpp.
Referenced by MenuButton::append(), MenuButton::appendSeparator(), MenuButton::get(), MenuButton::get_menu(), and MenuButton::setupButton().
|
private |
Definition at line 47 of file menu-button.hpp.
Referenced by MenuButton::append(), and MenuButton::setupButton().
Inheritance diagram for MenuButton:
Collaboration diagram for MenuButton: