[SLP Merge] Thu Jul 7 13:20:56 2011 +0900
[framework/uifw/elementary.git] / src / bin / test_separator.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6 void
7 test_separator(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *win, *bg, *bx0, *bx, *bt, *sp;
10
11    win = elm_win_add(NULL, "separators", ELM_WIN_BASIC);
12    elm_win_title_set(win, "Separators");
13    elm_win_autodel_set(win, 1);
14
15    bg = elm_bg_add(win);
16    elm_win_resize_object_add(win, bg);
17    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
18    evas_object_show(bg);
19
20    bx0 = elm_box_add(win);
21    evas_object_size_hint_weight_set(bx0, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
22    elm_box_horizontal_set(bx0, 1);
23    elm_win_resize_object_add(win, bx0);
24    evas_object_show(bx0);
25
26    bx = elm_box_add(win);
27    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28    elm_box_pack_end(bx0, bx);
29    evas_object_show(bx);
30
31    bt = elm_button_add(win);
32    elm_object_text_set(bt, "Left upper corner");
33    elm_box_pack_end(bx, bt);
34    evas_object_show(bt);
35
36    sp = elm_separator_add(win);
37    elm_separator_horizontal_set(sp, 1); // by default, separator is vertical, we must set it horizontal
38    elm_box_pack_end(bx, sp);
39    evas_object_show(sp);
40
41    bt = elm_button_add(win);
42    elm_object_text_set(bt, "Left lower corner");
43    elm_object_disabled_set(bt, 1);
44    elm_box_pack_end(bx, bt);
45    evas_object_show(bt);
46
47    sp = elm_separator_add(win); // now we need vertical separator
48    elm_box_pack_end(bx0, sp);
49    evas_object_show(sp);
50
51    bx = elm_box_add(win);
52    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
53    elm_box_pack_end(bx0, bx);
54    evas_object_show(bx);
55
56    bt = elm_button_add(win);
57    elm_object_text_set(bt, "Right upper corner");
58    elm_object_disabled_set(bt, 1);
59    elm_box_pack_end(bx, bt);
60    evas_object_show(bt);
61
62    sp = elm_separator_add(win);
63    elm_separator_horizontal_set(sp, 1);
64    elm_box_pack_end(bx, sp);
65    evas_object_show(sp);
66
67    bt = elm_button_add(win);
68    elm_object_text_set(bt, "Right lower corner");
69    elm_box_pack_end(bx, bt);
70    evas_object_show(bt);
71
72    evas_object_show(win);
73 }
74 #endif