## wxAuiNotebook

wxAuiNotebook is part of the wxAUI class framework. See also wxAUI overview.

wxAuiNotebook is a notebook control which implements many features common in applications with dockable panes. Specifically, wxAuiNotebook implements functionality which allows the user to rearrange tab order via drag-and-drop, split the tab window into many different splitter configurations, and toggle through different themes to customize the control's look and feel.

An effort has been made to try to maintain an API as similar to that of wxNotebook.

The default theme that is used is wxAuiDefaultTabArt, which provides a modern, glossy look and feel. The theme can be changed by calling wxAuiNotebook::SetArtProvider.

Derived from

wxControl

Include files

<wx/aui/auibook.h>

Window styles

wxAUI_NB_DEFAULT_STYLE | Defined as wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB .
wxAUI_NB_TAB_SPLIT | Allows the tab control to be split by dragging a tab.
wxAUI_NB_TAB_MOVE | Allows a tab to be moved horizontally by dragging.
wxAUI_NB_TAB_EXTERNAL_MOVE | Allows a tab to be moved to another tab control.
wxAUI_NB_TAB_FIXED_WIDTH | With this style, all tabs have the same width.
wxAUI_NB_SCROLL_BUTTONS | With this style, left and right scroll buttons are displayed.
wxAUI_NB_WINDOWLIST_BUTTON | With this style, a drop-down list of windows is available.
wxAUI_NB_CLOSE_BUTTON | With this style, a close button is available on the tab bar.
wxAUI_NB_CLOSE_ON_ACTIVE_TAB | With this style, the close button is visible on the active tab.
wxAUI_NB_CLOSE_ON_ALL_TABS | With this style, the close button is visible on all tabs.
wxAUI_NB_TOP | With this style, tabs are drawn along the top of the notebook.
wxAUI_NB_BOTTOM | With this style, tabs are drawn along the bottom of the notebook.

Data structures

Members

wxAuiNotebook::wxAuiNotebook
wxAuiNotebook::AddPage
wxAuiNotebook::AdvanceSelection
wxAuiNotebook::Create
wxAuiNotebook::DeletePage
wxAuiNotebook::GetArtProvider
wxAuiNotebook::GetHeightForPageHeight
wxAuiNotebook::GetPage
wxAuiNotebook::GetPageBitmap
wxAuiNotebook::GetPageCount
wxAuiNotebook::GetPageIndex
wxAuiNotebook::GetPageText
wxAuiNotebook::GetSelection
wxAuiNotebook::GetTabCtrlHeight
wxAuiNotebook::InsertPage
wxAuiNotebook::RemovePage
wxAuiNotebook::SetArtProvider
wxAuiNotebook::SetFont
wxAuiNotebook::SetNormalFont
wxAuiNotebook::SetSelectedFont
wxAuiNotebook::SetMeasuringFont
wxAuiNotebook::SetPageBitmap
wxAuiNotebook::SetPageText
wxAuiNotebook::SetSelection
wxAuiNotebook::SetTabCtrlHeight
wxAuiNotebook::SetUniformBitmapSize
wxAuiNotebook::ShowWindowMenu

### wxAuiNotebook::wxAuiNotebook

wxAuiNotebook()

wxAuiNotebook(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxAUI_NB_DEFAULT_STYLE)

Constructor. Creates a wxAuiNotebok control.

### wxAuiNotebook::AddPage

bool AddPage(wxWindow* page, const wxString& caption, bool select = false, const wxBitmap& bitmap = wxNullBitmap)

Adds a page. If the select parameter is true, calling this will generate a page change event.

### wxAuiNotebook::AdvanceSelection

void AdvanceSelection(bool forward = true)

Sets the selection to the next or previous page.

### wxAuiNotebook::Create

bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0)

Creates the notebook window.

### wxAuiNotebook::DeletePage

bool DeletePage(size_t page)

Deletes a page at the given index. Calling this method will generate a page change event.

### wxAuiNotebook::GetArtProvider

wxAuiTabArt* GetArtProvider() const

Returns the associated art provider.

### wxAuiNotebook::GetHeightForPageHeight

int GetHeightForPageHeight(int pageHeight)

Returns the desired height of the notebook for the given page height. Use this to fit the notebook to a given page size.

### wxAuiNotebook::GetPage

wxWindow* GetPage(size_t page_idx) const

Returns the page specified by the given index.

### wxAuiNotebook::GetPageBitmap

wxBitmap GetPageBitmap(size_t page) const

Returns the tab bitmap for the page.

### wxAuiNotebook::GetPageCount

size_t GetPageCount() const

Returns the number of pages in the notebook.

### wxAuiNotebook::GetPageIndex

int GetPageIndex(wxWindow* page_wnd) const

Returns the page index for the specified window. If the window is not found in the notebook, wxNOT_FOUND is returned.

### wxAuiNotebook::GetPageText

wxString GetPageText(size_t page) const

Returns the tab label for the page.

### wxAuiNotebook::GetSelection

int GetSelection() const

Returns the currently selected page.

### wxAuiNotebook::GetTabCtrlHeight

int GetTabCtrlHeight() const

Returns the height of the tab control.

### wxAuiNotebook::InsertPage

bool InsertPage(size_t page_idx, wxWindow* page, const wxString& caption, bool select = false, const wxBitmap& bitmap = wxNullBitmap)

InsertPage() is similar to AddPage, but allows the ability to specify the insert location. If the select parameter is true, calling this will generate a page change event.

### wxAuiNotebook::RemovePage

bool RemovePage(size_t page)

Removes a page, without deleting the window pointer.

### wxAuiNotebook::SetArtProvider

void SetArtProvider(wxAuiTabArt* art)

Sets the art provider to be used by the notebook.

### wxAuiNotebook::SetFont

bool SetFont(const wxFont& font)

Sets the font for drawing the tab labels, using a bold version of the font for selected tab labels.

### wxAuiNotebook::SetNormalFont

void SetNormalFont(const wxFont& font)

Sets the font for drawing unselected tab labels.

### wxAuiNotebook::SetSelectedFont

void SetSelectedFont(const wxFont& font)

Sets the font for drawing selected tab labels.

### wxAuiNotebook::SetMeasuringFont

void SetMeasuringFont(const wxFont& font)

Sets the font for measuring tab labels.

### wxAuiNotebook::SetPageBitmap

bool SetPageBitmap(size_t page, const wxBitmap& bitmap)

Sets the bitmap for the page. To remove a bitmap from the tab caption, pass wxNullBitmap.

### wxAuiNotebook::SetPageText

bool SetPageText(size_t page, const wxString& text)

Sets the tab label for the page.

### wxAuiNotebook::SetSelection

size_t SetSelection(size_t new_page)

Sets the page selection. Calling this method will generate a page change event.

### wxAuiNotebook::SetTabCtrlHeight

void SetTabCtrlHeight(int height)

Sets the tab height. By default, the tab control height is calculated by measuring the text height and bitmap sizes on the tab captions. Calling this method will override that calculation and set the tab control to the specified height parameter. A call to this method will override any call to SetUniformBitmapSize(). Specifying -1 as the height will return the control to its default auto-sizing behaviour.

### wxAuiNotebook::SetUniformBitmapSize

void SetUniformBitmapSize(const wxSize& size)

SetUniformBitmapSize() ensures that all tabs will have the same height, even if some tabs don't have bitmaps. Passing wxDefaultSize to this function will instruct the control to use dynamic tab height, which is the default behaviour. Under the default behaviour, when a tab with a large bitmap is added, the tab control's height will automatically increase to accommodate the larger bitmap.

void Split(size_t page, int direction)

Split performs a split operation programmatically. The argument page indicates the page that will be split off. This page will also become the active page after the split. The direction argument specifies where the pane should go, it should be one of the following: wxTOP, wxBOTTOM, wxLEFT, or wxRIGHT.

### wxAuiNotebook::ShowWindowMenu

bool ShowWindowMenu()

Shows the window menu for the active tab control associated with this notebook, and returns `true` if a selection was made.