wFrame

A frame is a top-level window in wNim. Since it is a top-level window, it cannot have a parent. However, it can has an owner. The frame will be minimized when its owner is minimized and restored when it is restored.

A dialog is also a top-level window with the owner. So it can be designed in wNim by using a frame with a owner (another main frame), put a panel in it, and then adding some contorls inside.

Notice that if a frame has exactly one child window, not counting the status and toolbar, this child is resized to take the entire frame client area. If two or more windows are present, they should be laid out explicitly by manually. This behavior just a default wEvent_Size event handler for frame, and it can be overwrited (Since 0.7.0).

Superclass:wWindow
Styles:
StylesDescription
wIconizeDisplay the frame iconized (minimized).
wCaptionPuts a caption on the frame.
wMinimizeIdentical to wIconize.
wMinimizeBoxDisplays a minimize box on the frame
wMaximizeDisplays the frame maximized
wMaximizeBoxDisplays a maximize box on the frame
wSystemMenuDisplays a system menu containing the list of various windows commands in the window title bar.
wResizeBorderDisplays a resizable border around the window.
wStayOnTopStay on top of all other windows.
wModalFrameCreates a frame with a modal dialog-box style.
wFrameToolWindowCauses a frame with a small title bar to be created; the frame does not appear in the taskbar.
wDefaultFrameStyleThe default style for a frame.
wDefaultDialogStyleThe default style for a dialog.
Events:

Consts

wIconize = 0x20000000
wCaption = 0x00C00000
wMinimize = 0x20000000
wMinimizeBox = 0x00020000
wMaximize = 0x01000000
wMaximizeBox = 0x00010000
wSystemMenu = 0x00080000
wResizeBorder = 0x00040000
wStayOnTop = 34359738368'i64
wModalFrame = 0x00000080
wFrameToolWindow = 549755813888'i64
wDefaultFrameStyle = 13565952
wDefaultDialogStyle = 1103819702272'i64
wBallonNone = 0x00000000
wBallonInfo = 0x00000001
wBallonWarning = 0x00000002
wBallonError = 0x00000003

Procs

proc getMenuBar(self: wFrame): wMenuBar {...}{.inline, raises: [], tags: [].}
Returns the menubar currently associated with the frame (if any).
proc setTopMost(self: wFrame; top = true) {...}{.raises: [], tags: [].}
Sets whether the frame top most to all windows.
proc setIcon(self: wFrame; icon: wIcon) {...}{.raises: [], tags: [].}
Sets the icon for this frame.
proc getIcon(self: wFrame): wIcon {...}{.inline, raises: [], tags: [].}
Returns the standard icon.
proc minimize(self: wFrame; flag = true) {...}{.raises: [], tags: [].}
Minimizes or restores the frame
proc iconize(self: wFrame; flag = true) {...}{.inline, raises: [], tags: [].}
Iconizes or restores the frame. The same as minimize().
proc maximize(self: wFrame; flag = true) {...}{.raises: [], tags: [].}
Maximizes or restores the frame.
proc restore(self: wFrame) {...}{.inline, raises: [], tags: [].}
Restore a previously iconized or maximized frame to its normal state.
proc isIconized(self: wFrame): bool {...}{.inline, raises: [], tags: [].}
Returns true if the frame is iconized.
proc isMaximized(self: wFrame): bool {...}{.inline, raises: [], tags: [].}
Returns true if the frame is maximized.
proc enableCloseButton(self: wFrame; flag = true) {...}{.raises: [], tags: [].}
Enables or disables the Close button.
proc disableCloseButton(self: wFrame) {...}{.inline, raises: [], tags: [].}
Disables the Close button.
proc enableMaximizeButton(self: wFrame; flag = true) {...}{.raises: [], tags: [].}
Enables or disables the Maximize button.
proc disableMaximizeButton(self: wFrame) {...}{.inline, raises: [], tags: [].}
Disables the Maximize button.
proc enableMinimizeButton(self: wFrame; flag = true) {...}{.raises: [], tags: [].}
Enables or disables the Minimize button.
proc disableMinimizeButton(self: wFrame) {...}{.inline, raises: [], tags: [].}
Disables the Minimize button.
proc shortcut(self: wFrame; flag: int; keyCode: int; handler: wEventProc): wEventConnection {...}{.
    discardable, raises: [wNilAccess], tags: [RootEffect].}
Quickly bind a keyboard shortcut to an event handler. If this frame not yet have a accelerator table, it will create a new one. This function use wCommandID between 64257..65535.
proc shortcut(self: wFrame; flag: int; keyCode: int; handler: wEventNeatProc): wEventConnection {...}{.
    discardable, raises: [wNilAccess], tags: [RootEffect].}
Quickly bind a keyboard shortcut to an event handler. If this frame not yet have a accelerator table, it will create a new one. This function use wCommandID between 64257..65535.
proc setReturnCode(self: wFrame; retCode: int) {...}{.inline, raises: [], tags: [].}
Sets the return code for this window.
proc getReturnCode(self: wFrame): int {...}{.inline, raises: [], tags: [].}
Gets the return code for this window.
proc isModal(self: wFrame): bool {...}{.inline, raises: [], tags: [].}
Returns true if the frame is modal, false otherwise.
proc showModal(self: wFrame): int {...}{.discardable, raises: [Exception],
                                tags: [RootEffect].}
Shows the frame as an application-modal dialog. Program flow does not return until the dialog has been dismissed with endModal.
proc showWindowModal(self: wFrame): int {...}{.discardable, raises: [Exception],
                                      tags: [RootEffect].}
Shows a dialog modal to the parent top level window only. Program flow does not return until the dialog has been dismissed with endModal.
proc endModal(self: wFrame; retCode: int = 0) {...}{.raises: [Exception], tags: [RootEffect].}
Ends a modal dialog, passing a value to be returned from the showModal() invocation.
proc setTrayIcon(self: wFrame; icon: wIcon; tooltip = "") {...}{.
    raises: [wNilAccess, IndexDefect, Exception], tags: [RootEffect].}
Creates the system tray icon.
proc removeTrayIcon(self: wFrame) {...}{.raises: [], tags: [RootEffect].}
Removes the system tray icon.
proc showBalloon(self: wFrame; title: string; text: string; timeout: int = 3000;
                flag = wBallonNone) {...}{.raises: [IndexDefect], tags: [].}
Display a balloon notification. Only works when the frame already have a tray icon. flag is one of wBallonNone, wBallonInfo, wBallonWarning or wBallonError.
proc init(self: wFrame; owner: wWindow = nil; title = ""; pos = wDefaultPoint;
         size = wDefaultSize; style: wStyle = wDefaultFrameStyle; className = "wFrame") {...}{.raises: [
    wWindowError, wCursorError, wBrushError, Exception, IndexDefect, wFontError],
    tags: [RootEffect].}
Initializes a frame.
proc Frame(owner: wWindow = nil; title = ""; pos = wDefaultPoint; size = wDefaultSize;
          style: wStyle = wDefaultFrameStyle; className = "wFrame"): wFrame {...}{.inline,
    discardable, raises: [wWindowError, wCursorError, wBrushError, Exception,
                        IndexDefect, wFontError], tags: [RootEffect].}
Constructor.

Methods

method getDefaultSize(self: wFrame): wSize {...}{.raises: [], tags: [].}
Returns the system suggested size of a window (usually used for GUI controls).
method release(self: wFrame) {...}{.raises: [], tags: [RootEffect].}
Release all the resources during destroying. Used internally.