C++ DevKit
C++ set of OOP library
|
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>
Public Member Functions | |
UIControlledIncrementalValue (int min_value=0, int max_value=10, bool is_wrappable=false, int increment=1) | |
Construct a new UIControlledIncrementalValue object. | |
~UIControlledIncrementalValue () | |
Destroy the UIControlledIncrementalValue object. | |
virtual void | increment_value () |
Add "increment" to the current value. | |
virtual void | decrement_value () |
Substract "increment" to the current value. | |
void | set_clipped_value (int _new_value) |
Set value to _new_value, and clip the result to min or max value if needed. | |
int | get_value () |
Get the value object. | |
int | get_min_value () |
Get the min value object. | |
int | get_max_value () |
Get the max value object. | |
![]() | |
void | update_status (ControlledObjectStatus _new_status) |
check if the _new_status change is effective, then change it and set the change_flag to true. | |
void | update_current_controller (UIController *_new_controller) |
if _new_controller is different from the current controller, change the current controller associated to the Model. the new controller has is member current_controlled_model also changed. | |
ControlledObjectStatus | get_status () |
Get the status object. | |
UIController * | get_current_controller () |
Get the current controller object. | |
virtual void | process_control_event (UIControlEvent _event)=0 |
The purpose of this function is to implement the behavior of the implemented model object when a ControlEvent is received. | |
![]() | |
Model () | |
Construct the Model object. | |
~Model () | |
Destroy the Model object. | |
void | update_attached_widgets (Widget *new_widget) |
add a new widget to the set of attached_widgets | |
int | get_number_of_attached_widget () |
get the number of attached widgets | |
bool | has_changed () |
get the change flag status | |
void | set_change_flag () |
Set the change flag object to true. | |
void | draw_widget_done () |
Set the change flag object to false. | |
uint32_t | get_time_since_last_change () |
compute time since the last status change | |
virtual void | draw_refresh_all_attached_widgets () |
update drawing for each attached widgets | |
Protected Attributes | |
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 | ( | int | min_value = 0, |
int | max_value = 10, | ||
bool | is_wrappable = false, | ||
int | increment = 1 ) |
Construct a new UIControlledIncrementalValue object.
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. |
int UIControlledIncrementalValue::get_max_value | ( | ) |
Get the max value object.
int UIControlledIncrementalValue::get_min_value | ( | ) |
Get the min value object.
int UIControlledIncrementalValue::get_value | ( | ) |
Get the value object.
void UIControlledIncrementalValue::set_clipped_value | ( | int | _new_value | ) |
Set value to _new_value, and clip the result to min or max value if needed.
_new_value |