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: [].}
Redraw the menubar.
proc attach(self: wMenuBar; frame: wFrame) {...}{.raises: [NilAccessError], tags: [].}
Attach a menubar to frame window.
proc detach(self: wMenuBar; frame: wFrame) {...}{.raises: [NilAccessError], tags: [].}
Detach a menubar from the frame.
proc detach(self: wMenuBar) {...}{.raises: [NilAccessError], tags: [].}
Detach a menubar from all frames.
proc isAttached(self: wMenuBar): bool {...}{.raises: [], tags: [].}
Return true if a menubar is attached to some frame window.
proc isAttached(self: wMenuBar; frame: wFrame): bool {...}{.raises: [NilAccessError],
    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: [NilAccessError], tags: [].}
Inserts the menu at the given position into the menubar.
proc append(self: wMenuBar; menu: wMenu; text: string; bitmap: wBitmap = nil) {...}{.inline,
    raises: [NilAccessError], tags: [].}
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: [NilAccessError], tags: [].}
Find the first index of menu or wNotFound(-1) if not found.
proc find(self: wMenuBar; text: string): int {...}{.raises: [IndexError], tags: [].}
Find the first index with the given title or wNotFound(-1) if not found.
proc findMenu(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexError], tags: [].}
Find the first wMenu object with the given title or nil if not found.
proc findText(self: wMenuBar; text: string): int {...}{.raises: [IndexError], 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: [IndexError], 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: [IndexError], tags: [].}
Returns the label of a top-level menu.
proc getLabelText(self: wMenuBar; pos: int): string {...}{.raises: [IndexError], 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: [].}
Removes the menu from the menubar and returns the menu object.
proc remove(self: wMenuBar; menu: wMenu) {...}{.raises: [NilAccessError], tags: [].}
Find and remove all the menu object from the menubar.
proc replace(self: wMenuBar; pos: int; menu: wMenu; text: string; bitmap: wBitmap = nil): wMenu {...}{.
    discardable, raises: [NilAccessError], tags: [].}
Replaces the menu at the given position with another one. Return the old menu object.
proc getHandle(self: wMenuBar): HMENU {...}{.inline, raises: [], tags: [].}
Get system handle of this menubar.
proc getCount(self: wMenuBar): int {...}{.inline, raises: [], tags: [].}
Returns the number of menus in this menubar.
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: [NilAccessError], tags: [].}
Delete the menubar.
proc final(self: wMenuBar) {...}{.raises: [NilAccessError], tags: [].}
Default finalizer for wMenuBar.
proc init(self: wMenuBar) {...}{.raises: [], tags: [].}
Initializes an empty menubar.
proc MenuBar(): wMenuBar {...}{.inline, discardable, raises: [NilAccessError], tags: [].}
Constructor.
proc init(self: wMenuBar; menus: openArray[(wMenu, string)]) {...}{.
    raises: [NilAccessError], tags: [].}
Initializes a menubar from arrays of menus and titles.
proc MenuBar(menus: openArray[(wMenu, string)]): wMenuBar {...}{.inline, discardable,
    raises: [NilAccessError], tags: [].}
Constructor.
proc init(self: wMenuBar; frame: wFrame; menus: openArray[(wMenu, string)] = []) {...}{.
    raises: [NilAccessError], tags: [].}
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: [NilAccessError], tags: [].}
Constructor.

Iterators

iterator find(self: wMenuBar; menu: wMenu): int {...}{.raises: [NilAccessError], tags: [].}
Iterates over each index of menu in menubar.
iterator find(self: wMenuBar; text: string): int {...}{.raises: [IndexError], tags: [].}
Iterates over each index with the given title.
iterator findMenu(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexError], tags: [].}
Iterates over each wMenu object with the given title.
iterator findText(self: wMenuBar; text: string): int {...}{.raises: [IndexError], tags: [].}
Iterates over each index with the given title (not include any accelerator characters).
iterator findMenuText(self: wMenuBar; text: string): wMenu {...}{.raises: [IndexError],
    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.