/* check */
EAPI Evas_Object *elm_check_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
- EAPI void elm_check_label_set(Evas_Object *obj, const char *label); EINA_ARG_NONNULL(1)
- EAPI const char *elm_check_label_get(const Evas_Object *obj); EINA_ARG_NONNULL(1)
+ EINA_DEPRECATED EAPI void elm_check_label_set(Evas_Object *obj, const char *label); EINA_ARG_NONNULL(1)
+ EINA_DEPRECATED EAPI const char *elm_check_label_get(const Evas_Object *obj); EINA_ARG_NONNULL(1)
EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon); EINA_ARG_NONNULL(1)
EAPI Evas_Object *elm_check_icon_get(const Evas_Object *obj); EINA_ARG_NONNULL(1)
EAPI Evas_Object *elm_check_icon_unset(Evas_Object *obj); EINA_ARG_NONNULL(1)
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
}
+static void
+_elm_check_label_set(Evas_Object *obj, const char *item, const char *label)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (item) return;
+ if (!wd) return;
+ eina_stringshare_replace(&wd->label, label);
+ if (label)
+ edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
+ else
+ edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
+ edje_object_message_signal_process(wd->chk);
+ edje_object_part_text_set(wd->chk, "elm.text", label);
+ _sizing_eval(obj);
+}
+
+static const char *
+_elm_check_label_get(const Evas_Object *obj, const char *item)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (item) return NULL;
+ if (!wd) return NULL;
+ return wd->label;
+}
+
/**
* Add a new Check object
*
elm_widget_can_focus_set(obj, EINA_TRUE);
elm_widget_activate_hook_set(obj, _activate_hook);
elm_widget_event_hook_set(obj, _event_hook);
+ elm_widget_label_set_hook_set(obj, _elm_check_label_set);
+ elm_widget_label_get_hook_set(obj, _elm_check_label_get);
wd->chk = edje_object_add(e);
_elm_theme_object_set(obj, wd->chk, "check", "base", "default");
EAPI void
elm_check_label_set(Evas_Object *obj, const char *label)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- eina_stringshare_replace(&wd->label, label);
- if (label)
- edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
- else
- edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
- edje_object_message_signal_process(wd->chk);
- edje_object_part_text_set(wd->chk, "elm.text", label);
- _sizing_eval(obj);
+ _elm_check_label_set(obj, NULL, label);
}
/**
EAPI const char *
elm_check_label_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return wd->label;
+ return _elm_check_label_get(obj, NULL);
}
/**