wex v24.10.0
|
Offers a notebook with page access using keys, and that interfaces with wex::frame. More...
#include <wex/ui/notebook.h>
Inherits wxAuiNotebook.
Public Member Functions | |
notebook (const data::window &data=data::window().style(wxAUI_NB_DEFAULT_STYLE)) | |
Default constructor. | |
wxWindow * | add_page (const data::notebook &data) |
Adds the page with given key and fills the keys. | |
const std::string | change_selection (const std::string &key) |
Changes the selection for the given page, returning the previous selection. | |
void | config_get () |
Sets the configurable parameters to values currently in config. | |
const std::string | current_page_key () |
Returns key for the current page. | |
bool | delete_page (const std::string &key) |
Deletes the page with the given key. | |
template<class T > | |
bool | for_each (int id) |
Do something for each page in the notebook. | |
wxWindow * | insert_page (const data::notebook &data) |
Inserts the page with given key and fills the keys. | |
const std::string | key_by_page (wxWindow *page) const |
Returns the key specified by the given page. | |
wxWindow * | page_by_key (const std::string &key) const |
Returns the page specified by the given key. | |
int | page_index_by_key (const std::string &key) const |
Returns the page index specified by the given key. | |
void | rearrange (int direction) |
Rearranges all pages. | |
bool | set_page_text (const std::string &key, const std::string &new_key, const std::string &caption, const wxBitmapBundle &bitmap=wxNullBitmap) |
Sets the pagetext for the given new key, on the page for the given key. | |
wxWindow * | set_selection (const std::string &key) |
Selects (and returns) the page specified by the given key. | |
bool | split (const std::string &key, int direction) |
Split performs a split operation programmatically. | |
Static Public Member Functions | |
static int | config_dialog (const data::window &data=data::window()) |
Shows a dialog with options, returns dialog return code. | |
Offers a notebook with page access using keys, and that interfaces with wex::frame.
const std::string wex::notebook::change_selection | ( | const std::string & | key | ) |
Changes the selection for the given page, returning the previous selection.
If the key does not exist an empty string is returned.
|
static |
Shows a dialog with options, returns dialog return code.
If used modeless, it uses the dialog id as specified, so you can use that id in frame::on_command_item_dialog.
bool wex::notebook::delete_page | ( | const std::string & | key | ) |
Deletes the page with the given key.
Returns true if page could be deleted.
bool wex::notebook::for_each | ( | int | id | ) |
Do something for each page in the notebook.
The id should be in between ID_ALL_LOWEST and ID_ALL_HIGHEST. Cannot be const as it can call delete_page.
|
inline |
Returns the key specified by the given page.
If the page does not exist or is nullptr an empty string is returned.
|
inline |
Returns the page specified by the given key.
If the key does not exist nullptr is returned.
|
inline |
Returns the page index specified by the given key.
If the key does not exist wxNOT_FOUND is returned.
void wex::notebook::rearrange | ( | int | direction | ) |
Rearranges all pages.
direction | Specify where the pane should go. It should be one of the following:
|
bool wex::notebook::set_page_text | ( | const std::string & | key, |
const std::string & | new_key, | ||
const std::string & | caption, | ||
const wxBitmapBundle & | bitmap = wxNullBitmap ) |
Sets the pagetext for the given new key, on the page for the given key.
If the key does not exist false is returned.
wxWindow * wex::notebook::set_selection | ( | const std::string & | key | ) |
Selects (and returns) the page specified by the given key.
If the key does not exist nullptr is returned.
bool wex::notebook::split | ( | const std::string & | key, |
int | direction ) |
Split performs a split operation programmatically.
If the key does not exist false is returned.
key | The page that will be split off. This page will also become the active page after the split. |
direction | Specify where the pane should go. It should be one of the following:
|