A model that holds an integer value that can be incremented or decremented within a defined range.
More...
#include <rtos_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.
|
| |
A model that holds an integer value that can be incremented or decremented within a defined range.
◆ core_IncrementControlledModel()
| core_IncrementControlledModel::core_IncrementControlledModel |
( |
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 core_IncrementControlledModel::decrement_value |
( |
| ) |
|
|
virtual |
Decrement the current value by the increment amount.
- Returns
- true if value changed, false if clipped and no change
◆ get_max_value()
| int core_IncrementControlledModel::get_max_value |
( |
| ) |
|
Get the max value object.
- Returns
- int
◆ get_min_value()
| int core_IncrementControlledModel::get_min_value |
( |
| ) |
|
Get the min value object.
- Returns
- int
◆ get_value()
| int core_IncrementControlledModel::get_value |
( |
| ) |
|
Get the current value.
- Returns
- The current value
◆ increment_value()
| bool core_IncrementControlledModel::increment_value |
( |
| ) |
|
|
virtual |
Increment the current value by the increment amount.
- Returns
- true if value changed, false if clipped and no change
◆ set_clipped_value()
| bool core_IncrementControlledModel::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 value changed, false if clipped and no change
The documentation for this class was generated from the following files: