Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
Browser::BasePopup Class Reference

A Baseclass for Widgets that want to implement easily popup widgets. More...

#include <BasePopup.hh>

Inheritance diagram for Browser::BasePopup:
[legend]
Collaboration diagram for Browser::BasePopup:
[legend]

Public Member Functions

 BasePopup (Gtk::Widget *to_register, Glib::ustring &ui_definition)
Glib::SignalProxy0< void > get_action (const char *name)
 Get a signal proxy of a certain Gtk::Action in the menu.

Protected Member Functions

void menu_add_item (Glib::RefPtr< Gtk::Action > &action, Glib::ustring item_name, Glib::ustring item_label, Glib::ustring item_tooltip, Gtk::StockID icon)
 Add an item to the Menu Popup.
void menu_construct (Glib::ustring menu_name)
 Call this when done with adding actions.

Protected Attributes

Glib::RefPtr< Gtk::UIManager > m_refUIManager
 This object stores the parsed UI Definition.
Glib::RefPtr< Gtk::ActionGroup > m_refActionGroup
 All actions are added to this object.
Glib::ustring * m_UiDefinition
 The actual definition.
Gtk::Menu * mp_Popup
 The visible popup.

Detailed Description

A Baseclass for Widgets that want to implement easily popup widgets.

This class registers the needed signals and parses a UI Definition given by the derived class. See QueuePopup, DatabasePopup or PlaylistManagerPopup for examples how this exactly works.

Definition at line 44 of file BasePopup.hh.


Constructor & Destructor Documentation

Browser::BasePopup::BasePopup ( Gtk::Widget *  to_register,
Glib::ustring &  ui_definition 
)
Parameters:
to_registerThe widget to register, for example a Gtk::TreeView
ui_definitionThe ui definition defining the Menu structure

Member Function Documentation

Glib::SignalProxy0<void> Browser::BasePopup::get_action ( const char *  name)

Get a signal proxy of a certain Gtk::Action in the menu.

Parameters:
nameThe name of the menu.
Returns:
a signal proxy, on which you can call connect()
void Browser::BasePopup::menu_add_item ( Glib::RefPtr< Gtk::Action > &  action,
Glib::ustring  item_name,
Glib::ustring  item_label,
Glib::ustring  item_tooltip,
Gtk::StockID  icon 
) [protected]

Add an item to the Menu Popup.

Parameters:
actionthe action defined in the UI definition
item_nameThe name of the titem
item_labelThe visual name of the item
item_tooltipA tooltip, that is actually not shown
iconThe icon shown lefthand to the label
void Browser::BasePopup::menu_construct ( Glib::ustring  menu_name) [protected]

Call this when done with adding actions.


Field Documentation

Glib::RefPtr<Gtk::ActionGroup> Browser::BasePopup::m_refActionGroup [protected]

All actions are added to this object.

Definition at line 74 of file BasePopup.hh.

Glib::RefPtr<Gtk::UIManager> Browser::BasePopup::m_refUIManager [protected]

This object stores the parsed UI Definition.

Definition at line 70 of file BasePopup.hh.

Glib::ustring* Browser::BasePopup::m_UiDefinition [protected]

The actual definition.

Definition at line 78 of file BasePopup.hh.

Gtk::Menu* Browser::BasePopup::mp_Popup [protected]

The visible popup.

Definition at line 82 of file BasePopup.hh.


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