elm_popup_add_with_buttons added with EINA_DEPRECATED
authorshilpa singh <shilpa.singh@samsung.com>
Thu, 26 Aug 2010 09:43:47 +0000 (18:43 +0900)
committershilpa singh <shilpa.singh@samsung.com>
Thu, 26 Aug 2010 09:43:47 +0000 (18:43 +0900)
src/lib/Elementary.h.in
src/lib/elm_popup.c

index bb4a685..2c3e903 100755 (executable)
@@ -1884,6 +1884,7 @@ extern "C" {
    EAPI Evas_Object* elm_popup_content_get(Evas_Object *obj);
    EAPI void         elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_text,  ...);
    Evas_Object*      elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... );
+   EINA_DEPRECATED Evas_Object*      elm_popup_add_with_buttons(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... );
    EAPI void         elm_popup_timeout_set(Evas_Object *obj, int timeout);
    EAPI void         elm_popup_mode_set(Evas_Object *obj, Elm_Popup_Mode mode);
    EAPI void         elm_popup_response(Evas_Object *obj, int  response_id);
index 5f00e68..3876abe 100644 (file)
@@ -201,6 +201,7 @@ _show(void *data, Evas *e, Evas_Object *obj, void *event_info)
    elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));\r
    _sizing_eval(obj);\r
    edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,show", "elm");\r
+   edje_object_message_signal_process(wd->layout);\r
    evas_object_show(obj);     \r
    if (e && !_elm_wnd_map_handler)\r
      {\r
@@ -224,6 +225,7 @@ _hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
    \r
    if (!wd) return;\r
    edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,hide", "elm");\r
+   edje_object_message_signal_process(wd->layout);\r
    if (wd->parent) evas_object_hide(wd->parent);  \r
    evas_object_hide(obj); \r
 }\r
@@ -434,17 +436,69 @@ elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int
        edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");\r
        if (wd->title_area)\r
          {\r
-               edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");\r
+               edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");\r
          }\r
        _elm_popup_buttons_add_valist (popup, first_button_text, args);\r
        va_end(args);\r
      }\r
+   edje_object_message_signal_process(wd->layout);\r
+   _sizing_eval(popup);\r
    \r
+   return popup;   \r
+}\r
+\r
+/**\r
+ * Add a new Popup object.\r
+ *\r
+ * @param parent The parent object\r
+ * @param title text to be displayed in title area.\r
+ * @param desc_text text to be displayed in description area.\r
+ * @param no_of_buttons Number of buttons to be packed in action area.\r
+ * @param first_button_text button text\r
+ * @param Varargs response ID for first button, then additional buttons followed by response id's ending with NULL\r
+ * @return The new object or NULL if it cannot be created\r
+ *\r
+ * @ingroup Popup\r
+ */\r
+EAPI Evas_Object *\r
+elm_popup_add_with_buttons(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... )\r
+{\r
+   Evas_Object *popup;\r
+   popup = elm_popup_add(parent);\r
+   Widget_Data *wd = elm_widget_data_get(popup);\r
+   char buf[4096];\r
+   \r
+   if (desc_text)\r
+     {\r
+       elm_popup_desc_set(popup, desc_text);\r
+     }\r
+   if (title)\r
+     {\r
+       elm_popup_title_label_set(popup, title);\r
+     }\r
+   if (first_button_text)\r
+     {\r
+       va_list args;  \r
+       va_start(args, first_button_text); \r
+       wd->action_area = elm_layout_add(popup);\r
+       elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);\r
+       snprintf(buf,sizeof(buf), "buttons%d", no_of_buttons);\r
+       elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(popup));\r
+       edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");\r
+       if (wd->title_area)\r
+         {\r
+               edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");\r
+         }\r
+       _elm_popup_buttons_add_valist (popup, first_button_text, args);\r
+       va_end(args);\r
+     }\r
+   edje_object_message_signal_process(wd->layout);\r
    _sizing_eval(popup);\r
    \r
    return popup;   \r
 }\r
 \r
+\r
 /**\r
  * This Set's the description text in content area of Popup widget.\r
  *\r
@@ -536,7 +590,8 @@ elm_popup_title_label_set(Evas_Object *obj, const char *text)
    if (wd->title_icon)\r
      {\r
        edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");\r
-     }     \r
+     } \r
+   edje_object_message_signal_process(wd->layout);\r
    _sizing_eval(obj);\r
 }\r
 \r
@@ -581,6 +636,7 @@ elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon)
    wd->title_icon = icon;   \r
    elm_layout_content_set(wd->layout, "elm.swallow.title.icon", wd->title_icon);    \r
    edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");   \r
+   edje_object_message_signal_process(wd->layout);\r
    _sizing_eval(obj);\r
 }\r
 \r
@@ -687,6 +743,7 @@ elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_tex
      }\r
    _elm_popup_buttons_add_valist (obj, first_button_text, args);\r
    va_end(args);\r
+   edje_object_message_signal_process(wd->layout);\r
    _sizing_eval(obj);\r
 }\r
 \r