[access] move mouse postion if an object has a highlight by highlight_cycle(); not...
[framework/uifw/elementary.git] / src / examples / conformant_example_02.c
1 /**
2  * Simple Elementary's <b>conformant widget</b> example, illustrating its
3  * usage and API.
4  *
5  * See stdout/stderr for output. Compile with:
6  *
7  * @verbatim
8  * gcc -g conformant_example_02.c -o conformant_example_02 `pkg-config --cflags --libs elementary`
9  * @endverbatim
10  */
11
12 #include <Elementary.h>
13
14 EAPI_MAIN int
15 elm_main(int argc, char **argv)
16 {
17    Evas_Object *win, *bg, *conform, *btn, *bx, *en;
18
19    win = elm_win_add(NULL, "conformant", ELM_WIN_BASIC);
20    elm_win_title_set(win, "Conformant Example");
21    elm_win_autodel_set(win, EINA_TRUE);
22
23    elm_win_conformant_set(win, EINA_TRUE);
24
25    bg = elm_bg_add(win);
26    elm_win_resize_object_add(win, bg);
27    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28    evas_object_show(bg);
29
30    conform = elm_conformant_add(win);
31    elm_win_resize_object_add(win, conform);
32    evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33    evas_object_show(conform);
34
35    bx = elm_box_add(win);
36    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
38
39    btn = elm_button_add(win);
40    elm_object_text_set(btn, "Test Conformant");
41    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
42    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
43    elm_box_pack_end(bx, btn);
44    evas_object_show(btn);
45
46    en = elm_entry_add(win);
47    elm_entry_scrollable_set(en, EINA_TRUE);
48    elm_object_text_set(en,
49                        "This is a multi-line entry at the bottom<br>"
50                        "This can contain more than 1 line of text and be "
51                        "scrolled around to allow for entering of lots of "
52                        "content. It is also to test to see that autoscroll "
53                        "moves to the right part of a larger multi-line "
54                        "text entry that is inside of a scroller than can be "
55                        "scrolled around, thus changing the expected position "
56                        "as well as cursor changes updating auto-scroll when "
57                        "it is enabled.");
58
59    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
60    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
61    evas_object_show(en);
62    elm_box_pack_end(bx, en);
63
64    btn = elm_button_add(win);
65    elm_object_text_set(btn, "Test Conformant");
66    evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
67    evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
68    elm_box_pack_end(bx, btn);
69    evas_object_show(btn);
70
71    elm_object_content_set(conform, bx);
72    evas_object_show(bx);
73
74    evas_object_resize(win, 240, 480);
75    evas_object_show(win);
76
77    elm_run();
78    elm_shutdown();
79
80    return 0;
81 }
82 ELM_MAIN()