}
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;
Evas_Object *fp = data;
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);
}
evas_object_show(fp);
bt = elm_button_add(win);
- elm_button_label_set(bt, "Select 1990");
- evas_object_smart_callback_add(bt, "clicked", _first_cb, fp);
+ elm_button_label_set(bt, "Select 1992");
+ evas_object_smart_callback_add(bt, "clicked", _third_cb, fp);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
}
static void
-_flip_up(Widget_Data *wd)
+_send_msg(Widget_Data *wd, int flipside, char *label)
{
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;
if (!wd->current)
if (!item)
return;
- msg.str = (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;
+ _send_msg(wd, MSG_FLIP_UP, (char *)item->label);
}
static Eina_Bool
static void
_flip_down(Widget_Data *wd)
{
- Edje_Message_String msg;
Elm_Flippicker_Item *item;
if (!wd->current)
if (!item)
return;
- msg.str = (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;
+ _send_msg(wd, MSG_FLIP_DOWN, (char *)item->label);
}
static Eina_Bool
{
ELM_FLIPPICKER_ITEM_CHECK_DELETED_RETURN(item);
- Elm_Flippicker_Item *_item;
+ Elm_Flippicker_Item *_item, *cur;
+ int flipside = MSG_FLIP_UP;
Widget_Data *wd;
Eina_List *l;
if (!wd)
return;
+ cur = DATA_GET(wd->current);
+ if (cur == item)
+ return;
+
_flippicker_walk(wd);
EINA_LIST_FOREACH(wd->items, l, _item)
{
+ if (_item == cur)
+ flipside = MSG_FLIP_DOWN;
+
if (_item == item)
{
wd->current = l;
- _update_view(item->base.widget);
+ _send_msg(wd, flipside, (char *)item->label);
break;
}
}