elementary/ctxpopup - one more API elm_ctxpopup_dismiss

requested by discomfitor 



SVN revision: 68874
This commit is contained in:
ChunEon Park 2012-03-07 05:58:38 +00:00
parent f7df0c0d4f
commit 2c64142996
2 changed files with 30 additions and 12 deletions

View File

@ -1023,7 +1023,9 @@ static void
_bg_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__, const char *source __UNUSED__)
{
evas_object_hide(data);
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
_hide_signal_emit(data, wd->dir);
}
static void
@ -1061,8 +1063,15 @@ _hide_finished(void *data, Evas_Object *obj __UNUSED__,
static void
_hide(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
_ctxpopup_hide(NULL, NULL, obj, NULL);
evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
}
static void
_ctxpopup_hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(obj);
if ((!wd) || (!wd->visible)) return;
evas_object_hide(wd->bg);
@ -1072,16 +1081,6 @@ _hide(Evas_Object *obj)
_scroller_size_reset(wd);
wd->visible = EINA_FALSE;
evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
}
static void
_ctxpopup_hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_hide_signal_emit(obj, wd->dir);
}
static void
@ -1591,3 +1590,12 @@ elm_ctxpopup_direction_get(const Evas_Object *obj)
if (!wd) return ELM_CTXPOPUP_DIRECTION_UNKNOWN;
return wd->dir;
}
EAPI void
elm_ctxpopup_dismiss(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_hide_signal_emit(obj, wd->dir);
}

View File

@ -190,6 +190,16 @@ EAPI void elm_ctxpopup_direction_priority_get(Evas_Objec
*/
EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Evas_Object *obj);
/**
* @brief Dismiss a ctxpopup object
*
* @param obj The ctxpopup object
* Use this function to simulate clicking outside the ctxpopup to dismiss it.
* In this way, the ctxpopup will be hidden and the "clicked" signal will be
* emitted.
*/
EAPI void elm_ctxpopup_dismiss(Evas_Object *obj);
/**
* @}
*/