elm gengrid: Gengrid longpress documentation. Patch by Benjamin Drucker <benjamin.t.drucker@alum.mit.edu>

On Fri, Sep 9, 2011 at 4:18 PM, Benjamin Drucker <benjamin.t.drucker@alum.mit.edu> wrote:
> gengrid already emits "longpressed" signals, but it is not currently
> documented nor demonstrated in the examples.  See the attached patch,
> please.


SVN revision: 63323
This commit is contained in:
Daniel Juyung Seo 2011-09-11 12:24:40 +00:00
parent d2af2558dc
commit 821ad97778
3 changed files with 16 additions and 1 deletions

View File

@ -288,6 +288,16 @@ _double_click(void *data __UNUSED__,
fprintf(stdout, "Double click on item with handle %p\n", event_info);
}
/* item long press callback */
static void
_long_pressed(void *data __UNUSED__,
Evas_Object *obj __UNUSED__,
void *event_info)
{
fprintf(stdout, "Long press on item with handle %p\n", event_info);
}
/* label fetching callback */
static char *
_grid_label_get(void *data,
@ -428,6 +438,7 @@ elm_main(int argc __UNUSED__,
evas_object_size_hint_min_set(grid, 600, 500);
elm_box_pack_end(bx, grid);
evas_object_smart_callback_add(grid, "clicked,double", _double_click, NULL);
evas_object_smart_callback_add(grid, "longpressed", _long_pressed, NULL);
evas_object_show(grid);
hbx_1 = elm_box_add(win);

View File

@ -7835,6 +7835,8 @@ extern "C" {
* is the gengrid item that was activated.
* - @c "clicked,double" - The user has double-clicked an item.
* The @c event_info parameter is the gengrid item that was double-clicked.
* - @c "longpressed" - This is called when the item is pressed for a certain
* amount of time. By default it's 1 second.
* - @c "selected" - The user has made an item selected. The
* @c event_info parameter is the gengrid item that was selected.
* - @c "unselected" - The user has made an item unselected. The

View File

@ -135,6 +135,7 @@ static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
static const char SIG_LONGPRESSED[] = "longpressed";
static const char SIG_SELECTED[] = "selected";
static const char SIG_UNSELECTED[] = "unselected";
static const char SIG_REALIZED[] = "realized";
@ -156,6 +157,7 @@ static const char SIG_MOVED[] = "moved";
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_ACTIVATED, ""},
{SIG_CLICKED_DOUBLE, ""},
{SIG_LONGPRESSED, ""},
{SIG_SELECTED, ""},
{SIG_UNSELECTED, ""},
{SIG_REALIZED, ""},
@ -762,7 +764,7 @@ _long_press(void *data)
item->long_timer = NULL;
if ((item->disabled) || (item->dragging)) return ECORE_CALLBACK_CANCEL;
item->wd->longpressed = EINA_TRUE;
evas_object_smart_callback_call(item->wd->self, "longpressed", item);
evas_object_smart_callback_call(item->wd->self, SIG_LONGPRESSED, item);
if (item->wd->reorder_mode)
{
item->wd->reorder_item = item;