summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2013-08-30 18:15:48 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2013-08-30 18:15:48 +0900
commit3ea332fdc602668139b34779356d82a5035acbea (patch)
tree3988bae8121b0989cdf13c4454e0741ada920821
parent9e6c219537df2007f496a48ffb7b6867bdbcb1d3 (diff)
widget_option: used hoversel for popup orient option.
-rw-r--r--src/bin/widget_option.c61
1 files changed, 38 insertions, 23 deletions
diff --git a/src/bin/widget_option.c b/src/bin/widget_option.c
index 2840ee4..9ad1b79 100644
--- a/src/bin/widget_option.c
+++ b/src/bin/widget_option.c
@@ -308,6 +308,25 @@ _widget_option_genlist_create(Evas_Object *box)
308} 308}
309 309
310// popup 310// popup
311struct _Popup_Orient
312{
313 const char *name;
314 Elm_Popup_Orient orient;
315};
316
317struct _Popup_Orient _popup_orient[ELM_POPUP_ORIENT_LAST] =
318{
319 { "Top", ELM_POPUP_ORIENT_TOP },
320 { "Center", ELM_POPUP_ORIENT_CENTER },
321 { "Bottom", ELM_POPUP_ORIENT_BOTTOM },
322 { "Left", ELM_POPUP_ORIENT_LEFT },
323 { "Right", ELM_POPUP_ORIENT_RIGHT },
324 { "Top Left", ELM_POPUP_ORIENT_TOP_LEFT },
325 { "Top Right", ELM_POPUP_ORIENT_TOP_RIGHT },
326 { "Bottom Left", ELM_POPUP_ORIENT_BOTTOM_LEFT },
327 { "Bottom Right", ELM_POPUP_ORIENT_BOTTOM_RIGHT }
328};
329
311static void 330static void
312_popup_button_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, 331_popup_button_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
313 void *event_info EINA_UNUSED) 332 void *event_info EINA_UNUSED)
@@ -344,18 +363,20 @@ _popup_content_changed_cb(void *data EINA_UNUSED,
344} 363}
345 364
346static void 365static void
347_popup_orient_changed_cb(void *data EINA_UNUSED, 366_popup_orient_changed_cb(void *data, Evas_Object *obj,
348 Evas_Object *obj,
349 void *event_info EINA_UNUSED) 367 void *event_info EINA_UNUSED)
350{ 368{
351 wod->pop_orient = elm_radio_value_get(obj); 369 wod->pop_orient = (int)(uintptr_t)data;
352 gui_preview_update(); 370 gui_preview_update();
371
372 elm_object_text_set(obj, _popup_orient[wod->pop_orient].name);
353} 373}
354 374
355static void 375static void
356_widget_option_popup_create(Evas_Object *box) 376_widget_option_popup_create(Evas_Object *box)
357{ 377{
358 Evas_Object *o = NULL, *rdg = NULL; 378 Evas_Object *o = NULL, *rdg = NULL;
379 int i = 0;
359 380
360 // number of buttons 381 // number of buttons
361 WIDGET_OPTION_LABEL_ADD(" &lt; Number of Buttons &gt; "); 382 WIDGET_OPTION_LABEL_ADD(" &lt; Number of Buttons &gt; ");
@@ -397,26 +418,20 @@ _widget_option_popup_create(Evas_Object *box)
397 WIDGET_OPTION_SEPARATOR_ADD(); 418 WIDGET_OPTION_SEPARATOR_ADD();
398 419
399 // orient set 420 // orient set
400 WIDGET_OPTION_LABEL_ADD(" &lt; Orient Set &gt; "); 421 WIDGET_OPTION_LABEL_ADD(" &lt; Popup Orient &gt; ");
401 WIDGET_OPTION_RADIO_ADD("Top", 0, _popup_orient_changed_cb); 422
402 rdg = o; 423 o = elm_hoversel_add(box);
403 WIDGET_OPTION_RADIO_ADD("Center", 1, _popup_orient_changed_cb); 424 WEIGHT(o, EVAS_HINT_EXPAND, 0.0); ALIGN(o, 0.0, 0.0);
404 elm_radio_group_add(o, rdg); 425 elm_hoversel_hover_parent_set(o, gd->win);
405 WIDGET_OPTION_RADIO_ADD("Bottom", 2, _popup_orient_changed_cb); 426 elm_object_text_set(o, _popup_orient[wod->pop_orient].name);
406 elm_radio_group_add(o, rdg); 427 for (i = 0; i < ELM_POPUP_ORIENT_LAST; i++)
407 WIDGET_OPTION_RADIO_ADD("Left", 3, _popup_orient_changed_cb); 428 {
408 elm_radio_group_add(o, rdg); 429 elm_hoversel_item_add(o, _popup_orient[i].name, NULL, ELM_ICON_NONE,
409 WIDGET_OPTION_RADIO_ADD("Right", 4, _popup_orient_changed_cb); 430 _popup_orient_changed_cb,
410 elm_radio_group_add(o, rdg); 431 (void *)(uintptr_t)_popup_orient[i].orient);
411 WIDGET_OPTION_RADIO_ADD("Top Left", 5, _popup_orient_changed_cb); 432 }
412 elm_radio_group_add(o, rdg); 433 elm_box_pack_end(box, o);
413 WIDGET_OPTION_RADIO_ADD("Top Right", 6, _popup_orient_changed_cb); 434 evas_object_show(o);
414 elm_radio_group_add(o, rdg);
415 WIDGET_OPTION_RADIO_ADD("Bottom Left", 7, _popup_orient_changed_cb);
416 elm_radio_group_add(o, rdg);
417 WIDGET_OPTION_RADIO_ADD("Bottom Right", 8, _popup_orient_changed_cb);
418 elm_radio_group_add(o, rdg);
419 elm_radio_value_set(rdg, wod->pop_orient);
420} 435}
421 436
422// progressbar 437// progressbar