summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-02-10 01:27:00 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-02-10 01:28:55 +0900
commit0136122e1200ffc05985e8d97c39e75f5a6ca268 (patch)
tree6136f10a1759adfbdc0c280688b24d33703a9c75
parent046f90bf963267f1fdaffc462eb59383dd09aae9 (diff)
test_entry: Refactored entry user style sample code.
- removed unnecessary lines. - used proper variable name. - used proper parent on widget add.
-rw-r--r--src/bin/test_entry.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/bin/test_entry.c b/src/bin/test_entry.c
index 0e6129ad5..9c0e7f0a7 100644
--- a/src/bin/test_entry.c
+++ b/src/bin/test_entry.c
@@ -821,18 +821,17 @@ ent_bt_style_user_push(void *data, Evas_Object *obj EINA_UNUSED, void *event_inf
821void 821void
822test_entry_style_user(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 822test_entry_style_user(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
823{ 823{
824 Evas_Object *win, *bx, *vbx, *en, *bt, *bt2; 824 Evas_Object *win, *bx, *hbx, *en, *bt, *bt2;
825 825
826 win = elm_win_util_standard_add("entry-style", "Entry User Style"); 826 win = elm_win_util_standard_add("entry-user-style", "Entry User Style");
827 elm_win_autodel_set(win, EINA_TRUE); 827 elm_win_autodel_set(win, EINA_TRUE);
828 evas_object_resize(win, 300, 300);
829 828
830 bx = elm_box_add(win); 829 bx = elm_box_add(win);
831 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 830 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
832 elm_win_resize_object_add(win, bx); 831 elm_win_resize_object_add(win, bx);
833 evas_object_show(bx); 832 evas_object_show(bx);
834 833
835 en = elm_entry_add(win); 834 en = elm_entry_add(bx);
836 elm_entry_line_wrap_set(en, ELM_WRAP_MIXED); 835 elm_entry_line_wrap_set(en, ELM_WRAP_MIXED);
837 elm_entry_text_style_user_push(en, user_style); 836 elm_entry_text_style_user_push(en, user_style);
838 elm_object_text_set(en, 837 elm_object_text_set(en,
@@ -845,48 +844,36 @@ test_entry_style_user(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
845 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 844 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
846 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); 845 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
847 elm_box_pack_end(bx, en); 846 elm_box_pack_end(bx, en);
848 evas_object_resize(en, 300, 300);
849 evas_object_show(en); 847 evas_object_show(en);
850 elm_object_focus_set(en, EINA_TRUE); 848 elm_object_focus_set(en, EINA_TRUE);
851 849
852 vbx = elm_box_add(win); 850 hbx = elm_box_add(bx);
853 elm_box_horizontal_set(vbx, EINA_TRUE); 851 elm_box_horizontal_set(hbx, EINA_TRUE);
854 elm_box_pack_end(bx, vbx); 852 elm_box_pack_end(bx, hbx);
855 evas_object_show(vbx); 853 evas_object_show(hbx);
856 854
857 bt = elm_button_add(win); 855 bt = elm_button_add(hbx);
858 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
859 elm_object_text_set(bt, "Peek"); 856 elm_object_text_set(bt, "Peek");
860 evas_object_smart_callback_add(bt, "clicked", ent_bt_style_user_peek, en); 857 evas_object_smart_callback_add(bt, "clicked", ent_bt_style_user_peek, en);
861 evas_object_size_hint_weight_set(bt, 0.0, 0.0); 858 elm_box_pack_end(hbx, bt);
862 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0.5);
863 elm_box_pack_end(vbx, bt);
864 evas_object_propagate_events_set(bt, EINA_FALSE);
865 elm_object_focus_allow_set(bt, EINA_FALSE); 859 elm_object_focus_allow_set(bt, EINA_FALSE);
866 evas_object_show(bt); 860 evas_object_show(bt);
867 861
868 bt2 = elm_button_add(win); 862 bt2 = elm_button_add(hbx);
869 evas_object_size_hint_weight_set(bt2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
870 elm_object_text_set(bt2, "Pop"); 863 elm_object_text_set(bt2, "Pop");
871 evas_object_smart_callback_add(bt2, "clicked", ent_bt_style_user_pop, en); 864 evas_object_smart_callback_add(bt2, "clicked", ent_bt_style_user_pop, en);
872 evas_object_size_hint_weight_set(bt2, 0.0, 0.0); 865 elm_box_pack_end(hbx, bt2);
873 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, 0.5);
874 elm_box_pack_end(vbx, bt2);
875 evas_object_propagate_events_set(bt2, EINA_FALSE);
876 elm_object_focus_allow_set(bt2, EINA_FALSE); 866 elm_object_focus_allow_set(bt2, EINA_FALSE);
877 evas_object_show(bt2); 867 evas_object_show(bt2);
878 868
879 bt2 = elm_button_add(win); 869 bt2 = elm_button_add(hbx);
880 evas_object_size_hint_weight_set(bt2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
881 elm_object_text_set(bt2, "Push"); 870 elm_object_text_set(bt2, "Push");
882 evas_object_smart_callback_add(bt2, "clicked", ent_bt_style_user_push, en); 871 evas_object_smart_callback_add(bt2, "clicked", ent_bt_style_user_push, en);
883 evas_object_size_hint_weight_set(bt2, 0.0, 0.0); 872 elm_box_pack_end(hbx, bt2);
884 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, 0.5);
885 elm_box_pack_end(vbx, bt2);
886 evas_object_propagate_events_set(bt2, EINA_FALSE);
887 elm_object_focus_allow_set(bt2, EINA_FALSE); 873 elm_object_focus_allow_set(bt2, EINA_FALSE);
888 evas_object_show(bt2); 874 evas_object_show(bt2);
889 875
876 evas_object_resize(win, 300, 100);
890 evas_object_show(win); 877 evas_object_show(win);
891} 878}
892 879