forked from enlightenment/efl
parent
1537411088
commit
8cbad3de66
|
@ -14,11 +14,13 @@ _sel_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_first_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
_third_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
Elm_Flippicker_Item *it;
|
Elm_Flippicker_Item *it;
|
||||||
Evas_Object *fp = data;
|
Evas_Object *fp = data;
|
||||||
it = elm_flippicker_first_item_get(fp);
|
it = elm_flippicker_first_item_get(fp);
|
||||||
|
it = elm_flippicker_item_next(it);
|
||||||
|
it = elm_flippicker_item_next(it);
|
||||||
elm_flippicker_item_selected_set(it);
|
elm_flippicker_item_selected_set(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +90,8 @@ test_flippicker(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
|
||||||
evas_object_show(fp);
|
evas_object_show(fp);
|
||||||
|
|
||||||
bt = elm_button_add(win);
|
bt = elm_button_add(win);
|
||||||
elm_button_label_set(bt, "Select 1990");
|
elm_button_label_set(bt, "Select 1992");
|
||||||
evas_object_smart_callback_add(bt, "clicked", _first_cb, fp);
|
evas_object_smart_callback_add(bt, "clicked", _third_cb, fp);
|
||||||
elm_box_pack_end(bx, bt);
|
elm_box_pack_end(bx, bt);
|
||||||
evas_object_show(bt);
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
|
|
@ -389,9 +389,20 @@ _changed(Widget_Data *wd)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_flip_up(Widget_Data *wd)
|
_send_msg(Widget_Data *wd, int flipside, char *label)
|
||||||
{
|
{
|
||||||
Edje_Message_String msg;
|
Edje_Message_String msg;
|
||||||
|
|
||||||
|
msg.str = label;
|
||||||
|
edje_object_message_send(wd->base, EDJE_MESSAGE_STRING, flipside, &msg);
|
||||||
|
edje_object_message_signal_process(wd->base);
|
||||||
|
|
||||||
|
_changed(wd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_flip_up(Widget_Data *wd)
|
||||||
|
{
|
||||||
Elm_Flippicker_Item *item;
|
Elm_Flippicker_Item *item;
|
||||||
|
|
||||||
if (!wd->current)
|
if (!wd->current)
|
||||||
|
@ -409,12 +420,7 @@ _flip_up(Widget_Data *wd)
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msg.str = (char *)item->label;
|
_send_msg(wd, MSG_FLIP_UP, (char *)item->label);
|
||||||
edje_object_message_send(wd->base, EDJE_MESSAGE_STRING, MSG_FLIP_UP, &msg);
|
|
||||||
edje_object_message_signal_process(wd->base);
|
|
||||||
|
|
||||||
_changed(wd);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -461,7 +467,6 @@ _signal_val_up_start(void *data, Evas_Object *obj __UNUSED__, const char *emissi
|
||||||
static void
|
static void
|
||||||
_flip_down(Widget_Data *wd)
|
_flip_down(Widget_Data *wd)
|
||||||
{
|
{
|
||||||
Edje_Message_String msg;
|
|
||||||
Elm_Flippicker_Item *item;
|
Elm_Flippicker_Item *item;
|
||||||
|
|
||||||
if (!wd->current)
|
if (!wd->current)
|
||||||
|
@ -478,13 +483,7 @@ _flip_down(Widget_Data *wd)
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msg.str = (char *)item->label;
|
_send_msg(wd, MSG_FLIP_DOWN, (char *)item->label);
|
||||||
|
|
||||||
edje_object_message_send(wd->base, EDJE_MESSAGE_STRING, MSG_FLIP_DOWN, &msg);
|
|
||||||
edje_object_message_signal_process(wd->base);
|
|
||||||
|
|
||||||
_changed(wd);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -864,7 +863,8 @@ elm_flippicker_item_selected_set(Elm_Flippicker_Item *item)
|
||||||
{
|
{
|
||||||
ELM_FLIPPICKER_ITEM_CHECK_DELETED_RETURN(item);
|
ELM_FLIPPICKER_ITEM_CHECK_DELETED_RETURN(item);
|
||||||
|
|
||||||
Elm_Flippicker_Item *_item;
|
Elm_Flippicker_Item *_item, *cur;
|
||||||
|
int flipside = MSG_FLIP_UP;
|
||||||
Widget_Data *wd;
|
Widget_Data *wd;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
|
@ -872,14 +872,21 @@ elm_flippicker_item_selected_set(Elm_Flippicker_Item *item)
|
||||||
if (!wd)
|
if (!wd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
cur = DATA_GET(wd->current);
|
||||||
|
if (cur == item)
|
||||||
|
return;
|
||||||
|
|
||||||
_flippicker_walk(wd);
|
_flippicker_walk(wd);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(wd->items, l, _item)
|
EINA_LIST_FOREACH(wd->items, l, _item)
|
||||||
{
|
{
|
||||||
|
if (_item == cur)
|
||||||
|
flipside = MSG_FLIP_DOWN;
|
||||||
|
|
||||||
if (_item == item)
|
if (_item == item)
|
||||||
{
|
{
|
||||||
wd->current = l;
|
wd->current = l;
|
||||||
_update_view(item->base.widget);
|
_send_msg(wd, flipside, (char *)item->label);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue