if (p->label)
elm_object_text_set(obj, p->label);
if (p->icon)
- elm_object_content_part_set(obj, "icon", p->icon);
+ elm_object_part_content_set(obj, "icon", p->icon);
if (p->on)
elm_object_part_text_set(obj, "on", p->on);
elm_object_part_text_set(obj, "off", p->off);
if (p->state_exists)
- elm_toggle_state_set(obj, p->state);
+ elm_check_state_set(obj, p->state);
}
static Eina_Bool
{
Evas_Object *icon = external_common_param_icon_get(obj, param);
if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
- elm_object_content_part_set(obj, "icon", icon);
+ elm_object_part_content_set(obj, "icon", icon);
return EINA_TRUE;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
- elm_toggle_state_set(obj, param->i);
+ elm_check_state_set(obj, param->i);
return EINA_TRUE;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
- param->i = elm_toggle_state_get(obj);
+ param->i = elm_check_state_get(obj);
return EINA_TRUE;
}
}
};
DEFINE_EXTERNAL_ICON_ADD(toggle, "toggle")
+#undef DEFINE_EXTERNAL_TYPE_SIMPLE
+#define DEFINE_EXTERNAL_TYPE_SIMPLE(type_name, name) \
+static Evas_Object * \
+external_##type_name##_add(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *edje, const Eina_List *params __UNUSED__, const char *part_name) \
+{ \
+ Evas_Object *parent, *obj; \
+ external_elm_init(); \
+ parent = elm_widget_parent_widget_get(edje); \
+ if (!parent) parent = edje; \
+ obj = elm_check_add(parent); \
+ elm_object_style_set(obj, "toggle"); \
+ external_signals_proxy(obj, edje, part_name); \
+ return obj; \
+} \
+ \
+DEFINE_EXTERNAL_TYPE(type_name, name)
+
DEFINE_EXTERNAL_TYPE_SIMPLE(toggle, "Toggle")