Tizen Native API
5.5
|
A spinner is a widget which allows the user to increase or decrease numeric values using arrow buttons, or edit values directly, clicking over it and typing the new value.
By default the spinner will not wrap and has a label of "%.0f" (just showing the integer value of the double).
A spinner has a label that is formatted with floating point values and thus accepts a printf-style format string, like “%1.2f units”.
It also allows specific values to be replaced by pre-defined labels.
This widget inherits from the Layout one, so that all the functions acting on it also work for spinner objects.
This widget emits the following signals, besides the ones sent from Layout:
"changed"
- Whenever the spinner value is changed."delay,changed"
- A short time after the value is changed by the user. This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, so it avoids possibly expensive reactions to the value change."language,changed"
- the program's language changed"focused"
- When the spinner has received focus. (since 1.8)"unfocused"
- When the spinner has lost focus. (since 1.8)"spinner,drag,start"
- When dragging has started. (since 1.8)"spinner,drag,stop"
- When dragging has stopped. (since 1.8)Available styles for it:
"default"
;"vertical"
: up/down buttons at the right side and text left aligned.Supported elm_object common APIs.
Here is an example on its usage: Spinner widget example
Functions | |
Evas_Object * | elm_spinner_add (Evas_Object *parent) |
void | elm_spinner_special_value_del (Evas_Object *obj, double value) |
const char * | elm_spinner_special_value_get (Evas_Object *obj, double value) |
void | elm_spinner_min_max_set (Evas_Object *obj, double min, double max) |
Control the minimum and maximum values for the spinner. | |
void | elm_spinner_min_max_get (const Evas_Object *obj, double *min, double *max) |
Control the minimum and maximum values for the spinner. | |
void | elm_spinner_step_set (Evas_Object *obj, double step) |
Control the step used to increment or decrement the spinner value. | |
double | elm_spinner_step_get (const Evas_Object *obj) |
Control the step used to increment or decrement the spinner value. | |
void | elm_spinner_value_set (Evas_Object *obj, double val) |
Control the value the spinner displays. | |
double | elm_spinner_value_get (const Evas_Object *obj) |
Control the value the spinner displays. |
Evas_Object* elm_spinner_add | ( | Evas_Object * | parent | ) |
Add a new spinner widget to the given parent Elementary (container) object.
parent | The parent object. |
NULL
, on errors.This function inserts a new spinner widget on the canvas.
void elm_spinner_min_max_get | ( | const Evas_Object * | obj, |
double * | min, | ||
double * | max | ||
) |
Control the minimum and maximum values for the spinner.
Define the allowed range of values to be selected by the user.
If actual value is less than min
, it will be updated to min
. If it is bigger then max
, will be updated to max
. Actual value can be get with elm_obj_spinner_value_get.
By default, min is equal to 0, and max is equal to 100.
[out] | min | The minimum value. |
[out] | max | The maximum value. |
void elm_spinner_min_max_set | ( | Evas_Object * | obj, |
double | min, | ||
double | max | ||
) |
Control the minimum and maximum values for the spinner.
Define the allowed range of values to be selected by the user.
If actual value is less than min
, it will be updated to min
. If it is bigger then max
, will be updated to max
. Actual value can be get with elm_obj_spinner_value_get.
By default, min is equal to 0, and max is equal to 100.
[in] | min | The minimum value. |
[in] | max | The maximum value. |
void elm_spinner_special_value_del | ( | Evas_Object * | obj, |
double | value | ||
) |
Delete the special string display in the place of the numerical value.
obj | The spinner object. |
value | The replaced value. |
It will remove a previously added special value. After this, the spinner will display the value itself instead of a label.
const char* elm_spinner_special_value_get | ( | Evas_Object * | obj, |
double | value | ||
) |
Get the special string display in the place of the numerical value.
obj | The spinner object. |
value | The replaced value. |
double elm_spinner_step_get | ( | const Evas_Object * | obj | ) |
Control the step used to increment or decrement the spinner value.
This value will be incremented or decremented to the displayed value. It will be incremented while the user keep right or top arrow pressed, and will be decremented while the user keep left or bottom arrow pressed.
The interval to increment / decrement can be set with elm_obj_spinner_interval_set.
By default step value is equal to 1.
void elm_spinner_step_set | ( | Evas_Object * | obj, |
double | step | ||
) |
Control the step used to increment or decrement the spinner value.
This value will be incremented or decremented to the displayed value. It will be incremented while the user keep right or top arrow pressed, and will be decremented while the user keep left or bottom arrow pressed.
The interval to increment / decrement can be set with elm_obj_spinner_interval_set.
By default step value is equal to 1.
[in] | step | The step value. |
double elm_spinner_value_get | ( | const Evas_Object * | obj | ) |
Control the value the spinner displays.
Value will be presented on the label following format specified with elm_spinner_format_set().
Warning The value must to be between min and max values. This values are set by elm_spinner_min_max_set().
void elm_spinner_value_set | ( | Evas_Object * | obj, |
double | val | ||
) |
Control the value the spinner displays.
Value will be presented on the label following format specified with elm_spinner_format_set().
Warning The value must to be between min and max values. This values are set by elm_spinner_min_max_set().
[in] | val | The value to be displayed. |