elm test_entry.c: Fixed formatting.
[framework/uifw/elementary.git] / src / bin / test_entry.c
1 #ifdef HAVE_CONFIG_H
2 # include "elementary_config.h"
3 #endif
4 #include <Elementary.h>
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_object_text_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_object_text_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 static void
59 my_entry_bt_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
60 {
61    Evas_Object *en = data;
62    elm_entry_scrollable_set(en, !elm_entry_scrollable_get(en));
63 }
64
65 static void
66 my_entry_bt_6(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
67 {
68    Evas_Object *en = data;
69    static Elm_Wrap_Type wr = ELM_WRAP_NONE;
70
71    wr++;
72    if (wr == ELM_WRAP_LAST) wr = ELM_WRAP_NONE;
73    printf("wr: %i\n", wr);
74    elm_entry_line_wrap_set(en, wr);
75 }
76
77 void
78 test_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
79 {
80    Evas_Object *win, *bx, *bx2, *bt, *en;
81    char buf[4096];
82
83    win = elm_win_util_standard_add("entry", "Entry");
84    elm_win_autodel_set(win, EINA_TRUE);
85
86    bx = elm_box_add(win);
87    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
88    elm_win_resize_object_add(win, bx);
89    evas_object_show(bx);
90
91    en = elm_entry_add(win);
92    elm_entry_line_wrap_set(en, ELM_WRAP_NONE);
93    snprintf(buf, sizeof(buf),
94             "This is an entry widget in this window that<br/>"
95             "uses markup <b>like this</> for styling and<br/>"
96             "formatting <em>like this</>, as well as<br/>"
97             "<a href=X><link>links in the text</></a>, so enter text<br/>"
98             "in here to edit it. By the way, links are<br/>"
99             "called <a href=anc-02>Anchors</a> so you will need<br/>"
100             "to refer to them this way.<br/>"
101             "<br/>"
102
103             "Also you can stick in items with (relsize + ascent): "
104             "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
105             " (full) "
106             "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
107             " (to the left)<br/>"
108
109             "Also (size + ascent): "
110             "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
111             " (full) "
112             "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
113             " (before this)<br/>"
114
115             "And as well (absize + ascent): "
116             "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
117             " (full) "
118             "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
119             " or even paths to image files on disk too like: "
120             "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>"
121             " ... end."
122             , elm_app_data_dir_get()
123             );
124    elm_object_text_set(en, buf);
125    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
126    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
127    elm_box_pack_end(bx, en);
128    evas_object_show(en);
129
130    bx2 = elm_box_add(win);
131    elm_box_horizontal_set(bx2, EINA_TRUE);
132    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
133    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
134
135    bt = elm_button_add(win);
136    elm_object_text_set(bt, "Clr");
137    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_1, en);
138    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
139    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
140    elm_box_pack_end(bx2, bt);
141    evas_object_propagate_events_set(bt, 0);
142    elm_object_focus_allow_set(bt, 0);
143    evas_object_show(bt);
144
145    bt = elm_button_add(win);
146    elm_object_text_set(bt, "Prnt");
147    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_2, en);
148    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
149    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
150    elm_box_pack_end(bx2, bt);
151    evas_object_propagate_events_set(bt, 0);
152    elm_object_focus_allow_set(bt, 0);
153    evas_object_show(bt);
154
155    bt = elm_button_add(win);
156    elm_object_text_set(bt, "Sel");
157    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_3, en);
158    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
159    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
160    elm_box_pack_end(bx2, bt);
161    evas_object_propagate_events_set(bt, 0);
162    elm_object_focus_allow_set(bt, 0);
163    evas_object_show(bt);
164
165    bt = elm_button_add(win);
166    elm_object_text_set(bt, "Ins");
167    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_4, en);
168    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
169    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
170    elm_box_pack_end(bx2, bt);
171    evas_object_propagate_events_set(bt, 0);
172    elm_object_focus_allow_set(bt, 0);
173    evas_object_show(bt);
174
175    bt = elm_button_add(win);
176    elm_object_text_set(bt, "Scrl");
177    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_5, en);
178    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
179    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
180    elm_box_pack_end(bx2, bt);
181    evas_object_propagate_events_set(bt, 0);
182    elm_object_focus_allow_set(bt, 0);
183    evas_object_show(bt);
184
185    bt = elm_button_add(win);
186    elm_object_text_set(bt, "Wr");
187    evas_object_smart_callback_add(bt, "clicked", my_entry_bt_6, en);
188    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
189    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
190    elm_box_pack_end(bx2, bt);
191    evas_object_propagate_events_set(bt, 0);
192    elm_object_focus_allow_set(bt, 0);
193    evas_object_show(bt);
194
195    elm_box_pack_end(bx, bx2);
196    evas_object_show(bx2);
197
198    elm_object_focus_set(en, EINA_TRUE);
199    evas_object_show(win);
200 }
201
202 static void
203 my_scrolled_entry_bt_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
204 {
205    Evas_Object *en = data;
206    elm_object_text_set(en, "");
207 }
208
209 static void
210 my_scrolled_entry_bt_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
211 {
212    Evas_Object *en = data;
213    const char *s = elm_object_text_get(en);
214    printf("ENTRY:\n");
215    if (s) printf("%s\n", s);
216    printf("ENTRY PLAIN UTF8:\n");
217    if (s)
218      {
219         s = elm_entry_markup_to_utf8(s);
220         if (s)
221           {
222              printf("%s\n", s);
223              free((char *)s);
224           }
225      }
226 }
227
228 static void
229 my_scrolled_entry_bt_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
230 {
231    Evas_Object *en = data;
232    const char *s = elm_entry_selection_get(en);
233    printf("SELECTION:\n");
234    if (s) printf("%s\n", s);
235    printf("SELECTION PLAIN UTF8:\n");
236    if (s)
237      {
238         s = elm_entry_markup_to_utf8(s);
239         if (s)
240           {
241              printf("%s\n", s);
242              free((char *)s);
243           }
244      }
245 }
246
247 static void
248 my_scrolled_entry_bt_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
249 {
250    Evas_Object *en = data;
251    elm_entry_entry_insert(en, "Insert some <b>BOLD</> text");
252 }
253
254 static void
255 my_scrolled_entry_bt_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
256 {
257    Evas_Object *en = data;
258    const char *s = elm_object_text_get(en);
259    printf("PASSWORD: '%s'\n", s ? s : "");
260 }
261
262 static void
263 scrolled_anchor_test(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
264 {
265    Evas_Object *en = data;
266    elm_entry_entry_insert(en, "ANCHOR CLICKED");
267 }
268
269 void
270 test_entry_scrolled(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
271 {
272    Evas_Object *win, *bx, *bx2, *bt, *en, *en_p, *sp;
273    static Elm_Entry_Filter_Accept_Set digits_filter_data, digits_filter_data2;
274    static Elm_Entry_Filter_Limit_Size limit_filter_data, limit_filter_data2;
275
276    win = elm_win_util_standard_add("entry-scrolled", "Entry Scrolled");
277    elm_win_autodel_set(win, EINA_TRUE);
278
279    bx = elm_box_add(win);
280    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
281    elm_win_resize_object_add(win, bx);
282    evas_object_show(bx);
283
284    /* disabled entry */
285    en = elm_entry_add(win);
286    elm_entry_scrollable_set(en, EINA_TRUE);
287    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
288    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
289    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
290    elm_object_text_set(en, "Disabled entry");
291    elm_entry_single_line_set(en, EINA_TRUE);
292    elm_object_disabled_set(en, EINA_TRUE);
293    evas_object_show(en);
294    elm_box_pack_end(bx, en);
295
296    /* password entry */
297    en = elm_entry_add(win);
298    elm_entry_scrollable_set(en, EINA_TRUE);
299    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
300    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
301    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
302    elm_entry_password_set(en, EINA_TRUE);
303    elm_entry_single_line_set(en, EINA_TRUE);
304    elm_object_text_set(en, "Access denied, give up!");
305    elm_object_disabled_set(en, EINA_TRUE);
306    evas_object_show(en);
307    elm_box_pack_end(bx, en);
308
309    /* multi-line disable entry */
310    en = elm_entry_add(win);
311    elm_entry_scrollable_set(en, EINA_TRUE);
312    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
313    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
314    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
315    elm_object_disabled_set(en, EINA_TRUE);
316    elm_entry_context_menu_item_add(en, "Hello", NULL, ELM_ICON_NONE, NULL, NULL);
317    elm_entry_context_menu_item_add(en, "World", NULL, ELM_ICON_NONE, NULL, NULL);
318    elm_object_text_set(en,
319                        "Multi-line disabled entry widget :)<br/>"
320                        "We can use markup <b>like this</> for styling and<br/>"
321                        "formatting <em>like this</>, as well as<br/>"
322                        "<a href=X><link>links in the text</></a>,"
323                        "but it won't be editable or clickable.");
324    evas_object_show(en);
325    elm_box_pack_end(bx, en);
326
327    sp = elm_separator_add(win);
328    elm_separator_horizontal_set(sp, EINA_TRUE);
329    elm_box_pack_end(bx, sp);
330    evas_object_show(sp);
331
332    /* Single line selected entry */
333    en = elm_entry_add(win);
334    elm_entry_scrollable_set(en, EINA_TRUE);
335    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
336    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
337    elm_object_text_set(en, "This is a single line");
338    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
339    elm_entry_single_line_set(en, EINA_TRUE);
340    elm_entry_select_all(en);
341    evas_object_show(en);
342    elm_box_pack_end(bx, en);
343
344    /* Only digits entry */
345    en = elm_entry_add(win);
346    elm_entry_scrollable_set(en, EINA_TRUE);
347    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
348    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
349    elm_object_text_set(en, "01234");
350    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
351    elm_entry_single_line_set(en, EINA_TRUE);
352    evas_object_show(en);
353    elm_box_pack_end(bx, en);
354
355    digits_filter_data.accepted = "0123456789";
356    digits_filter_data.rejected = NULL;
357    elm_entry_markup_filter_append(en, elm_entry_filter_accept_set, &digits_filter_data);
358
359    /* No digits entry */
360    en = elm_entry_add(win);
361    elm_entry_scrollable_set(en, EINA_TRUE);
362    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
363    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
364    elm_object_text_set(en, "No numbers here");
365    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
366    elm_entry_single_line_set(en, EINA_TRUE);
367    evas_object_show(en);
368    elm_box_pack_end(bx, en);
369
370    digits_filter_data2.accepted = NULL;
371    digits_filter_data2.rejected = "0123456789";
372    elm_entry_markup_filter_append(en, elm_entry_filter_accept_set, &digits_filter_data2);
373
374    /* Size limited entry */
375    en = elm_entry_add(win);
376    elm_entry_scrollable_set(en, EINA_TRUE);
377    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
378    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
379    elm_object_text_set(en, "Just 20 chars");
380    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
381    elm_entry_single_line_set(en, EINA_TRUE);
382    evas_object_show(en);
383    elm_box_pack_end(bx, en);
384
385    limit_filter_data.max_char_count = 20;
386    limit_filter_data.max_byte_count = 0;
387    elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data);
388
389    /* Byte size limited entry */
390    en = elm_entry_add(win);
391    elm_entry_scrollable_set(en, EINA_TRUE);
392    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
393    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
394    elm_object_text_set(en, "And now only 30 bytes");
395    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
396    elm_entry_single_line_set(en, EINA_TRUE);
397    evas_object_show(en);
398    elm_box_pack_end(bx, en);
399
400    limit_filter_data2.max_char_count = 0;
401    limit_filter_data2.max_byte_count = 30;
402    elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data2);
403
404    /* Single line password entry */
405    en_p = elm_entry_add(win);
406    elm_entry_scrollable_set(en_p, EINA_TRUE);
407    evas_object_size_hint_weight_set(en_p, EVAS_HINT_EXPAND, 0.0);
408    evas_object_size_hint_align_set(en_p, EVAS_HINT_FILL, 0.5);
409    elm_entry_scrollbar_policy_set(en_p, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
410    elm_object_text_set(en_p, "Password here");
411    elm_entry_single_line_set(en_p, EINA_TRUE);
412    elm_entry_password_set(en_p, EINA_TRUE);
413    evas_object_show(en_p);
414    elm_box_pack_end(bx, en_p);
415
416    /* entry with icon/end widgets*/
417    en = elm_entry_add(win);
418    elm_entry_scrollable_set(en, EINA_TRUE);
419    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
420    elm_entry_single_line_set(en, EINA_TRUE);
421    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
422    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
423    bt = elm_icon_add(win);
424    elm_icon_standard_set(bt, "home");
425    evas_object_size_hint_min_set(bt, 48, 48);
426    evas_object_color_set(bt, 255, 0, 0, 128);
427    evas_object_show(bt);
428    elm_object_part_content_set(en, "icon", bt);
429    bt = elm_icon_add(win);
430    elm_icon_standard_set(bt, "delete");
431    evas_object_color_set(bt, 255, 0, 0, 128);
432    evas_object_size_hint_min_set(bt, 48, 48);
433    evas_object_show(bt);
434    elm_object_part_content_set(en, "end", bt);
435    elm_object_text_set(en, "entry with icon and end objects");
436    evas_object_show(en);
437    elm_box_pack_end(bx, en);
438
439    /* markup entry */
440    en = elm_entry_add(win);
441    elm_entry_scrollable_set(en, EINA_TRUE);
442    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
443    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
444    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
445    elm_object_text_set(en,
446                        "This is an entry widget in this window that<br/>"
447                        "uses markup <b>like this</> for styling and<br/>"
448                        "formatting <em>like this</>, as well as<br/>"
449                        "<a href=X><link>links in the text</></a>, so enter text<br/>"
450                        "in here to edit it. By them way, links are<br/>"
451                        "called <a href=anc-02>Anchors</a> so you will need<br/>"
452                        "to refer to them this way. At the end here is a really long "
453                        "line to test line wrapping to see if it works. But just in "
454                        "case this line is not long enough I will add more here to "
455                        "really test it out, as Elementary really needs some "
456                        "good testing to see if entry widgets work as advertised.");
457    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
458    evas_object_show(en);
459    elm_box_pack_end(bx, en);
460
461    bx2 = elm_box_add(win);
462    elm_box_horizontal_set(bx2, EINA_TRUE);
463    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
464    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
465
466    bt = elm_button_add(win);
467    elm_object_text_set(bt, "Clear");
468    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_1, en);
469    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
470    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
471    elm_box_pack_end(bx2, bt);
472    evas_object_propagate_events_set(bt, 0);
473    elm_object_focus_allow_set(bt, 0);
474    evas_object_show(bt);
475
476    bt = elm_button_add(win);
477    elm_object_text_set(bt, "Print");
478    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_2, en);
479    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
480    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
481    elm_box_pack_end(bx2, bt);
482    evas_object_propagate_events_set(bt, 0);
483    elm_object_focus_allow_set(bt, 0);
484    evas_object_show(bt);
485
486    bt = elm_button_add(win);
487    elm_object_text_set(bt, "Print pwd");
488    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_5, en_p);
489    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
490    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
491    elm_box_pack_end(bx2, bt);
492    evas_object_propagate_events_set(bt, 0);
493    elm_object_focus_allow_set(bt, 0);
494    evas_object_show(bt);
495
496    bt = elm_button_add(win);
497    elm_object_text_set(bt, "Selection");
498    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_3, en);
499    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
500    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
501    elm_box_pack_end(bx2, bt);
502    evas_object_propagate_events_set(bt, 0);
503    elm_object_focus_allow_set(bt, 0);
504    evas_object_show(bt);
505
506    bt = elm_button_add(win);
507    elm_object_text_set(bt, "Insert");
508    evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_4, en);
509    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
510    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
511    elm_box_pack_end(bx2, bt);
512    evas_object_propagate_events_set(bt, 0);
513    elm_object_focus_allow_set(bt, 0);
514    evas_object_show(bt);
515
516    elm_box_pack_end(bx, bx2);
517    evas_object_show(bx2);
518
519    evas_object_resize(win, 320, 300);
520
521    elm_object_focus_set(win, EINA_TRUE);
522    evas_object_show(win);
523 }
524
525 static void
526 my_ent_bt_clr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
527 {
528    Evas_Object *en = data;
529    elm_object_text_set(en, "");
530 }
531
532 static void
533 my_ent_bt_pri(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
534 {
535    Evas_Object *en = data;
536    const char *s = elm_object_text_get(en);
537    printf("ENTRY:\n");
538    if (s) printf("%s\n", s);
539    printf("ENTRY PLAIN UTF8:\n");
540    if (s)
541      {
542         s = elm_entry_markup_to_utf8(s);
543         if (s)
544           {
545              printf("%s\n", s);
546              free((char *)s);
547           }
548      }
549 }
550
551 static void
552 my_ent_bt_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
553 {
554    Evas_Object *en = data;
555    const char *s = elm_entry_selection_get(en);
556    printf("SELECTION:\n");
557    if (s) printf("%s\n", s);
558    printf("SELECTION PLAIN UTF8:\n");
559    if (s)
560      {
561         s = elm_entry_markup_to_utf8(s);
562         if (s)
563           {
564              printf("%s\n", s);
565              free((char *)s);
566           }
567      }
568 }
569
570 static void
571 my_ent_bt_all(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
572 {
573    Evas_Object *en = data;
574    elm_entry_select_all(en);
575 }
576
577 static void
578 my_ent_bt_non(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
579 {
580    Evas_Object *en = data;
581    elm_entry_select_none(en);
582 }
583
584 static void
585 my_ent_bt_ins(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
586 {
587    Evas_Object *en = data;
588    elm_entry_entry_insert(en, "Insert text");
589 }
590
591 static void
592 my_ent_bt_lef(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
593 {
594    Evas_Object *en = data;
595    elm_entry_cursor_prev(en);
596 }
597
598 static void
599 my_ent_bt_rig(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
600 {
601    Evas_Object *en = data;
602    elm_entry_cursor_next(en);
603 }
604
605 static void
606 my_ent_bt_up_(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
607 {
608    Evas_Object *en = data;
609    elm_entry_cursor_up(en);
610 }
611
612 static void
613 my_ent_bt_dow(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
614 {
615    Evas_Object *en = data;
616    elm_entry_cursor_down(en);
617 }
618
619 static void
620 my_ent_bt_beg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
621 {
622    Evas_Object *en = data;
623    elm_entry_cursor_begin_set(en);
624 }
625
626 static void
627 my_ent_bt_end(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
628 {
629    Evas_Object *en = data;
630    elm_entry_cursor_end_set(en);
631 }
632
633 static void
634 my_ent_bt_lbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
635 {
636    Evas_Object *en = data;
637    elm_entry_cursor_line_begin_set(en);
638 }
639
640 static void
641 my_ent_bt_len(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
642 {
643    Evas_Object *en = data;
644    elm_entry_cursor_line_end_set(en);
645 }
646
647 static void
648 my_ent_bt_sbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
649 {
650    Evas_Object *en = data;
651    elm_entry_cursor_selection_begin(en);
652 }
653
654 static void
655 my_ent_bt_sen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
656 {
657    Evas_Object *en = data;
658    elm_entry_cursor_selection_end(en);
659 }
660
661 static void
662 my_ent_bt_fmt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
663 {
664    Evas_Object *en = data;
665    printf("IS FORMAT: %i\n",
666           (int)elm_entry_cursor_is_format_get(en));
667 }
668
669 static void
670 my_ent_bt_vfm(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
671 {
672    Evas_Object *en = data;
673    printf("IS VISIBLE FORMAT %i\n",
674           (int)elm_entry_cursor_is_visible_format_get(en));
675 }
676
677 static void
678 my_ent_bt_chr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
679 {
680    Evas_Object *en = data;
681    printf("CHAR '%s'\n", elm_entry_cursor_content_get(en));
682 }
683
684 static void
685 my_ent_bt_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
686 {
687    Evas_Object *en = data;
688    elm_entry_selection_cut(en);
689 }
690
691 static void
692 my_ent_bt_cop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
693 {
694    Evas_Object *en = data;
695    elm_entry_selection_copy(en);
696 }
697
698 static void
699 my_ent_bt_pas(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
700 {
701    Evas_Object *en = data;
702    elm_entry_selection_paste(en);
703 }
704
705 void
706 test_entry3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
707 {
708    Evas_Object *win, *bx, *bx2, *bt, *en;
709
710    win = elm_win_util_standard_add("entry3", "Entry 3");
711    elm_win_autodel_set(win, EINA_TRUE);
712
713    bx = elm_box_add(win);
714    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
715    elm_win_resize_object_add(win, bx);
716    evas_object_show(bx);
717
718    /* Single line selected entry */
719    en = elm_entry_add(win);
720    elm_entry_scrollable_set(en, EINA_TRUE);
721    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
722    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
723    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
724    elm_object_text_set(en, "This is a single line");
725    elm_entry_single_line_set(en, EINA_TRUE);
726    elm_box_pack_end(bx, en);
727    evas_object_show(en);
728
729    bx2 = elm_box_add(win);
730    elm_box_horizontal_set(bx2, EINA_TRUE);
731    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
732    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
733
734    bt = elm_button_add(win);
735    elm_object_text_set(bt, "Clr");
736    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
737    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
738    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
739    elm_box_pack_end(bx2, bt);
740    evas_object_propagate_events_set(bt, 0);
741    elm_object_focus_allow_set(bt, 0);
742    evas_object_show(bt);
743
744    bt = elm_button_add(win);
745    elm_object_text_set(bt, "Pri");
746    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
747    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
748    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
749    elm_box_pack_end(bx2, bt);
750    evas_object_propagate_events_set(bt, 0);
751    elm_object_focus_allow_set(bt, 0);
752    evas_object_show(bt);
753
754    bt = elm_button_add(win);
755    elm_object_text_set(bt, "Sel");
756    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
757    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
758    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
759    elm_box_pack_end(bx2, bt);
760    evas_object_propagate_events_set(bt, 0);
761    elm_object_focus_allow_set(bt, 0);
762    evas_object_show(bt);
763
764    bt = elm_button_add(win);
765    elm_object_text_set(bt, "All");
766    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
767    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
768    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
769    elm_box_pack_end(bx2, bt);
770    evas_object_propagate_events_set(bt, 0);
771    elm_object_focus_allow_set(bt, 0);
772    evas_object_show(bt);
773
774    bt = elm_button_add(win);
775    elm_object_text_set(bt, "Non");
776    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
777    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
778    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
779    elm_box_pack_end(bx2, bt);
780    evas_object_propagate_events_set(bt, 0);
781    elm_object_focus_allow_set(bt, 0);
782    evas_object_show(bt);
783
784    bt = elm_button_add(win);
785    elm_object_text_set(bt, "Ins");
786    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
787    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
788    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
789    elm_box_pack_end(bx2, bt);
790    evas_object_propagate_events_set(bt, 0);
791    elm_object_focus_allow_set(bt, 0);
792    evas_object_show(bt);
793
794    elm_box_pack_end(bx, bx2);
795    evas_object_show(bx2);
796
797    bx2 = elm_box_add(win);
798    elm_box_horizontal_set(bx2, EINA_TRUE);
799    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
800    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
801
802    bt = elm_button_add(win);
803    elm_object_text_set(bt, "Lef");
804    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
805    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
806    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
807    elm_box_pack_end(bx2, bt);
808    evas_object_propagate_events_set(bt, 0);
809    elm_object_focus_allow_set(bt, 0);
810    evas_object_show(bt);
811
812    bt = elm_button_add(win);
813    elm_object_text_set(bt, "Rig");
814    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
815    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
816    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
817    elm_box_pack_end(bx2, bt);
818    evas_object_propagate_events_set(bt, 0);
819    elm_object_focus_allow_set(bt, 0);
820    evas_object_show(bt);
821
822    bt = elm_button_add(win);
823    elm_object_text_set(bt, "Up ");
824    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
825    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
826    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
827    elm_box_pack_end(bx2, bt);
828    evas_object_propagate_events_set(bt, 0);
829    elm_object_focus_allow_set(bt, 0);
830    evas_object_show(bt);
831
832    bt = elm_button_add(win);
833    elm_object_text_set(bt, "Dow");
834    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
835    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
836    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
837    elm_box_pack_end(bx2, bt);
838    evas_object_propagate_events_set(bt, 0);
839    elm_object_focus_allow_set(bt, 0);
840    evas_object_show(bt);
841
842    bt = elm_button_add(win);
843    elm_object_text_set(bt, "Beg");
844    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
845    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
846    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
847    elm_box_pack_end(bx2, bt);
848    evas_object_propagate_events_set(bt, 0);
849    elm_object_focus_allow_set(bt, 0);
850    evas_object_show(bt);
851
852    bt = elm_button_add(win);
853    elm_object_text_set(bt, "End");
854    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
855    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
856    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
857    elm_box_pack_end(bx2, bt);
858    evas_object_propagate_events_set(bt, 0);
859    elm_object_focus_allow_set(bt, 0);
860    evas_object_show(bt);
861
862    elm_box_pack_end(bx, bx2);
863    evas_object_show(bx2);
864
865    bx2 = elm_box_add(win);
866    elm_box_horizontal_set(bx2, EINA_TRUE);
867    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
868    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
869
870    bt = elm_button_add(win);
871    elm_object_text_set(bt, "LBe");
872    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
873    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
874    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
875    elm_box_pack_end(bx2, bt);
876    evas_object_propagate_events_set(bt, 0);
877    elm_object_focus_allow_set(bt, 0);
878    evas_object_show(bt);
879
880    bt = elm_button_add(win);
881    elm_object_text_set(bt, "LEn");
882    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
883    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
884    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
885    elm_box_pack_end(bx2, bt);
886    evas_object_propagate_events_set(bt, 0);
887    elm_object_focus_allow_set(bt, 0);
888    evas_object_show(bt);
889
890    bt = elm_button_add(win);
891    elm_object_text_set(bt, "SBe");
892    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
893    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
894    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
895    elm_box_pack_end(bx2, bt);
896    evas_object_propagate_events_set(bt, 0);
897    elm_object_focus_allow_set(bt, 0);
898    evas_object_show(bt);
899
900    bt = elm_button_add(win);
901    elm_object_text_set(bt, "SEn");
902    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
903    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
904    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
905    elm_box_pack_end(bx2, bt);
906    evas_object_propagate_events_set(bt, 0);
907    elm_object_focus_allow_set(bt, 0);
908    evas_object_show(bt);
909
910    bt = elm_button_add(win);
911    elm_object_text_set(bt, "Fmt");
912    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
913    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
914    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
915    elm_box_pack_end(bx2, bt);
916    evas_object_propagate_events_set(bt, 0);
917    elm_object_focus_allow_set(bt, 0);
918    evas_object_show(bt);
919
920    bt = elm_button_add(win);
921    elm_object_text_set(bt, "VFm");
922    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
923    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
924    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
925    elm_box_pack_end(bx2, bt);
926    evas_object_propagate_events_set(bt, 0);
927    elm_object_focus_allow_set(bt, 0);
928    evas_object_show(bt);
929
930    elm_box_pack_end(bx, bx2);
931    evas_object_show(bx2);
932
933    bx2 = elm_box_add(win);
934    elm_box_horizontal_set(bx2, EINA_TRUE);
935    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
936    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
937
938    bt = elm_button_add(win);
939    elm_object_text_set(bt, "Chr");
940    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
941    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
942    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
943    elm_box_pack_end(bx2, bt);
944    evas_object_propagate_events_set(bt, 0);
945    elm_object_focus_allow_set(bt, 0);
946    evas_object_show(bt);
947
948    bt = elm_button_add(win);
949    elm_object_text_set(bt, "Cut");
950    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
951    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
952    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
953    elm_box_pack_end(bx2, bt);
954    evas_object_propagate_events_set(bt, 0);
955    elm_object_focus_allow_set(bt, 0);
956    evas_object_show(bt);
957
958    bt = elm_button_add(win);
959    elm_object_text_set(bt, "Cop");
960    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
961    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
962    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
963    elm_box_pack_end(bx2, bt);
964    evas_object_propagate_events_set(bt, 0);
965    elm_object_focus_allow_set(bt, 0);
966    evas_object_show(bt);
967
968    bt = elm_button_add(win);
969    elm_object_text_set(bt, "Pas");
970    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
971    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
972    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
973    elm_box_pack_end(bx2, bt);
974    evas_object_propagate_events_set(bt, 0);
975    elm_object_focus_allow_set(bt, 0);
976    evas_object_show(bt);
977
978    elm_box_pack_end(bx, bx2);
979    evas_object_show(bx2);
980
981    /* markup entry */
982    en = elm_entry_add(win);
983    elm_entry_scrollable_set(en, EINA_TRUE);
984    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
985    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
986    elm_object_text_set(en,
987                        "This is an entry widget in this window that<br/>"
988                        "uses markup <b>like this</> for styling and<br/>"
989                        "formatting <em>like this</>, as well as<br/>"
990                        "<a href=X><link>links in the text</></a>, so enter text<br/>"
991                        "in here to edit it. By them way, links are<br/>"
992                        "called <a href=anc-02>Anchors</a> so you will need<br/>"
993                        "to refer to them this way. At the end here is a really long "
994                        "line to test line wrapping to see if it works. But just in "
995                        "case this line is not long enough I will add more here to "
996                        "really test it out, as Elementary really needs some "
997                        "good testing to see if entry widgets work as advertised."
998                       );
999    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1000    elm_box_pack_end(bx, en);
1001    evas_object_show(en);
1002
1003    bx2 = elm_box_add(win);
1004    elm_box_horizontal_set(bx2, EINA_TRUE);
1005    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1006    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1007
1008    bt = elm_button_add(win);
1009    elm_object_text_set(bt, "Clr");
1010    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
1011    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1012    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1013    elm_box_pack_end(bx2, bt);
1014    evas_object_propagate_events_set(bt, 0);
1015    elm_object_focus_allow_set(bt, 0);
1016    evas_object_show(bt);
1017
1018    bt = elm_button_add(win);
1019    elm_object_text_set(bt, "Pri");
1020    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
1021    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1022    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1023    elm_box_pack_end(bx2, bt);
1024    evas_object_propagate_events_set(bt, 0);
1025    elm_object_focus_allow_set(bt, 0);
1026    evas_object_show(bt);
1027
1028    bt = elm_button_add(win);
1029    elm_object_text_set(bt, "Sel");
1030    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
1031    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1032    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1033    elm_box_pack_end(bx2, bt);
1034    evas_object_propagate_events_set(bt, 0);
1035    elm_object_focus_allow_set(bt, 0);
1036    evas_object_show(bt);
1037
1038    bt = elm_button_add(win);
1039    elm_object_text_set(bt, "All");
1040    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
1041    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1042    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1043    elm_box_pack_end(bx2, bt);
1044    evas_object_propagate_events_set(bt, 0);
1045    elm_object_focus_allow_set(bt, 0);
1046    evas_object_show(bt);
1047
1048    bt = elm_button_add(win);
1049    elm_object_text_set(bt, "Non");
1050    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
1051    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1052    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1053    elm_box_pack_end(bx2, bt);
1054    evas_object_propagate_events_set(bt, 0);
1055    elm_object_focus_allow_set(bt, 0);
1056    evas_object_show(bt);
1057
1058    bt = elm_button_add(win);
1059    elm_object_text_set(bt, "Ins");
1060    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
1061    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1062    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1063    elm_box_pack_end(bx2, bt);
1064    evas_object_propagate_events_set(bt, 0);
1065    elm_object_focus_allow_set(bt, 0);
1066    evas_object_show(bt);
1067
1068    elm_box_pack_end(bx, bx2);
1069    evas_object_show(bx2);
1070
1071    bx2 = elm_box_add(win);
1072    elm_box_horizontal_set(bx2, EINA_TRUE);
1073    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1074    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1075
1076    bt = elm_button_add(win);
1077    elm_object_text_set(bt, "Lef");
1078    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
1079    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1080    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1081    elm_box_pack_end(bx2, bt);
1082    evas_object_propagate_events_set(bt, 0);
1083    elm_object_focus_allow_set(bt, 0);
1084    evas_object_show(bt);
1085
1086    bt = elm_button_add(win);
1087    elm_object_text_set(bt, "Rig");
1088    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
1089    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1090    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1091    elm_box_pack_end(bx2, bt);
1092    evas_object_propagate_events_set(bt, 0);
1093    elm_object_focus_allow_set(bt, 0);
1094    evas_object_show(bt);
1095
1096    bt = elm_button_add(win);
1097    elm_object_text_set(bt, "Up ");
1098    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
1099    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1100    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1101    elm_box_pack_end(bx2, bt);
1102    evas_object_propagate_events_set(bt, 0);
1103    elm_object_focus_allow_set(bt, 0);
1104    evas_object_show(bt);
1105
1106    bt = elm_button_add(win);
1107    elm_object_text_set(bt, "Dow");
1108    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
1109    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1110    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1111    elm_box_pack_end(bx2, bt);
1112    evas_object_propagate_events_set(bt, 0);
1113    elm_object_focus_allow_set(bt, 0);
1114    evas_object_show(bt);
1115
1116    bt = elm_button_add(win);
1117    elm_object_text_set(bt, "Beg");
1118    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
1119    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1120    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1121    elm_box_pack_end(bx2, bt);
1122    evas_object_propagate_events_set(bt, 0);
1123    elm_object_focus_allow_set(bt, 0);
1124    evas_object_show(bt);
1125
1126    bt = elm_button_add(win);
1127    elm_object_text_set(bt, "End");
1128    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
1129    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1130    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1131    elm_box_pack_end(bx2, bt);
1132    evas_object_propagate_events_set(bt, 0);
1133    elm_object_focus_allow_set(bt, 0);
1134    evas_object_show(bt);
1135
1136    elm_box_pack_end(bx, bx2);
1137    evas_object_show(bx2);
1138
1139    bx2 = elm_box_add(win);
1140    elm_box_horizontal_set(bx2, EINA_TRUE);
1141    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1142    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1143
1144    bt = elm_button_add(win);
1145    elm_object_text_set(bt, "LBe");
1146    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
1147    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1148    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1149    elm_box_pack_end(bx2, bt);
1150    evas_object_propagate_events_set(bt, 0);
1151    elm_object_focus_allow_set(bt, 0);
1152    evas_object_show(bt);
1153
1154    bt = elm_button_add(win);
1155    elm_object_text_set(bt, "LEn");
1156    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
1157    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1158    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1159    elm_box_pack_end(bx2, bt);
1160    evas_object_propagate_events_set(bt, 0);
1161    elm_object_focus_allow_set(bt, 0);
1162    evas_object_show(bt);
1163
1164    bt = elm_button_add(win);
1165    elm_object_text_set(bt, "SBe");
1166    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
1167    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1168    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1169    elm_box_pack_end(bx2, bt);
1170    evas_object_propagate_events_set(bt, 0);
1171    elm_object_focus_allow_set(bt, 0);
1172    evas_object_show(bt);
1173
1174    bt = elm_button_add(win);
1175    elm_object_text_set(bt, "SEn");
1176    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
1177    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1178    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1179    elm_box_pack_end(bx2, bt);
1180    evas_object_propagate_events_set(bt, 0);
1181    elm_object_focus_allow_set(bt, 0);
1182    evas_object_show(bt);
1183
1184    bt = elm_button_add(win);
1185    elm_object_text_set(bt, "Fmt");
1186    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
1187    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1188    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1189    elm_box_pack_end(bx2, bt);
1190    evas_object_propagate_events_set(bt, 0);
1191    elm_object_focus_allow_set(bt, 0);
1192    evas_object_show(bt);
1193
1194    bt = elm_button_add(win);
1195    elm_object_text_set(bt, "VFm");
1196    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
1197    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1198    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1199    elm_box_pack_end(bx2, bt);
1200    evas_object_propagate_events_set(bt, 0);
1201    elm_object_focus_allow_set(bt, 0);
1202    evas_object_show(bt);
1203
1204    elm_box_pack_end(bx, bx2);
1205    evas_object_show(bx2);
1206
1207    bx2 = elm_box_add(win);
1208    elm_box_horizontal_set(bx2, EINA_TRUE);
1209    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1210    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1211
1212    bt = elm_button_add(win);
1213    elm_object_text_set(bt, "Chr");
1214    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
1215    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1216    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1217    elm_box_pack_end(bx2, bt);
1218    evas_object_propagate_events_set(bt, 0);
1219    elm_object_focus_allow_set(bt, 0);
1220    evas_object_show(bt);
1221
1222    bt = elm_button_add(win);
1223    elm_object_text_set(bt, "Cut");
1224    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
1225    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1226    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1227    elm_box_pack_end(bx2, bt);
1228    evas_object_propagate_events_set(bt, 0);
1229    elm_object_focus_allow_set(bt, 0);
1230    evas_object_show(bt);
1231
1232    bt = elm_button_add(win);
1233    elm_object_text_set(bt, "Cop");
1234    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
1235    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1236    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1237    elm_box_pack_end(bx2, bt);
1238    evas_object_propagate_events_set(bt, 0);
1239    elm_object_focus_allow_set(bt, 0);
1240    evas_object_show(bt);
1241
1242    bt = elm_button_add(win);
1243    elm_object_text_set(bt, "Pas");
1244    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
1245    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1246    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1247    elm_box_pack_end(bx2, bt);
1248    evas_object_propagate_events_set(bt, 0);
1249    elm_object_focus_allow_set(bt, 0);
1250    evas_object_show(bt);
1251
1252    elm_box_pack_end(bx, bx2);
1253    evas_object_show(bx2);
1254
1255    evas_object_resize(win, 320, 480);
1256
1257    elm_object_focus_set(win, EINA_TRUE);
1258    evas_object_show(win);
1259 }
1260
1261 void
1262 test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1263 {
1264    Evas_Object *win, *ly, *en;
1265    char buf[PATH_MAX];
1266
1267    win = elm_win_util_standard_add("entry4", "Entry 4");
1268    elm_win_autodel_set(win, EINA_TRUE);
1269
1270    ly = elm_layout_add(win);
1271    snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
1272    elm_layout_file_set(ly, buf, "layout");
1273    evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1274    elm_win_resize_object_add(win, ly);
1275    evas_object_show(ly);
1276
1277    en = elm_entry_add(win);
1278    elm_entry_scrollable_set(en, EINA_TRUE);
1279    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
1280    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
1281    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
1282    elm_object_text_set(en, "This is a single line");
1283    elm_entry_single_line_set(en, EINA_TRUE);
1284    elm_object_part_content_set(ly, "element1", en);
1285    evas_object_show(en);
1286
1287    en = elm_entry_add(win);
1288    elm_entry_line_wrap_set(en, ELM_WRAP_NONE);
1289    elm_object_text_set(en,
1290                        "This is an entry widget<br/>"
1291                        "that uses markup<br/>"
1292                        "<b>like this</> and has<br/>"
1293                        "no scroller, so you can<br/>"
1294                        "use it more flexibly.");
1295    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1296    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1297    elm_object_part_content_set(ly, "element2", en);
1298    evas_object_show(en);
1299
1300    en = elm_entry_add(win);
1301    elm_entry_scrollable_set(en, EINA_TRUE);
1302    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1303    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1304    elm_object_text_set(en,
1305                        "This is an entry widget in this window that<br/>"
1306                        "uses markup <b>like this</> for styling and<br/>"
1307                        "formatting <em>like this</>, as well as<br/>"
1308                        "<a href=X><link>links in the text</></a>, so enter text<br/>"
1309                        "in here to edit it. By them way, links are<br/>"
1310                        "called <a href=anc-02>Anchors</a> so you will need<br/>"
1311                        "to refer to them this way. At the end here is a really long "
1312                        "line to test line wrapping to see if it works. But just in "
1313                        "case this line is not long enough I will add more here to "
1314                        "really test it out, as Elementary really needs some "
1315                        "good testing to see if entry widgets work as advertised."
1316                       );
1317    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1318    elm_object_part_content_set(ly, "element3", en);
1319    evas_object_show(en);
1320
1321    evas_object_show(win);
1322 }
1323
1324 void
1325 test_entry5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1326 {
1327    Evas_Object *win, *bx, *bx2, *bt, *en;
1328
1329    win = elm_win_util_standard_add("entry5", "Entry 5");
1330    elm_win_autodel_set(win, EINA_TRUE);
1331
1332    bx = elm_box_add(win);
1333    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1334    elm_win_resize_object_add(win, bx);
1335    evas_object_show(bx);
1336
1337    en = elm_entry_add(win);
1338    elm_entry_scrollable_set(en, EINA_TRUE);
1339    elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1340    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1341    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1342    elm_object_text_set(en,
1343                        "This is an entry widget in this window that "
1344                        "uses markup like this for styling and "
1345                        "formatting like this, as well as "
1346                        "to refer to them this way. At the end here is a really long "
1347                        "line to test line wrapping to see if it works. But just in "
1348                        "case this line is not long enough I will add more here to "
1349                        "really test it out, as Elementary really needs some "
1350                        "good testing to see if entry widgets work as advertised."
1351                       );
1352    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1353    elm_box_pack_end(bx, en);
1354    evas_object_show(en);
1355
1356    bx2 = elm_box_add(win);
1357    elm_box_horizontal_set(bx2, EINA_TRUE);
1358    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1359    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1360
1361    bt = elm_button_add(win);
1362    elm_object_text_set(bt, "Clr");
1363    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
1364    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1365    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1366    elm_box_pack_end(bx2, bt);
1367    evas_object_propagate_events_set(bt, 0);
1368    elm_object_focus_allow_set(bt, 0);
1369    evas_object_show(bt);
1370
1371    bt = elm_button_add(win);
1372    elm_object_text_set(bt, "Pri");
1373    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
1374    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1375    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1376    elm_box_pack_end(bx2, bt);
1377    evas_object_propagate_events_set(bt, 0);
1378    elm_object_focus_allow_set(bt, 0);
1379    evas_object_show(bt);
1380
1381    bt = elm_button_add(win);
1382    elm_object_text_set(bt, "Sel");
1383    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
1384    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1385    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1386    elm_box_pack_end(bx2, bt);
1387    evas_object_propagate_events_set(bt, 0);
1388    elm_object_focus_allow_set(bt, 0);
1389    evas_object_show(bt);
1390
1391    bt = elm_button_add(win);
1392    elm_object_text_set(bt, "All");
1393    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
1394    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1395    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1396    elm_box_pack_end(bx2, bt);
1397    evas_object_propagate_events_set(bt, 0);
1398    elm_object_focus_allow_set(bt, 0);
1399    evas_object_show(bt);
1400
1401    bt = elm_button_add(win);
1402    elm_object_text_set(bt, "Non");
1403    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
1404    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1405    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1406    elm_box_pack_end(bx2, bt);
1407    evas_object_propagate_events_set(bt, 0);
1408    elm_object_focus_allow_set(bt, 0);
1409    evas_object_show(bt);
1410
1411    bt = elm_button_add(win);
1412    elm_object_text_set(bt, "Ins");
1413    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
1414    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1415    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1416    elm_box_pack_end(bx2, bt);
1417    evas_object_propagate_events_set(bt, 0);
1418    elm_object_focus_allow_set(bt, 0);
1419    evas_object_show(bt);
1420
1421    elm_box_pack_end(bx, bx2);
1422    evas_object_show(bx2);
1423
1424    bx2 = elm_box_add(win);
1425    elm_box_horizontal_set(bx2, EINA_TRUE);
1426    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1427    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1428
1429    bt = elm_button_add(win);
1430    elm_object_text_set(bt, "Lef");
1431    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
1432    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1433    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1434    elm_box_pack_end(bx2, bt);
1435    evas_object_propagate_events_set(bt, 0);
1436    elm_object_focus_allow_set(bt, 0);
1437    evas_object_show(bt);
1438
1439    bt = elm_button_add(win);
1440    elm_object_text_set(bt, "Rig");
1441    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
1442    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1443    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1444    elm_box_pack_end(bx2, bt);
1445    evas_object_propagate_events_set(bt, 0);
1446    elm_object_focus_allow_set(bt, 0);
1447    evas_object_show(bt);
1448
1449    bt = elm_button_add(win);
1450    elm_object_text_set(bt, "Up ");
1451    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
1452    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1453    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1454    elm_box_pack_end(bx2, bt);
1455    evas_object_propagate_events_set(bt, 0);
1456    elm_object_focus_allow_set(bt, 0);
1457    evas_object_show(bt);
1458
1459    bt = elm_button_add(win);
1460    elm_object_text_set(bt, "Dow");
1461    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
1462    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1463    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1464    elm_box_pack_end(bx2, bt);
1465    evas_object_propagate_events_set(bt, 0);
1466    elm_object_focus_allow_set(bt, 0);
1467    evas_object_show(bt);
1468
1469    bt = elm_button_add(win);
1470    elm_object_text_set(bt, "Beg");
1471    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
1472    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1473    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1474    elm_box_pack_end(bx2, bt);
1475    evas_object_propagate_events_set(bt, 0);
1476    elm_object_focus_allow_set(bt, 0);
1477    evas_object_show(bt);
1478
1479    bt = elm_button_add(win);
1480    elm_object_text_set(bt, "End");
1481    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
1482    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1483    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1484    elm_box_pack_end(bx2, bt);
1485    evas_object_propagate_events_set(bt, 0);
1486    elm_object_focus_allow_set(bt, 0);
1487    evas_object_show(bt);
1488
1489    elm_box_pack_end(bx, bx2);
1490    evas_object_show(bx2);
1491
1492    bx2 = elm_box_add(win);
1493    elm_box_horizontal_set(bx2, EINA_TRUE);
1494    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1495    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1496
1497    bt = elm_button_add(win);
1498    elm_object_text_set(bt, "LBe");
1499    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
1500    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1501    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1502    elm_box_pack_end(bx2, bt);
1503    evas_object_propagate_events_set(bt, 0);
1504    elm_object_focus_allow_set(bt, 0);
1505    evas_object_show(bt);
1506
1507    bt = elm_button_add(win);
1508    elm_object_text_set(bt, "LEn");
1509    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
1510    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1511    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1512    elm_box_pack_end(bx2, bt);
1513    evas_object_propagate_events_set(bt, 0);
1514    elm_object_focus_allow_set(bt, 0);
1515    evas_object_show(bt);
1516
1517    bt = elm_button_add(win);
1518    elm_object_text_set(bt, "SBe");
1519    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
1520    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1521    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1522    elm_box_pack_end(bx2, bt);
1523    evas_object_propagate_events_set(bt, 0);
1524    elm_object_focus_allow_set(bt, 0);
1525    evas_object_show(bt);
1526
1527    bt = elm_button_add(win);
1528    elm_object_text_set(bt, "SEn");
1529    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
1530    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1531    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1532    elm_box_pack_end(bx2, bt);
1533    evas_object_propagate_events_set(bt, 0);
1534    elm_object_focus_allow_set(bt, 0);
1535    evas_object_show(bt);
1536
1537    bt = elm_button_add(win);
1538    elm_object_text_set(bt, "Fmt");
1539    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
1540    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1541    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1542    elm_box_pack_end(bx2, bt);
1543    evas_object_propagate_events_set(bt, 0);
1544    elm_object_focus_allow_set(bt, 0);
1545    evas_object_show(bt);
1546
1547    bt = elm_button_add(win);
1548    elm_object_text_set(bt, "VFm");
1549    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
1550    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1551    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1552    elm_box_pack_end(bx2, bt);
1553    evas_object_propagate_events_set(bt, 0);
1554    elm_object_focus_allow_set(bt, 0);
1555    evas_object_show(bt);
1556
1557    elm_box_pack_end(bx, bx2);
1558    evas_object_show(bx2);
1559
1560    bx2 = elm_box_add(win);
1561    elm_box_horizontal_set(bx2, EINA_TRUE);
1562    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1563    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1564
1565    bt = elm_button_add(win);
1566    elm_object_text_set(bt, "Chr");
1567    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
1568    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1569    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1570    elm_box_pack_end(bx2, bt);
1571    evas_object_propagate_events_set(bt, 0);
1572    elm_object_focus_allow_set(bt, 0);
1573    evas_object_show(bt);
1574
1575    bt = elm_button_add(win);
1576    elm_object_text_set(bt, "Cut");
1577    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
1578    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1579    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1580    elm_box_pack_end(bx2, bt);
1581    evas_object_propagate_events_set(bt, 0);
1582    elm_object_focus_allow_set(bt, 0);
1583    evas_object_show(bt);
1584
1585    bt = elm_button_add(win);
1586    elm_object_text_set(bt, "Cop");
1587    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
1588    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1589    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1590    elm_box_pack_end(bx2, bt);
1591    evas_object_propagate_events_set(bt, 0);
1592    elm_object_focus_allow_set(bt, 0);
1593    evas_object_show(bt);
1594
1595    bt = elm_button_add(win);
1596    elm_object_text_set(bt, "Pas");
1597    evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
1598    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1599    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1600    elm_box_pack_end(bx2, bt);
1601    evas_object_propagate_events_set(bt, 0);
1602    elm_object_focus_allow_set(bt, 0);
1603    evas_object_show(bt);
1604
1605    elm_box_pack_end(bx, bx2);
1606    evas_object_show(bx2);
1607
1608    evas_object_resize(win, 320, 480);
1609
1610    elm_object_focus_set(win, EINA_TRUE);
1611    evas_object_show(win);
1612 }
1613
1614 void
1615 test_entry6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1616 {
1617    Evas_Object *win, *bx, *en;
1618
1619    win = elm_win_util_standard_add("entry6", "Entry 6");
1620    elm_win_autodel_set(win, EINA_TRUE);
1621
1622    bx = elm_box_add(win);
1623    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1624    elm_win_resize_object_add(win, bx);
1625    evas_object_show(bx);
1626
1627    en = elm_entry_add(win);
1628    elm_entry_scrollable_set(en, EINA_TRUE);
1629    elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1630    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1631    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1632    elm_object_text_set(en,
1633                        "input_panel_enabled: TRUE.<br>"
1634                        "When this entry gets a focus, virtual keyboard will be shown "
1635                        "in illume environment.");
1636    elm_box_pack_end(bx, en);
1637    evas_object_show(en);
1638
1639    en = elm_entry_add(win);
1640    elm_entry_scrollable_set(en, EINA_TRUE);
1641    elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1642    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1643    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1644    elm_object_text_set(en,
1645                        "input_panel_enabled: FALSE.<br>"
1646                        "This entry doesn't allow to show virtual keyboard automatically.<br>"
1647                        "it is used in case that wants its own keypad such as calculator.");
1648    elm_entry_input_panel_enabled_set(en, EINA_FALSE);
1649    elm_box_pack_end(bx, en);
1650    evas_object_show(en);
1651
1652    evas_object_resize(win, 320, 300);
1653
1654    elm_object_focus_set(win, EINA_TRUE);
1655    evas_object_show(win);
1656 }
1657
1658 static void
1659 changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1660 {
1661    Evas_Object *en;
1662    en = (Evas_Object*)data;
1663
1664    elm_entry_editable_set(en, elm_check_state_get(obj));
1665 }
1666
1667 static void
1668 en_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1669 {
1670    Evas_Object *sp, *en;
1671    sp = (Evas_Object *)data;
1672    en = (Evas_Object *)obj;
1673    elm_spinner_min_max_set(sp, 0, strlen(elm_object_text_get(en)));
1674 }
1675
1676 static void
1677 sp_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1678 {
1679    Evas_Object *en, *sp;
1680    en = (Evas_Object *)data;
1681    sp = (Evas_Object *)obj;
1682    elm_entry_cursor_pos_set(en, elm_spinner_value_get(sp));
1683    elm_object_focus_set(en, EINA_TRUE);
1684 }
1685
1686 static void
1687 add_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1688 {
1689    Evas_Object *en;
1690    en = (Evas_Object *)data;
1691
1692    elm_entry_context_menu_item_add(en, "item", NULL, ELM_ICON_NONE, NULL, NULL);
1693 }
1694
1695 static void
1696 clear_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1697 {
1698    Evas_Object *en;
1699    en = (Evas_Object *)data;
1700
1701    elm_entry_context_menu_clear(en);
1702 }
1703
1704 static Evas_Object *
1705 item_provider(void *images __UNUSED__, Evas_Object *en, const char *item)
1706 {
1707    Evas_Object *o = NULL;;
1708    char buf[1024];
1709
1710    if (!strcmp(item, "itemprovider"))
1711      {
1712         snprintf(buf, sizeof(buf), "%s/images/icon_00.png",
1713                  elm_app_data_dir_get());
1714         o = evas_object_image_filled_add(evas_object_evas_get(en));
1715         evas_object_image_file_set(o, buf, NULL);
1716      }
1717
1718    return o;
1719 }
1720
1721 static Evas_Object *
1722 prepend_item_provider(void *images __UNUSED__, Evas_Object *en, const char *item)
1723 {
1724    Evas_Object *o = NULL;;
1725    char buf[1024];
1726
1727    if (!strcmp(item, "itemprovider"))
1728      {
1729         snprintf(buf, sizeof(buf), "%s/images/icon_10.png",
1730                  elm_app_data_dir_get());
1731         o = evas_object_image_filled_add(evas_object_evas_get(en));
1732         evas_object_image_file_set(o, buf, NULL);
1733      }
1734
1735    return o;
1736 }
1737
1738 static void
1739 prepend_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1740 {
1741    Evas_Object *en;
1742    en = (Evas_Object *)data;
1743
1744    elm_entry_item_provider_prepend(en, prepend_item_provider, NULL);
1745    elm_object_text_set(en,
1746                        "Item Provider"
1747                        "<item size=50x50 vsize=full href=itemprovider></item>"
1748                       );
1749 }
1750
1751 static void
1752 remove_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1753 {
1754    Evas_Object *en;
1755    en = (Evas_Object *)data;
1756
1757    elm_entry_item_provider_remove(en, item_provider, NULL);
1758    elm_entry_item_provider_remove(en, prepend_item_provider, NULL);
1759    elm_object_text_set(en,
1760                        "Item Provider"
1761                        "<item size=50x50 vsize=full href=itemprovider></item>"
1762                       );
1763 }
1764
1765 static void
1766 enable_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1767 {
1768    Evas_Object *en;
1769    en = (Evas_Object*)data;
1770
1771    elm_entry_context_menu_disabled_set(en, elm_check_state_get(obj));
1772 }
1773
1774 void
1775 test_entry7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1776 {
1777    Evas_Object *win, *gd, *bg, *en, *tg, *lb, *sp;
1778    Evas_Object *bt, *en2;
1779
1780    win = elm_win_util_standard_add("entry7", "Entry 7");
1781    elm_win_autodel_set(win, EINA_TRUE);
1782
1783    gd = elm_grid_add(win);
1784    elm_grid_size_set(gd, 100, 100);
1785    evas_object_size_hint_weight_set(gd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1786    elm_win_resize_object_add(win, gd);
1787    evas_object_show(gd);
1788
1789    /* upper entry group */
1790    bg = elm_bg_add(win);
1791    elm_bg_color_set(bg, 255, 0, 0);
1792    elm_grid_pack(gd, bg, 10, 10, 60, 30);
1793    evas_object_show(bg);
1794
1795    en = elm_entry_add(win);
1796    elm_entry_scrollable_set(en, EINA_TRUE);
1797    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1798    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1799    elm_object_text_set(en, "Editable, Cursor Positioin");
1800    evas_object_show(en);
1801    elm_grid_pack(gd, en, 10, 10, 60, 30);
1802
1803    tg = elm_check_add(win);
1804    evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1805    evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, EVAS_HINT_FILL);
1806    elm_object_text_set(tg, "Editable");
1807    elm_check_state_set(tg, EINA_TRUE);
1808    evas_object_smart_callback_add(tg, "changed", changed_cb, en);
1809    elm_grid_pack(gd, tg, 70, 10, 22, 10);
1810    evas_object_show(tg);
1811
1812    lb = elm_label_add(win);
1813    elm_object_text_set(lb, "Cursor position:");
1814    evas_object_size_hint_weight_set(lb, 0.0, 0.0);
1815    evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1816    elm_grid_pack(gd, lb, 70, 25, 25, 5);
1817    evas_object_show(lb);
1818
1819    sp = elm_spinner_add(win);
1820    elm_spinner_label_format_set(sp, "%1.0f");
1821    elm_spinner_step_set(sp, 1);
1822    elm_spinner_wrap_set(sp, ELM_WRAP_CHAR);
1823    elm_spinner_min_max_set(sp, 0, strlen(elm_object_text_get(en)));
1824    evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, EVAS_HINT_FILL);
1825    evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1826    elm_grid_pack(gd, sp, 70, 30, 25, 10);
1827    evas_object_smart_callback_add(en, "changed", en_changed_cb, sp);
1828    evas_object_smart_callback_add(sp, "delay,changed", sp_changed_cb, en);
1829    evas_object_show(sp);
1830
1831    /* bottom entry group */
1832    bg = elm_bg_add(win);
1833    elm_bg_color_set(bg, 0, 255, 0);
1834    elm_grid_pack(gd, bg, 10, 50, 45, 30);
1835    evas_object_show(bg);
1836
1837    en2 = elm_entry_add(win);
1838    elm_entry_scrollable_set(en2, EINA_TRUE);
1839    evas_object_size_hint_weight_set(en2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1840    evas_object_size_hint_align_set(en2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1841    elm_object_text_set(en2,
1842                        "Item Provider"
1843                        "<item size=50x50 vsize=full href=itemprovider></item>"
1844                       );
1845    elm_entry_item_provider_append(en2, item_provider, NULL);
1846    elm_entry_context_menu_disabled_set(en, EINA_TRUE);
1847    elm_grid_pack(gd, en2, 10, 50, 45, 30);
1848    evas_object_show(en2);
1849
1850    tg = elm_check_add(win);
1851    evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1852    evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, EVAS_HINT_FILL);
1853    elm_object_text_set(tg, "Disable Context Menu");
1854    elm_check_state_set(tg, EINA_TRUE);
1855    evas_object_smart_callback_add(tg, "changed", enable_changed_cb, en2);
1856    elm_grid_pack(gd, tg, 55, 50, 40, 10);
1857    evas_object_show(tg);
1858
1859    bt = elm_button_add(win);
1860    elm_object_text_set(bt, "Add Context Menu");
1861    elm_grid_pack(gd, bt, 55, 60, 40, 10);
1862    evas_object_smart_callback_add(bt, "clicked", add_bt_clicked, en2);
1863    evas_object_show(bt);
1864
1865    bt = elm_button_add(win);
1866    elm_object_text_set(bt, "Clear Context Menu");
1867    elm_grid_pack(gd, bt, 55, 70, 40, 10);
1868    evas_object_smart_callback_add(bt, "clicked", clear_bt_clicked, en2);
1869    evas_object_show(bt);
1870
1871    bt = elm_button_add(win);
1872    elm_object_text_set(bt, "Prepend Item Provider");
1873    elm_grid_pack(gd, bt, 10, 80, 45, 10);
1874    evas_object_smart_callback_add(bt, "clicked", prepend_bt_clicked, en2);
1875    evas_object_show(bt);
1876
1877    bt = elm_button_add(win);
1878    elm_object_text_set(bt, "Remove Item Provider");
1879    elm_grid_pack(gd, bt, 55, 80, 40, 10);
1880    evas_object_smart_callback_add(bt, "clicked", remove_bt_clicked, en2);
1881    evas_object_show(bt);
1882
1883    evas_object_resize(win, 320, 320);
1884    evas_object_show(win);
1885 }
1886
1887 static void
1888 filter_prepend_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1889 {
1890    Evas_Object *en, *en2;
1891    static Elm_Entry_Filter_Accept_Set digits_filter_data;
1892
1893    en = (Evas_Object *)data;
1894    en2 = evas_object_data_get(en, "filter-entry");
1895    digits_filter_data.accepted = elm_object_text_get(en2);
1896    digits_filter_data.rejected = NULL;
1897
1898    elm_entry_markup_filter_append(en, elm_entry_filter_accept_set,
1899                                   &digits_filter_data);
1900    elm_object_text_set(en, "Markup Filter Prepend Test:");
1901 }
1902
1903 static void
1904 filter_remove_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1905 {
1906    Evas_Object *en;
1907    en = (Evas_Object *)data;
1908
1909    elm_entry_markup_filter_remove(en, elm_entry_filter_accept_set, NULL);
1910    elm_object_text_set(en, "Markup Filter Prepend Test:");
1911 }
1912
1913 static void
1914 icon_visible_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1915 {
1916    Evas_Object *en;
1917    en = (Evas_Object*)data;
1918
1919    elm_entry_icon_visible_set(en, elm_check_state_get(obj));
1920 }
1921
1922 static void
1923 end_visible_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1924 {
1925    Evas_Object *en;
1926    en = (Evas_Object*)data;
1927
1928    elm_entry_end_visible_set(en, elm_check_state_get(obj));
1929 }
1930
1931 static void
1932 horizontal_bounce_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1933 {
1934    Evas_Object *en;
1935    Eina_Bool vb;
1936    Eina_Bool bounce = elm_check_state_get(obj);
1937    en = (Evas_Object*)data;
1938
1939    elm_entry_bounce_get(en, NULL, &vb);
1940    elm_entry_bounce_set(en, bounce, bounce);
1941 }
1942
1943 static void
1944 vertical_bounce_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1945 {
1946    Evas_Object *en;
1947    Eina_Bool hb;
1948    Eina_Bool bounce = elm_check_state_get(obj);
1949    en = (Evas_Object*)data;
1950
1951    elm_entry_bounce_get(en, &hb, NULL);
1952    elm_entry_bounce_set(en, hb, bounce);
1953 }
1954
1955 void
1956 test_entry8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1957 {
1958    Evas_Object *win, *gd, *rect, *en, *lb;
1959    Evas_Object *bt, *en2;
1960    Evas_Object *ch, *en3, *bx;
1961    Evas_Object *en4;
1962    static Elm_Entry_Filter_Limit_Size limit_filter_data;
1963
1964    win = elm_win_util_standard_add("entry8", "Entry 8");
1965    elm_win_autodel_set(win, EINA_TRUE);
1966
1967    gd = elm_grid_add(win);
1968    elm_grid_size_set(gd, 100, 100);
1969    elm_win_resize_object_add(win, gd);
1970    evas_object_size_hint_weight_set(gd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1971    evas_object_show(gd);
1972
1973    rect = evas_object_rectangle_add(evas_object_evas_get(win));
1974    elm_grid_pack(gd, rect, 5, 5, 90, 10);
1975    evas_object_color_set(rect, 125, 125, 255, 255);
1976    evas_object_show(rect);
1977
1978    en = elm_entry_add(win);
1979    elm_entry_scrollable_set(en, EINA_TRUE);
1980    elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
1981    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1982    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1983    elm_object_text_set(en, "Markup Filter Prepend Test");
1984    elm_grid_pack(gd, en, 5, 5, 90, 10);
1985    evas_object_show(en);
1986
1987    lb = elm_label_add(win);
1988    elm_object_text_set(lb, "Markup Filter (20 Characters):");
1989    evas_object_size_hint_weight_set(lb, 0.0, 0.0);
1990    evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1991    elm_grid_pack(gd, lb, 5, 15, 50, 10);
1992    evas_object_show(lb);
1993
1994    rect = evas_object_rectangle_add(evas_object_evas_get(win));
1995    elm_grid_pack(gd, rect, 55, 15, 40, 10);
1996    evas_object_color_set(rect, 0, 125, 255, 255);
1997    evas_object_show(rect);
1998
1999    en2 = elm_entry_add(win);
2000    elm_entry_scrollable_set(en2, EINA_TRUE);
2001    elm_entry_scrollbar_policy_set(en2, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
2002    evas_object_size_hint_weight_set(en2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2003    evas_object_size_hint_align_set(en2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2004    limit_filter_data.max_char_count = 20;
2005    limit_filter_data.max_byte_count = 0;
2006    elm_entry_markup_filter_append(en2, elm_entry_filter_limit_size, &limit_filter_data);
2007    evas_object_data_set(en, "filter-entry", en2);
2008    evas_object_show(en2);
2009    elm_grid_pack(gd, en2, 55, 15, 40, 10);
2010
2011    bt = elm_button_add(win);
2012    elm_object_text_set(bt, "Markup Filter Prepend");
2013    elm_grid_pack(gd, bt, 5, 25, 45, 10);
2014    evas_object_smart_callback_add(bt, "clicked", filter_prepend_bt_clicked, en);
2015    evas_object_show(bt);
2016
2017    bt = elm_button_add(win);
2018    elm_object_text_set(bt, "Markup Filter Remove");
2019    elm_grid_pack(gd, bt, 50, 25, 45, 10);
2020    evas_object_smart_callback_add(bt, "clicked", filter_remove_bt_clicked, en);
2021    evas_object_show(bt);
2022
2023    bx = elm_box_add(win);
2024    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2025    elm_win_resize_object_add(win, bx);
2026    evas_object_show(bx);
2027
2028    en3 = elm_entry_add(win);
2029    elm_entry_scrollable_set(en3, EINA_TRUE);
2030    elm_entry_scrollbar_policy_set(en3, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
2031    elm_entry_single_line_set(en3, EINA_TRUE);
2032    evas_object_size_hint_weight_set(en3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2033    evas_object_size_hint_align_set(en3, EVAS_HINT_FILL, EVAS_HINT_FILL);
2034
2035    elm_box_pack_end(bx, en3);
2036    evas_object_show(en3);
2037    elm_grid_pack(gd, bx, 5, 35, 90, 20);
2038
2039    bt = elm_icon_add(win);
2040    elm_icon_standard_set(bt, "home");
2041    evas_object_size_hint_min_set(bt, 48, 48);
2042    evas_object_color_set(bt, 255, 0, 0, 128);
2043    evas_object_show(bt);
2044    elm_object_part_content_set(en3, "icon", bt);
2045
2046    bt = elm_icon_add(win);
2047    elm_icon_standard_set(bt, "delete");
2048    evas_object_color_set(bt, 255, 0, 0, 128);
2049    evas_object_size_hint_min_set(bt, 48, 48);
2050    evas_object_show(bt);
2051    elm_object_part_content_set(en3, "end", bt);
2052
2053    ch = elm_check_add(win);
2054    evas_object_size_hint_weight_set(ch, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2055    evas_object_size_hint_align_set(ch, EVAS_HINT_FILL, EVAS_HINT_FILL);
2056    elm_object_text_set(ch, "Icon Visible");
2057    elm_check_state_set(ch, EINA_TRUE);
2058    evas_object_smart_callback_add(ch, "changed", icon_visible_changed_cb, en3);
2059    elm_grid_pack(gd, ch, 5, 55, 30, 10);
2060    evas_object_show(ch);
2061
2062    ch = elm_check_add(win);
2063    evas_object_size_hint_weight_set(ch, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2064    evas_object_size_hint_align_set(ch, EVAS_HINT_FILL, EVAS_HINT_FILL);
2065    elm_object_text_set(ch, "End Visible");
2066    elm_check_state_set(ch, EINA_TRUE);
2067    evas_object_smart_callback_add(ch, "changed", end_visible_changed_cb, en3);
2068    elm_grid_pack(gd, ch, 70, 55, 25, 10);
2069    evas_object_show(ch);
2070
2071    rect = evas_object_rectangle_add(evas_object_evas_get(win));
2072    elm_grid_pack(gd, rect, 5, 65, 90, 20);
2073    evas_object_color_set(rect, 255, 125, 125, 255);
2074    evas_object_show(rect);
2075
2076    en4 = elm_entry_add(win);
2077    elm_entry_scrollable_set(en4, EINA_TRUE);
2078    elm_entry_bounce_set(en4, EINA_TRUE, EINA_TRUE);
2079    elm_entry_autocapital_type_set(en4, EINA_TRUE);
2080    evas_object_size_hint_weight_set(en4, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2081    evas_object_size_hint_align_set(en4, EVAS_HINT_FILL, EVAS_HINT_FILL);
2082    elm_grid_pack(gd, en4, 5, 65, 90, 20);
2083    evas_object_show(en4);
2084
2085    ch = elm_check_add(win);
2086    evas_object_size_hint_weight_set(ch, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2087    evas_object_size_hint_align_set(ch, EVAS_HINT_FILL, EVAS_HINT_FILL);
2088    elm_object_text_set(ch, "Horizontal Bounce Set");
2089    elm_check_state_set(ch, EINA_TRUE);
2090    evas_object_smart_callback_add(ch, "changed", horizontal_bounce_changed_cb, en4);
2091    elm_grid_pack(gd, ch, 5, 85, 45, 10);
2092    evas_object_show(ch);
2093
2094    ch = elm_check_add(win);
2095    evas_object_size_hint_weight_set(ch, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2096    evas_object_size_hint_align_set(ch, EVAS_HINT_FILL, EVAS_HINT_FILL);
2097    elm_object_text_set(ch, "Vertical Bounce Set");
2098    elm_check_state_set(ch, EINA_TRUE);
2099    evas_object_smart_callback_add(ch, "changed", vertical_bounce_changed_cb, en4);
2100    elm_grid_pack(gd, ch, 50, 85, 45, 10);
2101    evas_object_show(ch);
2102
2103    evas_object_resize(win, 320, 320);
2104    evas_object_show(win);
2105 }
2106
2107 static void
2108 _scrolled_entry_clear(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2109 {
2110    Evas_Object *en = data;
2111    elm_object_text_set(en, "");
2112 }
2113
2114 static void
2115 _scrolled_entry_save(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2116 {
2117    Evas_Object *en = data;
2118    elm_entry_file_save(en);
2119 }
2120
2121 static void
2122 auto_save_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
2123 {
2124    Evas_Object *en;
2125    en = (Evas_Object*)data;
2126
2127    elm_entry_autosave_set(en, elm_check_state_get(obj));
2128 }
2129
2130 void
2131 test_entry_notepad(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2132 {
2133    Evas_Object *win, *bx, *bx2, *bt, *np, *ch;
2134
2135    win = elm_win_util_standard_add("entry-notepad", "Entry Notepad");
2136    elm_win_autodel_set(win, EINA_TRUE);
2137
2138    bx = elm_box_add(win);
2139    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2140    elm_win_resize_object_add(win, bx);
2141    evas_object_show(bx);
2142
2143    np = elm_entry_add(win);
2144    elm_entry_scrollable_set(np, EINA_TRUE);
2145    elm_entry_file_set(np, "note.txt", ELM_TEXT_FORMAT_PLAIN_UTF8);
2146    evas_object_size_hint_weight_set(np, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2147    evas_object_size_hint_align_set(np, EVAS_HINT_FILL, EVAS_HINT_FILL);
2148    elm_box_pack_end(bx, np);
2149    evas_object_show(np);
2150
2151    bx2 = elm_box_add(win);
2152    elm_box_horizontal_set(bx2, EINA_TRUE);
2153    elm_box_homogeneous_set(bx2, EINA_TRUE);
2154    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
2155    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2156
2157    bt = elm_button_add(win);
2158    elm_object_text_set(bt, "Clear");
2159    evas_object_smart_callback_add(bt, "clicked", _scrolled_entry_clear, np);
2160    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
2161    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
2162    elm_box_pack_end(bx2, bt);
2163    evas_object_show(bt);
2164
2165    bt = elm_button_add(win);
2166    elm_object_text_set(bt, "Save");
2167    evas_object_smart_callback_add(bt, "clicked", _scrolled_entry_save, np);
2168    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
2169    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
2170    elm_box_pack_end(bx2, bt);
2171    evas_object_show(bt);
2172
2173    ch = elm_check_add(win);
2174    evas_object_size_hint_weight_set(ch, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2175    evas_object_size_hint_align_set(ch, EVAS_HINT_FILL, EVAS_HINT_FILL);
2176    elm_object_text_set(ch, "Auto Save");
2177    elm_check_state_set(ch, EINA_FALSE);
2178    evas_object_smart_callback_add(ch, "changed", auto_save_changed_cb, np);
2179    elm_box_pack_end(bx2, ch);
2180    evas_object_show(ch);
2181
2182    elm_box_pack_end(bx, bx2);
2183    evas_object_show(bx2);
2184
2185    evas_object_resize(win, 320, 300);
2186
2187    elm_object_focus_set(win, EINA_TRUE);
2188    evas_object_show(win);
2189 }
2190 #endif