|
wex
v20.04.0
|
Offers a notebook with page access using keys, and that interfaces with wex::managed_frame. More...
#include <wex/notebook.h>
Inherits wxAuiNotebook.
Public Member Functions | |
| notebook (const window_data &data=window_data().style(wxAUI_NB_DEFAULT_STYLE)) | |
| Other methods. More... | |
| wxWindow * | add_page (wxWindow *page, const std::string &key, const std::string &caption=std::string(), bool select=false, const wxBitmap &bitmap=wxNullBitmap) |
| Adds the page with given key and fills the keys. More... | |
| const std::string | change_selection (const std::string &key) |
| Changes the selection for the given page, returning the previous selection. More... | |
| 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. More... | |
| template<class T > | |
| bool | for_each (int id) |
| Do something for each page in the notebook. More... | |
| wxWindow * | insert_page (size_t page_idx, wxWindow *page, const std::string &key, const std::string &caption=std::string(), bool select=false, const wxBitmap &bitmap=wxNullBitmap) |
| Inserts the page with given key and fills the keys. More... | |
| const std::string | key_by_page (wxWindow *page) const |
| Returns the key specified by the given page. More... | |
| wxWindow * | page_by_key (const std::string &key) const |
| Returns the page specified by the given key. More... | |
| int | page_index_by_key (const std::string &key) const |
| Returns the page index specified by the given key. More... | |
| void | rearrange (int direction) |
| Rearranges all pages. More... | |
| bool | set_page_text (const std::string &key, const std::string &new_key, const std::string &caption, const wxBitmap &bitmap=wxNullBitmap) |
| Sets the pagetext for the given new key, on the page for the given key. More... | |
| wxWindow * | set_selection (const std::string &key) |
| Selects (and returns) the page specified by the given key. More... | |
| bool | split (const std::string &key, int direction) |
| Split performs a split operation programmatically. More... | |
Static Public Member Functions | |
| static int | config_dialog (const window_data &data=window_data()) |
| Static interface. More... | |
Offers a notebook with page access using keys, and that interfaces with wex::managed_frame.
| wex::notebook::notebook | ( | const window_data & | data = window_data().style(wxAUI_NB_DEFAULT_STYLE) | ) |
Other methods.
Default constructor.
| wxWindow* wex::notebook::add_page | ( | wxWindow * | page, |
| const std::string & | key, | ||
| const std::string & | caption = std::string(), |
||
| bool | select = false, |
||
| const wxBitmap & | bitmap = wxNullBitmap |
||
| ) |
Adds the page with given key and fills the keys.
| page | page to add |
| key | key for the page |
| caption | caption for the page, if empty uses key as caption |
| select | select the page after it is inserted |
| bitmap | bitmap for the page |
| 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 |
Static interface.
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.
|
inline |
Do something for each page in the notebook.
The id should be inbetween ID_ALL_LOWEST and ID_ALL_HIGHEST. Cannot be const as it can call delete_page.
| wxWindow* wex::notebook::insert_page | ( | size_t | page_idx, |
| wxWindow * | page, | ||
| const std::string & | key, | ||
| const std::string & | caption = std::string(), |
||
| bool | select = false, |
||
| const wxBitmap & | bitmap = wxNullBitmap |
||
| ) |
Inserts the page with given key and fills the keys.
| page_idx | index fo the page |
| page | page to add |
| key | key for the pagw |
| caption | caption for the page, if empty uses key as caption |
| select | select the page after it is inserted |
| bitmap | bitmap for the 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 wxBitmap & | 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:
|
1.8.17