The UIControlledIncrementalValue is a kind of Model that have special feature such as a value that can be incremented or decremented. This value runs between a min_value and a max_value.
More...
#include <ui_core.h>
|
|
int | value |
| | The internal value incremented or decremented by action on the controller.
|
| |
|
int | max_value |
| | The maximum value that can be reached. Can be either negative or positive.
|
| |
|
int | min_value |
| | The minimum value that can be reached. Can be either negative or positive.
|
| |
|
int | increment |
| | The number that is added or substracted to the current value. Default to 1.
|
| |
|
bool | is_wrappable |
| | If true, once the max (resp. min) value is reached, the next one wraps to min (resp*; max) value. If false values are clipped on min and max values.
|
| |
| std::set< Widget * > | attached_widgets |
| | the set of widgets that are in charge of viewing this model.
|
| |
The UIControlledIncrementalValue is a kind of Model that have special feature such as a value that can be incremented or decremented. This value runs between a min_value and a max_value.
The increment value is configurable. A is_wrappable flag indicates how the value behaves once min or max values are reached.
◆ UIControlledIncrementalValue()
| UIControlledIncrementalValue::UIControlledIncrementalValue |
( |
int | min_value = 0, |
|
|
int | max_value = 10, |
|
|
bool | is_wrappable = false, |
|
|
int | increment = 1 ) |
Construct a new UIControlledIncrementalValue object.
- Parameters
-
| min_value | The minimum value that can be reached. Can be either negative or positive. |
| max_value | The maximum value that can be reached. Can be either negative or positive. |
| is_wrappable | If true, once the max (resp. min) value is reached, the next one wraps to min (resp*; max) value. If false values are clipped on min and max values. |
| increment | The number that is added or substracted to the current value. Default to 1. |
◆ decrement_value()
| bool UIControlledIncrementalValue::decrement_value |
( |
| ) |
|
|
virtual |
Substract "increment" to the current value.
- Returns
- true if the value was changed
◆ get_max_value()
| int UIControlledIncrementalValue::get_max_value |
( |
| ) |
|
Get the max value object.
- Returns
- int
◆ get_min_value()
| int UIControlledIncrementalValue::get_min_value |
( |
| ) |
|
Get the min value object.
- Returns
- int
◆ get_value()
| int UIControlledIncrementalValue::get_value |
( |
| ) |
|
Get the value object.
- Returns
- int
◆ increment_value()
| bool UIControlledIncrementalValue::increment_value |
( |
| ) |
|
|
virtual |
Add "increment" to the current value.
- Returns
- true if the value was changed
◆ set_clipped_value()
| bool UIControlledIncrementalValue::set_clipped_value |
( |
int | _new_value | ) |
|
Set value to _new_value, and clip the result to min or max value if needed.
- Parameters
-
- Returns
- true if the value was changed
The documentation for this class was generated from the following files: