Wearable native

Circle Spinner

This feature is supported in wearable applications only.

The circle spinner extends elm_spinner by visualizing the value of elm_spinner. If a rotary event is activated by the eext_rotary_object_event_activated_set() function, the circle spinner increases or decreases the value of elm_spinner through a clockwise or counter-clockwise rotary event.

Figure: Circle Spinner

Circle Spinner

Adding an Eext Spinner Object

To create a circle spinner:

  1. Create an elm_spinner object.
  2. Set the object style as "circle".
  3. Create an eext_spinner object using the eext_circle_object_spinner_add() function.
Evas_Object *spinner, *circle_spinner;
spinner = elm_spinner_add(parent);
elm_object_style_set(spinner, "circle");
circle_spinner = eext_circle_object_spinner_add(spinner, surface);

Activating a Rotary Event

You can activate and deactivate the circle spinner by using the eext_rotary_object_event_activated_set() function. If its second parameter is set to EINA_TRUE, the circle spinner can receive rotary events.

eext_rotary_object_event_activated_set(circle_spinner, EINA_TRUE);

Configuring the Circle Spinner

The circle spinner shows the elm_spinner value through a marker, which indicates the value in the round. It has internal minimum and maximum spinner values, and calculates the min and max angles in order to draw the marker. The current value of the circle spinner is calculated internally as well.

To handle the circle spinner value, use the elm_spinner functions. They are synchronized automatically with the user values. You can also use the elm_spinner callback functions.

If you want to customize the angle offset of the marker (not to follow the internally-calculated system value), use the eext_circle_object_spinner_angle_set() function. For example, to set the circle spinner angle value with 2.0:

eext_circle_object_spinner_angle_set(circle_spinner, 2.0);

The formula for calculating the default angle offset of the circle spinner is:

(360/ max - min) * step

After calling the eext_circle_object_spinner_angle_set() function, the calculation formula for the angle offset is changed:

(360/ max - min) * step * 2.0

You can also use the same above function to give the angle offset per each rotary callback.

Using the Circle Spinner Properties

A circle spinner has the default style, which is applied automatically. It also has a default item, which draws a marker.

You can set and get various circle spinner properties with circle object functions, such as eext_circle_object_value_min_max_set(), eext_circle_object_value_min_max_get(), eext_circle_object_value_set(), and eext_circle_object_value_get().

Go to top