summaryrefslogtreecommitdiff
path: root/src/examples/gengrid_example.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2011-09-15 02:16:37 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2011-09-15 02:16:37 +0000
commit23b2dfe293ce2ce444520292fa165b05ba1964e6 (patch)
tree1bfc6ca60ab5a4dd73eb0bc5eb819af9e3cb712c /src/examples/gengrid_example.c
parent97d44c255ed107712d733f5c14140fc2047269a7 (diff)
elm gengrid: Added page feature to gengrid. Patch by Benjamin Drucker
<benjamin.t.drucker@alum.mit.edu>. Thanks a lot! On Wed, Aug 31, 2011 at 1:52 PM, Benjamin Drucker <benjamin.t.drucker@alum.mit.edu> wrote: > Earlier this month, there was a svn commit > (http://trac.enlightenment.org/e/changeset/62496) which added a few > page-related APIs to the elm scroller.  These should probably also be > added to gengrid, genlist and maybe even grid and list.  Right now, > though, I need them for gengrid.  So I propose this patch, based > entirely on the change that went in before.  I've built it and I'm > using these new gengrid APIs in my code now. On Fri, Sep 9, 2011 at 4:45 PM, Benjamin Drucker <benjamin.t.drucker@alum.mit.edu> wrote: > Slowly but surely.... > > This version of the gengrid page APIs patch has the following changes: > 1. fixed spacing issues > 2. add const where needed > 3. submitted a gengrid longpressed change in a separate patch > > I really want to try to squeak this in the upcoming release if at all > possible. If I have an extra space in some file, I promise I'll not do > it again for the next patch! > > Thanks!! > Ben SVN revision: 63403
Diffstat (limited to 'src/examples/gengrid_example.c')
-rw-r--r--src/examples/gengrid_example.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/examples/gengrid_example.c b/src/examples/gengrid_example.c
index b3c145eab..c68e5e52f 100644
--- a/src/examples/gengrid_example.c
+++ b/src/examples/gengrid_example.c
@@ -365,6 +365,18 @@ _grid_del(void *data,
365 free(it); 365 free(it);
366} 366}
367 367
368/* scrolling animation stopped callback */
369static void
370_grid_scroll_stopped_cb(void *data __UNUSED__,
371 Evas_Object *obj,
372 void *event_info __UNUSED__)
373{
374 int h_pagenumber = 0, v_pagenumber = 0;
375 elm_gengrid_current_page_get(obj, &h_pagenumber, &v_pagenumber);
376 fprintf(stdout, "Grid current horiz page is %d, vert page is %d\n",
377 h_pagenumber, v_pagenumber);
378}
379
368/* items grid horizontal alignment change */ 380/* items grid horizontal alignment change */
369static void 381static void
370_h_align_change_cb(void *data, 382_h_align_change_cb(void *data,
@@ -551,6 +563,7 @@ elm_main(int argc __UNUSED__,
551 evas_object_show(hbx_3); 563 evas_object_show(hbx_3);
552 564
553 elm_gengrid_align_get(grid, &h, &v); 565 elm_gengrid_align_get(grid, &h, &v);
566 evas_object_smart_callback_add(grid, "scroll,anim,stop", _grid_scroll_stopped_cb, NULL);
554 567
555 sl = elm_slider_add(win); 568 sl = elm_slider_add(win);
556 elm_object_text_set(sl, "Horiz. alignment"); 569 elm_object_text_set(sl, "Horiz. alignment");
@@ -588,6 +601,7 @@ elm_main(int argc __UNUSED__,
588 elm_box_pack_end(hbx_3, sl); 601 elm_box_pack_end(hbx_3, sl);
589 evas_object_show(sl); 602 evas_object_show(sl);
590 603
604 _page_change_cb(grid, sl, NULL);
591 evas_object_smart_callback_add(sl, "changed", _page_change_cb, grid); 605 evas_object_smart_callback_add(sl, "changed", _page_change_cb, grid);
592 606
593 gic.item_style = "default"; 607 gic.item_style = "default";