tasn pushed a commit to branch master.

http://git.enlightenment.org/bindings/cxx/eflxx.git/commit/?id=3663fe86c03f2c5b4b5590b7804a036a24256529

commit 3663fe86c03f2c5b4b5590b7804a036a24256529
Author: Andreas Volz <[email protected]>
Date:   Tue Aug 4 17:46:11 2009 +0000

    hover example
    
    
    SVN revision: 41596
---
 eflxx_examples/src/elementaryxx/full/main.cpp | 146 ++++++++++++--------------
 1 file changed, 70 insertions(+), 76 deletions(-)

diff --git a/eflxx_examples/src/elementaryxx/full/main.cpp 
b/eflxx_examples/src/elementaryxx/full/main.cpp
index ec43fc8..35c2de4 100644
--- a/eflxx_examples/src/elementaryxx/full/main.cpp
+++ b/eflxx_examples/src/elementaryxx/full/main.cpp
@@ -433,97 +433,97 @@ my_bt_10(void *data, Evas_Object *obj, void *event_info)
   win->show ();
 }
 
-#if 0
-
 static void
-my_hover_bt_1(void *data, Evas_Object *obj, void *event_info)
+my_hover_bt_1(Evas_Object *obj, void *event_info, ElmHover *hv)
 {
-  Evas_Object *hv = data;
-
-  evas_object_show(hv);
+  hv->show ();
 }
 
 static void
 my_bt_11(void *data, Evas_Object *obj, void *event_info)
 {
-  Evas_Object *win, *bg, *bx, *bt, *hv, *ic;
-  char buf[PATH_MAX];
+  ElmButton *bt = NULL;
+  ElmBox *bx = NULL;
+  
+  ElmWindow *win = ElmWindow::factory ("hover", ELM_WIN_BASIC);
+  win->setTitle ("Hover");
+  win->setAutoDel (true);
+  
+  ElmBackground *bg = ElmBackground::factory (*win);
+  win->addObjectResize (*bg);
+  bg->setWeightHintSize (1.0, 1.0);
+  bg->show ();
 
-  win = elm_win_add(NULL, "hover", ELM_WIN_BASIC);
-  elm_win_title_set(win, "Hover");
-  elm_win_autodel_set(win, 1);
+  bx = ElmBox::factory (*win);
+  bx->setWeightHintSize (1.0, 1.0);
+  win->addObjectResize (*bx);
+  bx->show ();
 
-  bg = elm_bg_add(win);
-  elm_win_resize_object_add(win, bg);
-  evas_object_size_hint_weight_set(bg, 1.0, 1.0);
-  evas_object_show(bg);
+  ElmHover *hv = ElmHover::factory (*win);
 
-  bx = elm_box_add(win);
-  evas_object_size_hint_weight_set(bx, 1.0, 1.0);
-  elm_win_resize_object_add(win, bx);
-  evas_object_show(bx);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Button");
+  bt->getEventSignal ("clicked")->connect (sigc::bind (sigc::ptr_fun 
(&my_hover_bt_1), hv));
+  bx->packEnd (*bt);
+  bt->show ();
+  hv->setParent (*win);
+  hv->setTarget (*bt);
 
-  hv = elm_hover_add(win);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Popup");
+  hv->setContent ("middle", *bt);
+  bt->show ();
 
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Button");
-  evas_object_smart_callback_add(bt, "clicked", my_hover_bt_1, hv);
-  elm_box_pack_end(bx, bt);
-  evas_object_show(bt);
-  elm_hover_parent_set(hv, win);
-  elm_hover_target_set(hv, bt);
+  bx = ElmBox::factory (*win);
 
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Popup");
-  elm_hover_content_set(hv, "middle", bt);
-  evas_object_show(bt);
+  ElmIcon *ic = ElmIcon::factory (*win);
+  ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png"));
+  ic->setScale (0, 0);
+  bx->packEnd (*ic);
+  ic->show ();
 
-  bx = elm_box_add(win);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Top 1");
+  bx->packEnd (*bt);
+  bt->show ();
 
-  ic = elm_icon_add(win);
-  snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
-  elm_icon_file_set(ic, buf, NULL);
-  elm_icon_scale_set(ic, 0, 0);
-  elm_box_pack_end(bx, ic);
-  evas_object_show(ic);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Top 2");
+  bx->packEnd (*bt);
+  bt->show ();
 
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Top 1");
-  elm_box_pack_end(bx, bt);
-  evas_object_show(bt);
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Top 2");
-  elm_box_pack_end(bx, bt);
-  evas_object_show(bt);
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Top 3");
-  elm_box_pack_end(bx, bt);
-  evas_object_show(bt);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Top 3");
+  bx->packEnd (*bt);
+  bt->show ();
 
-  evas_object_show(bx);
-  elm_hover_content_set(hv, "top", bx);
+  bx->show ();
 
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Bottom");
-  elm_hover_content_set(hv, "bottom", bt);
-  evas_object_show(bt);
+  hv->setContent ("top", *bx);
 
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Left");
-  elm_hover_content_set(hv, "left", bt);
-  evas_object_show(bt);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Bottom");
+  hv->setContent ("top", *bt);
+  bt->show ();
 
-  bt = elm_button_add(win);
-  elm_button_label_set(bt, "Right");
-  elm_hover_content_set(hv, "right", bt);
-  evas_object_show(bt);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Left");
+  hv->setContent ("left", *bt);
+  bt->show ();
 
-  evas_object_size_hint_min_set(bg, 160, 160);
-  evas_object_size_hint_max_set(bg, 640, 640);
-  evas_object_resize(win, 320, 320);
-  evas_object_show(win);
+  bt = ElmButton::factory (*win);
+  bt->setLabel ("Right");
+  hv->setContent ("right", *bt);
+  bt->show ();
+
+  bg->setMinHintSize (size160x160);
+  bg->setMaxHintSize (size640x640);
+  win->resize (size320x320);
+  win->show ();
 }
 
+#if 0
+
 static void
 my_bt_12(void *data, Evas_Object *obj, void *event_info)
 {
@@ -3541,8 +3541,8 @@ int main (int argc, char **argv)
   li->append("Table", my_bt_8, NULL);
   li->append("Clock", my_bt_9, NULL);
   li->append("Layout", my_bt_10, NULL);
-  /*li.append("Hover", NULL, NULL, my_bt_11, NULL);
-  li.append("Hover 2", NULL, NULL, my_bt_12, NULL);
+  li->append("Hover", my_bt_11, NULL);
+  /*li.append("Hover 2", NULL, NULL, my_bt_12, NULL);
   li.append("Entry", NULL, NULL, my_bt_13, NULL);
   li.append("Entry Scrolled", NULL, NULL, my_bt_14, NULL);
   li.append("Notepad", NULL, NULL, my_bt_15, NULL);
@@ -3579,9 +3579,3 @@ int main (int argc, char **argv)
 
   elmApp->run ();
 }
-
-
-
-
-
-

-- 


Reply via email to