From: jh0506.yun Date: Sat, 14 Aug 2010 09:16:47 +0000 (+0900) Subject: [selectioninfo] Modified for Beat UX X-Git-Tag: beat-winset-test_0.1.1-40~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1bd5f3133ec9a6699a914cd0579b0ff3da67e93;p=framework%2Fuifw%2Felementary.git [selectioninfo] Modified for Beat UX --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 138bd6d..8bb2bb2 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -696,12 +696,13 @@ extern "C" { EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat); /* smart callbacks called: */ - + EAPI Evas_Object *elm_selectioninfo_add(Evas_Object *parent); EAPI void elm_selectioninfo_content_set(Evas_Object *obj, Evas_Object *content); EAPI void elm_selectioninfo_parent_set(Evas_Object *obj, Evas_Object *parent); EAPI void elm_selectioninfo_check_state_set(Evas_Object *obj, Eina_Bool *state, int count); - EAPI void elm_selectioninfo_show(Evas_Object *obj); + EAPI int elm_selectioninfo_checked_count_get(Evas_Object *obj); + EAPI void elm_selectioninfo_text_set(Evas_Object *obj, char* text); /* smart callbacks called: */ diff --git a/src/lib/elm_selectioninfo.c b/src/lib/elm_selectioninfo.c index 8ccd7dd..76019d9 100644 --- a/src/lib/elm_selectioninfo.c +++ b/src/lib/elm_selectioninfo.c @@ -4,7 +4,6 @@ #include #include "elm_priv.h" - /** * @defgroup Selectioninfo selectioninfo * @ingroup Elementary @@ -26,7 +25,6 @@ struct _Widget_Data Evas_Object* parent; Eina_Bool* check_state; int check_count; - char label_text[128]; }; static const char *widtype = NULL; @@ -297,39 +295,46 @@ elm_selectioninfo_check_state_set(Evas_Object *obj, Eina_Bool *state, int count) } /** - * Show the selectioninfo + * Get the checked count * * @param obj The selectioninfo object * * @ingroup Selectioninfo */ -EAPI void -elm_selectioninfo_show(Evas_Object *obj) + +EAPI int +elm_selectioninfo_checked_count_get(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return -1; int i; - int state_count = 0; - for (i=0; icheck_count; i++) + int count = 0; + for (i=0; icheck_count; i++) { if (wd->check_state[i]) - state_count++; - } - - if (state_count == 0) - { - evas_object_hide(wd->selectioninfo); + count++; } - else - { - if (state_count == 1) - sprintf(wd->label_text, "%d File Selected", state_count); - else - sprintf(wd->label_text, "%d Files Selected", state_count); - edje_object_part_text_set(_EDJ(wd->content), "elm.text", strdup(wd->label_text)); - evas_object_show(wd->selectioninfo); - } + + return count; +} + +/** + * Set the text to the selectioninfo + * + * @param obj The selectioninfo object + * @param text The text + * + * @ingroup Selectioninfo + */ + +EAPI void +elm_selectioninfo_text_set(Evas_Object *obj, char* text) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + edje_object_part_text_set(_EDJ(wd->content), "elm.text", strdup(text)); }