wNoteBook

A wNoteBook control manages multiple windows with associated tabs.

Appearance:
Superclass:wControl
Styles:
StylesDescription
wNbIconLeftIcons are aligned with the left edge.
Events:wCommandEvent
wCommandEventDescription
wEvent_NoteBookPageChangedThe page selection was changed.
wEvent_NoteBookPageChangingThe page selection is about to be changed. This event can be vetoed.

Consts

wNbIconLeft = 0x00000010

Procs

proc getPageCount(self: wNoteBook): int {...}{.validate, property, inline, raises: [],
                                      tags: [].}
Returns the number of pages in the control.
proc len(self: wNoteBook): int {...}{.validate, inline, raises: [], tags: [].}
Returns the number of pages in the control. This shoud be equal to getPageCount() in most case.
proc getSelection(self: wNoteBook): int {...}{.validate, property, inline, raises: [],
                                      tags: [].}
Returns the currently selected page, or wNotFound if none was selected.
proc insertPage(self: wNoteBook; pos = -1; page: wPanel; text = ""; select = false;
               image: wImage = nil; imageId: int = -1) {...}{.validate, raises: [], tags: [].}
Inserts a page (wPanel object) at the specified position. Page's parent must be this control. Do not delete the page, it will be deleted by the wNoteBook control (if not removed).
proc insertPage(self: wNoteBook; pos = -1; text = ""; select = false; image: wImage = nil;
               imageId: int = -1): wPanel {...}{.validate, inline, discardable, raises: [],
                                       tags: [].}
Inserts a new page at the specified position. Return the new page (wPanel object).
proc addPage(self: wNoteBook; page: wPanel; text = ""; select = false; image: wImage = nil;
            imageId: int = -1) {...}{.validate, inline, raises: [], tags: [].}
Adds a page (wPanel object). Page's parent must be this control. Do not delete the page, it will be deleted by the wNoteBook control (if not removed).
proc addPage(self: wNoteBook; text = ""; select = false; image: wImage = nil;
            imageId: int = -1): wPanel {...}{.validate, inline, discardable, raises: [],
                                    tags: [].}
Adds a new page. Return the new page (wPanel object).
proc getPageText(self: wNoteBook; pos: int): string {...}{.validate, property, raises: [],
    tags: [].}
Returns the string for the given page.
proc setPageText(self: wNoteBook; pos: int; text: string) {...}{.validate, property,
    raises: [], tags: [].}
Sets the text for the given page.
proc changeSelection(self: wNoteBook; pos: int) {...}{.validate, raises: [], tags: [].}
Changes the selection to the given page. This function behaves as setSelection() but does not generate the page changing events.
proc setSelection(self: wNoteBook; pos: int): int {...}{.validate, property, discardable,
    raises: [], tags: [].}
Sets the selection to the given page. Notice that this function generates the page changing events, use the changeSelection() if you don't want these events to be generated.
proc getCurrentPage(self: wNoteBook): wPanel {...}{.validate, property, inline, raises: [],
    tags: [].}
Returns the currently selected page or nil.
proc getPage(self: wNoteBook; pos: int): wPanel {...}{.validate, property, inline, raises: [],
    tags: [].}
Returns the page at the given position or nil.
proc `[]`(self: wNoteBook; pos: int): wPanel {...}{.validate, inline, raises: [], tags: [].}
Returns the page at the given position. Raise error if index out of bounds.
proc removePage(self: wNoteBook; pos: int): wPanel {...}{.validate, inline, discardable,
    raises: [], tags: [].}
Removes the specified page, without deleting the associated panel object. Returns the removed panel object.
proc deletePage(self: wNoteBook; pos: int) {...}{.validate, inline, raises: [], tags: [].}
Deletes the specified page, and the associated window.
proc removeAllPages(self: wNoteBook) {...}{.validate, inline, raises: [], tags: [].}
Removes all pages.
proc deleteAllPages(self: wNoteBook) {...}{.validate, inline, raises: [], tags: [].}
Deletes all pages.
proc setImageList(self: wNoteBook; imageList: wImageList) {...}{.validate, property, inline,
    raises: [], tags: [].}
Sets the image list to use. By default, wNoteBook handle it's owns imagelist. However, you can decide to use another image list if needed. Assign imageId in insertPage()/addPage() to set the image index.
proc getImageList(self: wNoteBook): wImageList {...}{.validate, property, inline,
    raises: [], tags: [].}
Returns the associated image list.
proc setPageImage(self: wNoteBook; pos: int; image: int) {...}{.validate, property,
    raises: [], tags: [].}
Sets the image index for the given page. Notice that this should only use to change the image index. If the page don't have a image when creation, don't set image index for it.
proc getPageImage(self: wNoteBook; pos: int): int {...}{.validate, property, raises: [],
    tags: [].}
Returns the image index for the given page.
proc setPadding(self: wNoteBook; size: wSize) {...}{.validate, property, inline, raises: [],
    tags: [].}
Sets the amount of space around each page's icon and label, in pixels.
proc final(self: wNoteBook) {...}{.raises: [], tags: [].}
Default finalizer for wNoteBook.
proc init(self: wNoteBook; parent: wWindow; id = wDefaultID; pos = wDefaultPoint;
         size = wDefaultSize; style: wStyle = 0) {...}{.validate, raises: [], tags: [].}
Initializer.
proc NoteBook(parent: wWindow; id = wDefaultID; pos = wDefaultPoint; size = wDefaultSize;
             style: wStyle = 0): wNoteBook {...}{.inline, discardable, raises: [], tags: [].}
Constructs a notebook control.

Methods

method getClientSize(self: wNoteBook): wSize {...}{.property, raises: [], tags: [].}
Returns the size of the notebook 'client area' in pixels.
method getClientAreaOrigin(self: wNoteBook): wPoint {...}{.property, raises: [], tags: [].}
Get the origin of the client area of the window relative to the window top left corner.

Iterators

iterator items(self: wNoteBook): wPanel {...}{.validate, raises: [], tags: [].}
Iterate each page in this notebook control.