Elementary translation: Updated POTFILES.in
[framework/uifw/elementary.git] / src / bin / test_entry.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6 static void
7 my_entry_bt_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *en = data;
10    elm_entry_entry_set(en, "");
11 }
12
13 static void
14 my_entry_bt_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
15 {
16    Evas_Object *en = data;
17    const char *s = elm_entry_entry_get(en);
18    printf("ENTRY:\n");
19    if (s) printf("%s\n", s);
20    printf("ENTRY PLAIN UTF8:\n");
21    if (s)
22      {
23         s = elm_entry_markup_to_utf8(s);
24         if (s)
25           {
26              printf("%s\n", s);
27              free((char *)s);
28           }
29      }
30 }
31
32 static void
33 my_entry_bt_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
34 {
35    Evas_Object *en = data;
36    const char *s = elm_entry_selection_get(en);
37    printf("SELECTION:\n");
38    if (s) printf("%s\n", s);
39    printf("SELECTION PLAIN UTF8:\n");
40    if (s)
41      {
42         s = elm_entry_markup_to_utf8(s);
43         if (s)
44           {
45              printf("%s\n", s);
46              free((char *)s);
47           }
48      }
49 }
50
51 static void
52 my_entry_bt_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
53 {
54    Evas_Object *en = data;
55    elm_entry_entry_insert(en, "Insert some <b>BOLD</> text");
56 }
57
58 void
59 test_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
60 {
61    Evas_Object *win, *bg, *bx, *bx2, *bt, *en;
62    char buf[4096];
63
64    win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
65    elm_win_title_set(win, "Entry");
66    elm_win_autodel_set(win, 1);
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    en = elm_entry_add(win);
79    elm_entry_line_wrap_set(en, 0);
80    snprintf(buf, sizeof(buf),
81             "This is an entry widget in this window that<br>"
82             "uses markup <b>like this</> for styling and<br>"
83             "formatting <em>like this</>, as well as<br>"
84             "<a href=X><link>links in the text</></a>, so enter text<br>"
85             "in here to edit it. By the way, links are<br>"
86             "called <a href=anc-02>Anchors</a> so you will need<br>"
87             "to refer to them this way.<br>"
88             "<br>"
89             
90             "Also you can stick in items with (relsize + ascent): "
91             "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
92             " (full) "
93             "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
94             " (to the left)<br>"
95             
96             "Also (size + ascent): "
97             "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
98             " (full) "
99             "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
100             " (before this)<br>"
101             
102             "And as well (absize + ascent): "
103             "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
104             " (full) "
105             "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
106             " or even paths to image files on disk too like: "
107             "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>"
108             " ... end."
109             , PACKAGE_DATA_DIR
110             );
111    elm_entry_entry_set(en, buf);
112    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
113    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
114    elm_box_pack_end(bx, en);
115    evas_object_show(en);
116
117    bx2 = elm_box_add(win);
118    elm_box_horizontal_set(bx2, 1);
119    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
120    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
121
122    bt = elm_button_add(win);
123    elm_button_label_set(bt, "Clear");
124    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_1, en);
125    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
126    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
127    elm_box_pack_end(bx2, bt);
128    evas_object_propagate_events_set(bt, 0);
129    elm_object_focus_allow_set(bt, 0);
130    evas_object_show(bt);
131
132    bt = elm_button_add(win);
133    elm_button_label_set(bt, "Print");
134    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_2, en);
135    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
136    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
137    elm_box_pack_end(bx2, bt);
138    evas_object_propagate_events_set(bt, 0);
139    elm_object_focus_allow_set(bt, 0);
140    evas_object_show(bt);
141
142    bt = elm_button_add(win);
143    elm_button_label_set(bt, "Selection");
144    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_3, en);
145    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
146    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
147    elm_box_pack_end(bx2, bt);
148    evas_object_propagate_events_set(bt, 0);
149    elm_object_focus_allow_set(bt, 0);
150    evas_object_show(bt);
151
152    bt = elm_button_add(win);
153    elm_button_label_set(bt, "Insert");
154    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_4, en);
155    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
156    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
157    elm_box_pack_end(bx2, bt);
158    evas_object_propagate_events_set(bt, 0);
159    elm_object_focus_allow_set(bt, 0);
160    evas_object_show(bt);
161
162    elm_box_pack_end(bx, bx2);
163    evas_object_show(bx2);
164
165    elm_object_focus(en);
166    evas_object_show(win);
167 }
168
169 static void
170 my_scrolled_entry_bt_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
171 {
172    Evas_Object *en = data;
173    elm_scrolled_entry_entry_set(en, "");
174 }
175
176 static void
177 my_scrolled_entry_bt_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
178 {
179    Evas_Object *en = data;
180    const char *s = elm_scrolled_entry_entry_get(en);
181    printf("ENTRY:\n");
182    if (s) printf("%s\n", s);
183    printf("ENTRY PLAIN UTF8:\n");
184    if (s)
185      {
186         s = elm_entry_markup_to_utf8(s);
187         if (s)
188           {
189              printf("%s\n", s);
190              free((char *)s);
191           }
192      }
193 }
194
195 static void
196 my_scrolled_entry_bt_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
197 {
198    Evas_Object *en = data;
199    const char *s = elm_scrolled_entry_selection_get(en);
200    printf("SELECTION:\n");
201    if (s) printf("%s\n", s);
202    printf("SELECTION PLAIN UTF8:\n");
203    if (s)
204      {
205         s = elm_entry_markup_to_utf8(s);
206         if (s)
207           {
208              printf("%s\n", s);
209              free((char *)s);
210           }
211      }
212 }
213
214 static void
215 my_scrolled_entry_bt_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
216 {
217    Evas_Object *en = data;
218    elm_scrolled_entry_entry_insert(en, "Insert some <b>BOLD</> text");
219 }
220
221 static void
222 my_scrolled_entry_bt_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
223 {
224    Evas_Object *en = data;
225    const char *s = elm_scrolled_entry_entry_get(en);
226    printf("PASSWORD: '%s'\n", s ? s : "");
227 }
228
229 static void
230 scrolled_anchor_test(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
231 {
232    Evas_Object *en = data;
233    elm_scrolled_entry_entry_insert(en, "ANCHOR CLICKED");
234 }
235
236 void
237 test_entry_scrolled(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
238 {
239    Evas_Object *win, *bg, *bx, *bx2, *bt, *en, *en_p, *sp;
240    static Elm_Entry_Filter_Accept_Set digits_filter_data, digits_filter_data2;
241    static Elm_Entry_Filter_Limit_Size limit_filter_data, limit_filter_data2;
242
243    win = elm_win_add(NULL, "entry-scrolled", ELM_WIN_BASIC);
244    elm_win_title_set(win, "Entry Scrolled");
245    elm_win_autodel_set(win, 1);
246
247    bg = elm_bg_add(win);
248    elm_win_resize_object_add(win, bg);
249    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
250    evas_object_show(bg);
251
252    bx = elm_box_add(win);
253    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
254    elm_win_resize_object_add(win, bx);
255    evas_object_show(bx);
256
257    /* disabled entry */
258    en = elm_scrolled_entry_add(win);
259    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
260    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
261    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
262    elm_scrolled_entry_entry_set(en, "Disabled entry");
263    elm_scrolled_entry_single_line_set(en, 1);
264    elm_object_disabled_set(en, 1);
265    evas_object_show(en);
266    elm_box_pack_end(bx, en);
267
268    /* password entry */
269    en = elm_scrolled_entry_add(win);
270    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
271    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
272    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
273    elm_scrolled_entry_password_set(en, 1);
274    elm_scrolled_entry_single_line_set(en, 1);
275    elm_scrolled_entry_entry_set(en, "Access denied, give up!");
276    elm_object_disabled_set(en, 1);
277    evas_object_show(en);
278    elm_box_pack_end(bx, en);
279
280    /* multi-line disable entry */
281    en = elm_scrolled_entry_add(win);
282    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
283    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
284    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
285    elm_object_disabled_set(en, 1);
286    elm_scrolled_entry_context_menu_item_add(en, "Hello", NULL, ELM_ICON_NONE, NULL, NULL);
287    elm_scrolled_entry_context_menu_item_add(en, "World", NULL, ELM_ICON_NONE, NULL, NULL);
288    elm_scrolled_entry_entry_set(en,
289                                 "Multi-line disabled entry widget :)<br>"
290                                 "We can use markup <b>like this</> for styling and<br>"
291                                 "formatting <em>like this</>, as well as<br>"
292                                 "<a href=X><link>links in the text</></a>,"
293                                 "but it won't be editable or clickable.");
294    evas_object_show(en);
295    elm_box_pack_end(bx, en);
296
297    sp = elm_separator_add(win);
298    elm_separator_horizontal_set(sp, 1);
299    elm_box_pack_end(bx, sp);
300    evas_object_show(sp);
301
302    /* Single line selected entry */
303    en = elm_scrolled_entry_add(win);
304    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
305    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
306    elm_scrolled_entry_entry_set(en, "This is a single line");
307    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
308    elm_scrolled_entry_single_line_set(en, 1);
309    elm_scrolled_entry_select_all(en);
310    evas_object_show(en);
311    elm_box_pack_end(bx, en);
312
313    /* Only digits entry */
314    en = elm_scrolled_entry_add(win);
315    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
316    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
317    elm_scrolled_entry_entry_set(en, "01234");
318    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
319    elm_scrolled_entry_single_line_set(en, 1);
320    evas_object_show(en);
321    elm_box_pack_end(bx, en);
322
323    digits_filter_data.accepted = "0123456789";
324    digits_filter_data.rejected = NULL;
325    elm_scrolled_entry_text_filter_append(en, elm_entry_filter_accept_set, &digits_filter_data);
326
327    /* No digits entry */
328    en = elm_scrolled_entry_add(win);
329    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
330    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
331    elm_scrolled_entry_entry_set(en, "No numbers here");
332    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
333    elm_scrolled_entry_single_line_set(en, 1);
334    evas_object_show(en);
335    elm_box_pack_end(bx, en);
336
337    digits_filter_data2.accepted = NULL;
338    digits_filter_data2.rejected = "0123456789";
339    elm_scrolled_entry_text_filter_append(en, elm_entry_filter_accept_set, &digits_filter_data2);
340
341    /* Size limited entry */
342    en = elm_scrolled_entry_add(win);
343    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
344    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
345    elm_scrolled_entry_entry_set(en, "Just 20 chars");
346    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
347    elm_scrolled_entry_single_line_set(en, 1);
348    evas_object_show(en);
349    elm_box_pack_end(bx, en);
350
351    limit_filter_data.max_char_count = 20;
352    limit_filter_data.max_byte_count = 0;
353    elm_scrolled_entry_text_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data);
354
355    /* Byte size limited entry */
356    en = elm_scrolled_entry_add(win);
357    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
358    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
359    elm_scrolled_entry_entry_set(en, "And now only 30 bytes");
360    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
361    elm_scrolled_entry_single_line_set(en, 1);
362    evas_object_show(en);
363    elm_box_pack_end(bx, en);
364
365    limit_filter_data2.max_char_count = 0;
366    limit_filter_data2.max_byte_count = 30;
367    elm_scrolled_entry_text_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data2);
368
369    /* Single line password entry */
370    en_p = elm_scrolled_entry_add(win);
371    evas_object_size_hint_weight_set(en_p, EVAS_HINT_EXPAND, 0.0);
372    evas_object_size_hint_align_set(en_p, EVAS_HINT_FILL, 0.5);
373    elm_scrolled_entry_scrollbar_policy_set(en_p, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
374    elm_scrolled_entry_entry_set(en_p, "Password here");
375    elm_scrolled_entry_single_line_set(en_p, 1);
376    elm_scrolled_entry_password_set(en_p, 1);
377    evas_object_show(en_p);
378    elm_box_pack_end(bx, en_p);
379
380    /* scrolled entry with icon/end widgets*/
381    en = elm_scrolled_entry_add(win);
382    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
383    elm_scrolled_entry_single_line_set(en, 1);
384    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
385    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
386    bt = elm_icon_add(win);
387    elm_icon_standard_set(bt, "home");
388    evas_object_size_hint_min_set(bt, 48, 48);
389    evas_object_color_set(bt, 255, 0, 0, 128);
390    evas_object_show(bt);
391    elm_scrolled_entry_icon_set(en, bt);
392    bt = elm_icon_add(win);
393    elm_icon_standard_set(bt, "delete");
394    evas_object_color_set(bt, 255, 0, 0, 128);
395    evas_object_size_hint_min_set(bt, 48, 48);
396    evas_object_show(bt);
397    elm_scrolled_entry_end_set(en, bt);
398    elm_scrolled_entry_entry_set(en, "scrolled entry with icon and end objects");
399    evas_object_show(en);
400    elm_box_pack_end(bx, en);
401    elm_scrolled_entry_cursor_end_set(en);
402    elm_object_focus(en);
403
404    /* markup scrolled entry */
405    en = elm_scrolled_entry_add(win);
406    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
407    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
408    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
409    elm_scrolled_entry_entry_set(en,
410                                 "This is an entry widget in this window that<br>"
411                                 "uses markup <b>like this</> for styling and<br>"
412                                 "formatting <em>like this</>, as well as<br>"
413                                 "<a href=X><link>links in the text</></a>, so enter text<br>"
414                                 "in here to edit it. By them way, links are<br>"
415                                 "called <a href=anc-02>Anchors</a> so you will need<br>"
416                                 "to refer to them this way. At the end here is a really long "
417                                 "line to test line wrapping to see if it works. But just in "
418                                 "case this line is not long enough I will add more here to "
419                                 "really test it out, as Elementary really needs some "
420                                 "good testing to see if entry widgets work as advertised.");
421    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
422    evas_object_show(en);
423    elm_box_pack_end(bx, en);
424
425    bx2 = elm_box_add(win);
426    elm_box_horizontal_set(bx2, 1);
427    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
428    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
429
430    bt = elm_button_add(win);
431    elm_button_label_set(bt, "Clear");
432    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_1, en);
433    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
434    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
435    elm_box_pack_end(bx2, bt);
436    evas_object_propagate_events_set(bt, 0);
437    elm_object_focus_allow_set(bt, 0);
438    evas_object_show(bt);
439
440    bt = elm_button_add(win);
441    elm_button_label_set(bt, "Print");
442    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_2, en);
443    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
444    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
445    elm_box_pack_end(bx2, bt);
446    evas_object_propagate_events_set(bt, 0);
447    elm_object_focus_allow_set(bt, 0);
448    evas_object_show(bt);
449
450    bt = elm_button_add(win);
451    elm_button_label_set(bt, "Print pwd");
452    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_5, en_p);
453    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
454    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
455    elm_box_pack_end(bx2, bt);
456    evas_object_propagate_events_set(bt, 0);
457    elm_object_focus_allow_set(bt, 0);
458    evas_object_show(bt);
459
460    bt = elm_button_add(win);
461    elm_button_label_set(bt, "Selection");
462    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_3, en);
463    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
464    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
465    elm_box_pack_end(bx2, bt);
466    evas_object_propagate_events_set(bt, 0);
467    elm_object_focus_allow_set(bt, 0);
468    evas_object_show(bt);
469
470    bt = elm_button_add(win);
471    elm_button_label_set(bt, "Insert");
472    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_4, en);
473    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
474    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
475    elm_box_pack_end(bx2, bt);
476    evas_object_propagate_events_set(bt, 0);
477    elm_object_focus_allow_set(bt, 0);
478    evas_object_show(bt);
479
480    elm_box_pack_end(bx, bx2);
481    evas_object_show(bx2);
482
483    evas_object_resize(win, 320, 300);
484
485    elm_object_focus(win);
486    evas_object_show(win);
487 }
488
489 static void
490 my_ent_bt_clr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
491 {
492    Evas_Object *en = data;
493    elm_scrolled_entry_entry_set(en, "");
494 }
495
496 static void
497 my_ent_bt_pri(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
498 {
499    Evas_Object *en = data;
500    const char *s = elm_scrolled_entry_entry_get(en);
501    printf("ENTRY:\n");
502    if (s) printf("%s\n", s);
503    printf("ENTRY PLAIN UTF8:\n");
504    if (s)
505      {
506         s = elm_entry_markup_to_utf8(s);
507         if (s)
508           {
509              printf("%s\n", s);
510              free((char *)s);
511           }
512      }
513 }
514
515 static void
516 my_ent_bt_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
517 {
518    Evas_Object *en = data;
519    const char *s = elm_scrolled_entry_selection_get(en);
520    printf("SELECTION:\n");
521    if (s) printf("%s\n", s);
522    printf("SELECTION PLAIN UTF8:\n");
523    if (s)
524      {
525         s = elm_entry_markup_to_utf8(s);
526         if (s)
527           {
528              printf("%s\n", s);
529              free((char *)s);
530           }
531      }
532 }
533
534 static void
535 my_ent_bt_all(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
536 {
537    Evas_Object *en = data;
538    elm_scrolled_entry_select_all(en);
539 }
540
541 static void
542 my_ent_bt_non(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
543 {
544    Evas_Object *en = data;
545    elm_scrolled_entry_select_none(en);
546 }
547
548 static void
549 my_ent_bt_ins(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
550 {
551    Evas_Object *en = data;
552    elm_scrolled_entry_entry_insert(en, "Insert text");
553 }
554
555 static void
556 my_ent_bt_lef(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
557 {
558    Evas_Object *en = data;
559    elm_scrolled_entry_cursor_prev(en);
560 }
561
562 static void
563 my_ent_bt_rig(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
564 {
565    Evas_Object *en = data;
566    elm_scrolled_entry_cursor_next(en);
567 }
568
569 static void
570 my_ent_bt_up_(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
571 {
572    Evas_Object *en = data;
573    elm_scrolled_entry_cursor_up(en);
574 }
575
576 static void
577 my_ent_bt_dow(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
578 {
579    Evas_Object *en = data;
580    elm_scrolled_entry_cursor_down(en);
581 }
582
583 static void
584 my_ent_bt_beg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
585 {
586    Evas_Object *en = data;
587    elm_scrolled_entry_cursor_begin_set(en);
588 }
589
590 static void
591 my_ent_bt_end(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
592 {
593    Evas_Object *en = data;
594    elm_scrolled_entry_cursor_end_set(en);
595 }
596
597 static void
598 my_ent_bt_lbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
599 {
600    Evas_Object *en = data;
601    elm_scrolled_entry_cursor_line_begin_set(en);
602 }
603
604 static void
605 my_ent_bt_len(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
606 {
607    Evas_Object *en = data;
608    elm_scrolled_entry_cursor_line_end_set(en);
609 }
610
611 static void
612 my_ent_bt_sbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
613 {
614    Evas_Object *en = data;
615    elm_scrolled_entry_cursor_selection_begin(en);
616 }
617
618 static void
619 my_ent_bt_sen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
620 {
621    Evas_Object *en = data;
622    elm_scrolled_entry_cursor_selection_end(en);
623 }
624
625 static void
626 my_ent_bt_fmt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
627 {
628    Evas_Object *en = data;
629    printf("IS FORMAT: %i\n", 
630           (int)elm_scrolled_entry_cursor_is_format_get(en));
631 }
632
633 static void
634 my_ent_bt_vfm(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
635 {
636    Evas_Object *en = data;
637    printf("IS VISIBLE FORMAT %i\n",
638           (int)elm_scrolled_entry_cursor_is_visible_format_get(en));
639 }
640
641 static void
642 my_ent_bt_chr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
643 {
644    Evas_Object *en = data;
645    printf("CHAR '%s'\n", elm_scrolled_entry_cursor_content_get(en));
646 }
647
648 static void
649 my_ent_bt_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
650 {
651    Evas_Object *en = data;
652    elm_scrolled_entry_selection_cut(en);
653 }
654
655 static void
656 my_ent_bt_cop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
657 {
658    Evas_Object *en = data;
659    elm_scrolled_entry_selection_copy(en);
660 }
661
662 static void
663 my_ent_bt_pas(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
664 {
665    Evas_Object *en = data;
666    elm_scrolled_entry_selection_paste(en);
667 }
668
669 void
670 test_entry3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
671 {
672    Evas_Object *win, *bg, *bx, *bx2, *bt, *en;
673
674    win = elm_win_add(NULL, "entry3", ELM_WIN_BASIC);
675    elm_win_title_set(win, "Entry 3");
676    elm_win_autodel_set(win, 1);
677
678    bg = elm_bg_add(win);
679    elm_win_resize_object_add(win, bg);
680    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
681    evas_object_show(bg);
682
683    bx = elm_box_add(win);
684    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
685    elm_win_resize_object_add(win, bx);
686    evas_object_show(bx);
687
688    /* Single line selected entry */
689    en = elm_scrolled_entry_add(win);
690    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
691    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
692    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
693    elm_scrolled_entry_entry_set(en, "This is a single line");
694    elm_scrolled_entry_single_line_set(en, 1);
695    elm_box_pack_end(bx, en);
696    evas_object_show(en);
697
698    bx2 = elm_box_add(win);
699    elm_box_horizontal_set(bx2, 1);
700    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
701    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
702
703    bt = elm_button_add(win);
704    elm_button_label_set(bt, "Clr");
705    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
706    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
707    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
708    elm_box_pack_end(bx2, bt);
709    evas_object_propagate_events_set(bt, 0);
710    elm_object_focus_allow_set(bt, 0);
711    evas_object_show(bt);
712
713    bt = elm_button_add(win);
714    elm_button_label_set(bt, "Pri");
715    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
716    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
717    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
718    elm_box_pack_end(bx2, bt);
719    evas_object_propagate_events_set(bt, 0);
720    elm_object_focus_allow_set(bt, 0);
721    evas_object_show(bt);
722
723    bt = elm_button_add(win);
724    elm_button_label_set(bt, "Sel");
725    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
726    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
727    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
728    elm_box_pack_end(bx2, bt);
729    evas_object_propagate_events_set(bt, 0);
730    elm_object_focus_allow_set(bt, 0);
731    evas_object_show(bt);
732
733    bt = elm_button_add(win);
734    elm_button_label_set(bt, "All");
735    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
736    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
737    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
738    elm_box_pack_end(bx2, bt);
739    evas_object_propagate_events_set(bt, 0);
740    elm_object_focus_allow_set(bt, 0);
741    evas_object_show(bt);
742
743    bt = elm_button_add(win);
744    elm_button_label_set(bt, "Non");
745    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
746    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
747    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
748    elm_box_pack_end(bx2, bt);
749    evas_object_propagate_events_set(bt, 0);
750    elm_object_focus_allow_set(bt, 0);
751    evas_object_show(bt);
752
753    bt = elm_button_add(win);
754    elm_button_label_set(bt, "Ins");
755    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
756    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
757    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
758    elm_box_pack_end(bx2, bt);
759    evas_object_propagate_events_set(bt, 0);
760    elm_object_focus_allow_set(bt, 0);
761    evas_object_show(bt);
762
763    elm_box_pack_end(bx, bx2);
764    evas_object_show(bx2);
765
766    bx2 = elm_box_add(win);
767    elm_box_horizontal_set(bx2, 1);
768    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
769    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
770
771    bt = elm_button_add(win);
772    elm_button_label_set(bt, "Lef");
773    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
774    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
775    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
776    elm_box_pack_end(bx2, bt);
777    evas_object_propagate_events_set(bt, 0);
778    elm_object_focus_allow_set(bt, 0);
779    evas_object_show(bt);
780
781    bt = elm_button_add(win);
782    elm_button_label_set(bt, "Rig");
783    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
784    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
785    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
786    elm_box_pack_end(bx2, bt);
787    evas_object_propagate_events_set(bt, 0);
788    elm_object_focus_allow_set(bt, 0);
789    evas_object_show(bt);
790
791    bt = elm_button_add(win);
792    elm_button_label_set(bt, "Up ");
793    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
794    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
795    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
796    elm_box_pack_end(bx2, bt);
797    evas_object_propagate_events_set(bt, 0);
798    elm_object_focus_allow_set(bt, 0);
799    evas_object_show(bt);
800
801    bt = elm_button_add(win);
802    elm_button_label_set(bt, "Dow");
803    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
804    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
805    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
806    elm_box_pack_end(bx2, bt);
807    evas_object_propagate_events_set(bt, 0);
808    elm_object_focus_allow_set(bt, 0);
809    evas_object_show(bt);
810
811    bt = elm_button_add(win);
812    elm_button_label_set(bt, "Beg");
813    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
814    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
815    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
816    elm_box_pack_end(bx2, bt);
817    evas_object_propagate_events_set(bt, 0);
818    elm_object_focus_allow_set(bt, 0);
819    evas_object_show(bt);
820
821    bt = elm_button_add(win);
822    elm_button_label_set(bt, "End");
823    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
824    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
825    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
826    elm_box_pack_end(bx2, bt);
827    evas_object_propagate_events_set(bt, 0);
828    elm_object_focus_allow_set(bt, 0);
829    evas_object_show(bt);
830
831    elm_box_pack_end(bx, bx2);
832    evas_object_show(bx2);
833
834    bx2 = elm_box_add(win);
835    elm_box_horizontal_set(bx2, 1);
836    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
837    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
838
839    bt = elm_button_add(win);
840    elm_button_label_set(bt, "LBe");
841    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
842    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
843    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
844    elm_box_pack_end(bx2, bt);
845    evas_object_propagate_events_set(bt, 0);
846    elm_object_focus_allow_set(bt, 0);
847    evas_object_show(bt);
848
849    bt = elm_button_add(win);
850    elm_button_label_set(bt, "LEn");
851    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
852    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
853    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
854    elm_box_pack_end(bx2, bt);
855    evas_object_propagate_events_set(bt, 0);
856    elm_object_focus_allow_set(bt, 0);
857    evas_object_show(bt);
858
859    bt = elm_button_add(win);
860    elm_button_label_set(bt, "SBe");
861    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
862    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
863    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
864    elm_box_pack_end(bx2, bt);
865    evas_object_propagate_events_set(bt, 0);
866    elm_object_focus_allow_set(bt, 0);
867    evas_object_show(bt);
868
869    bt = elm_button_add(win);
870    elm_button_label_set(bt, "SEn");
871    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
872    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
873    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
874    elm_box_pack_end(bx2, bt);
875    evas_object_propagate_events_set(bt, 0);
876    elm_object_focus_allow_set(bt, 0);
877    evas_object_show(bt);
878
879    bt = elm_button_add(win);
880    elm_button_label_set(bt, "Fmt");
881    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
882    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
883    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
884    elm_box_pack_end(bx2, bt);
885    evas_object_propagate_events_set(bt, 0);
886    elm_object_focus_allow_set(bt, 0);
887    evas_object_show(bt);
888
889    bt = elm_button_add(win);
890    elm_button_label_set(bt, "VFm");
891    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
892    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
893    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
894    elm_box_pack_end(bx2, bt);
895    evas_object_propagate_events_set(bt, 0);
896    elm_object_focus_allow_set(bt, 0);
897    evas_object_show(bt);
898
899    elm_box_pack_end(bx, bx2);
900    evas_object_show(bx2);
901
902    bx2 = elm_box_add(win);
903    elm_box_horizontal_set(bx2, 1);
904    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
905    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
906
907    bt = elm_button_add(win);
908    elm_button_label_set(bt, "Chr");
909    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
910    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
911    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
912    elm_box_pack_end(bx2, bt);
913    evas_object_propagate_events_set(bt, 0);
914    elm_object_focus_allow_set(bt, 0);
915    evas_object_show(bt);
916
917    bt = elm_button_add(win);
918    elm_button_label_set(bt, "Cut");
919    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
920    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
921    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
922    elm_box_pack_end(bx2, bt);
923    evas_object_propagate_events_set(bt, 0);
924    elm_object_focus_allow_set(bt, 0);
925    evas_object_show(bt);
926
927    bt = elm_button_add(win);
928    elm_button_label_set(bt, "Cop");
929    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
930    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
931    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
932    elm_box_pack_end(bx2, bt);
933    evas_object_propagate_events_set(bt, 0);
934    elm_object_focus_allow_set(bt, 0);
935    evas_object_show(bt);
936
937    bt = elm_button_add(win);
938    elm_button_label_set(bt, "Pas");
939    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
940    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
941    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
942    elm_box_pack_end(bx2, bt);
943    evas_object_propagate_events_set(bt, 0);
944    elm_object_focus_allow_set(bt, 0);
945    evas_object_show(bt);
946
947    elm_box_pack_end(bx, bx2);
948    evas_object_show(bx2);
949
950    /* markup scrolled entry */
951    en = elm_scrolled_entry_add(win);
952    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
953    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
954    elm_scrolled_entry_entry_set(en,
955                                 "This is an entry widget in this window that<br>"
956                                 "uses markup <b>like this</> for styling and<br>"
957                                 "formatting <em>like this</>, as well as<br>"
958                                 "<a href=X><link>links in the text</></a>, so enter text<br>"
959                                 "in here to edit it. By them way, links are<br>"
960                                 "called <a href=anc-02>Anchors</a> so you will need<br>"
961                                 "to refer to them this way. At the end here is a really long "
962                                 "line to test line wrapping to see if it works. But just in "
963                                 "case this line is not long enough I will add more here to "
964                                 "really test it out, as Elementary really needs some "
965                                 "good testing to see if entry widgets work as advertised."
966                                 );
967    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
968    elm_box_pack_end(bx, en);
969    evas_object_show(en);
970    
971    bx2 = elm_box_add(win);
972    elm_box_horizontal_set(bx2, 1);
973    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
974    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
975
976    bt = elm_button_add(win);
977    elm_button_label_set(bt, "Clr");
978    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
979    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
980    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
981    elm_box_pack_end(bx2, bt);
982    evas_object_propagate_events_set(bt, 0);
983    elm_object_focus_allow_set(bt, 0);
984    evas_object_show(bt);
985
986    bt = elm_button_add(win);
987    elm_button_label_set(bt, "Pri");
988    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
989    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
990    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
991    elm_box_pack_end(bx2, bt);
992    evas_object_propagate_events_set(bt, 0);
993    elm_object_focus_allow_set(bt, 0);
994    evas_object_show(bt);
995
996    bt = elm_button_add(win);
997    elm_button_label_set(bt, "Sel");
998    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
999    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1000    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1001    elm_box_pack_end(bx2, bt);
1002    evas_object_propagate_events_set(bt, 0);
1003    elm_object_focus_allow_set(bt, 0);
1004    evas_object_show(bt);
1005
1006    bt = elm_button_add(win);
1007    elm_button_label_set(bt, "All");
1008    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
1009    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1010    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1011    elm_box_pack_end(bx2, bt);
1012    evas_object_propagate_events_set(bt, 0);
1013    elm_object_focus_allow_set(bt, 0);
1014    evas_object_show(bt);
1015
1016    bt = elm_button_add(win);
1017    elm_button_label_set(bt, "Non");
1018    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
1019    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1020    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1021    elm_box_pack_end(bx2, bt);
1022    evas_object_propagate_events_set(bt, 0);
1023    elm_object_focus_allow_set(bt, 0);
1024    evas_object_show(bt);
1025
1026    bt = elm_button_add(win);
1027    elm_button_label_set(bt, "Ins");
1028    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
1029    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1030    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1031    elm_box_pack_end(bx2, bt);
1032    evas_object_propagate_events_set(bt, 0);
1033    elm_object_focus_allow_set(bt, 0);
1034    evas_object_show(bt);
1035
1036    elm_box_pack_end(bx, bx2);
1037    evas_object_show(bx2);
1038
1039    bx2 = elm_box_add(win);
1040    elm_box_horizontal_set(bx2, 1);
1041    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1042    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1043
1044    bt = elm_button_add(win);
1045    elm_button_label_set(bt, "Lef");
1046    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
1047    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1048    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1049    elm_box_pack_end(bx2, bt);
1050    evas_object_propagate_events_set(bt, 0);
1051    elm_object_focus_allow_set(bt, 0);
1052    evas_object_show(bt);
1053
1054    bt = elm_button_add(win);
1055    elm_button_label_set(bt, "Rig");
1056    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
1057    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1058    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1059    elm_box_pack_end(bx2, bt);
1060    evas_object_propagate_events_set(bt, 0);
1061    elm_object_focus_allow_set(bt, 0);
1062    evas_object_show(bt);
1063
1064    bt = elm_button_add(win);
1065    elm_button_label_set(bt, "Up ");
1066    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
1067    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1068    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1069    elm_box_pack_end(bx2, bt);
1070    evas_object_propagate_events_set(bt, 0);
1071    elm_object_focus_allow_set(bt, 0);
1072    evas_object_show(bt);
1073
1074    bt = elm_button_add(win);
1075    elm_button_label_set(bt, "Dow");
1076    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
1077    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1078    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1079    elm_box_pack_end(bx2, bt);
1080    evas_object_propagate_events_set(bt, 0);
1081    elm_object_focus_allow_set(bt, 0);
1082    evas_object_show(bt);
1083
1084    bt = elm_button_add(win);
1085    elm_button_label_set(bt, "Beg");
1086    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
1087    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1088    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1089    elm_box_pack_end(bx2, bt);
1090    evas_object_propagate_events_set(bt, 0);
1091    elm_object_focus_allow_set(bt, 0);
1092    evas_object_show(bt);
1093
1094    bt = elm_button_add(win);
1095    elm_button_label_set(bt, "End");
1096    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
1097    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1098    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1099    elm_box_pack_end(bx2, bt);
1100    evas_object_propagate_events_set(bt, 0);
1101    elm_object_focus_allow_set(bt, 0);
1102    evas_object_show(bt);
1103
1104    elm_box_pack_end(bx, bx2);
1105    evas_object_show(bx2);
1106
1107    bx2 = elm_box_add(win);
1108    elm_box_horizontal_set(bx2, 1);
1109    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1110    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1111
1112    bt = elm_button_add(win);
1113    elm_button_label_set(bt, "LBe");
1114    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
1115    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1116    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1117    elm_box_pack_end(bx2, bt);
1118    evas_object_propagate_events_set(bt, 0);
1119    elm_object_focus_allow_set(bt, 0);
1120    evas_object_show(bt);
1121
1122    bt = elm_button_add(win);
1123    elm_button_label_set(bt, "LEn");
1124    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
1125    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1126    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1127    elm_box_pack_end(bx2, bt);
1128    evas_object_propagate_events_set(bt, 0);
1129    elm_object_focus_allow_set(bt, 0);
1130    evas_object_show(bt);
1131
1132    bt = elm_button_add(win);
1133    elm_button_label_set(bt, "SBe");
1134    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
1135    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1136    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1137    elm_box_pack_end(bx2, bt);
1138    evas_object_propagate_events_set(bt, 0);
1139    elm_object_focus_allow_set(bt, 0);
1140    evas_object_show(bt);
1141
1142    bt = elm_button_add(win);
1143    elm_button_label_set(bt, "SEn");
1144    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
1145    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1146    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1147    elm_box_pack_end(bx2, bt);
1148    evas_object_propagate_events_set(bt, 0);
1149    elm_object_focus_allow_set(bt, 0);
1150    evas_object_show(bt);
1151
1152    bt = elm_button_add(win);
1153    elm_button_label_set(bt, "Fmt");
1154    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
1155    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1156    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1157    elm_box_pack_end(bx2, bt);
1158    evas_object_propagate_events_set(bt, 0);
1159    elm_object_focus_allow_set(bt, 0);
1160    evas_object_show(bt);
1161
1162    bt = elm_button_add(win);
1163    elm_button_label_set(bt, "VFm");
1164    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
1165    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1166    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1167    elm_box_pack_end(bx2, bt);
1168    evas_object_propagate_events_set(bt, 0);
1169    elm_object_focus_allow_set(bt, 0);
1170    evas_object_show(bt);
1171
1172    elm_box_pack_end(bx, bx2);
1173    evas_object_show(bx2);
1174
1175    bx2 = elm_box_add(win);
1176    elm_box_horizontal_set(bx2, 1);
1177    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1178    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1179
1180    bt = elm_button_add(win);
1181    elm_button_label_set(bt, "Chr");
1182    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
1183    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1184    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1185    elm_box_pack_end(bx2, bt);
1186    evas_object_propagate_events_set(bt, 0);
1187    elm_object_focus_allow_set(bt, 0);
1188    evas_object_show(bt);
1189
1190    bt = elm_button_add(win);
1191    elm_button_label_set(bt, "Cut");
1192    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
1193    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1194    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1195    elm_box_pack_end(bx2, bt);
1196    evas_object_propagate_events_set(bt, 0);
1197    elm_object_focus_allow_set(bt, 0);
1198    evas_object_show(bt);
1199
1200    bt = elm_button_add(win);
1201    elm_button_label_set(bt, "Cop");
1202    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
1203    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1204    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1205    elm_box_pack_end(bx2, bt);
1206    evas_object_propagate_events_set(bt, 0);
1207    elm_object_focus_allow_set(bt, 0);
1208    evas_object_show(bt);
1209
1210    bt = elm_button_add(win);
1211    elm_button_label_set(bt, "Pas");
1212    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
1213    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1214    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1215    elm_box_pack_end(bx2, bt); 
1216    evas_object_propagate_events_set(bt, 0);
1217    elm_object_focus_allow_set(bt, 0);
1218    evas_object_show(bt);
1219
1220    elm_box_pack_end(bx, bx2);
1221    evas_object_show(bx2);
1222
1223    evas_object_resize(win, 320, 480);
1224
1225    elm_object_focus(win);
1226    evas_object_show(win);
1227 }
1228
1229 void
1230 test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1231 {
1232    Evas_Object *win, *bg, *ly, *en;
1233    char buf[PATH_MAX];
1234    
1235    win = elm_win_add(NULL, "entry4", ELM_WIN_BASIC);
1236    elm_win_title_set(win, "Entry 4");
1237    elm_win_autodel_set(win, 1);
1238
1239    bg = elm_bg_add(win);
1240    elm_win_resize_object_add(win, bg);
1241    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1242    evas_object_show(bg);
1243
1244    ly = elm_layout_add(win);
1245    snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
1246    elm_layout_file_set(ly, buf, "layout");
1247    evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1248    elm_win_resize_object_add(win, ly);
1249    evas_object_show(ly);
1250    
1251    en = elm_scrolled_entry_add(win);
1252    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
1253    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
1254    elm_scrolled_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
1255    elm_scrolled_entry_entry_set(en, "This is a single line");
1256    elm_scrolled_entry_single_line_set(en, 1);
1257    elm_layout_content_set(ly, "element1", en);
1258    evas_object_show(en);
1259    
1260    en = elm_entry_add(win);
1261    elm_entry_line_wrap_set(en, 0);
1262    elm_entry_entry_set(en,
1263                        "This is an entry widget<br>"
1264                        "that uses markup<br>"
1265                        "<b>like this</> and has<br>"
1266                        "no scroller, so you can<br>"
1267                        "use it more flexibly.");
1268    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1269    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1270    elm_layout_content_set(ly, "element2", en);
1271    evas_object_show(en);
1272
1273    en = elm_scrolled_entry_add(win);
1274    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1275    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1276    elm_scrolled_entry_entry_set(en,
1277                                 "This is an entry widget in this window that<br>"
1278                                 "uses markup <b>like this</> for styling and<br>"
1279                                 "formatting <em>like this</>, as well as<br>"
1280                                 "<a href=X><link>links in the text</></a>, so enter text<br>"
1281                                 "in here to edit it. By them way, links are<br>"
1282                                 "called <a href=anc-02>Anchors</a> so you will need<br>"
1283                                 "to refer to them this way. At the end here is a really long "
1284                                 "line to test line wrapping to see if it works. But just in "
1285                                 "case this line is not long enough I will add more here to "
1286                                 "really test it out, as Elementary really needs some "
1287                                 "good testing to see if entry widgets work as advertised."
1288                                 );
1289    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1290    elm_layout_content_set(ly, "element3", en);
1291    evas_object_show(en);
1292
1293    evas_object_show(win);
1294 }
1295
1296 void
1297 test_entry5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1298 {
1299    Evas_Object *win, *bg, *bx, *bx2, *bt, *en;
1300
1301    win = elm_win_add(NULL, "entry5", ELM_WIN_BASIC);
1302    elm_win_title_set(win, "Entry 5");
1303    elm_win_autodel_set(win, 1);
1304
1305    bg = elm_bg_add(win);
1306    elm_win_resize_object_add(win, bg);
1307    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1308    evas_object_show(bg);
1309
1310    bx = elm_box_add(win);
1311    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1312    elm_win_resize_object_add(win, bx);
1313    evas_object_show(bx);
1314
1315    en = elm_scrolled_entry_add(win);
1316    elm_scrolled_entry_line_char_wrap_set(en, 1);
1317    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1318    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1319    elm_scrolled_entry_entry_set(en,
1320                                 "This is an entry widget in this window that "
1321                                 "uses markup like this for styling and "
1322                                 "formatting like this, as well as "
1323                                 "to refer to them this way. At the end here is a really long "
1324                                 "line to test line wrapping to see if it works. But just in "
1325                                 "case this line is not long enough I will add more here to "
1326                                 "really test it out, as Elementary really needs some "
1327                                 "good testing to see if entry widgets work as advertised."
1328                                 );
1329    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1330    elm_box_pack_end(bx, en);
1331    evas_object_show(en);
1332    
1333    bx2 = elm_box_add(win);
1334    elm_box_horizontal_set(bx2, 1);
1335    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1336    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1337
1338    bt = elm_button_add(win);
1339    elm_button_label_set(bt, "Clr");
1340    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
1341    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1342    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1343    elm_box_pack_end(bx2, bt);
1344    evas_object_propagate_events_set(bt, 0);
1345    elm_object_focus_allow_set(bt, 0);
1346    evas_object_show(bt);
1347
1348    bt = elm_button_add(win);
1349    elm_button_label_set(bt, "Pri");
1350    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
1351    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1352    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1353    elm_box_pack_end(bx2, bt);
1354    evas_object_propagate_events_set(bt, 0);
1355    elm_object_focus_allow_set(bt, 0);
1356    evas_object_show(bt);
1357
1358    bt = elm_button_add(win);
1359    elm_button_label_set(bt, "Sel");
1360    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
1361    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1362    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1363    elm_box_pack_end(bx2, bt);
1364    evas_object_propagate_events_set(bt, 0);
1365    elm_object_focus_allow_set(bt, 0);
1366    evas_object_show(bt);
1367
1368    bt = elm_button_add(win);
1369    elm_button_label_set(bt, "All");
1370    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
1371    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1372    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1373    elm_box_pack_end(bx2, bt);
1374    evas_object_propagate_events_set(bt, 0);
1375    elm_object_focus_allow_set(bt, 0);
1376    evas_object_show(bt);
1377
1378    bt = elm_button_add(win);
1379    elm_button_label_set(bt, "Non");
1380    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
1381    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1382    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1383    elm_box_pack_end(bx2, bt);
1384    evas_object_propagate_events_set(bt, 0);
1385    elm_object_focus_allow_set(bt, 0);
1386    evas_object_show(bt);
1387
1388    bt = elm_button_add(win);
1389    elm_button_label_set(bt, "Ins");
1390    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
1391    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1392    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1393    elm_box_pack_end(bx2, bt);
1394    evas_object_propagate_events_set(bt, 0);
1395    elm_object_focus_allow_set(bt, 0);
1396    evas_object_show(bt);
1397
1398    elm_box_pack_end(bx, bx2);
1399    evas_object_show(bx2);
1400
1401    bx2 = elm_box_add(win);
1402    elm_box_horizontal_set(bx2, 1);
1403    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1404    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1405
1406    bt = elm_button_add(win);
1407    elm_button_label_set(bt, "Lef");
1408    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
1409    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1410    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1411    elm_box_pack_end(bx2, bt);
1412    evas_object_propagate_events_set(bt, 0);
1413    elm_object_focus_allow_set(bt, 0);
1414    evas_object_show(bt);
1415
1416    bt = elm_button_add(win);
1417    elm_button_label_set(bt, "Rig");
1418    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
1419    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1420    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1421    elm_box_pack_end(bx2, bt);
1422    evas_object_propagate_events_set(bt, 0);
1423    elm_object_focus_allow_set(bt, 0);
1424    evas_object_show(bt);
1425
1426    bt = elm_button_add(win);
1427    elm_button_label_set(bt, "Up ");
1428    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
1429    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1430    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1431    elm_box_pack_end(bx2, bt);
1432    evas_object_propagate_events_set(bt, 0);
1433    elm_object_focus_allow_set(bt, 0);
1434    evas_object_show(bt);
1435
1436    bt = elm_button_add(win);
1437    elm_button_label_set(bt, "Dow");
1438    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
1439    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1440    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1441    elm_box_pack_end(bx2, bt);
1442    evas_object_propagate_events_set(bt, 0);
1443    elm_object_focus_allow_set(bt, 0);
1444    evas_object_show(bt);
1445
1446    bt = elm_button_add(win);
1447    elm_button_label_set(bt, "Beg");
1448    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
1449    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1450    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1451    elm_box_pack_end(bx2, bt);
1452    evas_object_propagate_events_set(bt, 0);
1453    elm_object_focus_allow_set(bt, 0);
1454    evas_object_show(bt);
1455
1456    bt = elm_button_add(win);
1457    elm_button_label_set(bt, "End");
1458    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
1459    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1460    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1461    elm_box_pack_end(bx2, bt);
1462    evas_object_propagate_events_set(bt, 0);
1463    elm_object_focus_allow_set(bt, 0);
1464    evas_object_show(bt);
1465
1466    elm_box_pack_end(bx, bx2);
1467    evas_object_show(bx2);
1468
1469    bx2 = elm_box_add(win);
1470    elm_box_horizontal_set(bx2, 1);
1471    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1472    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1473
1474    bt = elm_button_add(win);
1475    elm_button_label_set(bt, "LBe");
1476    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
1477    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1478    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1479    elm_box_pack_end(bx2, bt);
1480    evas_object_propagate_events_set(bt, 0);
1481    elm_object_focus_allow_set(bt, 0);
1482    evas_object_show(bt);
1483
1484    bt = elm_button_add(win);
1485    elm_button_label_set(bt, "LEn");
1486    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
1487    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1488    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1489    elm_box_pack_end(bx2, bt);
1490    evas_object_propagate_events_set(bt, 0);
1491    elm_object_focus_allow_set(bt, 0);
1492    evas_object_show(bt);
1493
1494    bt = elm_button_add(win);
1495    elm_button_label_set(bt, "SBe");
1496    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
1497    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1498    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1499    elm_box_pack_end(bx2, bt);
1500    evas_object_propagate_events_set(bt, 0);
1501    elm_object_focus_allow_set(bt, 0);
1502    evas_object_show(bt);
1503
1504    bt = elm_button_add(win);
1505    elm_button_label_set(bt, "SEn");
1506    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
1507    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1508    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1509    elm_box_pack_end(bx2, bt);
1510    evas_object_propagate_events_set(bt, 0);
1511    elm_object_focus_allow_set(bt, 0);
1512    evas_object_show(bt);
1513
1514    bt = elm_button_add(win);
1515    elm_button_label_set(bt, "Fmt");
1516    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
1517    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1518    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1519    elm_box_pack_end(bx2, bt);
1520    evas_object_propagate_events_set(bt, 0);
1521    elm_object_focus_allow_set(bt, 0);
1522    evas_object_show(bt);
1523
1524    bt = elm_button_add(win);
1525    elm_button_label_set(bt, "VFm");
1526    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
1527    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1528    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1529    elm_box_pack_end(bx2, bt);
1530    evas_object_propagate_events_set(bt, 0);
1531    elm_object_focus_allow_set(bt, 0);
1532    evas_object_show(bt);
1533
1534    elm_box_pack_end(bx, bx2);
1535    evas_object_show(bx2);
1536
1537    bx2 = elm_box_add(win);
1538    elm_box_horizontal_set(bx2, 1);
1539    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1540    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1541
1542    bt = elm_button_add(win);
1543    elm_button_label_set(bt, "Chr");
1544    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
1545    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1546    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1547    elm_box_pack_end(bx2, bt);
1548    evas_object_propagate_events_set(bt, 0);
1549    elm_object_focus_allow_set(bt, 0);
1550    evas_object_show(bt);
1551
1552    bt = elm_button_add(win);
1553    elm_button_label_set(bt, "Cut");
1554    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
1555    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1556    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1557    elm_box_pack_end(bx2, bt);
1558    evas_object_propagate_events_set(bt, 0);
1559    elm_object_focus_allow_set(bt, 0);
1560    evas_object_show(bt);
1561
1562    bt = elm_button_add(win);
1563    elm_button_label_set(bt, "Cop");
1564    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
1565    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1566    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1567    elm_box_pack_end(bx2, bt);
1568    evas_object_propagate_events_set(bt, 0);
1569    elm_object_focus_allow_set(bt, 0);
1570    evas_object_show(bt);
1571
1572    bt = elm_button_add(win);
1573    elm_button_label_set(bt, "Pas");
1574    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
1575    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1576    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1577    elm_box_pack_end(bx2, bt); 
1578    evas_object_propagate_events_set(bt, 0);
1579    elm_object_focus_allow_set(bt, 0);
1580    evas_object_show(bt);
1581
1582    elm_box_pack_end(bx, bx2);
1583    evas_object_show(bx2);
1584
1585    evas_object_resize(win, 320, 480);
1586
1587    elm_object_focus(win);
1588    evas_object_show(win);
1589 }
1590
1591 static void
1592 _scrolled_entry_clear(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1593 {
1594    Evas_Object *en = data;
1595    elm_scrolled_entry_entry_set(en, "");
1596 }
1597
1598 void
1599 test_entry_notepad(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1600 {
1601    Evas_Object *win, *bg, *bx, *bx2, *bt, *np;
1602
1603    win = elm_win_add(NULL, "entry-notepad", ELM_WIN_BASIC);
1604    elm_win_title_set(win, "Entry Notepad");
1605    elm_win_autodel_set(win, EINA_TRUE);
1606
1607    bg = elm_bg_add(win);
1608    elm_win_resize_object_add(win, bg);
1609    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1610    evas_object_show(bg);
1611
1612    bx = elm_box_add(win);
1613    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1614    elm_win_resize_object_add(win, bx);
1615    evas_object_show(bx);
1616
1617    np = elm_scrolled_entry_add(win);
1618    elm_scrolled_entry_file_set(np, "note.txt", ELM_TEXT_FORMAT_PLAIN_UTF8);
1619    evas_object_size_hint_weight_set(np, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1620    evas_object_size_hint_align_set(np, EVAS_HINT_FILL, EVAS_HINT_FILL);
1621    elm_box_pack_end(bx, np);
1622    evas_object_show(np);
1623
1624    bx2 = elm_box_add(win);
1625    elm_box_horizontal_set(bx2, EINA_TRUE);
1626    elm_box_homogenous_set(bx2, EINA_TRUE);
1627    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1628    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1629
1630    bt = elm_button_add(win);
1631    elm_button_label_set(bt, "Clear");
1632    evas_object_smart_callback_add(bt, "clicked", _scrolled_entry_clear, np);
1633    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1634    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1635    elm_box_pack_end(bx2, bt);
1636    evas_object_show(bt);
1637
1638    elm_box_pack_end(bx, bx2);
1639    evas_object_show(bx2);
1640
1641    evas_object_resize(win, 320, 300);
1642
1643    elm_object_focus(win);
1644    evas_object_show(win);
1645 }
1646 #endif