wWindow

wWindow is the base for all windows and represents any visible object on screen.

Superclass:wResizable
Subclasses:wFrame wPanel wControl wDialog
Seealso:wEvent
Styles:
StylesDescription
wBorderSimpleDisplays a thin border around the window.
wBorderSunkenDisplays a sunken border.
wBorderRaisedDisplays a raised border.
wBorderStaticDisplays a border suitable for a static control.
wBorderDoubleDisplays a double border.
wTransparentWindowThe window is transparent.
wDoubleBufferedThe window is double-buffered.
wVScrollUse this style to enable a vertical scrollbar.
wHScrollUse this style to enable a horizontal scrollbar.
wClipChildrenUse this style to eliminate flicker caused by the background being repainted, then children being painted over them.
wHideTaskbarUse this style to hide the taskbar item (top-level window only).
wInvisibleThe window is initially invisible (child window is visible by default).
wPopupThe window is a pop-up window (WS_POPUP).
wPopupWindowThe window is a pop-up window (WS_POPUPWINDOW).
Events:

Consts

wBorderSimple = 0x00800000
wBorderSunken = 2199023255552
wBorderRaised = 1099511627776
wBorderStatic = 562949953421312
wBorderDouble = 4294967296
wTransparentWindow = 137438953472
wDoubleBuffered = 144115188075855872
wVScroll = 0x00200000
wHScroll = 0x00100000
wClipChildren = 0x02000000
wHideTaskbar = 1152921504606846976
wInvisible = 2305843009213693952
wPopup = 2147483648
wPopupWindow = 2156396544
wShowHide = 0
wShowNormal = 1
wShowMinimized = 2
wShowMaximized = 3
wShowMaximize = 3
wShowNoActivate = 4
wShow = 5
wShowMinimize = 6
wShowMinNoactive = 7
wShowShowNa = 8
wShowRestore = 9
wShowDefault = 10
wShowForceMinimize = 11
wModShift = 0x00000004
wModCtrl = 0x00000002
wModAlt = 0x00000001
wModWin = 0x00000008
wModNoRepeat = 0x00004000
wPopMenuRecurse = 0x00000001
wPopMenuTopAlign = 0x00000000
wPopMenuBottomAlign = 0x00000020
wPopMenuCenterAlign = 0x00000010
wPopMenuReturnId = 0x00000100

Procs

proc getMargin(self: wWindow): wDirection {...}{.inline, raises: [], tags: [].}
Gets the margin setting of the window. Margin is the extra space around the client area..
proc setMarginX(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the x-axis margin..
proc setMarginY(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the y-axis margin.
proc setMargin(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the window margins to the same value.
proc setMargin(self: wWindow; margin: wDirection) {...}{.inline, raises: [], tags: [].}
Sets the window margins.
proc setMarginLeft(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the left margin
proc setMarginUp(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the up margin
proc setMarginRight(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the right margin
proc setMarginDown(self: wWindow; margin: int) {...}{.inline, raises: [], tags: [].}
Sets the down margin
proc close(self: wWindow) {...}{.inline, raises: [], tags: [].}
This function simply generates a wEvent_Close whose handler usually tries to close the window.
proc delete(self: wWindow) {...}{.inline, raises: [], tags: [].}
Destroys the window.
proc destroy(self: wWindow) {...}{.inline, raises: [], tags: [].}
Destroys the window. The same as delete().
proc move(self: wWindow; x: int; y: int) {...}{.raises: [Exception], tags: [RootEffect].}
Moves the window to the given position. wDefault to indicate not to change.
proc move(self: wWindow; pos: wPoint) {...}{.inline, raises: [Exception], tags: [RootEffect].}
Moves the window to the given position. wDefault to indicate not to change.
proc setPosition(self: wWindow; pos: wPoint) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Moves the window to the specified position. The same as move(). wDefault to indicate not to change.
proc setPosition(self: wWindow; x: int; y: int) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Moves the window to the specified position. The same as move(). wDefault to indicate not to change.
proc setSize(self: wWindow; width: int; height: int) {...}{.raises: [], tags: [].}
Sets the size of the window in pixels. wDefault to indicate not to change.
proc setSize(self: wWindow; x: int; y: int; width: int; height: int) {...}{.raises: [Exception],
    tags: [RootEffect].}
Sets the size of the window in pixels. wDefault to indicate not to change.
proc setSize(self: wWindow; size: wSize) {...}{.inline, raises: [], tags: [].}
Sets the size of the window in pixels. wDefault to indicate not to change.
proc setSize(self: wWindow; point: wPoint; size: wSize) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the size of the window in pixels. wDefault to indicate not to change.
proc setSize(self: wWindow; rect: wRect) {...}{.inline, raises: [Exception],
                                      tags: [RootEffect].}
Sets the size of the window in pixels. wDefault to indicate not to change.
proc getSize(self: wWindow): wSize {...}{.inline, raises: [], tags: [].}
Returns the size of the entire window in pixels.
proc getRect(self: wWindow): wRect {...}{.raises: [Exception], tags: [RootEffect].}
Returns the position and size of the window as a wRect object.
proc getPosition(self: wWindow): wPoint {...}{.raises: [Exception], tags: [RootEffect].}
Gets the position of the window in pixels.
proc getClientMargin(self: wWindow; direction: int): int {...}{.raises: [Exception],
    tags: [RootEffect].}
Returns the client margin of the specified direction. This function basically exists for wNim's layout DSL.
proc getClientMargins(self: wWindow): tuple[left, top, right, bottom: int] {...}{.
    raises: [Exception], tags: [RootEffect].}
Returns client margin of all the direction.
proc fit(self: wWindow) {...}{.inline, raises: [Exception], tags: [RootEffect].}
Sizes the window to fit its best size.
proc suit(self: wWindow) {...}{.inline, raises: [Exception], tags: [RootEffect].}
Sizes the window to suit its default size.
proc setClientSize(self: wWindow; size: wSize) {...}{.raises: [Exception],
    tags: [RootEffect].}
This sets the size of the window client area in pixels.
proc setClientSize(self: wWindow; width: int; height: int) {...}{.raises: [Exception],
    tags: [RootEffect].}
This sets the size of the window client area in pixels.
proc contain(self: wWindow; windows: varargs[wWindow, wWindow]) {...}{.
    raises: [NilAccessError, Exception], tags: [RootEffect].}
Sizes the window to contain all the specified windows. Basically used by staticbox control.
proc setMinSize(self: wWindow; size: wSize) {...}{.raises: [], tags: [].}
Sets the minimum size of the window.
proc setMinSize(self: wWindow; x: int; y: int) {...}{.inline, raises: [], tags: [].}
Sets the minimum size of the window.
proc getMinSize(self: wWindow): wSize {...}{.inline, raises: [], tags: [].}
Returns the minimum size of the window.
proc setMaxSize(self: wWindow; size: wSize) {...}{.raises: [], tags: [].}
Sets the maximum size of the window.
proc setMaxSize(self: wWindow; x: int; y: int) {...}{.inline, raises: [], tags: [].}
Sets the maximum size of the window.
proc getMaxSize(self: wWindow): wSize {...}{.inline, raises: [], tags: [].}
Returns the maximum size of the window.
proc setMinClientSize(self: wWindow; size: wSize) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the minimum client size of the window.
proc setMinClientSize(self: wWindow; x: int; y: int) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the minimum client size of the window.
proc setMaxClientSize(self: wWindow; size: wSize) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the maximum client size of the window
proc setMaxClientSize(self: wWindow; x: int; y: int) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the maximum client size of the window
proc screenToClient(self: wWindow; pos: wPoint): wPoint {...}{.raises: [Exception],
    tags: [RootEffect].}
Converts from screen to client window coordinates.
proc clientToScreen(self: wWindow; pos: wPoint): wPoint {...}{.raises: [Exception],
    tags: [RootEffect].}
Converts to screen coordinates from coordinates relative to this window.
proc getDpi(self: wWindow): int {...}{.raises: [Exception], tags: [RootEffect].}
Returns the dpi value for the window. This function use GetDpiForWindow() api (requires win 10) to get the current dpi if possible.
proc getDpiScaleRatio(self: wWindow): float {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Returns the dpi scale ratio for the window.
proc dpiScale(self: wWindow; value: int): int {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Returns the relative value according to current dpi setting.
proc dpiScale(self: wWindow; value: float): float {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Returns the relative value according to current dpi setting.
proc getWindowStyle(self: wWindow): wStyle {...}{.raises: [], tags: [].}
Gets the wNim's window style. It simply combine of windows' style and exstyle.
proc setWindowStyle(self: wWindow; style: wStyle) {...}{.raises: [], tags: [].}
Sets the style of the window.
proc addWindowStyle(self: wWindow; style: wStyle) {...}{.inline, raises: [], tags: [].}
Add the specified style but don't change other styles.
proc clearWindowStyle(self: wWindow; style: wStyle) {...}{.inline, raises: [], tags: [].}
Clear the specified style but don't change other styles.
proc refresh(self: wWindow; eraseBackground = true) {...}{.inline, raises: [], tags: [].}
Redraws the contents of the window.
proc refresh(self: wWindow; eraseBackground = true; rect: wRect) {...}{.inline, raises: [],
    tags: [].}
Redraws the contents of the given rectangle: only the area inside it will be repainted.
proc show(self: wWindow; cmd: int) {...}{.inline, raises: [], tags: [].}
Shows the window using specified command.
proc hide(self: wWindow) {...}{.inline, raises: [], tags: [].}
Hides the window.
proc isShownOnScreen(self: wWindow): bool {...}{.inline, raises: [], tags: [].}
Returns true if the window is physically visible on the screen. i.e. it is shown and all its parents up to the toplevel window are shown as well.
proc isShown(self: wWindow): bool {...}{.inline, raises: [], tags: [].}
Returns true if the window is shown, false if it has been hidden.
proc isMouseInWindow(self: wWindow): bool {...}{.raises: [], tags: [].}
Check whether the mouse pointer is inside the window.
proc setRedraw(self: wWindow; flag = true) {...}{.inline, raises: [], tags: [].}
Allows a window to be redrawn or prevents it from being redrawn.
proc enable(self: wWindow; flag = true) {...}{.inline, raises: [], tags: [].}
Enable or disable the window for user input.
proc disable(self: wWindow) {...}{.inline, raises: [], tags: [].}
Disables the window.
proc isEnabled(self: wWindow): bool {...}{.inline, raises: [], tags: [].}
Returns true if the window is enabled.
proc setFocus(self: wWindow) {...}{.raises: [], tags: [].}
This sets the window to receive keyboard input.
proc isFocusable(self: wWindow): bool {...}{.inline, raises: [], tags: [].}
Can this window itself have focus?
proc hasFocus(self: wWindow): bool {...}{.raises: [], tags: [].}
Returns true if the window or it's child window has the focus.
proc disableFocus(self: wWindow; flag = true) {...}{.raises: [Exception], tags: [RootEffect].}
Disable (or reenable) focus to a window.
proc captureMouse(self: wWindow) {...}{.inline, raises: [], tags: [].}
Directs all mouse input to this window.
proc releaseMouse(self: wWindow) {...}{.inline, raises: [], tags: [].}
Releases mouse input captured with CaptureMouse().
proc hasCapture(self: wWindow): bool {...}{.inline, raises: [], tags: [].}
Returns true if this window has the current mouse capture.
proc getHandle(self: wWindow): HANDLE {...}{.inline, raises: [], tags: [].}
Returns the system HWND of this window.
proc getParent(self: wWindow): wWindow {...}{.inline, raises: [], tags: [].}
Returns the parent of the window.
proc getForegroundColor(self: wWindow): wColor {...}{.inline, raises: [], tags: [].}
Returns the foreground color of the window.
proc getBackgroundColor(self: wWindow): wColor {...}{.inline, raises: [], tags: [].}
Returns the background color of the window.
proc getFont(self: wWindow): wFont {...}{.inline, raises: [], tags: [].}
Returns the font for this window.
proc getStatusBar(self: wWindow): wStatusBar {...}{.inline, raises: [], tags: [].}
Returns the status bar currently associated with the window.
proc getToolBar(self: wWindow): wToolBar {...}{.inline, raises: [], tags: [].}
Returns the toolbar currently associated with the window.
proc getId(self: wWindow): wCommandID {...}{.inline, raises: [], tags: [].}
Returns the identifier of the window.
proc getTitle(self: wWindow): string {...}{.raises: [], tags: [].}
Returns the title of the window.
proc getLabel(self: wWindow): string {...}{.inline, raises: [], tags: [].}
Returns the label of the window. The same as getTitle().
proc getChildren(self: wWindow): seq[wWindow] {...}{.inline, raises: [], tags: [].}
Returns a seq of the window's children.
proc getTopParent(self: wWindow): wWindow {...}{.raises: [], tags: [].}
Returns the first top level parent of the given window.
proc getNextSibling(self: wWindow): wWindow {...}{.raises: [], tags: [].}
Returns the next window after this one among the parent's children.
proc getPrevSibling(self: wWindow): wWindow {...}{.raises: [], tags: [].}
Returns the previous window before this one among the parent's children.
proc isDescendant(self: wWindow; win: wWindow): bool {...}{.raises: [NilAccessError],
    tags: [].}
Check if the specified window is a descendant of this one.
proc isTopLevel(self: wWindow): bool {...}{.raises: [], tags: [].}
Returns true if the given window is a top-level one.
proc setParent(self: wWindow; parent: wWindow): bool {...}{.discardable,
    raises: [NilAccessError], tags: [].}
Set the window's parent, i.e. the window will be removed from its current parent window and then re-inserted into another. Warning: this is a dangerous action and some control may work incorrectly after changing the parent.
proc reparent(self: wWindow; parent: wWindow): bool {...}{.inline, discardable,
    raises: [NilAccessError], tags: [].}
Reparents the window. The same as setParent().
proc setId(self: wWindow; id: wCommandID) {...}{.inline, raises: [], tags: [].}
Sets the identifier of the window.
proc setTitle(self: wWindow; title: string) {...}{.inline, raises: [], tags: [].}
Sets the window's title.
proc setLabel(self: wWindow; label: string) {...}{.inline, raises: [], tags: [].}
Sets the window's label. The same as setTitle().
proc getData(self: wWindow): int {...}{.inline, raises: [], tags: [].}
Returns the data associated with the window.
proc setData(self: wWindow; data: int) {...}{.raises: [], tags: [].}
Sets the window associated data.
proc setTransparent(self: wWindow; alpha: range[0 .. 255]) {...}{.raises: [], tags: [].}
proc getTransparent(self: wWindow): int {...}{.raises: [], tags: [].}
Get the alpha value of a transparent window. Return -1 if failed.
proc setAcceleratorTable(self: wWindow; accel: wAcceleratorTable) {...}{.inline,
    raises: [NilAccessError], tags: [].}
Sets the accelerator table for this window.
proc getAcceleratorTable(self: wWindow): wAcceleratorTable {...}{.inline, raises: [],
    tags: [].}
Gets the accelerator table for this window.
proc setCursor(self: wWindow; cursor: wCursor) {...}{.inline, raises: [NilAccessError],
    tags: [].}
Sets the window's cursor. The cursor may be wNilCursor, in which case the window cursor will be reset. Notice that the window cursor also sets it for the children of the window implicitly. Set children's cursor to wDefaultCursor can restore the children's default cursor. For example, if you change a frame's cursor, the textctrl in the frame will uses the cursor too. To avoid it, you can set textctrl's cursor to wDefaultCursor.
proc getCursor(self: wWindow): wCursor {...}{.inline, raises: [], tags: [].}
Return the cursor associated with this window.
proc setScrollbar(self: wWindow; orientation: int; position: Natural;
                 pageSize: Positive; range: Positive) {...}{.raises: [], tags: [].}
Sets the scrollbar properties of a built-in scrollbar . Orientation should be wHorizontal or wVertical
proc showScrollBar(self: wWindow; orientation: int; flag = true) {...}{.inline, raises: [],
    tags: [].}
Shows the built-in scrollbar.
proc enableScrollBar(self: wWindow; orientation: int; flag = true) {...}{.inline, raises: [],
    tags: [].}
Enable or disable the built-in scrollbar.
proc setScrollPos(self: wWindow; orientation: int; position: int) {...}{.raises: [], tags: [].}
Sets the position of the scrollbar.
proc getScrollRange(self: wWindow; orientation: int): int {...}{.inline, raises: [], tags: [].}
Returns the built-in scrollbar range.
proc getPageSize(self: wWindow; orientation: int): int {...}{.inline, raises: [], tags: [].}
Returns the built-in scrollbar page size.
proc getScrollPos(self: wWindow; orientation: int): int {...}{.inline, raises: [], tags: [].}
Returns the built-in scrollbar position.
proc hasScrollbar(self: wWindow; orientation: int): bool {...}{.raises: [], tags: [].}
Returns true if this window currently has a scroll bar for this orientation.
proc scrollLines(self: wWindow; lines: int = 1) {...}{.raises: [], tags: [].}
Scrolls the window by the given number of lines down (if lines is positive) or up.
proc scrollPages(self: wWindow; pages: int = 1) {...}{.raises: [], tags: [].}
Scrolls the window by the given number of pages down (if pages is positive) or up.
proc center(self: wWindow; direction = wBoth) {...}{.raises: [Exception], tags: [RootEffect].}
Centers the window. direction is a bitwise combination of wHorizontal and wVertical.
proc activate(self: wWindow) {...}{.raises: [], tags: [].}
Activates the window.
proc popupMenu(self: wWindow; menu: wMenu; pos: wPoint = wDefaultPoint; flag = 0): wCommandID {...}{.
    discardable, raises: [NilAccessError, Exception], tags: [RootEffect].}
Pops up the given menu at the specified coordinates. flag is a bitlist of the following:
FlagDescription
wPopMenuRecurseDisplay a menu when another menu is already displayed.
wPopMenuTopAlignTop side of menu is aligned with the coordinate specified by the y parameter.
wPopMenuBottomAlignBottom side of menu is aligned with the coordinate specified by the y parameter.
wPopMenuCenterAlignCenters the menu vertically relative to the coordinate specified by the y parameter.
wPopMenuReturnIdNot generates wEvent_Menu event but returns the wCommandID or 0 if an error occurs.
proc popupMenu(self: wWindow; menu: wMenu; x: int; y: int; flag = 0): wCommandID {...}{.inline,
    discardable, raises: [NilAccessError, Exception], tags: [RootEffect].}
Pops up the given menu at the specified coordinates.
proc startTimer(self: wWindow; seconds: float; id = 1) {...}{.inline, raises: [], tags: [].}
Start a timer. It generates wEvent_Timer event to the window. In the event handler, use event.timerId to get the timer id.
proc stopTimer(self: wWindow; id = 1) {...}{.inline, raises: [], tags: [].}
Stop the timer.
proc registerHotKey(self: wWindow; id: int; modifiers: int; keyCode: int): bool {...}{.inline,
    discardable, raises: [], tags: [].}
Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window will receive a wEvent_HotKey event. Modifiers is a bitwise combination of wModShift, wModCtrl, wModAlt, wModWin, and wModNoRepeat (Windows 7 later).
proc registerHotKey(self: wWindow; id: int;
                   hotkey: tuple[modifiers: int, keyCode: int]): bool {...}{.inline,
    discardable, raises: [], tags: [].}
Registers a system wide hotkey.
proc unregisterHotKey(self: wWindow; id: int): bool {...}{.inline, discardable, raises: [],
    tags: [].}
Unregisters a system wide hotkey.
proc setDoubleBuffered(self: wWindow; on = true) {...}{.raises: [], tags: [].}
Turn on or off double buffering of the window.
proc getDoubleBuffered(self: wWindow): bool {...}{.raises: [], tags: [].}
Returns true if the window contents is double-buffered by the system
proc processEvent(self: wWindow; event: wEvent): bool {...}{.discardable,
    raises: [Exception], tags: [RootEffect].}
Processes an event: searching event tables and calling event handler. Returned true if a suitable event handler function was executed and it did not call wEvent.skip().
proc queueEvent(self: wWindow; event: wEvent) {...}{.inline, raises: [NilAccessError],
    tags: [].}
Queue event for a later processing.
proc queueMessage(self: wWindow; msg: UINT; wParam: wWparam; lParam: wLparam) {...}{.inline,
    raises: [], tags: [].}
Queue message for a later processing.
proc processMessage(self: wWindow; msg: UINT; wParam: wWparam = 0; lParam: wLparam = 0): bool {...}{.
    inline, discardable, raises: [Exception], tags: [RootEffect].}
Create an event object of specified message and then call processEvent() to process it. Returned true if a suitable event handler function was executed and it did not call wEvent.skip().
proc connect(self: wWindow; msg: UINT; handler: wEventProc; userData: int = 0): wEventConnection {...}{.
    discardable, raises: [], tags: [].}
Connects the given event type with the event handler defined as "proc (event: wEvent)".
proc connect(self: wWindow; msg: UINT; handler: wEventNeatProc; userData: int = 0): wEventConnection {...}{.
    discardable, raises: [], tags: [].}
Connects the given event type with the event handler defined as "proc ()".
proc connect(self: wWindow; msg: UINT; id: wCommandID; handler: wEventProc;
            userData: int = 0): wEventConnection {...}{.discardable, raises: [], tags: [].}
Connects the given event type and specified ID with the event handler defined as "proc (event: wEvent)".
proc connect(self: wWindow; msg: UINT; id: wCommandID; handler: wEventNeatProc;
            userData: int = 0): wEventConnection {...}{.discardable, raises: [], tags: [].}
Connects the given event type and specified ID with the event handler defined as "proc ()".
proc connect(self: wWindow; id: wCommandID; handler: wEventProc; userData: int = 0): wEventConnection {...}{.
    discardable, raises: [], tags: [].}
Connects the specified ID with the event handler defined as "proc (event: wEvent)".
proc connect(self: wWindow; id: wCommandID; handler: wEventNeatProc; userData: int = 0): wEventConnection {...}{.
    discardable, raises: [], tags: [].}
Connects the specified ID with the event handler defined as "proc ()".
proc disconnect(self: wWindow; msg: UINT; limit = -1) {...}{.raises: [], tags: [].}
Disconnects the given event type from the event handler.
proc disconnect(self: wWindow; msg: UINT; id: wCommandID; limit = -1) {...}{.raises: [], tags: [].}
Disconnects the given event type and specified ID from the event handler.
proc disconnect(self: wWindow; id: wCommandID; limit = -1) {...}{.raises: [], tags: [].}
Disconnects the specified ID from the event handler.
proc disconnect(self: wWindow; msg: UINT; handler: wEventProc) {...}{.raises: [Exception],
    tags: [RootEffect].}
Disconnects the specified handler proc from the event handler.
proc disconnect(self: wWindow; msg: UINT; handler: wEventNeatProc) {...}{.
    raises: [Exception], tags: [RootEffect].}
Disconnects the specified handler proc from the event handler.
proc disconnect(self: wWindow; connection: wEventConnection) {...}{.raises: [], tags: [].}
Disconnects the specified token that returned by connect().
proc `.`(self: wWindow; msg: UINT; handler: wEventProc): wEventConnection {...}{.inline,
    discardable, raises: [], tags: [].}
Symbol alias for connect.
proc `.`(self: wWindow; msg: UINT; handler: wEventNeatProc): wEventConnection {...}{.inline,
    discardable, raises: [], tags: [].}
Symbol alias for connect.
proc `.`(self: wWindow; id: wCommandID; handler: wEventProc): wEventConnection {...}{.inline,
    discardable, raises: [], tags: [].}
Symbol alias for connect.
proc `.`(self: wWindow; id: wCommandID; handler: wEventNeatProc): wEventConnection {...}{.
    inline, discardable, raises: [], tags: [].}
Symbol alias for connect.
proc setDraggable(self: wWindow; flag = true; inClient = true) {...}{.
    raises: [Exception, wCursorError], tags: [RootEffect].}
Allow a window to be moved by dragging. If the window is a top-level window, this means to allow dragging by it's client area. In this case, inClient is ignored, and no wEvent_Dragging event will be triggered. Otherwise, When a child window is dragging by user, it receive wEvent_Dragging event. If inClient is true, the window is limited to move inside client area of it's parent.
proc setSizingBorder(self: wWindow; direction: wDirection) {...}{.
    raises: [Exception, wCursorError], tags: [RootEffect].}
Allow a child window to be changed size using the mouse. When a window is sizing by user, it receive wEvent_Sizing event.
proc setDropTarget(self: wWindow; flag = true) {...}{.raises: [], tags: [].}
Register the window as a drop target, or revoke it. The window will recieve wDragDropEvent during a drag-and-drop operation.
proc getToolTip(self: wWindow): string {...}{.raises: [], tags: [].}
Get the text of the associated tooltip or empty string if none.
proc setToolTip(self: wWindow; tip: string) {...}{.raises: [], tags: [].}
Attach a tooltip to the window.
proc unsetToolTip(self: wWindow) {...}{.inline, raises: [], tags: [].}
Unset any existing tooltip.
proc setToolTip(self: wWindow; maxWidth = wDefault; autoPop = wDefault; delay = wDefault;
               reshow = wDefault) {...}{.raises: [], tags: [].}
Sets the parameters of the associated tooltip. -1 to restore the default.
proc setShape(self: wWindow; region: wRegion) {...}{.raises: [], tags: [].}
Set the shape of the window to the given region. Nil to clear it.
proc final(self: wWindow) {...}{.raises: [], tags: [].}
Default finalizer for wWindow.
proc init(self: wWindow; hWnd: HWND) {...}{.raises: [Exception, wCursorError, IndexError,
    wFontError], tags: [RootEffect].}
Initializes a wWindow by subclassing the hWnd.
proc Window(hWnd: HWND): wWindow {...}{.inline, discardable, raises: [Exception,
    wCursorError, IndexError, wFontError], tags: [RootEffect].}
Constructor.
proc init(self: wWindow; parent: wWindow = nil; id: wCommandID = 0; pos = wDefaultPoint;
         size = wDefaultSize; style: wStyle = 0; className = "wWindow") {...}{.inline, raises: [
    Exception, wCursorError, wBrushError, wError, IndexError, wFontError,
    NilAccessError], tags: [RootEffect].}
Initializes a window.
proc Window(parent: wWindow = nil; id: wCommandID = 0; pos = wDefaultPoint;
           size = wDefaultSize; style: wStyle = 0; className = "wWindow"): wWindow {...}{.
    inline, discardable, raises: [Exception, wCursorError, wBrushError, wError,
                               IndexError, wFontError, NilAccessError],
    tags: [RootEffect].}
Constructor.

Methods

method getClientSize(self: wWindow): wSize {...}{.locks: "unknown", raises: [Exception],
    tags: [RootEffect].}
Returns the size of the window 'client area' in pixels.
method getClientAreaOrigin(self: wWindow): wPoint {...}{.base, locks: "unknown",
    raises: [Exception], tags: [RootEffect].}
Gets the origin of the client area of the window relative to the window top left corner (the client area may be shifted because of the borders, scrollbars, other decorations...).
method getDefaultSize(self: wWindow): wSize {...}{.base, inline, locks: "unknown",
    raises: [Exception], tags: [RootEffect].}
Returns the system suggested size of a window (usually used for GUI controls).
method getBestSize(self: wWindow): wSize {...}{.base, locks: "unknown", raises: [Exception],
                                       tags: [RootEffect].}
Returns the best acceptable minimal size for the window (usually used for GUI controls).
method show(self: wWindow; flag = true) {...}{.base, inline, locks: "unknown", raises: [],
                                    tags: [].}
Shows or hides the window.
method setForegroundColor(self: wWindow; color: wColor) {...}{.base, inline, raises: [],
    tags: [].}
Sets the foreground color of the window.
method setBackgroundColor(self: wWindow; color: wColor) {...}{.base,
    raises: [Exception, wBrushError], tags: [RootEffect].}
Sets the background color of the window, -1 means transparent.
method setFont(self: wWindow; font: wFont) {...}{.base, locks: "unknown",
                                        raises: [NilAccessError], tags: [].}
Sets the font for this window.

Iterators

iterator children(self: wWindow): wWindow {...}{.raises: [], tags: [].}
Iterates over each window's child.
iterator siblings(self: wWindow): wWindow {...}{.raises: [], tags: [].}
Iterates over each window's sibling.

Macros

macro dpiAutoScale(self: wWindow; body: untyped): untyped
A macro to convert all int literal and float literal by dpiScale(). For example:
frame.dpiAutoScale:
  frame.minSize = (300, 200)
  frame.size = (350, 200)