Number counter box.
Types
CounterObj = object of ControlPtr as_int*: bool ## if true, then use integer representation. min_value*, value*, max_value*: float label*: LabelPtr label_obj*: LabelObj
CounterPtr = ptr CounterObj
Procs
proc Counter(name: string; variable: var CounterObj): CounterPtr {...}{.raises: [], tags: [].}
-
Creates a new Counter pointer.
Arguments:
- name is a node name.
- variable is a CounterObj variable.
Examples:
var cobj: CounterObj c = Counter("Counter", cobj)
proc Counter(obj: var CounterObj): CounterPtr {...}{.inline, raises: [], tags: [].}
-
Creates a new Counterpointer with default node name "Counter".
Arguments:
- variable is a CounterObj variable.
Examples:
var cobj: CounterObj c = Counter(cobj)
Methods
method changeValue(self: CounterPtr; value: float) {...}{.base, raises: [], tags: [].}
- Changes value, if it more than min_value and less than max_value.
method draw(self: CounterPtr; w, h: GLfloat) {...}{.raises: [GLerror, Exception], tags: [RootEffect].}
- This uses in the window.nim.
method duplicate(self: CounterPtr; obj: var CounterObj): CounterPtr {...}{.base, raises: [], tags: [].}
- Duplicates Counter object and create a new Counter pointer.
method handle(self: CounterPtr; event: InputEvent; mouse_on: var NodePtr) {...}{. raises: [Exception], tags: [RootEffect].}
method setMaxValue(self: CounterPtr; value: float) {...}{.base, raises: [], tags: [].}
- Changes max value, if it more then current value.
method setMinValue(self: CounterPtr; value: float) {...}{.base, raises: [], tags: [].}
- Changes max value, if it less then current value.