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
wModalFrame = 0x00000080
wFrameToolWindow = 549755813888
wDefaultFrameStyle = 13565952
wDefaultDialogStyle = wBorderSimple or wBorderDouble or wBorderRaised or 0x00080000 or
    0x00C00000
wBallonNone = 0x00000000
wBallonInfo = 0x00000001
wBallonWarning = 0x00000002
wBallonError = 0x00000003

Procs

proc setMenuBar(self: wFrame; menuBar: wMenuBar) {...}{.validate, property, inline,
    raises: [], tags: [].}
Tells the frame to show the given menu bar.
proc getMenuBar(self: wFrame): wMenuBar {...}{.validate, property, inline, raises: [],
                                      tags: [].}
Returns the menubar currently associated with the frame (if any).
proc getStatusBar(self: wFrame): wStatusBar {...}{.validate, property, inline, raises: [],
    tags: [].}
Returns the status bar currently associated with the frame (if any).
proc setTopMost(self: wFrame; top = true) {...}{.validate, property, raises: [], tags: [].}
Sets whether the frame top most to all windows.
proc createStatusBar(self: wFrame; number: int = 1; style: wStyle = 0; id: wCommandID = 0): wStatusBar {...}{.
    validate, property, discardable, raises: [], tags: [].}
Creates a status bar at the bottom of the frame.
proc setIcon(self: wFrame; icon: wIcon) {...}{.validate, property, raises: [], tags: [].}
Sets the icon for this frame.
proc getIcon(self: wFrame): wIcon {...}{.validate, property, inline, raises: [], tags: [].}
Returns the standard icon.
proc minimize(self: wFrame; flag = true) {...}{.validate, raises: [], tags: [].}
Minimizes or restores the frame
proc iconize(self: wFrame; flag = true) {...}{.validate, inline, raises: [], tags: [].}
Iconizes or restores the frame. The same as minimize().
proc maximize(self: wFrame; flag = true) {...}{.validate, raises: [], tags: [].}
Maximizes or restores the frame.
proc restore(self: wFrame) {...}{.validate, inline, raises: [], tags: [].}
Restore a previously iconized or maximized frame to its normal state.
proc isIconized(self: wFrame): bool {...}{.validate, inline, raises: [], tags: [].}
Returns true if the frame is iconized.
proc isMaximized(self: wFrame): bool {...}{.validate, inline, raises: [], tags: [].}
Returns true if the frame is maximized.
proc enableCloseButton(self: wFrame; flag = true) {...}{.validate, raises: [], tags: [].}
Enables or disables the Close button.
proc disableCloseButton(self: wFrame) {...}{.validate, inline, raises: [], tags: [].}
Disables the Close button.
proc enableMaximizeButton(self: wFrame; flag = true) {...}{.validate, raises: [], tags: [].}
Enables or disables the Maximize button.
proc disableMaximizeButton(self: wFrame) {...}{.validate, inline, raises: [], tags: [].}
Disables the Maximize button.
proc enableMinimizeButton(self: wFrame; flag = true) {...}{.validate, raises: [], tags: [].}
Enables or disables the Minimize button.
proc disableMinimizeButton(self: wFrame) {...}{.validate, inline, raises: [], tags: [].}
Disables the Minimize button.
proc shortcut(self: wFrame; flag: int; keyCode: int; handler: wEventProc): wEventConnection {...}{.
    validate, discardable, raises: [], tags: [].}
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) {...}{.validate, property, inline, raises: [],
    tags: [].}
Sets the return code for this window.
proc getReturnCode(self: wFrame): int {...}{.validate, property, inline, raises: [], tags: [].}
Gets the return code for this window.
proc isModal(self: wFrame): bool {...}{.validate, inline, raises: [], tags: [].}
Returns true if the frame is modal, false otherwise.
proc showModal(self: wFrame): int {...}{.validate, discardable, raises: [], tags: [].}
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 {...}{.validate, discardable, raises: [], tags: [].}
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: [], tags: [].}
Ends a modal dialog, passing a value to be returned from the showModal() invocation.
proc setTrayIcon(self: wFrame; icon: wIcon; tooltip = "") {...}{.validate, property,
    raises: [], tags: [].}
Creates the system tray icon.
proc removeTrayIcon(self: wFrame) {...}{.validate, raises: [], tags: [].}
Removes the system tray icon.
proc showBalloon(self: wFrame; title: string; text: string; timeout: int = 3000;
                flag = wBallonNone) {...}{.validate, raises: [], 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 final(self: wFrame) {...}{.raises: [], tags: [].}
Default finalizer for wFrame.
proc init(self: wFrame; owner: wWindow = nil; title = ""; pos = wDefaultPoint;
         size = wDefaultSize; style: wStyle = wDefaultFrameStyle; className = "wFrame") {...}{.
    validate, raises: [], tags: [].}
Initializer.
proc Frame(owner: wWindow = nil; title = ""; pos = wDefaultPoint; size = wDefaultSize;
          style: wStyle = wDefaultFrameStyle; className = "wFrame"): wFrame {...}{.inline,
    discardable, raises: [], tags: [].}
Constructor, creating the frame.

Methods

method getDefaultSize(self: wFrame): wSize {...}{.validate, raises: [], tags: [].}
Returns the system suggested size of a window (usually used for GUI controls).