wControl

This is the base class for a GUI controls.

Superclass:wWindow
Subclasses:wStatusBar wToolBar wButton wCheckBox wRadioButton wStaticBox wListBox wTextCtrl wComboBox wCheckComboBox wStaticText wStaticBitmap wStaticLine wNoteBook wSpinCtrl wSpinButton wSlider wScrollBar wGauge wCalendarCtrl wDatePickerCtrl wTimePickerCtrl wListCtrl wTreeCtrl wHyperlinkCtrl wSplitter wIpCtrl wWebView wHotkeyCtrl wRebar wMenuBarCtrl

Procs

proc setBuddy(self: wControl; buddy: wControl; direction: int = wRight;
             length = wDefault; indent = 0) {...}{.raises: [Exception, wError],
                                        tags: [RootEffect].}

Sets a control as the buddy to this control. The buddy control will be attached to the border specified by direction (wUp, wDown, wLeft, wRight), and occupies part of non-client area in length. buddy can be nil to cancel the relationship. Notice: buddy control should be a sibling, not a child.

For example, a text control with a "Browse" button as a buddy:

let textctrl = TextCtrl(panel, style=wBorderSunken, pos=(10, 10))
let button = Button(panel, label="...")
textctrl.setBuddy(button, wRight, length=25)
proc init(self: wControl; className: string; parent: wWindow; id: wCommandID = -1;
         label: string = ""; pos = wDefaultPoint; size = wDefaultSize; style: wStyle = 0) {...}{.raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError], tags: [RootEffect].}
Initializes a GUI control by given window class name. Only useful to implement a custom wNim GUI control.
proc Control(className: string; parent: wWindow; id: wCommandID = -1; label: string = "";
            pos = wDefaultPoint; size = wDefaultSize; style: wStyle = 0): wControl {...}{.
    inline, discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                               Exception, IndexDefect, wFontError],
    tags: [RootEffect].}
Constructor.

Methods

method getClientSize(self: wControl): wSize {...}{.raises: [], tags: [].}
Returns the size of the control 'client area' in pixels.
method getClientAreaOrigin(self: wControl): wPoint {...}{.raises: [], tags: [].}
Gets the origin of the client area of the control.
method release(self: wControl) {...}{.raises: [], tags: [].}
Release all the resources during destroying. Used internally.