elm bin: Use convenient utility function elm_win_util_standard_add() instead of elm_w...
[framework/uifw/elementary.git] / src / bin / test_scaling.c
1 #ifdef HAVE_CONFIG_H
2 # include "elementary_config.h"
3 #endif
4 #include <Elementary.h>
5 #ifndef ELM_LIB_QUICKLAUNCH
6 void
7 test_scaling(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *win, *bx, *bt;
10
11    win = elm_win_util_standard_add("scaling", "Scaling");
12    elm_win_autodel_set(win, EINA_TRUE);
13
14    bx = elm_box_add(win);
15    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
16    elm_win_resize_object_add(win, bx);
17    evas_object_show(bx);
18
19    bt = elm_button_add(win);
20    elm_object_text_set(bt, "Scale: 0.5");
21    elm_object_scale_set(bt, 0.5);
22    elm_box_pack_end(bx, bt);
23    evas_object_show(bt);
24
25    bt = elm_button_add(win);
26    elm_object_text_set(bt, "Scale: 0.75");
27    elm_object_scale_set(bt, 0.75);
28    elm_box_pack_end(bx, bt);
29    evas_object_show(bt);
30
31    bt = elm_button_add(win);
32    elm_object_text_set(bt, "Scale: 1.0");
33    elm_object_scale_set(bt, 1.0);
34    elm_box_pack_end(bx, bt);
35    evas_object_show(bt);
36
37    bt = elm_button_add(win);
38    elm_object_text_set(bt, "Scale: 1.5");
39    elm_object_scale_set(bt, 1.5);
40    elm_box_pack_end(bx, bt);
41    evas_object_show(bt);
42
43    bt = elm_button_add(win);
44    elm_object_text_set(bt, "Scale: 2.0");
45    elm_object_scale_set(bt, 2.0);
46    elm_box_pack_end(bx, bt);
47    evas_object_show(bt);
48
49    bt = elm_button_add(win);
50    elm_object_text_set(bt, "Scale: 3.0");
51    elm_object_scale_set(bt, 3.0);
52    elm_box_pack_end(bx, bt);
53    evas_object_show(bt);
54
55    evas_object_resize(win, 320, 320);
56    evas_object_show(win);
57 }
58
59 void
60 test_scaling2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
61 {
62    Evas_Object *win, *bg, *bx, *fr, *lb;
63
64    win = elm_win_add(NULL, "scaling2", ELM_WIN_BASIC);
65    elm_win_title_set(win, "Scaling 2");
66    elm_win_autodel_set(win, EINA_TRUE);
67
68    bg = elm_bg_add(win);
69    elm_win_resize_object_add(win, bg);
70    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
71    evas_object_show(bg);
72
73    bx = elm_box_add(win);
74    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
75    elm_win_resize_object_add(win, bx);
76    evas_object_show(bx);
77
78    fr = elm_frame_add(win);
79    elm_object_scale_set(fr, 0.5);
80    elm_object_text_set(fr, "Scale: 0.5");
81    lb = elm_label_add(win);
82    elm_object_text_set(lb,
83                        "Parent frame scale<br/>"
84                        "is 0.5. Child should<br/>"
85                        "inherit it.");
86    elm_object_content_set(fr, lb);
87    evas_object_show(lb);
88    elm_box_pack_end(bx, fr);
89    evas_object_show(fr);
90
91    fr = elm_frame_add(win);
92    elm_object_text_set(fr, "Scale: 1.0");
93    lb = elm_label_add(win);
94    elm_object_text_set(lb,
95                        "Parent frame scale<br/>"
96                        "is 1.0. Child should<br/>"
97                        "inherit it.");
98    elm_object_content_set(fr, lb);
99    evas_object_show(lb);
100    elm_object_scale_set(fr, 1.0);
101    elm_box_pack_end(bx, fr);
102    evas_object_show(fr);
103
104    fr = elm_frame_add(win);
105    elm_object_text_set(fr, "Scale: 2.0");
106    lb = elm_label_add(win);
107    elm_object_text_set(lb,
108                        "Parent frame scale<br/>"
109                        "is 2.0. Child should<br/>"
110                        "inherit it.");
111    elm_object_content_set(fr, lb);
112    evas_object_show(lb);
113    elm_object_scale_set(fr, 2.0);
114    elm_box_pack_end(bx, fr);
115    evas_object_show(fr);
116
117    evas_object_resize(win, 320, 320);
118    evas_object_show(win);
119 }
120 #endif