rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=4f66833f96d805d9969936d83ef41d001360de80
commit 4f66833f96d805d9969936d83ef41d001360de80 Author: Vitalii Vorobiov <vi.vorob...@samsung.com> Date: Tue Jan 19 12:46:34 2016 +0000 property_macro: need to be able to set labels instead of predined x: and y: --- src/bin/ui/property_group.c | 10 +++--- src/bin/ui/property_macros.h | 82 ++++++++++++++++++++++++++++++++------------ 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/src/bin/ui/property_group.c b/src/bin/ui/property_group.c index 27e2bc3..2e15ca7 100644 --- a/src/bin/ui/property_group.c +++ b/src/bin/ui/property_group.c @@ -2783,12 +2783,12 @@ _on_combobox_##SUB##_##VALUE##_change(void *data, \ evas_object_smart_callback_call(ap.win, SIGNAL_PROPERTY_ATTRIBUTE_CHANGED, NULL); \ } -#define STATE_ATTR_2COMBOBOX_V(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, DESCRIPTION1, DESCRIPTION2) \ +#define STATE_ATTR_2COMBOBOX_V(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, DESCRIPTION1, DESCRIPTION2, LABEL1, LABEL2) \ STATE_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE1, MEMBER, DESCRIPTION1) \ STATE_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE2, MEMBER, DESCRIPTION2) \ STATE_ATTR_SOURCE_UPDATE(SUB, VALUE1, MEMBER, part->type, ==) \ STATE_ATTR_SOURCE_UPDATE(SUB, VALUE2, MEMBER, part->type, ==) \ - STATE_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2) + STATE_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, LABEL1, LABEL2) #define STATE_ATTR_2SPINNER_ICON(TEXT, SUB, VALUE1, VALUE2, MEMBER, MIN, MAX, STEP, FMT, \ L1_START, L1_END, L2_START, L2_END, TOOLTIP1, TOOLTIP2, MULTIPLIER, \ @@ -2804,7 +2804,8 @@ STATE_ATTR_2COMBOBOX_V(_("relative to"), state, rel1_to_x, rel1_to_y, state_obje _("Causes a corner to be positioned relatively to the Y axis of another " "part. Setting to \"\" will un-set this value"), _("rel1.to_x changed to \"%s\""), - _("rel1.to_y changed to \"%s\"")) + _("rel1.to_y changed to \"%s\""), + _("x:"), _("y:")) STATE_ATTR_2SPINNER_ICON(_("align"), state, rel1_relative_x, rel1_relative_y, state_object_area, -500, 500, 1, NULL, "x:", "%", "y:", "%", _("Define the position of left-up corner of the part's container. " @@ -2829,7 +2830,8 @@ STATE_ATTR_2COMBOBOX_V(_("relative to"), state, rel2_to_x, rel2_to_y, state_obje _("Causes a corner to be positioned relatively to the Y axis of another " "part. Setting to \"\" will un-set this value"), _("rel2.to_x changed to \"%s\""), - _("rel2.to_y changed to \"%s\"")) + _("rel2.to_y changed to \"%s\""), + _("x:"), _("y:")) STATE_ATTR_2SPINNER_ICON(_("align"), state, rel2_relative_x, rel2_relative_y, state_object_area, -500, 500, 1, NULL, "x:", "%", "y:", "%", _("Define the position of right-down corner of the part's container. " diff --git a/src/bin/ui/property_macros.h b/src/bin/ui/property_macros.h index 2158259..e5b529c 100644 --- a/src/bin/ui/property_macros.h +++ b/src/bin/ui/property_macros.h @@ -585,6 +585,43 @@ _on_##SUB##_##VALUE##_activated(void *data, \ eina_stringshare_del(val); \ } +/** + * Macro defines a creating of COMMON_ATTR_2COMBOBOX. + * + * @param TEXT Text of attribute mix + * @param SUB The prefix of main parameter of attribute + * @param VALUE1 The first value of attribute + * @param VALUE2 The second value of attribute + * @param MEMBER position of attribute controls in struct + * @param TOOLTIP1 tooltip for first control + * @param TOOLTIP2 tooltip for second control + * @param LABEL1 label for first control + * @param LABEL2 label for second control + * + * @ingroup Property_Macro + */ +#define COMMON_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, LABEL1, LABEL2) \ +static Evas_Object * \ +prop_##MEMBER##_##VALUE1##_##VALUE2##_add(Evas_Object *parent, Group_Prop_Data *pd) \ +{ \ + PROPERTY_ITEM_ADD(parent, TEXT, "2swallow_vertical_pad") \ + elm_object_part_text_set(item, "label.swallow1.start", LABEL1); \ + EWE_COMBOBOX_ADD(item, pd->attributes.MEMBER.VALUE1) \ + if (TOOLTIP1) elm_object_tooltip_text_set(pd->attributes.MEMBER.VALUE1, TOOLTIP1); \ + evas_object_smart_callback_add(pd->attributes.MEMBER.VALUE1, "selected", \ + _on_##MEMBER##_##VALUE1##_change, pd); \ + elm_object_part_content_set(item, "swallow.content1", pd->attributes.MEMBER.VALUE1); \ + elm_object_part_text_set(item, "label.swallow2.start", LABEL2); \ + EWE_COMBOBOX_ADD(item, pd->attributes.MEMBER.VALUE2) \ + if (TOOLTIP2) elm_object_tooltip_text_set(pd->attributes.MEMBER.VALUE2, TOOLTIP2); \ + evas_object_smart_callback_add(pd->attributes.MEMBER.VALUE2, "selected", \ + _on_##MEMBER##_##VALUE2##_change, pd); \ + elm_object_part_content_set(item, "swallow.content2", pd->attributes.MEMBER.VALUE2); \ + prop_##MEMBER##_##VALUE1##_update(pd); \ + prop_##MEMBER##_##VALUE2##_update(pd); \ + return item; \ +} + /*****************************************************************************/ /* GROUP 2 CHECK CONTROL */ /*****************************************************************************/ @@ -855,6 +892,27 @@ _on_group_##SUB1##_##VALUE##_change(void *data, \ COMMON_COMBOBOX_LIST_CALLBACK(TEXT, SUB, VALUE, TYPE, PROGRAM_ARGS, DESCRIPTION) /*****************************************************************************/ +/* PROGRAM 1 NORMAL COMBOBOX */ +/*****************************************************************************/ + +/** + * Macro for functions that create an item with label and 1 combobox for state + * attribute. + * + * @param TEXT The label text + * @param SUB The prefix of main parameter of state attribute + * @param VALUE1 The first value of state attribute + * @param VALUE2 The second value of state attribute + * @param MEMEBER The combobox member from Group_Prop_Data structure + * @paramram TOOLTIP1 The tooltip for first combobox + * @paramram TOOLTIP2 The tooltip for second combobox + * + * @ingroup Property_Macro + */ +#define PROGRAM_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, LABEL1, LABEL2) \ + COMMON_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, LABEL1, LABEL2) + +/*****************************************************************************/ /* PROGRAM 1 SPINNER CONTROL */ /*****************************************************************************/ /** @@ -2101,6 +2159,7 @@ _on_##MEMBER##_##VALUE##_change(void *data, \ /*****************************************************************************/ /* STATE 2 COMBOBOX CONTROL */ /*****************************************************************************/ + /** * Macro for functions that create an item with label and 1 combobox for state * attribute. @@ -2115,27 +2174,8 @@ _on_##MEMBER##_##VALUE##_change(void *data, \ * * @ingroup Property_Macro */ -#define STATE_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2) \ -static Evas_Object * \ -prop_##MEMBER##_##VALUE1##_##VALUE2##_add(Evas_Object *parent, Group_Prop_Data *pd) \ -{ \ - PROPERTY_ITEM_ADD(parent, TEXT, "2swallow_vertical_pad") \ - elm_object_part_text_set(item, "label.swallow1.start", _("x:")); \ - EWE_COMBOBOX_ADD(item, pd->attributes.MEMBER.VALUE1) \ - if (TOOLTIP1) elm_object_tooltip_text_set(pd->attributes.MEMBER.VALUE1, TOOLTIP1); \ - evas_object_smart_callback_add(pd->attributes.MEMBER.VALUE1, "selected", \ - _on_##MEMBER##_##VALUE1##_change, pd); \ - elm_object_part_content_set(item, "swallow.content1", pd->attributes.MEMBER.VALUE1); \ - elm_object_part_text_set(item, "label.swallow2.start", _("y:")); \ - EWE_COMBOBOX_ADD(item, pd->attributes.MEMBER.VALUE2) \ - if (TOOLTIP2) elm_object_tooltip_text_set(pd->attributes.MEMBER.VALUE2, TOOLTIP2); \ - evas_object_smart_callback_add(pd->attributes.MEMBER.VALUE2, "selected", \ - _on_##MEMBER##_##VALUE2##_change, pd); \ - elm_object_part_content_set(item, "swallow.content2", pd->attributes.MEMBER.VALUE2); \ - prop_##MEMBER##_##VALUE1##_update(pd); \ - prop_##MEMBER##_##VALUE2##_update(pd); \ - return item; \ -} +#define STATE_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, LABEL1, LABEL2) \ + COMMON_ATTR_2COMBOBOX_ADD(TEXT, SUB, VALUE1, VALUE2, MEMBER, TOOLTIP1, TOOLTIP2, LABEL1, LABEL2) /*****************************************************************************/ /* STATE 1COMBOBOX SOURCE UPDATE */ --