1 #include <Elementary.h>
8 * A spinner is a widget which allows the user to increase or decrease
9 * numeric values. By default the spinner will not wrap and has a label
10 * of "%.0f" (just showing the integer value of the double).
12 * A spinner has a label that is formatted with floating
13 * point values and thus accepts a printf-style format string, like
16 * Signals that you can add callbacks for are:
18 * "changed" - Whenever the spinner value is changed by the user.
19 * "delay,changed" - A short time after the value is changed by the user.
20 * This will be called only when the user stops dragging for a very short
21 * period or when they release their finger/mouse, so it avoids possibly
22 * expensive reactions to the value change.
24 typedef struct _Widget_Data Widget_Data;
25 typedef struct _Elm_Spinner_Special_Value Elm_Spinner_Special_Value;
29 Evas_Object *spinner, *ent;
31 double val, val_min, val_max, orig_val, step;
32 double drag_start_pos, spin_speed, interval, first_interval;
33 Ecore_Timer *delay, *spin;
34 Eina_List *special_values;
36 Eina_Bool entry_visible : 1;
37 Eina_Bool dragging : 1;
38 Eina_Bool editable : 1;
41 struct _Elm_Spinner_Special_Value
47 static const char *widtype = NULL;
48 static void _del_hook(Evas_Object *obj);
49 static void _disable_hook(Evas_Object *obj);
50 static void _write_label(Evas_Object *obj);
51 static void _sizing_eval(Evas_Object *obj);
52 //static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
53 static Eina_Bool _value_set(Evas_Object *obj, double delta);
54 static void _on_focus_hook(void *data, Evas_Object *obj);
55 static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
56 Evas_Callback_Type type, void *event_info);
58 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
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, Edje_Signal_Cb func_cb, 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, Edje_Signal_Cb func_cb, void *data)
111 Widget_Data *wd = elm_widget_data_get(obj);
112 edje_object_signal_callback_del_full(wd->spinner, emission, source,
117 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
119 Widget_Data *wd = elm_widget_data_get(obj);
121 edje_object_mirrored_set(wd->spinner, rtl);
125 _theme_hook(Evas_Object *obj)
127 Widget_Data *wd = elm_widget_data_get(obj);
129 _elm_widget_mirrored_reload(obj);
130 _mirrored_set(obj, elm_widget_mirrored_get(obj));
131 _elm_theme_object_set(obj, wd->spinner, "spinner", "base", elm_widget_style_get(obj));
132 edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
134 if (elm_widget_focus_get(obj))
135 edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm");
137 edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm");
138 if (elm_widget_disabled_get(obj))
139 edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm");
140 edje_object_message_signal_process(wd->spinner);
141 edje_object_scale_set(wd->spinner, elm_widget_scale_get(obj) * _elm_config->scale);
146 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
148 Widget_Data *wd = elm_widget_data_get(obj);
150 if (elm_widget_focus_get(obj))
152 edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm");
153 evas_object_focus_set(wd->spinner, EINA_TRUE);
157 edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm");
158 evas_object_focus_set(wd->spinner, EINA_FALSE);
163 _delay_change(void *data)
165 Widget_Data *wd = elm_widget_data_get(data);
166 if (!wd) return ECORE_CALLBACK_CANCEL;
168 evas_object_smart_callback_call(data, "delay,changed", NULL);
169 return ECORE_CALLBACK_CANCEL;
173 _entry_show(Widget_Data *wd)
175 char buf[32], fmt[32] = "%0.f";
177 /* try to construct just the format from given label
178 * completely ignoring pre/post words
182 const char *start = strchr(wd->label, '%');
189 start = strchr(start + 2, '%');
194 const char *itr, *end = NULL;
195 for (itr = start + 1; *itr != '\0'; itr++)
197 /* allowing '%d' is quite dangerous, remove it? */
198 if ((*itr == 'd') || (*itr == 'f'))
205 if ((end) && ((size_t)(end - start + 1) < sizeof(fmt)))
207 memcpy(fmt, start, end - start);
208 fmt[end - start] = '\0';
212 snprintf(buf, sizeof(buf), fmt, wd->val);
213 elm_entry_entry_set(wd->ent, buf);
217 _write_label(Evas_Object *obj)
220 Elm_Spinner_Special_Value *sv;
221 Widget_Data *wd = elm_widget_data_get(obj);
224 EINA_LIST_FOREACH(wd->special_values, l, sv)
226 if (sv->value == wd->val)
228 snprintf(buf, sizeof(buf), "%s", sv->label);
233 snprintf(buf, sizeof(buf), wd->label, wd->val);
235 snprintf(buf, sizeof(buf), "%.0f", wd->val);
238 edje_object_part_text_set(wd->spinner, "elm.text", buf);
239 if (wd->entry_visible) _entry_show(wd);
243 _value_set(Evas_Object *obj, double delta)
245 Widget_Data *wd = elm_widget_data_get(obj);
247 if (!wd) return EINA_FALSE;
248 new_val = wd->val + delta;
251 while (new_val < wd->val_min)
252 new_val = wd->val_max + new_val + 1 - wd->val_min;
253 while (new_val > wd->val_max)
254 new_val = wd->val_min + new_val - wd->val_max - 1;
258 if (new_val < wd->val_min)
259 new_val = wd->val_min;
260 else if (new_val > wd->val_max)
261 new_val = wd->val_max;
264 if (new_val == wd->val) return EINA_FALSE;
267 evas_object_smart_callback_call(obj, "changed", NULL);
268 if (wd->delay) ecore_timer_del(wd->delay);
269 wd->delay = ecore_timer_add(0.2, _delay_change, obj);
275 _sizing_eval(Evas_Object *obj)
277 Widget_Data *wd = elm_widget_data_get(obj);
278 Evas_Coord minw = -1, minh = -1;
280 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
281 edje_object_size_min_restricted_calc(wd->spinner, &minw, &minh, minw, minh);
282 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
283 evas_object_size_hint_min_set(obj, minw, minh);
284 evas_object_size_hint_max_set(obj, -1, -1);
289 _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
296 _val_set(Evas_Object *obj)
298 Widget_Data *wd = elm_widget_data_get(obj);
301 if (wd->val_max > wd->val_min)
302 pos = ((wd->val - wd->val_min) / (wd->val_max - wd->val_min));
303 if (pos < 0.0) pos = 0.0;
304 else if (pos > 1.0) pos = 1.0;
305 edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
310 _drag(void *data, Evas_Object *_obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
312 Evas_Object *obj = data;
313 Widget_Data *wd = elm_widget_data_get(obj);
314 double pos = 0.0, offset, delta;
316 if (wd->entry_visible) return;
317 edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
320 delta = (pos - wd->drag_start_pos) * offset;
321 /* If we are on rtl mode, change the delta to be negative on such changes */
322 if (elm_widget_mirrored_get(obj))
324 if (_value_set(data, delta)) _write_label(data);
325 wd->drag_start_pos = pos;
330 _drag_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
332 Widget_Data *wd = elm_widget_data_get(data);
335 edje_object_part_drag_value_get(wd->spinner, "elm.dragable.slider",
337 wd->drag_start_pos = pos;
341 _drag_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
343 Widget_Data *wd = elm_widget_data_get(data);
345 wd->drag_start_pos = 0;
346 edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider", 0.0, 0.0);
350 _hide_entry(Evas_Object *obj)
352 Widget_Data *wd = elm_widget_data_get(obj);
354 edje_object_signal_emit(wd->spinner, "elm,state,inactive", "elm");
355 wd->entry_visible = 0;
359 _reset_value(Evas_Object *obj)
361 Widget_Data *wd = elm_widget_data_get(obj);
364 elm_spinner_value_set(obj, wd->orig_val);
368 _apply_entry_value(Evas_Object *obj)
370 Widget_Data *wd = elm_widget_data_get(obj);
377 str = elm_entry_entry_get(wd->ent);
379 val = strtod(str, &end);
380 if ((*end != '\0') && (!isspace(*end))) return;
381 elm_spinner_value_set(obj, val);
385 _toggle_entry(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
387 Widget_Data *wd = elm_widget_data_get(data);
394 if (elm_widget_disabled_get(data)) return;
395 if (!wd->editable) return;
396 if (wd->entry_visible) _apply_entry_value(data);
399 wd->orig_val = wd->val;
400 edje_object_signal_emit(wd->spinner, "elm,state,active", "elm");
402 elm_entry_select_all(wd->ent);
403 elm_widget_focus_set(wd->ent, 1);
404 wd->entry_visible = 1;
409 _spin_value(void *data)
411 Widget_Data *wd = elm_widget_data_get(data);
412 if (!wd) return ECORE_CALLBACK_CANCEL;
413 if (_value_set(data, wd->spin_speed)) _write_label(data);
414 wd->interval = wd->interval / 1.05;
415 ecore_timer_interval_set(wd->spin, wd->interval);
416 return ECORE_CALLBACK_RENEW;
420 _val_inc_start(Evas_Object *obj)
422 Widget_Data *wd = elm_widget_data_get(obj);
424 wd->interval = wd->first_interval;
425 wd->spin_speed = wd->step;
426 if (wd->spin) ecore_timer_del(wd->spin);
427 wd->spin = ecore_timer_add(wd->interval, _spin_value, obj);
432 _val_inc_stop(Evas_Object *obj)
434 Widget_Data *wd = elm_widget_data_get(obj);
436 wd->interval = wd->first_interval;
438 if (wd->spin) ecore_timer_del(wd->spin);
443 _val_dec_start(Evas_Object *obj)
445 Widget_Data *wd = elm_widget_data_get(obj);
447 wd->interval = wd->first_interval;
448 wd->spin_speed = -wd->step;
449 if (wd->spin) ecore_timer_del(wd->spin);
450 wd->spin = ecore_timer_add(wd->interval, _spin_value, obj);
455 _val_dec_stop(Evas_Object *obj)
457 Widget_Data *wd = elm_widget_data_get(obj);
459 wd->interval = wd->first_interval;
461 if (wd->spin) ecore_timer_del(wd->spin);
466 _button_inc_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
468 Widget_Data *wd = elm_widget_data_get(data);
470 if (wd->entry_visible)
475 _val_inc_start(data);
479 _button_inc_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
481 Widget_Data *wd = elm_widget_data_get(data);
487 _button_dec_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
489 Widget_Data *wd = elm_widget_data_get(data);
491 if (wd->entry_visible)
496 _val_dec_start(data);
500 _button_dec_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
502 Widget_Data *wd = elm_widget_data_get(data);
508 _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
510 Widget_Data *wd = elm_widget_data_get(data);
512 _apply_entry_value(data);
513 evas_object_smart_callback_call(data, "changed", NULL);
514 if (wd->delay) ecore_timer_del(wd->delay);
515 wd->delay = ecore_timer_add(0.2, _delay_change, data);
519 _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
521 Widget_Data *wd = elm_widget_data_get(obj);
522 if (!wd) return EINA_FALSE;
523 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
524 if (type == EVAS_CALLBACK_KEY_DOWN)
526 Evas_Event_Key_Down *ev = event_info;
527 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
528 else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")
529 || !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down"))
532 edje_object_signal_emit(wd->spinner, "elm,left,anim,activate", "elm");
533 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
536 else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")
537 || !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up"))
540 edje_object_signal_emit(wd->spinner, "elm,right,anim,activate", "elm");
541 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
545 else if (type == EVAS_CALLBACK_KEY_UP)
547 Evas_Event_Key_Down *ev = event_info;
548 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
549 if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")
550 || !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up"))
552 else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")
553 || !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down"))
555 else return EINA_FALSE;
556 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
563 * Add a new spinner to the parent
565 * @param parent The parent object
566 * @return The new object or NULL if it cannot be created
571 elm_spinner_add(Evas_Object *parent)
577 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
579 ELM_SET_WIDTYPE(widtype, "spinner");
580 elm_widget_type_set(obj, "spinner");
581 elm_widget_sub_object_add(parent, obj);
582 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
583 elm_widget_data_set(obj, wd);
584 elm_widget_del_hook_set(obj, _del_hook);
585 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
586 elm_widget_theme_hook_set(obj, _theme_hook);
587 elm_widget_disable_hook_set(obj, _disable_hook);
588 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
589 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
590 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
591 elm_widget_can_focus_set(obj, EINA_TRUE);
592 elm_widget_event_hook_set(obj, _event_hook);
599 wd->first_interval = 0.85;
600 wd->entry_visible = 0;
601 wd->editable = EINA_TRUE;
603 wd->spinner = edje_object_add(e);
604 _elm_theme_object_set(obj, wd->spinner, "spinner", "base", "default");
605 elm_widget_resize_object_set(obj, wd->spinner);
606 edje_object_signal_callback_add(wd->spinner, "drag", "*", _drag, obj);
607 edje_object_signal_callback_add(wd->spinner, "drag,start", "*",
609 edje_object_signal_callback_add(wd->spinner, "drag,stop", "*",
611 edje_object_signal_callback_add(wd->spinner, "drag,step", "*",
613 edje_object_signal_callback_add(wd->spinner, "drag,page", "*",
616 edje_object_signal_callback_add(wd->spinner, "elm,action,increment,start",
617 "*", _button_inc_start, obj);
618 edje_object_signal_callback_add(wd->spinner, "elm,action,increment,stop",
619 "*", _button_inc_stop, obj);
620 edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,start",
621 "*", _button_dec_start, obj);
622 edje_object_signal_callback_add(wd->spinner, "elm,action,decrement,stop",
623 "*", _button_dec_stop, obj);
624 edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider",
627 wd->ent = elm_entry_add(obj);
628 elm_entry_single_line_set(wd->ent, 1);
629 evas_object_smart_callback_add(wd->ent, "activated", _entry_activated, obj);
630 edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
631 edje_object_signal_callback_add(wd->spinner, "elm,action,entry,toggle",
632 "*", _toggle_entry, obj);
634 _mirrored_set(obj, elm_widget_mirrored_get(obj));
641 * Set the format string of the label area
643 * If NULL, this sets the format to "%.0f". If not it sets the format
644 * string for the label text. The label text is provided a floating point
645 * value, so the label text can display up to 1 floating point value. Note that
646 * this is optional. Use a format string such as "%1.2f meters" for example.
648 * @param obj The spinner object
649 * @param fmt The format string for the label display
654 elm_spinner_label_format_set(Evas_Object *obj, const char *fmt)
656 ELM_CHECK_WIDTYPE(obj, widtype);
657 Widget_Data *wd = elm_widget_data_get(obj);
659 eina_stringshare_replace(&wd->label, fmt);
665 * Get the label format of the spinner
667 * @param obj The spinner object
668 * @return The text label format string in UTF-8
673 elm_spinner_label_format_get(const Evas_Object *obj)
675 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
676 Widget_Data *wd = elm_widget_data_get(obj);
677 if (!wd) return NULL;
682 * Set the minimum and maximum values for the spinner
684 * Maximum must be greater than minimum.
686 * @param obj The spinner object
687 * @param min The minimum value
688 * @param max The maximum value
693 elm_spinner_min_max_set(Evas_Object *obj, double min, double max)
695 ELM_CHECK_WIDTYPE(obj, widtype);
696 Widget_Data *wd = elm_widget_data_get(obj);
698 if ((wd->val_min == min) && (wd->val_max == max)) return;
701 if (wd->val < wd->val_min) wd->val = wd->val_min;
702 if (wd->val > wd->val_max) wd->val = wd->val_max;
708 * Get the minimum and maximum values of the spinner
710 * @param obj The spinner object
711 * @param min The minimum value
712 * @param max The maximum value
717 elm_spinner_min_max_get(const Evas_Object *obj, double *min, double *max)
721 ELM_CHECK_WIDTYPE(obj, widtype);
722 Widget_Data *wd = elm_widget_data_get(obj);
724 if (min) *min = wd->val_min;
725 if (max) *max = wd->val_max;
729 * Set the step for the spinner
731 * @param obj The spinner object
732 * @param step The step value
737 elm_spinner_step_set(Evas_Object *obj, double step)
739 ELM_CHECK_WIDTYPE(obj, widtype);
740 Widget_Data *wd = elm_widget_data_get(obj);
746 * Get the step of the spinner
748 * @param obj The spinner object
749 * @return The step value
754 elm_spinner_step_get(const Evas_Object *obj)
756 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
757 Widget_Data *wd = elm_widget_data_get(obj);
762 * Set the value the spinner indicates
764 * @param obj The spinner object
765 * @param val The value (must be between min and max for the spinner)
770 elm_spinner_value_set(Evas_Object *obj, double val)
772 ELM_CHECK_WIDTYPE(obj, widtype);
773 Widget_Data *wd = elm_widget_data_get(obj);
775 if (wd->val == val) return;
777 if (wd->val < wd->val_min) wd->val = wd->val_min;
778 if (wd->val > wd->val_max) wd->val = wd->val_max;
784 * Get the value the spinner has
786 * @param obj The spinner object
787 * @return The value of the spinner
792 elm_spinner_value_get(const Evas_Object *obj)
794 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
795 Widget_Data *wd = elm_widget_data_get(obj);
801 * Sets whether the spinner should wrap when it reaches its
802 * minimum/maximum value
804 * @param obj The spinner object
805 * @param wrap True if it should wrap, false otherwise
810 elm_spinner_wrap_set(Evas_Object *obj, Eina_Bool wrap)
812 ELM_CHECK_WIDTYPE(obj, widtype);
813 Widget_Data *wd = elm_widget_data_get(obj);
819 * Gets whether the spinner should wrap when it reaches its
820 * minimum/maximum value
822 * @param obj The spinner object
823 * @return Bool value of wrap option
824 * (0 = disabled, 1 = enabled)
829 elm_spinner_wrap_get(const Evas_Object *obj)
831 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
832 Widget_Data *wd = elm_widget_data_get(obj);
833 if (!wd) return EINA_FALSE;
838 * Set a special value to display in the place of the numerical one.
840 * @param obj The spinner object
841 * @param value The value to be replaced
842 * @param label The label to be used
847 elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label)
849 Elm_Spinner_Special_Value *sv;
850 ELM_CHECK_WIDTYPE(obj, widtype);
851 Widget_Data *wd = elm_widget_data_get(obj);
854 sv = calloc(1, sizeof(*sv));
857 sv->label = eina_stringshare_add(label);
859 wd->special_values = eina_list_append(wd->special_values, sv);
864 * Set whether the spinner can be directly edited by the user or not.
865 * Default is editable.
867 * @param obj The spinner object
868 * @param editable Bool value of the edit option
869 * (EINA_FALSE = not editable, EINA_TRUE = editable)
872 elm_spinner_editable_set(Evas_Object *obj, Eina_Bool editable)
874 ELM_CHECK_WIDTYPE(obj, widtype);
875 Widget_Data *wd = elm_widget_data_get(obj);
877 wd->editable = editable;
881 * Gets whether the spinner is editable.
883 * @param obj The spinner object
884 * @return Bool value of edit option
885 * (EINA_FALSE = not editable, EINA_TRUE = editable)
888 elm_spinner_editable_get(const Evas_Object *obj)
890 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
891 Widget_Data *wd = elm_widget_data_get(obj);
892 if (!wd) return EINA_FALSE;
897 * Set the interval for the spinner
899 * @param obj The spinner object
900 * @param interval The interval value in seconds
902 * The interval value is decreased while the user increments or decrements
903 * the spinner value. The next interval value is the previous interval / 1.05,
904 * so it speed up a bit. Default value is 0.85 seconds.
909 elm_spinner_interval_set(Evas_Object *obj, double interval)
911 ELM_CHECK_WIDTYPE(obj, widtype);
912 Widget_Data *wd = elm_widget_data_get(obj);
914 wd->first_interval = interval;
918 * Get the interval of the spinner
920 * @param obj The spinner object
921 * @return The value of the first interval in seconds
923 * The interval value is decreased while the user increments or decrements
924 * the spinner value. The next interval value is the previous interval / 1.05,
925 * so it speed up a bit. Default value is 0.85 seconds.
930 elm_spinner_interval_get(const Evas_Object *obj)
932 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
933 Widget_Data *wd = elm_widget_data_get(obj);
935 return wd->first_interval;