elm radio: Added elm_radio_selected_object_get().
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 21 Feb 2012 11:46:01 +0000 (11:46 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 21 Feb 2012 11:46:01 +0000 (11:46 +0000)
Signed-off-by: Daniel Juyung Seo <juyung.seo@samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68215 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_radio.c
src/lib/elm_radio.h

index 391197d..3d7617c 100644 (file)
@@ -528,3 +528,23 @@ elm_radio_value_pointer_set(Evas_Object *obj, int *valuep)
         wd->group->valuep = NULL;
      }
 }
+
+EAPI Evas_Object *
+elm_radio_selected_object_get(Evas_Object *obj)
+{
+   Eina_List *l;
+   Evas_Object *child;
+   Widget_Data *wd2;
+
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+
+   EINA_LIST_FOREACH(wd->group->radios, l, child)
+     {
+        wd2  = elm_widget_data_get(child);
+        if (wd2->value == wd->group->value)
+           return child;
+     }
+   return NULL;
+}
index c25fefb..36eadfe 100644 (file)
@@ -131,5 +131,13 @@ EAPI int                          elm_radio_value_get(const Evas_Object *obj);
 EAPI void                         elm_radio_value_pointer_set(Evas_Object *obj, int *valuep);
 
 /**
+ * @brief Get the selected radio object.
+ *
+ * @param obj Any radio object (any object of a group)
+ * @return The selected radio object
+ */
+EAPI Evas_Object                 *elm_radio_selected_object_get(Evas_Object *obj);
+
+/**
  * @}
  */