Progressbar
This feature is supported in wearable applications only.
The progressbar component is used to display the progress status of a given job. It inherits from the layout component, so all function concerning the layout component is used on the progressbar component.
Figure: Progressbar component
Figure: Progressbar hierarchy
Adding a Progressbar Component
The following example shows how to create a progressbar component.
Evas_Object *pb = elm_progressbar_add(win);
Using the Progressbar Styles
The progressbar has several styles for the rectangular UI component:
- default
- pending_list
- process
- process/groupindex
- process/popup/small
The progressbar has several styles for the circular UI component:
- process
- process/small
Set the style of the progressbar to pending_list.
elm_object_style_set(pb, "pending_list");
Configuring the Progressbar for Rectangular UI Components
The progressbar pulse mode is activated to make the progressbar loop infinitely between the start and end position.
elm_progressbar_pulse_set(pb, EINA_TRUE); elm_progressbar_pulse(pb, EINA_TRUE);
The progressbar can be inverted. In that mode, the values are inverted so that the high values are on the left and the low values on the right.
elm_progressbar_inverted_set(pb, EINA_TRUE);
The progressbar emits the changed signal when the progress value changes. The value is changed with the elm_progressbar_value_set() function. Here the pb progress value is set to 20%.
elm_progressbar_value_set(pb, 0.2);
It is possible to read the current value.
double value = elm_progressbar_value_get(pb);
Configuring the Progressbar for Circular UI Components
The progressbar emits the changed signal when the progress value changes. The value is changed with the elm_progressbar_value_set() function. Here the pb progress value is set to 20%.
elm_progressbar_value_set(pb, 0.2);
The current value can be read.
double value = elm_progressbar_value_get(pb);
Using the Progressbar Callbacks
The changed signal is the only signal specifically emitted by the progressbar component.
The following example shows how to register a callback on this signal.
{ evas_object_smart_callback_add(pb, "changed", changed_cb, data); } // Callback function for the "changed" signal // This callback is called when the progressbar value changes void changed_cb(void *data, Evas_Object *obj, void *event_info) { dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n"); }