# nodesnim/nodescontrol/vslider

Dark Mode

Search:
Group by:

It provides a primitive vertical slider.

# Imports

../thirdparty/opengl, ../core/vector2, ../core/rect2, ../core/anchor, ../core/input, ../core/color, ../core/enums, ../nodes/node, control

# Types

    VSliderObj = object of ControlRef
      max_value*, value*: uint
      progress_color*: ColorRef
      thumb_color*: ColorRef
      on_changed*: proc (self: VSliderRef; new_value: uint): void

    VSliderRef = ref VSliderObj

# Procs

    proc VSlider(name: string = "VSlider"): VSliderRef {...}{.raises: [], tags: [].}

  Creates a new VSlider.

  Arguments:

  - `name` is a node name.

  Examples:

      var slider = VSlider("VSlider")

# Methods

    method draw(self: VSliderRef; w, h: GLfloat) {...}{.raises: [GLerror, Exception],
        tags: [RootEffect].}

  This uses in the `window.nim`.

    method duplicate(self: VSliderRef): VSliderRef {...}{.base, raises: [], tags: [].}

  Duplicates VSlider object and create a new VSlider.

    method setMaxValue(self: VSliderRef; value: uint) {...}{.base, raises: [], tags: [].}

  Changes max value, if it not less than progress.

    method setProgress(self: VSliderRef; value: uint) {...}{.base, raises: [], tags: [].}

  Changes progress, if it not more than max value.

    method setProgressColor(self: VSliderRef; color: ColorRef) {...}{.base, raises: [], tags: [].}

  Changes progress color. For change background color use `setBackgroundColor` method.

    method handle(self: VSliderRef; event: InputEvent; mouse_on: var NodeRef) {...}{.
        raises: [Exception], tags: [RootEffect].}

  handles user input. This uses in the `window.nim`.