egami
C++ Image Processing program
|
A Gtk::Notebook with tabs management facilities. More...
#include <catalogue.hpp>
Public Member Functions | |
Catalogue () | |
unsigned | append (std::shared_ptr< Tab > tab, std::shared_ptr< Page > page) |
Appends a Tab and a Page to the Catalogue. | |
void | remove (unsigned id) |
Removes the Tab and the Page associated with a given id. | |
Protected Types | |
typedef std::map< unsigned, std::pair< std::shared_ptr < Tab >, std::shared_ptr< Page > > > | Pages |
Protected Attributes | |
Pages | pages |
Private Member Functions | |
static_assert (std::is_base_of< Gtk::Widget, Tab >::value,"The Tab type of a Catalogue must have Gtk::Widget as a base class") | |
static_assert (std::is_base_of< Gtk::Widget, Page >::value,"The Page type of a Catalogue must have Gtk::Widget as a base class") |
A Gtk::Notebook with tabs management facilities.
After the insertion of a Tab/Page pair, they can be accessed by an id returned by the Catalogue::append function. A map is used instead of the facility to retrieve tabs and pages' widgets of Gtk::Notebook in order to ensure type safety.
Tab | tab's widget type (must have Gtk::Widget as base class) |
Page | page's widget type (must have Gtk::Widget as base class) |
Definition at line 39 of file catalogue.hpp.
typedef std::map<unsigned, std::pair<std::shared_ptr<Tab>, std::shared_ptr<Page> > > Catalogue< Tab, Page >::Pages [protected] |
Definition at line 44 of file catalogue.hpp.
Definition at line 126 of file catalogue.hpp.
unsigned Catalogue< Tab, Page >::append | ( | std::shared_ptr< Tab > | tab, |
std::shared_ptr< Page > | page | ||
) |
Appends a Tab and a Page to the Catalogue.
The two objects can now be accessed by their id (returned by the function).
tab | the widget to display in the tab |
page | the widget to display in the page |
Definition at line 132 of file catalogue.hpp.
void Catalogue< Tab, Page >::remove | ( | unsigned | id | ) |
Removes the Tab and the Page associated with a given id.
The Tab and the Page are also removed from Catalogue::pages and so, are destructed.
id | the id of the page to be removed from the Catalogue |
Definition at line 141 of file catalogue.hpp.
Catalogue< Tab, Page >::static_assert | ( | std::is_base_of< Gtk::Widget, Tab >::value | , |
"The Tab type of a Catalogue< Tab, Page > must have Gtk::Widget as a base class" | |||
) | [private] |
Catalogue< Tab, Page >::static_assert | ( | std::is_base_of< Gtk::Widget, Page >::value | , |
"The Page type of a Catalogue< Tab, Page > must have Gtk::Widget as a base class" | |||
) | [private] |
Page and Tab objects managed by the Catalogue
Definition at line 70 of file catalogue.hpp.