EAPI Eina_Bool elm_clock_show_am_pm_get(const Evas_Object *obj);
EAPI void elm_clock_show_seconds_set(Evas_Object *obj, Eina_Bool seconds);
EAPI Eina_Bool elm_clock_show_seconds_get(const Evas_Object *obj);
+ EAPI void elm_clock_interval_set(Evas_Object *obj, double interval);
+ EAPI double elm_clock_interval_get(const Evas_Object *obj);
/* smart callbacks called:
* "changed" - the user changed the time
*/
EAPI void elm_spinner_editable_set(Evas_Object *obj, Eina_Bool editable);
EAPI Eina_Bool elm_spinner_editable_get(const Evas_Object *obj);
EAPI void elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label);
+ EAPI void elm_spinner_interval_set(Evas_Object *obj, double interval);
+ EAPI double elm_spinner_interval_get(const Evas_Object *obj);
/* smart callbacks called:
* "changed" - when the spinner value changes
* "delay,changed" - when the spinner value changed, but a small time after a change (use this if you only want to respond to a change once the spinner is held still for a short while).
struct _Widget_Data
{
Evas_Object *clk;
- double interval;
+ double interval, first_interval;
Eina_Bool seconds : 1;
Eina_Bool am_pm : 1;
Eina_Bool edit : 1;
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
- wd->interval = 0.85;
+ wd->interval = wd->first_interval;
wd->sel_obj = obj;
if (wd->spin) ecore_timer_del(wd->spin);
wd->spin = ecore_timer_add(wd->interval, _signal_clock_val_up, data);
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
- wd->interval = 0.85;
+ wd->interval = wd->first_interval;
wd->sel_obj = obj;
if (wd->spin) ecore_timer_del(wd->spin);
wd->spin = ecore_timer_add(wd->interval, _signal_clock_val_down, data);
wd->cur.am_pm = EINA_TRUE;
wd->cur.edit = EINA_TRUE;
wd->cur.digedit = ELM_CLOCK_NONE;
+ wd->first_interval = 0.85;
_time_update(obj);
_ticker(obj);
if (!wd) return EINA_FALSE;
return wd->seconds;
}
+
+/**
+ * Set the interval for the clock
+ *
+ * @param obj The clock object
+ * @param interval The interval value in seconds
+ *
+ * The interval value is decreased while the user increments or decrements
+ * the clock value. The next interval value is the previous interval / 1.05,
+ * so it speed up a bit. Default value is 0.85 seconds.
+ *
+ * @ingroup Clock
+ */
+EAPI void
+elm_clock_interval_set(Evas_Object *obj, double interval)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->first_interval = interval;
+}
+
+/**
+ * Get the interval of the clock
+ *
+ * @param obj The clock object
+ * @return The value of the first interval in seconds
+ *
+ * The interval value is decreased while the user increments or decrements
+ * the clock value. The next interval value is the previous interval / 1.05,
+ * so it speed up a bit. Default value is 0.85 seconds.
+ *
+ * @ingroup Clock
+ */
+EAPI double
+elm_clock_interval_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return 0.0;
+ return wd->first_interval;
+}
Evas_Object *spinner, *ent;
const char *label;
double val, val_min, val_max, orig_val, step;
- double drag_start_pos, spin_speed, interval;
+ double drag_start_pos, spin_speed, interval, first_interval;
Ecore_Timer *delay, *spin;
Eina_List *special_values;
Eina_Bool wrap : 1;
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- wd->interval = 0.85;
+ wd->interval = wd->first_interval;
wd->spin_speed = wd->step;
if (wd->spin) ecore_timer_del(wd->spin);
wd->spin = ecore_timer_add(wd->interval, _spin_value, obj);
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- wd->interval = 0.85;
+ wd->interval = wd->first_interval;
wd->spin_speed = 0;
if (wd->spin) ecore_timer_del(wd->spin);
wd->spin = NULL;
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- wd->interval = 0.85;
+ wd->interval = wd->first_interval;
wd->spin_speed = -wd->step;
if (wd->spin) ecore_timer_del(wd->spin);
wd->spin = ecore_timer_add(wd->interval, _spin_value, obj);
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- wd->interval = 0.85;
+ wd->interval = wd->first_interval;
wd->spin_speed = 0;
if (wd->spin) ecore_timer_del(wd->spin);
wd->spin = NULL;
wd->val_max = 100.0;
wd->wrap = 0;
wd->step = 1.0;
+ wd->first_interval = 0.85;
wd->entry_visible = 0;
wd->editable = EINA_TRUE;
if (!wd) return EINA_FALSE;
return wd->editable;
}
+
+/**
+ * Set the interval for the spinner
+ *
+ * @param obj The spinner object
+ * @param interval The interval value in seconds
+ *
+ * The interval value is decreased while the user increments or decrements
+ * the spinner value. The next interval value is the previous interval / 1.05,
+ * so it speed up a bit. Default value is 0.85 seconds.
+ *
+ * @ingroup Spinner
+ */
+EAPI void
+elm_spinner_interval_set(Evas_Object *obj, double interval)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->first_interval = interval;
+}
+
+/**
+ * Get the interval of the spinner
+ *
+ * @param obj The spinner object
+ * @return The value of the first interval in seconds
+ *
+ * The interval value is decreased while the user increments or decrements
+ * the spinner value. The next interval value is the previous interval / 1.05,
+ * so it speed up a bit. Default value is 0.85 seconds.
+ *
+ * @ingroup Spinner
+ */
+EAPI double
+elm_spinner_interval_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return 0.0;
+ return wd->first_interval;
+}