1 #include <Elementary.h>
6 * @defgroup Spinner Spinner
9 * A spinner is a widget which allows the user to increase or decrease
10 * numeric values. By default the spinner will not wrap and has a label
11 * of "%.0f" (just showing the integer value of the double).
13 * A spinner has a label that is formatted with floating
14 * point values and thus accepts a printf-style format string, like
17 * Signals that you can add callbacks for are:
19 * changed - Whenever the spinner value is changed by the user.
21 * delay,changed - A short time after the value is changed by the user.
22 * This will be called only when the user stops dragging for a very short
23 * period or when they release their finger/mouse, so it avoids possibly
24 * expensive reactions to the value change.
26 typedef struct _Widget_Data Widget_Data;
27 typedef struct _Elm_Spinner_Special_Value Elm_Spinner_Special_Value;
31 Evas_Object *spinner, *ent;
33 double val, val_min, val_max, orig_val, step;
34 double drag_start_pos, spin_speed, interval, first_interval;
35 Ecore_Timer *delay, *spin;
36 Eina_List *special_values;
38 Eina_Bool entry_visible : 1;
39 Eina_Bool dragging : 1;
40 Eina_Bool editable : 1;
43 struct _Elm_Spinner_Special_Value
49 static const char *widtype = NULL;
50 static void _del_hook(Evas_Object *obj);
51 static void _disable_hook(Evas_Object *obj);
52 static void _write_label(Evas_Object *obj);
53 static void _sizing_eval(Evas_Object *obj);
54 //static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
55 static Eina_Bool _value_set(Evas_Object *obj, double delta);
56 static void _on_focus_hook(void *data, Evas_Object *obj);
57 static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
58 Evas_Callback_Type type, void *event_info);
61 _del_hook(Evas_Object *obj)
63 Elm_Spinner_Special_Value *sv;
64 Widget_Data *wd = elm_widget_data_get(obj);
66 if (wd->label) eina_stringshare_del(wd->label);
67 if (wd->delay) ecore_timer_del(wd->delay);
68 if (wd->spin) ecore_timer_del(wd->spin);
69 if (wd->special_values)
71 EINA_LIST_FREE(wd->special_values, sv)
73 eina_stringshare_del(sv->label);
81 _disable_hook(Evas_Object *obj)
83 Widget_Data *wd = elm_widget_data_get(obj);
85 if (elm_widget_disabled_get(obj))
86 edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm");
88 edje_object_signal_emit(wd->spinner, "elm,state,enabled", "elm");
92 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
94 Widget_Data *wd = elm_widget_data_get(obj);
96 edje_object_signal_emit(wd->spinner, emission, source);
100 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data)
102 Widget_Data *wd = elm_widget_data_get(obj);
104 edje_object_signal_callback_add(wd->spinner, emission,
105 source, func_cb, data);
109 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data)
111 Widget_Data *wd = elm_widget_data_get(obj);
112 edje_object_signal_callback_del_full(wd->spinner, emission, source,
117 _theme_hook(Evas_Object *obj)
119 Widget_Data *wd = elm_widget_data_get(obj);
121 _elm_theme_object_set(obj, wd->spinner, "spinner", "base", elm_widget_style_get(obj));
122 edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
124 if (elm_widget_focus_get(obj))
125 edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm");
127 edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm");
128 if (elm_widget_disabled_get(obj))
129 edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm");
130 edje_object_message_signal_process(wd->spinner);
131 edje_object_scale_set(wd->spinner, elm_widget_scale_get(obj) * _elm_config->scale);
136 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
138 Widget_Data *wd = elm_widget_data_get(obj);
140 if (elm_widget_focus_get(obj))
142 edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm");
143 evas_object_focus_set(wd->spinner, EINA_TRUE);
147 edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm");
148 evas_object_focus_set(wd->spinner, EINA_FALSE);
153 _delay_change(void *data)
155 Widget_Data *wd = elm_widget_data_get(data);
156 if (!wd) return ECORE_CALLBACK_CANCEL;
158 evas_object_smart_callback_call(data, "delay,changed", NULL);
159 return ECORE_CALLBACK_CANCEL;
163 _entry_show(Widget_Data *wd)
165 char buf[32], fmt[32] = "%0.f";
167 /* try to construct just the format from given label
168 * completely ignoring pre/post words
172 const char *start = strchr(wd->label, '%');
179 start = strchr(start + 2, '%');
184 const char *itr, *end = NULL;
185 for (itr = start + 1; *itr != '\0'; itr++)
187 /* allowing '%d' is quite dangerous, remove it? */
188 if ((*itr == 'd') || (*itr == 'f'))
195 if ((end) && ((size_t)(end - start + 1) < sizeof(fmt)))
197 memcpy(fmt, start, end - start);
198 fmt[end - start] = '\0';
202 snprintf(buf, sizeof(buf), fmt, wd->val);
203 elm_entry_entry_set(wd->ent, buf);
207 _write_label(Evas_Object *obj)
210 Elm_Spinner_Special_Value *sv;
211 Widget_Data *wd = elm_widget_data_get(obj);
214 EINA_LIST_FOREACH(wd->special_values, l, sv)
216 if (sv->value == wd->val)
218 snprintf(buf, sizeof(buf), "%s", sv->label);
223 snprintf(buf, sizeof(buf), wd->label, wd->val);
225 snprintf(buf, sizeof(buf), "%.0f", wd->val);
228 edje_object_part_text_set(wd->spinner, "elm.text", buf);
229 if (wd->entry_visible) _entry_show(wd);
233 _value_set(Evas_Object *obj, double delta)
235 Widget_Data *wd = elm_widget_data_get(obj);
237 if (!wd) return EINA_FALSE;
238 new_val = wd->val + delta;
241 while (new_val < wd->val_min)
242 new_val = wd->val_max + new_val + 1 - wd->val_min;
243 while (new_val > wd->val_max)
244 new_val = wd->val_min + new_val - wd->val_max - 1;
248 if (new_val < wd->val_min)
249 new_val = wd->val_min;
250 else if (new_val > wd->val_max)
251 new_val = wd->val_max;
254 if (new_val == wd->val) return EINA_FALSE;
257 evas_object_smart_callback_call(obj, "changed", NULL);
258 if (wd->delay) ecore_timer_del(wd->delay);
259 wd->delay = ecore_timer_add(0.2, _delay_change, obj);
265 _sizing_eval(Evas_Object *obj)
267 Widget_Data *wd = elm_widget_data_get(obj);
268 Evas_Coord minw = -1, minh = -1;
270 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
271 edje_object_size_min_restricted_calc(wd->spinner, &minw, &minh, minw, minh);
272 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
273 evas_object_size_hint_min_set(obj, minw, minh);
274 evas_object_size_hint_max_set(obj, -1, -1);
279 _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
286 _val_set(Evas_Object *obj)
288 Widget_Data *wd = elm_widget_data_get(obj);
291 if (wd->val_max > wd->val_min)
292 pos = ((wd->val - wd->val_min) / (wd->val_max - wd->val_min));
293 if (pos < 0.0) pos = 0.0;
294 else if (pos > 1.0) pos = 1.0;
295 edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
300 _drag(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
302 Widget_Data *wd = elm_widget_data_get(data);
303 double pos = 0.0, offset, delta;
305 if (wd->entry_visible) return;
306 edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
309 delta = (pos - wd->drag_start_pos) * offset;
310 if (_value_set(data, delta)) _write_label(data);
311 wd->drag_start_pos = pos;
316 _drag_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
318 Widget_Data *wd = elm_widget_data_get(data);
321 edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
323 wd->drag_start_pos = pos;
327 _drag_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
329 Widget_Data *wd = elm_widget_data_get(data);
331 wd->drag_start_pos = 0;
332 edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider", 0.0, 0.0);
336 _hide_entry(Evas_Object *obj)
338 Widget_Data *wd = elm_widget_data_get(obj);
340 edje_object_signal_emit(wd->spinner, "elm,state,inactive", "elm");
341 wd->entry_visible = 0;
345 _reset_value(Evas_Object *obj)
347 Widget_Data *wd = elm_widget_data_get(obj);
350 elm_spinner_value_set(obj, wd->orig_val);
354 _apply_entry_value(Evas_Object *obj)
356 Widget_Data *wd = elm_widget_data_get(obj);
363 str = elm_entry_entry_get(wd->ent);
365 val = strtod(str, &end);
366 if ((*end != '\0') && (!isspace(*end))) return;
367 elm_spinner_value_set(obj, val);
371 _toggle_entry(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
373 Widget_Data *wd = elm_widget_data_get(data);
380 if (elm_widget_disabled_get(data)) return;
381 if (!wd->editable) return;
382 if (wd->entry_visible) _apply_entry_value(data);
385 wd->orig_val = wd->val;
386 edje_object_signal_emit(wd->spinner, "elm,state,active", "elm");
388 elm_entry_select_all(wd->ent);
389 elm_widget_focus_set(wd->ent, 1);
390 wd->entry_visible = 1;
395 _spin_value(void *data)
397 Widget_Data *wd = elm_widget_data_get(data);
398 if (!wd) return ECORE_CALLBACK_CANCEL;
399 if (_value_set(data, wd->spin_speed)) _write_label(data);
400 wd->interval = wd->interval / 1.05;
401 ecore_timer_interval_set(wd->spin, wd->interval);
402 return ECORE_CALLBACK_RENEW;
406 _val_inc_start(Evas_Object *obj)
408 Widget_Data *wd = elm_widget_data_get(obj);
410 wd->interval = wd->first_interval;
411 wd->spin_speed = wd->step;
412 if (wd->spin) ecore_timer_del(wd->spin);
413 wd->spin = ecore_timer_add(wd->interval, _spin_value, obj);
418 _val_inc_stop(Evas_Object *obj)
420 Widget_Data *wd = elm_widget_data_get(obj);
422 wd->interval = wd->first_interval;
424 if (wd->spin) ecore_timer_del(wd->spin);
429 _val_dec_start(Evas_Object *obj)
431 Widget_Data *wd = elm_widget_data_get(obj);
433 wd->interval = wd->first_interval;
434 wd->spin_speed = -wd->step;
435 if (wd->spin) ecore_timer_del(wd->spin);
436 wd->spin = ecore_timer_add(wd->interval, _spin_value, obj);
441 _val_dec_stop(Evas_Object *obj)
443 Widget_Data *wd = elm_widget_data_get(obj);
445 wd->interval = wd->first_interval;
447 if (wd->spin) ecore_timer_del(wd->spin);
452 _button_inc_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
454 Widget_Data *wd = elm_widget_data_get(data);
456 if (wd->entry_visible)
461 _val_inc_start(data);
465 _button_inc_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
467 Widget_Data *wd = elm_widget_data_get(data);
473 _button_dec_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
475 Widget_Data *wd = elm_widget_data_get(data);
477 if (wd->entry_visible)
482 _val_dec_start(data);
486 _button_dec_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
488 Widget_Data *wd = elm_widget_data_get(data);
494 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
496 Widget_Data *wd = elm_widget_data_get(data);
498 _apply_entry_value(data);
499 evas_object_smart_callback_call(data, "changed", NULL);
500 if (wd->delay) ecore_timer_del(wd->delay);
501 wd->delay = ecore_timer_add(0.2, _delay_change, data);
505 _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
507 Widget_Data *wd = elm_widget_data_get(obj);
508 if (!wd) return EINA_FALSE;
509 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
510 if (type == EVAS_CALLBACK_KEY_DOWN)
512 Evas_Event_Key_Down *ev = event_info;
513 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
514 else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")
515 || !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down"))
518 edje_object_signal_emit(wd->spinner, "elm,left,anim,activate", "elm");
519 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
522 else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")
523 || !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up"))
526 edje_object_signal_emit(wd->spinner, "elm,right,anim,activate", "elm");
527 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
531 else if (type == EVAS_CALLBACK_KEY_UP)
533 Evas_Event_Key_Down *ev = event_info;
534 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
535 if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")
536 || !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up"))
538 else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")
539 || !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down"))
541 else return EINA_FALSE;
542 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
549 * Add a new spinner to the parent
551 * @param parent The parent object
552 * @return The new object or NULL if it cannot be created
557 elm_spinner_add(Evas_Object *parent)
563 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
565 wd = ELM_NEW(Widget_Data);
566 e = evas_object_evas_get(parent);
568 obj = elm_widget_add(e);
569 ELM_SET_WIDTYPE(widtype, "spinner");
570 elm_widget_type_set(obj, "spinner");
571 elm_widget_sub_object_add(parent, obj);
572 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
573 elm_widget_data_set(obj, wd);
574 elm_widget_del_hook_set(obj, _del_hook);
575 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
576 elm_widget_theme_hook_set(obj, _theme_hook);
577 elm_widget_disable_hook_set(obj, _disable_hook);
578 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
579 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
580 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
581 elm_widget_can_focus_set(obj, EINA_TRUE);
582 elm_widget_event_hook_set(obj, _event_hook);
589 wd->first_interval = 0.85;
590 wd->entry_visible = 0;
591 wd->editable = EINA_TRUE;
593 wd->spinner = edje_object_add(e);
594 _elm_theme_object_set(obj, wd->spinner, "spinner", "base", "default");
595 elm_widget_resize_object_set(obj, wd->spinner);
596 edje_object_signal_callback_add(wd->spinner, "drag", "*", _drag, obj);
597 edje_object_signal_callback_add(wd->spinner, "drag,start", "*",
599 edje_object_signal_callback_add(wd->spinner, "drag,stop", "*",
601 edje_object_signal_callback_add(wd->spinner, "drag,step", "*",
603 edje_object_signal_callback_add(wd->spinner, "drag,page", "*",
606 edje_object_signal_callback_add(wd->spinner, "elm,action,increment,start",
607 "*", _button_inc_start, obj);
608 edje_object_signal_callback_add(wd->spinner, "elm,action,increment,stop",
609 "*", _button_inc_stop, obj);
610 edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,start",
611 "*", _button_dec_start, obj);
612 edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,stop",
613 "*", _button_dec_stop, obj);
614 edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
617 wd->ent = elm_entry_add(obj);
618 elm_entry_single_line_set(wd->ent, 1);
619 evas_object_smart_callback_add(wd->ent, "activated", _entry_activated, obj);
620 edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
621 edje_object_signal_callback_add(wd->spinner, "elm,action,entry,toggle",
622 "*", _toggle_entry, obj);
630 * Set the format string of the label area
632 * If NULL, this sets the format to "%.0f". If not it sets the format
633 * string for the label text. The label text is provided a floating point
634 * value, so the label text can display up to 1 floating point value. Note that
635 * this is optional. Use a format string such as "%1.2f meters" for example.
637 * @param obj The spinner object
638 * @param fmt The format string for the label display
643 elm_spinner_label_format_set(Evas_Object *obj, const char *fmt)
645 ELM_CHECK_WIDTYPE(obj, widtype);
646 Widget_Data *wd = elm_widget_data_get(obj);
648 eina_stringshare_replace(&wd->label, fmt);
654 * Get the label format of the spinner
656 * @param obj The spinner object
657 * @return The text label format string in UTF-8
662 elm_spinner_label_format_get(const Evas_Object *obj)
664 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
665 Widget_Data *wd = elm_widget_data_get(obj);
666 if (!wd) return NULL;
671 * Set the minimum and maximum values for the spinner
673 * Maximum must be greater than minimum.
675 * @param obj The spinner object
676 * @param min The minimum value
677 * @param max The maximum value
682 elm_spinner_min_max_set(Evas_Object *obj, double min, double max)
684 ELM_CHECK_WIDTYPE(obj, widtype);
685 Widget_Data *wd = elm_widget_data_get(obj);
687 if ((wd->val_min == min) && (wd->val_max == max)) return;
690 if (wd->val < wd->val_min) wd->val = wd->val_min;
691 if (wd->val > wd->val_max) wd->val = wd->val_max;
697 * Get the minimum and maximum values of the spinner
699 * @param obj The spinner object
700 * @param min The minimum value
701 * @param max The maximum value
706 elm_spinner_min_max_get(const Evas_Object *obj, double *min, double *max)
710 ELM_CHECK_WIDTYPE(obj, widtype);
711 Widget_Data *wd = elm_widget_data_get(obj);
713 if (min) *min = wd->val_min;
714 if (max) *max = wd->val_max;
718 * Set the step for the spinner
720 * @param obj The spinner object
721 * @param step The step value
726 elm_spinner_step_set(Evas_Object *obj, double step)
728 ELM_CHECK_WIDTYPE(obj, widtype);
729 Widget_Data *wd = elm_widget_data_get(obj);
735 * Get the step of the spinner
737 * @param obj The spinner object
738 * @return The step value
743 elm_spinner_step_get(const Evas_Object *obj)
745 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
746 Widget_Data *wd = elm_widget_data_get(obj);
751 * Set the value the spinner indicates
753 * @param obj The spinner object
754 * @param val The value (must be between min and max for the spinner)
759 elm_spinner_value_set(Evas_Object *obj, double val)
761 ELM_CHECK_WIDTYPE(obj, widtype);
762 Widget_Data *wd = elm_widget_data_get(obj);
764 if (wd->val == val) return;
766 if (wd->val < wd->val_min) wd->val = wd->val_min;
767 if (wd->val > wd->val_max) wd->val = wd->val_max;
773 * Get the value the spinner has
775 * @param obj The spinner object
776 * @return The value of the spinner
781 elm_spinner_value_get(const Evas_Object *obj)
783 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
784 Widget_Data *wd = elm_widget_data_get(obj);
790 * Sets whether the spinner should wrap when it reaches its
791 * minimum/maximum value
793 * @param obj The spinner object
794 * @param wrap True if it should wrap, false otherwise
799 elm_spinner_wrap_set(Evas_Object *obj, Eina_Bool wrap)
801 ELM_CHECK_WIDTYPE(obj, widtype);
802 Widget_Data *wd = elm_widget_data_get(obj);
808 * Gets whether the spinner should wrap when it reaches its
809 * minimum/maximum value
811 * @param obj The spinner object
812 * @return Bool value of wrap option
813 * (0 = disabled, 1 = enabled)
818 elm_spinner_wrap_get(const Evas_Object *obj)
820 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
821 Widget_Data *wd = elm_widget_data_get(obj);
822 if (!wd) return EINA_FALSE;
827 * Set a special value to display in the place of the numerical one.
829 * @param obj The spinner object
830 * @param value The value to be replaced
831 * @param label The label to be used
836 elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label)
838 Elm_Spinner_Special_Value *sv;
839 ELM_CHECK_WIDTYPE(obj, widtype);
840 Widget_Data *wd = elm_widget_data_get(obj);
843 sv = calloc(1, sizeof(*sv));
846 sv->label = eina_stringshare_add(label);
848 wd->special_values = eina_list_append(wd->special_values, sv);
853 * Set whether the spinner can be directly edited by the user or not.
854 * Default is editable.
856 * @param obj The spinner object
857 * @param editable Bool value of the edit option
858 * (EINA_FALSE = not editable, EINA_TRUE = editable)
861 elm_spinner_editable_set(Evas_Object *obj, Eina_Bool editable)
863 ELM_CHECK_WIDTYPE(obj, widtype);
864 Widget_Data *wd = elm_widget_data_get(obj);
866 wd->editable = editable;
870 * Gets whether the spinner is editable.
872 * @param obj The spinner object
873 * @return Bool value of edit option
874 * (EINA_FALSE = not editable, EINA_TRUE = editable)
877 elm_spinner_editable_get(const Evas_Object *obj)
879 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
880 Widget_Data *wd = elm_widget_data_get(obj);
881 if (!wd) return EINA_FALSE;
886 * Set the interval for the spinner
888 * @param obj The spinner object
889 * @param interval The interval value in seconds
891 * The interval value is decreased while the user increments or decrements
892 * the spinner value. The next interval value is the previous interval / 1.05,
893 * so it speed up a bit. Default value is 0.85 seconds.
898 elm_spinner_interval_set(Evas_Object *obj, double interval)
900 ELM_CHECK_WIDTYPE(obj, widtype);
901 Widget_Data *wd = elm_widget_data_get(obj);
903 wd->first_interval = interval;
907 * Get the interval of the spinner
909 * @param obj The spinner object
910 * @return The value of the first interval in seconds
912 * The interval value is decreased while the user increments or decrements
913 * the spinner value. The next interval value is the previous interval / 1.05,
914 * so it speed up a bit. Default value is 0.85 seconds.
919 elm_spinner_interval_get(const Evas_Object *obj)
921 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
922 Widget_Data *wd = elm_widget_data_get(obj);
924 return wd->first_interval;