Number counter box.
Types
CounterObj = object of ControlRef as_int*: bool ## if true, then use integer representation. min_value*, value*, max_value*: float label*: LabelRef
CounterRef = ref CounterObj
Procs
proc Counter(name: string = "Counter"): CounterRef {...}{. raises: [GLerror, Exception], tags: [RootEffect].}
-
Creates a new Counter.
Arguments:
- name is a node name.
Example:
var c = Counter("Counter")
Methods
method changeValue(self: CounterRef; value: float) {...}{.base, raises: [], tags: [].}
- Changes value, if it more than min_value and less than max_value.
method draw(self: CounterRef; w, h: GLfloat) {...}{. raises: [GLerror, ResourceError, Exception], tags: [RootEffect].}
- This uses in the window.nim.
method duplicate(self: CounterRef): CounterRef {...}{.base, raises: [], tags: [].}
- Duplicates Counter object and create a new Counter.
method handle(self: CounterRef; event: InputEvent; mouse_on: var NodeRef) {...}{. raises: [Exception, GLerror], tags: [RootEffect].}
method setMaxValue(self: CounterRef; value: float) {...}{.base, raises: [], tags: [].}
-
Changes max value, if it more then current value.
See also:
method setMinValue(self: CounterRef; value: float) {...}{.base, raises: [], tags: [].}
-
Changes max value, if it less then current value.
See also: