wMenuBar

A menubar is a series of menus accessible from the top of a frame.

Superclass:wMenuBase
Seealso:wMenu wMenuItem

Procs

proc refresh(self: wMenuBar) {...}{.raises: [], tags: [RootEffect].}
Redraw the menubar.
proc attach(self: wMenuBar; frame: wFrame) {...}{.raises: [wNilAccess], tags: [].}
Attach a menubar to frame window.
proc detach(self: wMenuBar; frame: wFrame) {...}{.raises: [wNilAccess], tags: [].}
Detach a menubar from the frame.
proc detach(self: wMenuBar) {...}{.raises: [wNilAccess], tags: [RootEffect].}
Detach a menubar from all frames.
proc isAttached(self: wMenuBar): bool {...}{.raises: [], tags: [RootEffect].}
Return true if a menubar is attached to some frame window.
proc isAttached(self: wMenuBar; frame: wFrame): bool {...}{.raises: [wNilAccess], tags: [].}
Return true if a menubar is attached to the frame window.
proc insert(self: wMenuBar; pos: int; menu: wMenu; text: string; bitmap: wBitmap = nil) {...}{.
    raises: [wNilAccess], tags: [RootEffect].}
Inserts the menu at the given position into the menubar.
proc append(self: wMenuBar; menu: wMenu; text: string; bitmap: wBitmap = nil) {...}{.inline,
    raises: [wNilAccess], tags: [RootEffect].}
Adds the menu to the end of the menubar.
proc enable(self: wMenuBar; pos: int; flag = true) {...}{.raises: [], tags: [].}
Enables or disables a whole menu.
proc disable(self: wMenuBar; pos: int) {...}{.inline, raises: [], tags: [].}
Disables a whole menu.
proc isEnabled(self: wMenuBar; pos: int): bool {...}{.raises: [], tags: [].}
Returns true if the menu with the given index is enabled.
proc find(self: wMenuBar; menu: wMenu): int {...}{.raises: [wNilAccess], tags: [].}
Find the first index of menu or wNotFound(-1) if not found.
proc find(self: wMenuBar; text: string): int {...}{.raises: [IndexDefect], tags: [].}
Find the first index with the given title or wNotFound(-1) if not found.
proc findMenu(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexDefect], tags: [].}
Find the first wMenu object with the given title or nil if not found.
proc findText(self: wMenuBar; text: string): int {...}{.raises: [IndexDefect], tags: [].}
Find the first index with the given title (not include any accelerator characters), wNotFound(-1) if not found.
proc findMenuText(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexDefect], tags: [].}
Find the first wMenu object with the given title (not include any accelerator characters), nil if not found.
proc getMenu(self: wMenuBar; pos: int): wMenu {...}{.raises: [], tags: [].}
Returns the menu at pos, nil if index out of bounds.
proc getLabel(self: wMenuBar; pos: int): string {...}{.raises: [IndexDefect], tags: [].}
Returns the label of a top-level menu.
proc getLabelText(self: wMenuBar; pos: int): string {...}{.raises: [IndexDefect], tags: [].}
Returns the label of a top-level menu, not include any accelerator characters.
proc setLabel(self: wMenuBar; pos: int; text: string) {...}{.raises: [], tags: [].}
Sets the label of a top-level menu.
proc remove(self: wMenuBar; pos: int): wMenu {...}{.discardable, raises: [],
    tags: [RootEffect].}
Removes the menu from the menubar and returns the menu object.
proc remove(self: wMenuBar; menu: wMenu) {...}{.raises: [wNilAccess], tags: [RootEffect].}
Find and remove all the menu object from the menubar.
proc removeAll(self: wMenuBar) {...}{.raises: [], tags: [].}
Removes all the menu from the menubar.
proc replace(self: wMenuBar; pos: int; menu: wMenu; text: string; bitmap: wBitmap = nil): wMenu {...}{.
    discardable, raises: [wNilAccess], tags: [RootEffect].}
Replaces the menu at the given position with another one. Return the old menu object.
proc `[]`(self: wMenuBar; pos: int): wMenu {...}{.inline, raises: [], tags: [].}
Returns the menu at pos. Raise error if index out of bounds.
proc len(self: wMenuBar): int {...}{.inline, raises: [], tags: [].}
Returns the number of wMenu objects in this menubar. This shoud be equal to getCount in most case.
proc delete(self: wMenuBar) {...}{.raises: [wNilAccess], tags: [RootEffect].}
Delete the menubar.
proc init(self: wMenuBar) {...}{.raises: [], tags: [RootEffect].}
Initializes an empty menubar.
proc MenuBar(): wMenuBar {...}{.inline, discardable, raises: [], tags: [RootEffect].}
Constructor.
proc init(self: wMenuBar; menus: openArray[(wMenu, string)]) {...}{.raises: [wNilAccess],
    tags: [RootEffect].}
Initializes a menubar from arrays of menus and titles.
proc MenuBar(menus: openArray[(wMenu, string)]): wMenuBar {...}{.inline, discardable,
    raises: [wNilAccess], tags: [RootEffect].}
Constructor.
proc init(self: wMenuBar; frame: wFrame; menus: openArray[(wMenu, string)] = []) {...}{.
    raises: [wNilAccess], tags: [RootEffect].}
Initializes a menubar from arrays of menus and titles, and attach it to a frame.
proc MenuBar(frame: wFrame; menus: openArray[(wMenu, string)] = []): wMenuBar {...}{.inline,
    discardable, raises: [wNilAccess], tags: [RootEffect].}
Constructor.

Iterators

iterator find(self: wMenuBar; menu: wMenu): int {...}{.raises: [wNilAccess], tags: [].}
Iterates over each index of menu in menubar.
iterator find(self: wMenuBar; text: string): int {...}{.raises: [IndexDefect], tags: [].}
Iterates over each index with the given title.
iterator findMenu(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexDefect], tags: [].}
Iterates over each wMenu object with the given title.
iterator findText(self: wMenuBar; text: string): int {...}{.raises: [IndexDefect], tags: [].}
Iterates over each index with the given title (not include any accelerator characters).
iterator findMenuText(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexDefect],
    tags: [].}
Iterates over each wMenu object with the given title (not include any accelerator characters).
iterator items(self: wMenuBar): wMenu {...}{.raises: [], tags: [].}
Items iterator for menus in a menubar.
iterator pairs(self: wMenuBar): (int, wMenu) {...}{.raises: [], tags: [].}
Iterates over each menu of menubar. Yields (index, [index]) pairs.