wxRuby Documentation Home

Wx::AuiNotebook

AuiNotebook is part of the AUI class framework.
See also AUI overview.

AuiNotebook is a notebook control which implements many features common in applications with dockable panes.
Specifically, AuiNotebook 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 Notebook.

The default theme that is used is AuiDefaultTabArt, which provides a modern, glossy look and feel.
The theme can be changed by calling AuiNotebook#set_art_provider.

Derived from

Control

Window styles

AUI_NB_DEFAULT_STYLE Defined as AUI_NB_TOP AUI_NB_TAB_SPLIT AUI_NB_TAB_MOVE AUI_NB_SCROLL_BUTTONS AUI_NB_CLOSE_ON_ACTIVE_TAB.
AUI_NB_TAB_SPLIT Allows the tab control to be split by dragging a tab.
AUI_NB_TAB_MOVE Allows a tab to be moved horizontally by dragging.
AUI_NB_TAB_EXTERNAL_MOVE Allows a tab to be moved to another tab control.
AUI_NB_TAB_FIXED_WIDTH With this style, all tabs have the same width.
AUI_NB_SCROLL_BUTTONS With this style, left and right scroll buttons are displayed.
AUI_NB_WINDOWLIST_BUTTON With this style, a drop-down list of windows is available.
AUI_NB_CLOSE_BUTTON With this style, a close button is available on the tab bar.
AUI_NB_CLOSE_ON_ACTIVE_TAB With this style, the close button is visible on the active tab.
AUI_NB_CLOSE_ON_ALL_TABS With this style, the close button is visible on all tabs.

Data structures

Methods

AuiNotebook.new

AuiNotebook.new(%(arg-type)Window% parent, Integer id = ID_ANY, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = AUI_NB_DEFAULT_STYLE)

Constructor. Creates a AuiNotebok control.

AuiNotebook#add_page

Boolean add_page(%(arg-type)Window% page, String caption, Boolean select = false, Bitmap bitmap = Wx::NULL_BITMAP)

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

AuiNotebook#create

Boolean create(%(arg-type)Window% parent, Integer id = ID_ANY, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = 0)

Creates the notebook window.

AuiNotebook#delete_page

Boolean delete_page(%(arg-type)Integer% page)

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

AuiNotebook#each_page

each_page() { … }

Iterates over all the pages in the notebook, from first to last. Each
page (a Window object) will be passed to the associated block.

AuiNotebook#get_art_provider

AuiTabArt get_art_provider()

Returns the associated art provider.

AuiNotebook#get_page

Window get_page(%(arg-type)Integer% page_idx)

Returns the page specified by the given index.

AuiNotebook#get_page_bitmap

Bitmap get_page_bitmap(%(arg-type)Integer% page)

Returns the tab bitmap for the page.

AuiNotebook#get_page_count

Integer get_page_count()

Returns the number of pages in the notebook.

AuiNotebook#get_page_index

Integer get_page_index(%(arg-type)Window% page_wnd)

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

AuiNotebook#get_page_text

String get_page_text(%(arg-type)Integer% page)

Returns the tab label for the page.

AuiNotebook#get_selection

Integer get_selection()

Returns the currently selected page.

AuiNotebook#insert_page

Boolean insert_page(%(arg-type)Integer% page_idx, Window page, String caption, Boolean select = false, Bitmap bitmap = Wx::NULL_BITMAP)

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.

AuiNotebook#remove_page

Boolean remove_page(%(arg-type)Integer% page)

Removes a page, without deleting the window pointer.

AuiNotebook#set_art_provider

set_art_provider(%(arg-type)AuiTabArt% art)

Sets the art provider to be used by the notebook.

AuiNotebook#set_page_bitmap

Boolean set_page_bitmap(%(arg-type)Integer% page, Bitmap bitmap)

Sets the bitmap for the page. To remove a bitmap from the tab caption, pass
Wx::NULL_BITMAP.

AuiNotebook#set_page_text

Boolean set_page_text(%(arg-type)Integer% page, String text)

Sets the tab label for the page.

AuiNotebook#set_selection

Integer set_selection(%(arg-type)Integer% new_page)

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

AuiNotebook#set_tab_ctrl_height

set_tab_ctrl_height(%(arg-type)Integer% 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.

AuiNotebook#set_uniform_bitmap_size

set_uniform_bitmap_size(%(arg-type)Size% size)

SetUniformBitmapSize() ensures that all tabs will have the same height, even
if some tabs don’t have bitmaps. Passing DefaultSize 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.

split(%(arg-type)Integer% page, Integer 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: TOP, BOTTOM,
LEFT, or RIGHT.

AuiNotebook#use_glossy_art

use_glossy_art()

Makes the notebook tabs be drawn with a ‘glossy’ style, including a
gradient. This is the default.

AuiNotebook#use_simple_art

use_simple_art()

Makes the notebook tabs be drawn with a simple, flat style.

[This page automatically generated from the Textile source at 2023-06-03 08:07:36 +0000]