wex v24.04.0
Public Member Functions | Static Public Member Functions | List of all members
wex::notebook Class Reference

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.
 

Detailed Description

Offers a notebook with page access using keys, and that interfaces with wex::frame.

Member Function Documentation

◆ change_selection()

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.

◆ config_dialog()

static int wex::notebook::config_dialog ( const data::window & data = data::window())
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.

◆ delete_page()

bool wex::notebook::delete_page ( const std::string & key)

Deletes the page with the given key.

Returns true if page could be deleted.

◆ for_each()

template<class T >
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.

◆ key_by_page()

const std::string wex::notebook::key_by_page ( wxWindow * page) const
inline

Returns the key specified by the given page.

If the page does not exist or is nullptr an empty string is returned.

◆ page_by_key()

wxWindow * wex::notebook::page_by_key ( const std::string & key) const
inline

Returns the page specified by the given key.

If the key does not exist nullptr is returned.

◆ page_index_by_key()

int wex::notebook::page_index_by_key ( const std::string & key) const
inline

Returns the page index specified by the given key.

If the key does not exist wxNOT_FOUND is returned.

◆ rearrange()

void wex::notebook::rearrange ( int direction)

Rearranges all pages.

Parameters
directionSpecify where the pane should go. It should be one of the following:
  • wxTOP
  • wxBOTTOM
  • wxLEFT
  • wxRIGHT

◆ set_page_text()

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.

◆ set_selection()

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.

◆ split()

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.

Parameters
keyThe page that will be split off. This page will also become the active page after the split.
directionSpecify where the pane should go. It should be one of the following:
  • wxTOP
  • wxBOTTOM
  • wxLEFT
  • wxRIGHT