wSlider

A slider is a control with a handle which can be pulled back and forth to change the value.

Appearance:
Superclass:wControl
Styles:
StylesDescription
wSlHorizontalDisplays the slider horizontally (this is the default).
wSlVerticalDisplays the slider vertically.
wSlAutoTicksDisplays tick marks.
wSlLeftDisplays ticks on the left and forces the slider to be vertical.
wSlRightDisplays ticks on the right and forces the slider to be vertical.
wSlTopDisplays ticks on the top.
wSlBottomDisplays ticks on the bottom
wSlSelRangeAllows the user to select a range on the slider.
wSlNoTicksDoes not display any tick marks.
wSlNoThumbDoes not display a thumb.
Events:wScrollEvent

Consts

wSlHorizontal = 0x00000000
wSlVertical = 0x00000002
wSlAutoTicks = 0x00000001
wSlLeft = 6
wSlRight = 2
wSlTop = 4
wSlBottom = 0
wSlSelRange = 0x00000020
wSlNoTicks = 0x00000010
wSlNoThumb = 0x00000080

Procs

proc isVertical(self: wSlider): bool {...}{.inline, raises: [], tags: [].}
Returns true for slider that have the vertical style set.
proc getValue(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Gets the current slider value.
proc setValue(self: wSlider; value: int) {...}{.inline, raises: [], tags: [].}
Sets the slider position.
proc setRange(self: wSlider; range: Slice[int]) {...}{.raises: [], tags: [].}
Sets the minimum and maximum slider values.
proc setMin(self: wSlider; min: int) {...}{.inline, raises: [], tags: [].}
Sets the minimum slider value.
proc setMax(self: wSlider; max: int) {...}{.inline, raises: [], tags: [].}
Sets the maximum slider value.
proc setRange(self: wSlider; min: int; max: int) {...}{.inline, raises: [], tags: [].}
Sets the minimum and maximum slider value.
proc getMax(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Gets the maximum slider value.
proc getMin(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Gets the minimum slider value.
proc getPageSize(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Returns the page size.
proc setPageSize(self: wSlider; pageSize: int) {...}{.inline, raises: [], tags: [].}
Sets the page size for the slider.
proc getLineSize(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Returns the line size.
proc setLineSize(self: wSlider; lineSize: int) {...}{.inline, raises: [], tags: [].}
Sets the line size for the slider.
proc getThumbLength(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Sets the slider thumb length.
proc setThumbLength(self: wSlider; length: int) {...}{.inline, raises: [], tags: [].}
Sets the slider thumb length.
proc getSelEnd(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Returns the selection end point.
proc getSelStart(self: wSlider): int {...}{.inline, raises: [], tags: [].}
Returns the selection start point.
proc getSelection(self: wSlider): Slice[int] {...}{.inline, raises: [], tags: [].}
Returns the selection start and end point.
proc setSelection(self: wSlider; min: int; max: int) {...}{.inline, raises: [], tags: [].}
Sets the selection.
proc setSelection(self: wSlider; range: Slice[int]) {...}{.inline, raises: [], tags: [].}
Sets the selection.
proc setTickFreq(self: wSlider; n: int) {...}{.inline, raises: [], tags: [].}
Sets the tick mark frequency and position, for a slider with the wSlAutoTicks style.
proc setTick(self: wSlider; tick: int) {...}{.inline, raises: [], tags: [].}
Sets a tick position.
proc setTicks(self: wSlider; ticks: openArray[int]) {...}{.inline, raises: [], tags: [].}
Sets mulpitle ticks at the same time.
proc clearSel(self: wSlider) {...}{.inline, raises: [], tags: [].}
Clears the selection, for a slider with the wSlSelRange style.
proc clearTicks(self: wSlider) {...}{.inline, raises: [], tags: [].}
Clears the ticks.
proc init(self: wSlider; parent: wWindow; id = wDefaultID; value = 0;
         range: Slice[int] = 0 .. 100; pos = wDefaultPoint; size = wDefaultSize;
         style: wStyle = wSlHorizontal) {...}{.raises: [wNilAccess, wWindowError,
    wCursorError, wBrushError, Exception, IndexDefect, wFontError],
                                      tags: [RootEffect].}
Initializes a slider.
proc Slider(parent: wWindow; id = wDefaultID; value = 0; range: Slice[int] = 0 .. 100;
           pos = wDefaultPoint; size = wDefaultSize; style: wStyle = wSlHorizontal): wSlider {...}{.
    inline, discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                               Exception, IndexDefect, wFontError],
    tags: [RootEffect].}
Constructor.

Methods

method getDefaultSize(self: wSlider): wSize {...}{.raises: [], tags: [].}
Returns the default size for the control.
method getBestSize(self: wSlider): wSize {...}{.inline, raises: [], tags: [].}
Returns the best acceptable minimal size for the control.
method release(self: wSlider) {...}{.raises: [], tags: [RootEffect].}
Release all the resources during destroying. Used internally.