#include <Elementary.h>
static const char *commands = \
"commands are:\n"
"\tn - flip to next item\n"
"\tp - flip to previous item\n"
"\tf - print first item's label\n"
"\tl - print last item's label\n"
"\ts - print selected item's label\n"
"\th - print help\n";
void
_unsel_cb(void *data,
{
it = elm_flipselector_selected_item_get(fp);
elm_flipselector_item_selected_set(it,
EINA_FALSE);
}
void
_del_cb(void *data,
{
it = elm_flipselector_selected_item_get(fp);
}
void
{
printf("Underflow!\n");
}
void
{
printf("Overflow!\n");
}
_on_keydown(void *data,
void *event_info)
{
{
printf("%s", commands);
}
else if (strcmp(ev->
keyname,
"n") == 0)
{
elm_flipselector_flip_next(fs);
printf("Flipping to next item\n");
}
else if (strcmp(ev->
keyname,
"p") == 0)
{
elm_flipselector_flip_prev(fs);
printf("Flipping to previous item\n");
}
else if (strcmp(ev->
keyname,
"f") == 0)
{
it = elm_flipselector_first_item_get(fs);
printf("Flip selector's first item is: %s\n", it ?
elm_object_item_text_get(it) : "none");
}
else if (strcmp(ev->
keyname,
"l") == 0)
{
it = elm_flipselector_last_item_get(fs);
printf("Flip selector's last item is: %s\n", it ?
elm_object_item_text_get(it) : "none");
}
else if (strcmp(ev->
keyname,
"s") == 0)
{
it = elm_flipselector_selected_item_get(fs);
printf("Flip selector's selected item is: %s\n", it ?
elm_object_item_text_get(it) : "none");
}
else
}
EAPI_MAIN int
{
unsigned int i;
static const char *lbl[] =
{
"Elementary",
"Evas",
"Eina",
"Edje",
"Eet",
"Ecore",
"Efreet",
"Eldbus"
};
for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
elm_object_text_set(bt, "Unselect item");
elm_object_text_set(bt, "Delete item");
printf("%s", commands);
return 0;
}
@ EVAS_EVENT_FLAG_ON_HOLD
This event is being delivered but should be put "on hold" until the on hold flag is unset.
Definition: Evas_Common.h:368
#define EVAS_HINT_EXPAND
Use with evas_object_size_hint_weight_set(), evas_object_size_hint_weight_get(), evas_object_size_hin...
Definition: Evas_Common.h:297
Evas_Callback_Type
Identifier of callbacks to be set for Evas canvases or Evas objects.
Definition: Evas_Common.h:419
@ EVAS_CALLBACK_KEY_DOWN
Key Press Event.
Definition: Evas_Common.h:430
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
#define EINA_FALSE
boolean value FALSE (numerical value 0)
Definition: eina_types.h:533
unsigned char Eina_Bool
Type to mimic a boolean.
Definition: eina_types.h:527
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
Evas_Object * elm_box_add(Evas_Object *parent)
Add a new box to the parent.
Definition: elm_box.c:363
void elm_box_pack_end(Elm_Box *obj, Efl_Canvas_Object *subobj)
Add an object at the end of the pack list.
Definition: elm_box_eo.legacy.c:57
Evas_Object * elm_flipselector_add(Evas_Object *parent)
Add a new flip selector widget to the given parent Elementary (container) widget.
Definition: elm_flipselector.c:659
Eo Elm_Object_Item
An Elementary Object item handle.
Definition: elm_object_item.h:6
#define ELM_MAIN()
macro to be used after the elm_main() function
Definition: elm_general.h:556
Eina_Bool elm_policy_set(unsigned int policy, int value)
Set a new policy's value (for a given policy group/identifier).
Definition: elm_main.c:1380
void elm_object_item_del(Eo *obj)
Delete the given item.
Definition: elm_main.c:2017
void elm_run(void)
Run Elementary's main loop.
Definition: elm_main.c:1357
void elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
Add a callback for input events (key up, key down, mouse wheel) on a given Elementary widget.
Definition: elm_main.c:1879
@ ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
quit when the application's last window is closed
Definition: elm_general.h:248
@ ELM_POLICY_QUIT
under which circumstances the application should quit automatically.
Definition: elm_general.h:227
Evas_Object * elm_win_util_standard_add(const char *name, const char *title)
Adds a window object with standard setup.
Definition: efl_ui_win.c:9582
void elm_win_resize_object_add(Eo *obj, Evas_Object *subobj)
Add subobj as a resize object of window obj.
Definition: efl_ui_win.c:8997
void elm_win_autodel_set(Eo *obj, Eina_Bool autodel)
Set the window's autodel state.
Definition: efl_ui_win.c:6194
EVAS_API void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1814
EVAS_API void evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
Sets the hints for an object's weight.
Definition: evas_object_main.c:2638
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:185
EVAS_API void evas_object_smart_callback_add(Evas_Object *eo_obj, const char *event, Evas_Smart_Cb func, const void *data)
Add (register) a callback function to the smart event specified by event on the smart object obj.
Definition: evas_object_smart.c:1040
Key press event.
Definition: Evas_Legacy.h:314
char * keyname
the name string of the key pressed
Definition: Evas_Legacy.h:315