NoteBook

A notebook widget manages a collection of panes and displays a single one at a time. Each pane is associated with a tab, which the user may select to change the currently-displayed pane.

Constructors

this
this(UiElement parent)

Construct the widget.

Members

Functions

addTab
auto addTab(string text, Widget widget)

Add a tab to the notebook. When adding a tab to the notebook the tab gains an id that is equal to the passed widget's id and can be used later to refer to the new tab.

enableKeyboardTraversal
auto enableKeyboardTraversal()

Call to enable keyboard traversal of the tabs.

getNumberOfTabs
int getNumberOfTabs()

Get the number of tabs in the notebook.

getTabIds
string[] getTabIds()

Get an array of all the current tab id's.

getTabIndexById
int getTabIndexById(string tabId)

Get the tab index from its id. The id is the widget id that was added as the tab.

hideTab
auto hideTab(I tabIdentifier)

Hide a tab from the notbook.

insertTab
auto insertTab(I tabIdentifier, string text, Widget widget)

Insert a tab into the notebook at a specified zero based index. When adding a tab to the notebook the tab gains an id that is equal to the passed widget's id and can be used later to refer to the new tab. If the id of the widget passed is already used as a tab id then that existing one will be moved to the new position.

removeTab
auto removeTab(I tabIdentifier)

Remove a tab from the notbook.

selectTab
auto selectTab(I tabIdentifier)

Select a tab in the notebook.

setPanePadding
auto setPanePadding(I tabIdentifier, int padding)

Set a tab pane's padding.

setPaneStickyState
auto setPaneStickyState(I tabIdentifier, string stickyState)

Set a tab pane's sticky state. Specifies how the slave widget is positioned within the pane area. Sticky state is a string containing zero or more of the characters n, s, e, or w. Each letter refers to a side (north, south, east, or west) that the slave window will "stick" to, as per the grid geometry manager.

setTabImage
auto setTabImage(I tabIdentifier, Image image, string imagePosition)

Set a tab's image.

setTabImagePosition
auto setTabImagePosition(I tabIdentifier, string imagePosition)

Change the position of the tab image in relation to the text.

setTabState
auto setTabState(I tabIdentifier, string state)

Set a tab's state.

setTabText
auto setTabText(I tabIdentifier, string text)

Set a tab's text.

underlineTabChar
auto underlineTabChar(I tabIdentifier, int index)

Underline a character in the tab text. The underlined character is used for mnemonic activation if keyboard traversal is enabled.

Mixins

__anonymous
mixin Height

Mixin common commands.

__anonymous
mixin Padding
Undocumented in source.
__anonymous
mixin Width
Undocumented in source.

Mixed In Members

From mixin Height

setHeight
auto setHeight(int height)

Set the height of the widget if the geometry manager allows.

From mixin Padding

setPadding
auto setPadding(int padding)

Set the amount of padding within the widget.

From mixin Width

setWidth
auto setWidth(int width)

Set the width of the widget if the geometry manager allows.

Inherited Members

From Widget

setState
auto setState(string[] state)

Set the widget's state.

getState
string[] getState()

Get the widget's state.

inState
bool inState(string[] state)

Test if a widget is in a particular state.

removeState
auto removeState(string[] state)

Remove the widget's state.

resetState
auto resetState()

Reset the widget's state to default.

setStyle
auto setStyle(string style)

Set the widget's style.

getStyle
string getStyle()

Get the widget's style.

setKeyboardFocus
auto setKeyboardFocus(string focus)

Set if the widget can recieve focus during keyboard traversal.

getKeyboardFocus
string getKeyboardFocus()

Get if the widget can recieve focus during keyboard traversal.

pack
auto pack(int outerPadding, int innerPadding, string side, string fill, string anchor, bool expand)

Geometry method for loosely placing this widget inside its parent using a web browser model. Widgets flow around each other in the available space.

grid
auto grid(int column, int row, int outerPadding, int innerPadding, int columnSpan, int rowSpan, string sticky)

Geometry method for placing this widget inside its parent using an imaginary grid. Somewhat more direct and intuitive than pack. Choose grid for tabular layouts, and when there's no good reason to choose something else.

place
auto place(int xPos, int yPos, int width, int height, string anchor, string borderMode)

Geometry method for placing this widget inside its parent using absolute positioning.

place
auto place(double relativeXPos, double relativeYPos, double relativeWidth, double relativeHeight, string anchor, string borderMode)

Geometry method for placing this widget inside its parent using relative positioning. In this case the position and size is specified as a floating-point number between 0.0 and 1.0 relative to the height of the parent. 0.5 means the widget will be half as high as the parent and 1.0 means the widget will have the same height as the parent, and so on.

Examples

// The notebook must be created first.
// See the constructor notes in the documentation.
auto noteBook = new NoteBook();

// The pane's widgets are contained within the frame.
auto pane = new Frame(noteBook);

noteBook.addTab("Text", pane)
	.pack();

Common Commands

These are injected common commands that can also be used with this widget.

Height
Padding
Width

Additional Events

Additional events that can also be bound to using the bind method.

<<NotebookTabChanged>>, <<PrevWindow>>, <Alt-Key>, <Button-1>, <Control-Key-ISO_Left_Tab>, <Control-Key-Tab>, <Control-Shift-Key-Tab>, <Destroy>, <Key-F10>, <Key-Left>, <Key-Right>, <Key-Tab>,

See Also

Meta