wIpCtrl

A IP control allows the user to enter an IP (v4) address in an easily understood format. Because of the limitation of Windows native control, IP control cannot change size after creation.

Notice: a IP control may recieve events propagated from its child text control. (wEvent_Text, wEvent_TextUpdate, wEvent_TextMaxlen etc.) In these case, event.window should be the child text control, not IP control itself.

Appearance:
Superclass:wControl
Events:wIpEvent wCommandEvent
wIpEventDescription
wEvent_IpChangedWhen the user changes a field or moves from one field to another.
wCommandEventDescription
wEvent_TextWhen the text changes.
wEvent_TextUpdateWhen the control is about to redraw itself.
wEvent_TextMaxlenWhen the user tries to enter more text into the control than the limit.
wEvent_TextEnterWhen pressing Enter key.

Procs

proc setFocus(self: wIpCtrl; index: range[0 .. 3]) {...}{.raises: [], tags: [].}
Sets the focus to specified field.
proc setValue(self: wIpCtrl; value: int) {...}{.raises: [], tags: [].}
Sets the address values for all four fields in the IP address control.
proc getValue(self: wIpCtrl): int {...}{.raises: [], tags: [].}
Gets the address values for all four fields in the IP address control.
proc setIpAddress(self: wIpCtrl; ipAddress: IpAddress) {...}{.raises: [], tags: [].}
Sets the address object for all four fields in the IP address control.
proc getIpAddress(self: wIpCtrl): IpAddress {...}{.raises: [], tags: [].}
Gets the address object for all four fields in the IP address control.
proc setText(self: wIpCtrl; text: string) {...}{.raises: [ValueError], tags: [].}
Sets the address text for all four fields in the IP address control.
proc getText(self: wIpCtrl): string {...}{.raises: [], tags: [].}
Gets the address text for all four fields in the IP address control.
proc clear(self: wIpCtrl) {...}{.raises: [], tags: [].}
Clears the contents of the IP address control.
proc getEditControl(self: wIpCtrl; index: range[0 .. 3]): wTextCtrl {...}{.inline, raises: [],
    tags: [].}
Returns the text control part of the specified field.
proc getTextCtrl(self: wIpCtrl; index: range[0 .. 3]): wTextCtrl {...}{.inline, raises: [],
    tags: [].}
Returns the text control part of the specified field. The same as getEditControl().
proc init(self: wIpCtrl; parent: wWindow; id = wDefaultID; value: int = 0;
         pos = wDefaultPoint; size = wDefaultSize; font: wFont = nil; style: wStyle = 0) {...}{.raises: [
    wNilAccess, IndexDefect, wFontError, wWindowError, wCursorError, wBrushError,
    Exception, wError], tags: [RootEffect].}
Initializes a ip control.
proc IpCtrl(parent: wWindow; id = wDefaultID; value: int = 0; pos = wDefaultPoint;
           size = wDefaultSize; font: wFont = nil; style: wStyle = 0): wIpCtrl {...}{.inline,
    discardable, raises: [wNilAccess, IndexDefect, wFontError, wWindowError,
                        wCursorError, wBrushError, Exception, wError],
    tags: [RootEffect].}
Constructor.

Methods

method release(self: wIpCtrl) {...}{.raises: [], tags: [].}
Release all the resources during destroying. Used internally.