2 # include "elementary_config.h"
4 #include <Elementary.h>
5 #ifndef ELM_LIB_QUICKLAUNCH
7 my_entry_bt_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *en = data;
10 elm_object_text_set(en, "");
14 my_entry_bt_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
16 Evas_Object *en = data;
17 const char *s = elm_object_text_get(en);
19 if (s) printf("%s\n", s);
20 printf("ENTRY PLAIN UTF8:\n");
23 s = elm_entry_markup_to_utf8(s);
33 my_entry_bt_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
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");
42 s = elm_entry_markup_to_utf8(s);
52 my_entry_bt_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
54 Evas_Object *en = data;
55 elm_entry_entry_insert(en, "Insert some <b>BOLD</> text");
59 my_entry_bt_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
61 Evas_Object *en = data;
62 elm_entry_scrollable_set(en, !elm_entry_scrollable_get(en));
66 my_entry_bt_6(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
68 Evas_Object *en = data;
69 static Elm_Wrap_Type wr = ELM_WRAP_NONE;
72 if (wr == ELM_WRAP_LAST) wr = ELM_WRAP_NONE;
73 printf("wr: %i\n", wr);
74 elm_entry_line_wrap_set(en, wr);
78 test_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
80 Evas_Object *win, *bx, *bx2, *bt, *en;
83 win = elm_win_util_standard_add("entry", "Entry");
84 elm_win_autodel_set(win, EINA_TRUE);
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);
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/>"
103 "Also you can stick in items with (relsize + ascent): "
104 "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
106 "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
107 " (to the left)<br/>"
109 "Also (size + ascent): "
110 "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
112 "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
113 " (before this)<br/>"
115 "And as well (absize + ascent): "
116 "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
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>"
122 , elm_app_data_dir_get()
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);
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);
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);
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);
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);
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);
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);
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);
195 elm_box_pack_end(bx, bx2);
196 evas_object_show(bx2);
198 elm_object_focus_set(en, EINA_TRUE);
199 evas_object_show(win);
203 my_scrolled_entry_bt_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
205 Evas_Object *en = data;
206 elm_object_text_set(en, "");
210 my_scrolled_entry_bt_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
212 Evas_Object *en = data;
213 const char *s = elm_object_text_get(en);
215 if (s) printf("%s\n", s);
216 printf("ENTRY PLAIN UTF8:\n");
219 s = elm_entry_markup_to_utf8(s);
229 my_scrolled_entry_bt_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
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");
238 s = elm_entry_markup_to_utf8(s);
248 my_scrolled_entry_bt_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
250 Evas_Object *en = data;
251 elm_entry_entry_insert(en, "Insert some <b>BOLD</> text");
255 my_scrolled_entry_bt_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
257 Evas_Object *en = data;
258 const char *s = elm_object_text_get(en);
259 printf("PASSWORD: '%s'\n", s ? s : "");
263 scrolled_anchor_test(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
265 Evas_Object *en = data;
266 elm_entry_entry_insert(en, "ANCHOR CLICKED");
270 test_entry_scrolled(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
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;
276 win = elm_win_util_standard_add("entry-scrolled", "Entry Scrolled");
277 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
516 elm_box_pack_end(bx, bx2);
517 evas_object_show(bx2);
519 evas_object_resize(win, 320, 300);
521 elm_object_focus_set(win, EINA_TRUE);
522 evas_object_show(win);
526 my_ent_bt_clr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
528 Evas_Object *en = data;
529 elm_object_text_set(en, "");
533 my_ent_bt_pri(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
535 Evas_Object *en = data;
536 const char *s = elm_object_text_get(en);
538 if (s) printf("%s\n", s);
539 printf("ENTRY PLAIN UTF8:\n");
542 s = elm_entry_markup_to_utf8(s);
552 my_ent_bt_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
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");
561 s = elm_entry_markup_to_utf8(s);
571 my_ent_bt_all(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
573 Evas_Object *en = data;
574 elm_entry_select_all(en);
578 my_ent_bt_non(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
580 Evas_Object *en = data;
581 elm_entry_select_none(en);
585 my_ent_bt_ins(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
587 Evas_Object *en = data;
588 elm_entry_entry_insert(en, "Insert text");
592 my_ent_bt_lef(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
594 Evas_Object *en = data;
595 elm_entry_cursor_prev(en);
599 my_ent_bt_rig(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
601 Evas_Object *en = data;
602 elm_entry_cursor_next(en);
606 my_ent_bt_up_(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
608 Evas_Object *en = data;
609 elm_entry_cursor_up(en);
613 my_ent_bt_dow(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
615 Evas_Object *en = data;
616 elm_entry_cursor_down(en);
620 my_ent_bt_beg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
622 Evas_Object *en = data;
623 elm_entry_cursor_begin_set(en);
627 my_ent_bt_end(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
629 Evas_Object *en = data;
630 elm_entry_cursor_end_set(en);
634 my_ent_bt_lbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
636 Evas_Object *en = data;
637 elm_entry_cursor_line_begin_set(en);
641 my_ent_bt_len(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
643 Evas_Object *en = data;
644 elm_entry_cursor_line_end_set(en);
648 my_ent_bt_sbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
650 Evas_Object *en = data;
651 elm_entry_cursor_selection_begin(en);
655 my_ent_bt_sen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
657 Evas_Object *en = data;
658 elm_entry_cursor_selection_end(en);
662 my_ent_bt_fmt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
664 Evas_Object *en = data;
665 printf("IS FORMAT: %i\n",
666 (int)elm_entry_cursor_is_format_get(en));
670 my_ent_bt_vfm(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
672 Evas_Object *en = data;
673 printf("IS VISIBLE FORMAT %i\n",
674 (int)elm_entry_cursor_is_visible_format_get(en));
678 my_ent_bt_chr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
680 Evas_Object *en = data;
681 printf("CHAR '%s'\n", elm_entry_cursor_content_get(en));
685 my_ent_bt_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
687 Evas_Object *en = data;
688 elm_entry_selection_cut(en);
692 my_ent_bt_cop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
694 Evas_Object *en = data;
695 elm_entry_selection_copy(en);
699 my_ent_bt_pas(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
701 Evas_Object *en = data;
702 elm_entry_selection_paste(en);
706 test_entry3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
708 Evas_Object *win, *bx, *bx2, *bt, *en;
710 win = elm_win_util_standard_add("entry3", "Entry 3");
711 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
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);
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);
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);
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);
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);
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);
794 elm_box_pack_end(bx, bx2);
795 evas_object_show(bx2);
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);
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);
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);
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);
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);
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);
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);
862 elm_box_pack_end(bx, bx2);
863 evas_object_show(bx2);
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);
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);
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);
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);
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);
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);
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);
930 elm_box_pack_end(bx, bx2);
931 evas_object_show(bx2);
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);
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);
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);
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);
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);
978 elm_box_pack_end(bx, bx2);
979 evas_object_show(bx2);
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."
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);
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);
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);
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);
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);
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);
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);
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);
1068 elm_box_pack_end(bx, bx2);
1069 evas_object_show(bx2);
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);
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);
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);
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);
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);
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);
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);
1136 elm_box_pack_end(bx, bx2);
1137 evas_object_show(bx2);
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);
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);
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);
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);
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);
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);
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);
1204 elm_box_pack_end(bx, bx2);
1205 evas_object_show(bx2);
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);
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);
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);
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);
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);
1252 elm_box_pack_end(bx, bx2);
1253 evas_object_show(bx2);
1255 evas_object_resize(win, 320, 480);
1257 elm_object_focus_set(win, EINA_TRUE);
1258 evas_object_show(win);
1262 test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1264 Evas_Object *win, *ly, *en;
1267 win = elm_win_util_standard_add("entry4", "Entry 4");
1268 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
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."
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);
1321 evas_object_show(win);
1325 test_entry5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1327 Evas_Object *win, *bx, *bx2, *bt, *en;
1329 win = elm_win_util_standard_add("entry5", "Entry 5");
1330 elm_win_autodel_set(win, EINA_TRUE);
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);
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."
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);
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);
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);
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);
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);
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);
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);
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);
1421 elm_box_pack_end(bx, bx2);
1422 evas_object_show(bx2);
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);
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);
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);
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);
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);
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);
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);
1489 elm_box_pack_end(bx, bx2);
1490 evas_object_show(bx2);
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);
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);
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);
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);
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);
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);
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);
1557 elm_box_pack_end(bx, bx2);
1558 evas_object_show(bx2);
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);
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);
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);
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);
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);
1605 elm_box_pack_end(bx, bx2);
1606 evas_object_show(bx2);
1608 evas_object_resize(win, 320, 480);
1610 elm_object_focus_set(win, EINA_TRUE);
1611 evas_object_show(win);
1615 test_entry6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1617 Evas_Object *win, *bx, *en;
1619 win = elm_win_util_standard_add("entry6", "Entry 6");
1620 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
1652 evas_object_resize(win, 320, 300);
1654 elm_object_focus_set(win, EINA_TRUE);
1655 evas_object_show(win);
1659 changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1662 en = (Evas_Object*)data;
1664 elm_entry_editable_set(en, elm_check_state_get(obj));
1668 en_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
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)));
1677 sp_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
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);
1687 add_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1690 en = (Evas_Object *)data;
1692 elm_entry_context_menu_item_add(en, "item", NULL, ELM_ICON_NONE, NULL, NULL);
1696 clear_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1699 en = (Evas_Object *)data;
1701 elm_entry_context_menu_clear(en);
1704 static Evas_Object *
1705 item_provider(void *images __UNUSED__, Evas_Object *en, const char *item)
1707 Evas_Object *o = NULL;;
1710 if (!strcmp(item, "itemprovider"))
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);
1721 static Evas_Object *
1722 prepend_item_provider(void *images __UNUSED__, Evas_Object *en, const char *item)
1724 Evas_Object *o = NULL;;
1727 if (!strcmp(item, "itemprovider"))
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);
1739 prepend_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1742 en = (Evas_Object *)data;
1744 elm_entry_item_provider_prepend(en, prepend_item_provider, NULL);
1745 elm_object_text_set(en,
1747 "<item size=50x50 vsize=full href=itemprovider></item>"
1752 remove_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1755 en = (Evas_Object *)data;
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,
1761 "<item size=50x50 vsize=full href=itemprovider></item>"
1766 enable_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1769 en = (Evas_Object*)data;
1771 elm_entry_context_menu_disabled_set(en, elm_check_state_get(obj));
1775 test_entry7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1777 Evas_Object *win, *gd, *bg, *en, *tg, *lb, *sp;
1778 Evas_Object *bt, *en2;
1780 win = elm_win_util_standard_add("entry7", "Entry 7");
1781 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
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);
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);
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);
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);
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,
1843 "<item size=50x50 vsize=full href=itemprovider></item>"
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);
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);
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);
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);
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);
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);
1883 evas_object_resize(win, 320, 320);
1884 evas_object_show(win);
1888 filter_prepend_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1890 Evas_Object *en, *en2;
1891 static Elm_Entry_Filter_Accept_Set digits_filter_data;
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;
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:");
1904 filter_remove_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1907 en = (Evas_Object *)data;
1909 elm_entry_markup_filter_remove(en, elm_entry_filter_accept_set, NULL);
1910 elm_object_text_set(en, "Markup Filter Prepend Test:");
1914 icon_visible_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1917 en = (Evas_Object*)data;
1919 elm_entry_icon_visible_set(en, elm_check_state_get(obj));
1923 end_visible_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1926 en = (Evas_Object*)data;
1928 elm_entry_end_visible_set(en, elm_check_state_get(obj));
1932 horizontal_bounce_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1936 Eina_Bool bounce = elm_check_state_get(obj);
1937 en = (Evas_Object*)data;
1939 elm_entry_bounce_get(en, NULL, &vb);
1940 elm_entry_bounce_set(en, bounce, bounce);
1944 vertical_bounce_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
1948 Eina_Bool bounce = elm_check_state_get(obj);
1949 en = (Evas_Object*)data;
1951 elm_entry_bounce_get(en, &hb, NULL);
1952 elm_entry_bounce_set(en, hb, bounce);
1956 test_entry8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1958 Evas_Object *win, *gd, *rect, *en, *lb;
1959 Evas_Object *bt, *en2;
1960 Evas_Object *ch, *en3, *bx;
1962 static Elm_Entry_Filter_Limit_Size limit_filter_data;
1964 win = elm_win_util_standard_add("entry8", "Entry 8");
1965 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
2035 elm_box_pack_end(bx, en3);
2036 evas_object_show(en3);
2037 elm_grid_pack(gd, bx, 5, 35, 90, 20);
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);
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);
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);
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);
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);
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);
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);
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);
2103 evas_object_resize(win, 320, 320);
2104 evas_object_show(win);
2108 _scrolled_entry_clear(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2110 Evas_Object *en = data;
2111 elm_object_text_set(en, "");
2115 _scrolled_entry_save(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2117 Evas_Object *en = data;
2118 elm_entry_file_save(en);
2122 auto_save_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
2125 en = (Evas_Object*)data;
2127 elm_entry_autosave_set(en, elm_check_state_get(obj));
2131 test_entry_notepad(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
2133 Evas_Object *win, *bx, *bx2, *bt, *np, *ch;
2135 win = elm_win_util_standard_add("entry-notepad", "Entry Notepad");
2136 elm_win_autodel_set(win, EINA_TRUE);
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);
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);
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);
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);
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);
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);
2182 elm_box_pack_end(bx, bx2);
2183 evas_object_show(bx2);
2185 evas_object_resize(win, 320, 300);
2187 elm_object_focus_set(win, EINA_TRUE);
2188 evas_object_show(win);