wxAuiNotebook — wx v2.4.2

Search documentation of wx

# View Source wxAuiNotebook (wx v2.4.2)

Functions for wxAuiNotebook class

`wxAuiNotebook` is part of the wxAUI class framework, which represents a notebook control, managing multiple windows with associated tabs.

See also overview_aui.

`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.

The default theme that is used is `wxAuiDefaultTabArt` (not implemented in wx), which provides a modern, glossy look and feel. The theme can be changed by calling `setArtProvider/2`.

Styles

This class supports the following styles:

This class is derived (and can use functions) from: `wxControl` `wxWindow` `wxEvtHandler`

wxWidgets docs: wxAuiNotebook

## Events

Event types emitted from this class: `command_auinotebook_page_close`, `command_auinotebook_page_closed`, `command_auinotebook_page_changed`, `command_auinotebook_page_changing`, `command_auinotebook_button`, `command_auinotebook_begin_drag`, `command_auinotebook_end_drag`, `command_auinotebook_drag_motion`, `command_auinotebook_allow_dnd`, `command_auinotebook_drag_done`, `command_auinotebook_tab_middle_down`, `command_auinotebook_tab_middle_up`, `command_auinotebook_tab_right_down`, `command_auinotebook_tab_right_up`, `command_auinotebook_bg_dclick`

# Summary

## Types

wxAuiNotebook()

## Functions

addPage(This, Page, Caption)
addPage/4

Adds a page.

addPage(This, Page, Text, Select, ImageId)

Adds a new page.

create(This, Parent)
create/3

Creates the notebook window.

create/4

Constructs the book control with the given parameters.

deletePage(This, Page)

Deletes a page at the given index.

destroy(This)

Destroys the object.

getArtProvider(This)

Returns the associated art provider.

getPage(This, Page_idx)

Returns the page specified by the given index.

getPageBitmap(This, Page)

Returns the tab bitmap for the page.

getPageCount(This)

Returns the number of pages in the notebook.

getPageIndex(This, Page_wnd)

Returns the page index for the specified window.

getPageText(This, Page)

Returns the tab label for the page.

getSelection(This)

Returns the currently selected page.

insertPage(This, Page_idx, Page, Caption)
insertPage/5

`insertPage/6` is similar to AddPage, but allows the ability to specify the insert location.

insertPage(This, Index, Page, Text, Select, ImageId)

Inserts a new page at the specified position.

new()

Default ctor.

new(Parent)
new/2

Constructor.

removePage(This, Page)

Removes a page, without deleting the window pointer.

setArtProvider(This, Art)

Sets the art provider to be used by the notebook.

setFont(This, Font)

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

setPageBitmap(This, Page, Bitmap)

Sets the bitmap for the page.

setPageText(This, Page, Text)

Sets the tab label for the page.

setSelection(This, New_page)

Sets the page selection.

setTabCtrlHeight(This, Height)

Sets the tab height.

setUniformBitmapSize(This, Size)

Ensure that all tabs have the same height, even if some of them don't have bitmaps.

# Types

Link to this type

# wxAuiNotebook()

View Source

    -type wxAuiNotebook() :: wx:wx_object().

# Functions

Link to this function

# addPage(This, Page, Caption)

View Source

    -spec addPage(This, Page, Caption) -> boolean()
                     when
                         This :: wxAuiNotebook(), Page :: wxWindow:wxWindow(), Caption :: unicode:chardata().

Link to this function

# addPage/4

View Source

    -spec addPage(This, Page, Caption, [Option]) -> boolean()
                     when
                         This :: wxAuiNotebook(),
                         Page :: wxWindow:wxWindow(),
                         Caption :: unicode:chardata(),
                         Option :: {select, boolean()} | {bitmap, wxBitmap:wxBitmap()}.

Adds a page.

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

Link to this function

# addPage(This, Page, Text, Select, ImageId)

View Source

    -spec addPage(This, Page, Text, Select, ImageId) -> boolean()
                     when
                         This :: wxAuiNotebook(),
                         Page :: wxWindow:wxWindow(),
                         Text :: unicode:chardata(),
                         Select :: boolean(),
                         ImageId :: integer().

Adds a new page.

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function may generate the page changing events.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: `insertPage/6`

Since: 2.9.3

Link to this function

# create(This, Parent)

View Source

    -spec create(This, Parent) -> boolean() when This :: wxAuiNotebook(), Parent :: wxWindow:wxWindow().

Link to this function

# create/3

View Source

    -spec create(This, Parent, Winid) -> boolean()
                    when This :: wxAuiNotebook(), Parent :: wxWindow:wxWindow(), Winid :: integer();
                (This, Parent, [Option]) -> boolean()
                    when
                        This :: wxAuiNotebook(),
                        Parent :: wxWindow:wxWindow(),
                        Option ::
                            {id, integer()} |
                            {pos, {X :: integer(), Y :: integer()}} |
                            {size, {W :: integer(), H :: integer()}} |
                            {style, integer()}.

Creates the notebook window.

Link to this function

# create/4

View Source

    -spec create(This, Parent, Winid, [Option]) -> boolean()
                    when
                        This :: wxAuiNotebook(),
                        Parent :: wxWindow:wxWindow(),
                        Winid :: integer(),
                        Option ::
                            {pos, {X :: integer(), Y :: integer()}} |
                            {size, {W :: integer(), H :: integer()}} |
                            {style, integer()}.

Constructs the book control with the given parameters.

Link to this function

# deletePage(This, Page)

View Source

    -spec deletePage(This, Page) -> boolean() when This :: wxAuiNotebook(), Page :: integer().

Deletes a page at the given index.

Calling this method will generate a page change event.

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxAuiNotebook()) -> ok.

Destroys the object.

Link to this function

# getArtProvider(This)

View Source

    -spec getArtProvider(This) -> wxAuiTabArt:wxAuiTabArt() when This :: wxAuiNotebook().

Returns the associated art provider.

Link to this function

# getPage(This, Page_idx)

View Source

    -spec getPage(This, Page_idx) -> wxWindow:wxWindow() when This :: wxAuiNotebook(), Page_idx :: integer().

Returns the page specified by the given index.

Link to this function

# getPageBitmap(This, Page)

View Source

    -spec getPageBitmap(This, Page) -> wxBitmap:wxBitmap() when This :: wxAuiNotebook(), Page :: integer().

Returns the tab bitmap for the page.

Link to this function

# getPageCount(This)

View Source

    -spec getPageCount(This) -> integer() when This :: wxAuiNotebook().

Returns the number of pages in the notebook.

Link to this function

# getPageIndex(This, Page_wnd)

View Source

    -spec getPageIndex(This, Page_wnd) -> integer()
                          when This :: wxAuiNotebook(), Page_wnd :: wxWindow:wxWindow().

Returns the page index for the specified window.

If the window is not found in the notebook, wxNOT_FOUND is returned.

Link to this function

# getPageText(This, Page)

View Source

    -spec getPageText(This, Page) -> unicode:charlist() when This :: wxAuiNotebook(), Page :: integer().

Returns the tab label for the page.

Link to this function

# getSelection(This)

View Source

    -spec getSelection(This) -> integer() when This :: wxAuiNotebook().

Returns the currently selected page.

Link to this function

# insertPage(This, Page_idx, Page, Caption)

View Source

    -spec insertPage(This, Page_idx, Page, Caption) -> boolean()
                        when
                            This :: wxAuiNotebook(),
                            Page_idx :: integer(),
                            Page :: wxWindow:wxWindow(),
                            Caption :: unicode:chardata().

Link to this function

# insertPage/5

View Source

    -spec insertPage(This, Page_idx, Page, Caption, [Option]) -> boolean()
                        when
                            This :: wxAuiNotebook(),
                            Page_idx :: integer(),
                            Page :: wxWindow:wxWindow(),
                            Caption :: unicode:chardata(),
                            Option :: {select, boolean()} | {bitmap, wxBitmap:wxBitmap()}.

`insertPage/6` 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.

Link to this function

# insertPage(This, Index, Page, Text, Select, ImageId)

View Source

    -spec insertPage(This, Index, Page, Text, Select, ImageId) -> boolean()
                        when
                            This :: wxAuiNotebook(),
                            Index :: integer(),
                            Page :: wxWindow:wxWindow(),
                            Text :: unicode:chardata(),
                            Select :: boolean(),
                            ImageId :: integer().

Inserts a new page at the specified position.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: `addPage/5`

Since: 2.9.3

Link to this function

# new()

View Source

    -spec new() -> wxAuiNotebook().

Default ctor.

Link to this function

# new(Parent)

View Source

    -spec new(Parent) -> wxAuiNotebook() when Parent :: wxWindow:wxWindow().

Link to this function

# new/2

View Source

    -spec new(Parent, [Option]) -> wxAuiNotebook()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Option ::
                         {id, integer()} |
                         {pos, {X :: integer(), Y :: integer()}} |
                         {size, {W :: integer(), H :: integer()}} |
                         {style, integer()}.

Constructor.

Creates a wxAuiNotebok control.

Link to this function

# removePage(This, Page)

View Source

    -spec removePage(This, Page) -> boolean() when This :: wxAuiNotebook(), Page :: integer().

Removes a page, without deleting the window pointer.

Link to this function

# setArtProvider(This, Art)

View Source

    -spec setArtProvider(This, Art) -> ok when This :: wxAuiNotebook(), Art :: wxAuiTabArt:wxAuiTabArt().

Sets the art provider to be used by the notebook.

Link to this function

# setFont(This, Font)

View Source

    -spec setFont(This, Font) -> boolean() when This :: wxAuiNotebook(), Font :: wxFont:wxFont().

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

Link to this function

# setPageBitmap(This, Page, Bitmap)

View Source

    -spec setPageBitmap(This, Page, Bitmap) -> boolean()
                           when This :: wxAuiNotebook(), Page :: integer(), Bitmap :: wxBitmap:wxBitmap().

Sets the bitmap for the page.

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

Link to this function

# setPageText(This, Page, Text)

View Source

    -spec setPageText(This, Page, Text) -> boolean()
                         when This :: wxAuiNotebook(), Page :: integer(), Text :: unicode:chardata().

Sets the tab label for the page.

Link to this function

# setSelection(This, New_page)

View Source

    -spec setSelection(This, New_page) -> integer() when This :: wxAuiNotebook(), New_page :: integer().

Sets the page selection.

Calling this method will generate a page change event.

Link to this function

# setTabCtrlHeight(This, Height)

View Source

    -spec setTabCtrlHeight(This, Height) -> ok when This :: wxAuiNotebook(), Height :: integer().

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/2`.

Specifying -1 as the height will return the control to its default auto-sizing behaviour.

Link to this function

# setUniformBitmapSize(This, Size)

View Source

    -spec setUniformBitmapSize(This, Size) -> ok
                                  when This :: wxAuiNotebook(), Size :: {W :: integer(), H :: integer()}.

Ensure that all tabs have the same height, even if some of them don't have bitmaps.

Passing ?wxDefaultSize as `size` undoes the effect of a previous call to this function and instructs the control to use dynamic tab height.