1 #include <Elementary.h>
3 # include "elementary_config.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_entry_entry_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_entry_entry_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, *bg, *bx, *bx2, *bt, *en;
83 win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
84 elm_win_title_set(win, "Entry");
85 elm_win_autodel_set(win, EINA_TRUE);
88 elm_win_resize_object_add(win, bg);
89 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
92 bx = elm_box_add(win);
93 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
94 elm_win_resize_object_add(win, bx);
97 en = elm_entry_add(win);
98 elm_entry_line_wrap_set(en, ELM_WRAP_NONE);
99 snprintf(buf, sizeof(buf),
100 "This is an entry widget in this window that<br/>"
101 "uses markup <b>like this</> for styling and<br/>"
102 "formatting <em>like this</>, as well as<br/>"
103 "<a href=X><link>links in the text</></a>, so enter text<br/>"
104 "in here to edit it. By the way, links are<br/>"
105 "called <a href=anc-02>Anchors</a> so you will need<br/>"
106 "to refer to them this way.<br/>"
109 "Also you can stick in items with (relsize + ascent): "
110 "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
112 "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
113 " (to the left)<br/>"
115 "Also (size + ascent): "
116 "<item size=16x16 vsize=ascent href=emoticon/haha></item>"
118 "<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
119 " (before this)<br/>"
121 "And as well (absize + ascent): "
122 "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
124 "<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
125 " or even paths to image files on disk too like: "
126 "<item absize=96x128 vsize=full href=file://%s/images/sky_01.jpg></item>"
128 , elm_app_data_dir_get()
130 elm_entry_entry_set(en, buf);
131 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
132 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
133 elm_box_pack_end(bx, en);
134 evas_object_show(en);
136 bx2 = elm_box_add(win);
137 elm_box_horizontal_set(bx2, EINA_TRUE);
138 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
139 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
141 bt = elm_button_add(win);
142 elm_object_text_set(bt, "Clr");
143 evas_object_smart_callback_add(bt, "clicked", my_entry_bt_1, en);
144 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
145 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
146 elm_box_pack_end(bx2, bt);
147 evas_object_propagate_events_set(bt, 0);
148 elm_object_focus_allow_set(bt, 0);
149 evas_object_show(bt);
151 bt = elm_button_add(win);
152 elm_object_text_set(bt, "Prnt");
153 evas_object_smart_callback_add(bt, "clicked", my_entry_bt_2, en);
154 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
155 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
156 elm_box_pack_end(bx2, bt);
157 evas_object_propagate_events_set(bt, 0);
158 elm_object_focus_allow_set(bt, 0);
159 evas_object_show(bt);
161 bt = elm_button_add(win);
162 elm_object_text_set(bt, "Sel");
163 evas_object_smart_callback_add(bt, "clicked", my_entry_bt_3, en);
164 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
165 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
166 elm_box_pack_end(bx2, bt);
167 evas_object_propagate_events_set(bt, 0);
168 elm_object_focus_allow_set(bt, 0);
169 evas_object_show(bt);
171 bt = elm_button_add(win);
172 elm_object_text_set(bt, "Ins");
173 evas_object_smart_callback_add(bt, "clicked", my_entry_bt_4, en);
174 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
175 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
176 elm_box_pack_end(bx2, bt);
177 evas_object_propagate_events_set(bt, 0);
178 elm_object_focus_allow_set(bt, 0);
179 evas_object_show(bt);
181 bt = elm_button_add(win);
182 elm_object_text_set(bt, "Scrl");
183 evas_object_smart_callback_add(bt, "clicked", my_entry_bt_5, en);
184 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
185 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
186 elm_box_pack_end(bx2, bt);
187 evas_object_propagate_events_set(bt, 0);
188 elm_object_focus_allow_set(bt, 0);
189 evas_object_show(bt);
191 bt = elm_button_add(win);
192 elm_object_text_set(bt, "Wr");
193 evas_object_smart_callback_add(bt, "clicked", my_entry_bt_6, en);
194 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
195 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
196 elm_box_pack_end(bx2, bt);
197 evas_object_propagate_events_set(bt, 0);
198 elm_object_focus_allow_set(bt, 0);
199 evas_object_show(bt);
201 elm_box_pack_end(bx, bx2);
202 evas_object_show(bx2);
204 elm_object_focus_set(en, EINA_TRUE);
205 evas_object_show(win);
209 my_scrolled_entry_bt_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
211 Evas_Object *en = data;
212 elm_entry_entry_set(en, "");
216 my_scrolled_entry_bt_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
218 Evas_Object *en = data;
219 const char *s = elm_entry_entry_get(en);
221 if (s) printf("%s\n", s);
222 printf("ENTRY PLAIN UTF8:\n");
225 s = elm_entry_markup_to_utf8(s);
235 my_scrolled_entry_bt_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
237 Evas_Object *en = data;
238 const char *s = elm_entry_selection_get(en);
239 printf("SELECTION:\n");
240 if (s) printf("%s\n", s);
241 printf("SELECTION PLAIN UTF8:\n");
244 s = elm_entry_markup_to_utf8(s);
254 my_scrolled_entry_bt_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
256 Evas_Object *en = data;
257 elm_entry_entry_insert(en, "Insert some <b>BOLD</> text");
261 my_scrolled_entry_bt_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
263 Evas_Object *en = data;
264 const char *s = elm_entry_entry_get(en);
265 printf("PASSWORD: '%s'\n", s ? s : "");
269 scrolled_anchor_test(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
271 Evas_Object *en = data;
272 elm_entry_entry_insert(en, "ANCHOR CLICKED");
276 test_entry_scrolled(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
278 Evas_Object *win, *bg, *bx, *bx2, *bt, *en, *en_p, *sp;
279 static Elm_Entry_Filter_Accept_Set digits_filter_data, digits_filter_data2;
280 static Elm_Entry_Filter_Limit_Size limit_filter_data, limit_filter_data2;
282 win = elm_win_add(NULL, "entry-scrolled", ELM_WIN_BASIC);
283 elm_win_title_set(win, "Entry Scrolled");
284 elm_win_autodel_set(win, EINA_TRUE);
286 bg = elm_bg_add(win);
287 elm_win_resize_object_add(win, bg);
288 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
289 evas_object_show(bg);
291 bx = elm_box_add(win);
292 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
293 elm_win_resize_object_add(win, bx);
294 evas_object_show(bx);
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_entry_set(en, "Disabled entry");
303 elm_entry_single_line_set(en, 1);
304 elm_object_disabled_set(en, 1);
305 evas_object_show(en);
306 elm_box_pack_end(bx, en);
309 en = elm_entry_add(win);
310 elm_entry_scrollable_set(en, EINA_TRUE);
311 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
312 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
313 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
314 elm_entry_password_set(en, 1);
315 elm_entry_single_line_set(en, 1);
316 elm_entry_entry_set(en, "Access denied, give up!");
317 elm_object_disabled_set(en, 1);
318 evas_object_show(en);
319 elm_box_pack_end(bx, en);
321 /* multi-line disable entry */
322 en = elm_entry_add(win);
323 elm_entry_scrollable_set(en, EINA_TRUE);
324 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
325 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
326 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
327 elm_object_disabled_set(en, 1);
328 elm_entry_context_menu_item_add(en, "Hello", NULL, ELM_ICON_NONE, NULL, NULL);
329 elm_entry_context_menu_item_add(en, "World", NULL, ELM_ICON_NONE, NULL, NULL);
330 elm_entry_entry_set(en,
331 "Multi-line disabled entry widget :)<br/>"
332 "We can use markup <b>like this</> for styling and<br/>"
333 "formatting <em>like this</>, as well as<br/>"
334 "<a href=X><link>links in the text</></a>,"
335 "but it won't be editable or clickable.");
336 evas_object_show(en);
337 elm_box_pack_end(bx, en);
339 sp = elm_separator_add(win);
340 elm_separator_horizontal_set(sp, 1);
341 elm_box_pack_end(bx, sp);
342 evas_object_show(sp);
344 /* Single line selected 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_entry_entry_set(en, "This is a single line");
350 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
351 elm_entry_single_line_set(en, 1);
352 elm_entry_select_all(en);
353 evas_object_show(en);
354 elm_box_pack_end(bx, en);
356 /* Only digits entry */
357 en = elm_entry_add(win);
358 elm_entry_scrollable_set(en, EINA_TRUE);
359 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
360 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
361 elm_entry_entry_set(en, "01234");
362 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
363 elm_entry_single_line_set(en, 1);
364 evas_object_show(en);
365 elm_box_pack_end(bx, en);
367 digits_filter_data.accepted = "0123456789";
368 digits_filter_data.rejected = NULL;
369 elm_entry_text_filter_append(en, elm_entry_filter_accept_set, &digits_filter_data);
371 /* No digits entry */
372 en = elm_entry_add(win);
373 elm_entry_scrollable_set(en, EINA_TRUE);
374 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
375 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
376 elm_entry_entry_set(en, "No numbers here");
377 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
378 elm_entry_single_line_set(en, 1);
379 evas_object_show(en);
380 elm_box_pack_end(bx, en);
382 digits_filter_data2.accepted = NULL;
383 digits_filter_data2.rejected = "0123456789";
384 elm_entry_text_filter_append(en, elm_entry_filter_accept_set, &digits_filter_data2);
386 /* Size limited entry */
387 en = elm_entry_add(win);
388 elm_entry_scrollable_set(en, EINA_TRUE);
389 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
390 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
391 elm_entry_entry_set(en, "Just 20 chars");
392 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
393 elm_entry_single_line_set(en, 1);
394 evas_object_show(en);
395 elm_box_pack_end(bx, en);
397 limit_filter_data.max_char_count = 20;
398 limit_filter_data.max_byte_count = 0;
399 elm_entry_text_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data);
401 /* Byte size limited entry */
402 en = elm_entry_add(win);
403 elm_entry_scrollable_set(en, EINA_TRUE);
404 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
405 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
406 elm_entry_entry_set(en, "And now only 30 bytes");
407 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
408 elm_entry_single_line_set(en, 1);
409 evas_object_show(en);
410 elm_box_pack_end(bx, en);
412 limit_filter_data2.max_char_count = 0;
413 limit_filter_data2.max_byte_count = 30;
414 elm_entry_text_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data2);
416 /* Single line password entry */
417 en_p = elm_entry_add(win);
418 elm_entry_scrollable_set(en_p, EINA_TRUE);
419 evas_object_size_hint_weight_set(en_p, EVAS_HINT_EXPAND, 0.0);
420 evas_object_size_hint_align_set(en_p, EVAS_HINT_FILL, 0.5);
421 elm_entry_scrollbar_policy_set(en_p, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
422 elm_entry_entry_set(en_p, "Password here");
423 elm_entry_single_line_set(en_p, 1);
424 elm_entry_password_set(en_p, 1);
425 evas_object_show(en_p);
426 elm_box_pack_end(bx, en_p);
428 /* scrolled entry with icon/end widgets*/
429 en = elm_entry_add(win);
430 elm_entry_scrollable_set(en, EINA_TRUE);
431 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
432 elm_entry_single_line_set(en, 1);
433 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
434 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
435 bt = elm_icon_add(win);
436 elm_icon_standard_set(bt, "home");
437 evas_object_size_hint_min_set(bt, 48, 48);
438 evas_object_color_set(bt, 255, 0, 0, 128);
439 evas_object_show(bt);
440 elm_entry_icon_set(en, bt);
441 bt = elm_icon_add(win);
442 elm_icon_standard_set(bt, "delete");
443 evas_object_color_set(bt, 255, 0, 0, 128);
444 evas_object_size_hint_min_set(bt, 48, 48);
445 evas_object_show(bt);
446 elm_entry_end_set(en, bt);
447 elm_entry_entry_set(en, "scrolled entry with icon and end objects");
448 evas_object_show(en);
449 elm_box_pack_end(bx, en);
451 /* markup scrolled entry */
452 en = elm_entry_add(win);
453 elm_entry_scrollable_set(en, EINA_TRUE);
454 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
455 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
456 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
457 elm_entry_entry_set(en,
458 "This is an entry widget in this window that<br/>"
459 "uses markup <b>like this</> for styling and<br/>"
460 "formatting <em>like this</>, as well as<br/>"
461 "<a href=X><link>links in the text</></a>, so enter text<br/>"
462 "in here to edit it. By them way, links are<br/>"
463 "called <a href=anc-02>Anchors</a> so you will need<br/>"
464 "to refer to them this way. At the end here is a really long "
465 "line to test line wrapping to see if it works. But just in "
466 "case this line is not long enough I will add more here to "
467 "really test it out, as Elementary really needs some "
468 "good testing to see if entry widgets work as advertised.");
469 evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
470 evas_object_show(en);
471 elm_box_pack_end(bx, en);
473 bx2 = elm_box_add(win);
474 elm_box_horizontal_set(bx2, EINA_TRUE);
475 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
476 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
478 bt = elm_button_add(win);
479 elm_object_text_set(bt, "Clear");
480 evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_1, en);
481 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
482 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
483 elm_box_pack_end(bx2, bt);
484 evas_object_propagate_events_set(bt, 0);
485 elm_object_focus_allow_set(bt, 0);
486 evas_object_show(bt);
488 bt = elm_button_add(win);
489 elm_object_text_set(bt, "Print");
490 evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_2, en);
491 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
492 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
493 elm_box_pack_end(bx2, bt);
494 evas_object_propagate_events_set(bt, 0);
495 elm_object_focus_allow_set(bt, 0);
496 evas_object_show(bt);
498 bt = elm_button_add(win);
499 elm_object_text_set(bt, "Print pwd");
500 evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_5, en_p);
501 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
502 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
503 elm_box_pack_end(bx2, bt);
504 evas_object_propagate_events_set(bt, 0);
505 elm_object_focus_allow_set(bt, 0);
506 evas_object_show(bt);
508 bt = elm_button_add(win);
509 elm_object_text_set(bt, "Selection");
510 evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_3, en);
511 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
512 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
513 elm_box_pack_end(bx2, bt);
514 evas_object_propagate_events_set(bt, 0);
515 elm_object_focus_allow_set(bt, 0);
516 evas_object_show(bt);
518 bt = elm_button_add(win);
519 elm_object_text_set(bt, "Insert");
520 evas_object_smart_callback_add(bt, "clicked", my_scrolled_entry_bt_4, en);
521 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
522 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
523 elm_box_pack_end(bx2, bt);
524 evas_object_propagate_events_set(bt, 0);
525 elm_object_focus_allow_set(bt, 0);
526 evas_object_show(bt);
528 elm_box_pack_end(bx, bx2);
529 evas_object_show(bx2);
531 evas_object_resize(win, 320, 300);
533 elm_object_focus_set(win, EINA_TRUE);
534 evas_object_show(win);
538 my_ent_bt_clr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
540 Evas_Object *en = data;
541 elm_entry_entry_set(en, "");
545 my_ent_bt_pri(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
547 Evas_Object *en = data;
548 const char *s = elm_entry_entry_get(en);
550 if (s) printf("%s\n", s);
551 printf("ENTRY PLAIN UTF8:\n");
554 s = elm_entry_markup_to_utf8(s);
564 my_ent_bt_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
566 Evas_Object *en = data;
567 const char *s = elm_entry_selection_get(en);
568 printf("SELECTION:\n");
569 if (s) printf("%s\n", s);
570 printf("SELECTION PLAIN UTF8:\n");
573 s = elm_entry_markup_to_utf8(s);
583 my_ent_bt_all(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
585 Evas_Object *en = data;
586 elm_entry_select_all(en);
590 my_ent_bt_non(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
592 Evas_Object *en = data;
593 elm_entry_select_none(en);
597 my_ent_bt_ins(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
599 Evas_Object *en = data;
600 elm_entry_entry_insert(en, "Insert text");
604 my_ent_bt_lef(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
606 Evas_Object *en = data;
607 elm_entry_cursor_prev(en);
611 my_ent_bt_rig(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
613 Evas_Object *en = data;
614 elm_entry_cursor_next(en);
618 my_ent_bt_up_(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
620 Evas_Object *en = data;
621 elm_entry_cursor_up(en);
625 my_ent_bt_dow(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
627 Evas_Object *en = data;
628 elm_entry_cursor_down(en);
632 my_ent_bt_beg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
634 Evas_Object *en = data;
635 elm_entry_cursor_begin_set(en);
639 my_ent_bt_end(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
641 Evas_Object *en = data;
642 elm_entry_cursor_end_set(en);
646 my_ent_bt_lbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
648 Evas_Object *en = data;
649 elm_entry_cursor_line_begin_set(en);
653 my_ent_bt_len(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
655 Evas_Object *en = data;
656 elm_entry_cursor_line_end_set(en);
660 my_ent_bt_sbe(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
662 Evas_Object *en = data;
663 elm_entry_cursor_selection_begin(en);
667 my_ent_bt_sen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
669 Evas_Object *en = data;
670 elm_entry_cursor_selection_end(en);
674 my_ent_bt_fmt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
676 Evas_Object *en = data;
677 printf("IS FORMAT: %i\n",
678 (int)elm_entry_cursor_is_format_get(en));
682 my_ent_bt_vfm(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
684 Evas_Object *en = data;
685 printf("IS VISIBLE FORMAT %i\n",
686 (int)elm_entry_cursor_is_visible_format_get(en));
690 my_ent_bt_chr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
692 Evas_Object *en = data;
693 printf("CHAR '%s'\n", elm_entry_cursor_content_get(en));
697 my_ent_bt_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
699 Evas_Object *en = data;
700 elm_entry_selection_cut(en);
704 my_ent_bt_cop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
706 Evas_Object *en = data;
707 elm_entry_selection_copy(en);
711 my_ent_bt_pas(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
713 Evas_Object *en = data;
714 elm_entry_selection_paste(en);
718 test_entry3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
720 Evas_Object *win, *bg, *bx, *bx2, *bt, *en;
722 win = elm_win_add(NULL, "entry3", ELM_WIN_BASIC);
723 elm_win_title_set(win, "Entry 3");
724 elm_win_autodel_set(win, EINA_TRUE);
726 bg = elm_bg_add(win);
727 elm_win_resize_object_add(win, bg);
728 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
729 evas_object_show(bg);
731 bx = elm_box_add(win);
732 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
733 elm_win_resize_object_add(win, bx);
734 evas_object_show(bx);
736 /* Single line selected entry */
737 en = elm_entry_add(win);
738 elm_entry_scrollable_set(en, EINA_TRUE);
739 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
740 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
741 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
742 elm_entry_entry_set(en, "This is a single line");
743 elm_entry_single_line_set(en, 1);
744 elm_box_pack_end(bx, en);
745 evas_object_show(en);
747 bx2 = elm_box_add(win);
748 elm_box_horizontal_set(bx2, EINA_TRUE);
749 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
750 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
752 bt = elm_button_add(win);
753 elm_object_text_set(bt, "Clr");
754 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
755 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
756 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
757 elm_box_pack_end(bx2, bt);
758 evas_object_propagate_events_set(bt, 0);
759 elm_object_focus_allow_set(bt, 0);
760 evas_object_show(bt);
762 bt = elm_button_add(win);
763 elm_object_text_set(bt, "Pri");
764 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
765 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
766 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
767 elm_box_pack_end(bx2, bt);
768 evas_object_propagate_events_set(bt, 0);
769 elm_object_focus_allow_set(bt, 0);
770 evas_object_show(bt);
772 bt = elm_button_add(win);
773 elm_object_text_set(bt, "Sel");
774 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
775 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
776 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
777 elm_box_pack_end(bx2, bt);
778 evas_object_propagate_events_set(bt, 0);
779 elm_object_focus_allow_set(bt, 0);
780 evas_object_show(bt);
782 bt = elm_button_add(win);
783 elm_object_text_set(bt, "All");
784 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
785 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
786 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
787 elm_box_pack_end(bx2, bt);
788 evas_object_propagate_events_set(bt, 0);
789 elm_object_focus_allow_set(bt, 0);
790 evas_object_show(bt);
792 bt = elm_button_add(win);
793 elm_object_text_set(bt, "Non");
794 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
795 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
796 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
797 elm_box_pack_end(bx2, bt);
798 evas_object_propagate_events_set(bt, 0);
799 elm_object_focus_allow_set(bt, 0);
800 evas_object_show(bt);
802 bt = elm_button_add(win);
803 elm_object_text_set(bt, "Ins");
804 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, 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 elm_box_pack_end(bx, bx2);
813 evas_object_show(bx2);
815 bx2 = elm_box_add(win);
816 elm_box_horizontal_set(bx2, EINA_TRUE);
817 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
818 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
820 bt = elm_button_add(win);
821 elm_object_text_set(bt, "Lef");
822 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
823 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
824 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
825 elm_box_pack_end(bx2, bt);
826 evas_object_propagate_events_set(bt, 0);
827 elm_object_focus_allow_set(bt, 0);
828 evas_object_show(bt);
830 bt = elm_button_add(win);
831 elm_object_text_set(bt, "Rig");
832 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
833 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
834 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
835 elm_box_pack_end(bx2, bt);
836 evas_object_propagate_events_set(bt, 0);
837 elm_object_focus_allow_set(bt, 0);
838 evas_object_show(bt);
840 bt = elm_button_add(win);
841 elm_object_text_set(bt, "Up ");
842 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
843 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
844 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
845 elm_box_pack_end(bx2, bt);
846 evas_object_propagate_events_set(bt, 0);
847 elm_object_focus_allow_set(bt, 0);
848 evas_object_show(bt);
850 bt = elm_button_add(win);
851 elm_object_text_set(bt, "Dow");
852 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
853 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
854 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
855 elm_box_pack_end(bx2, bt);
856 evas_object_propagate_events_set(bt, 0);
857 elm_object_focus_allow_set(bt, 0);
858 evas_object_show(bt);
860 bt = elm_button_add(win);
861 elm_object_text_set(bt, "Beg");
862 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
863 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
864 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
865 elm_box_pack_end(bx2, bt);
866 evas_object_propagate_events_set(bt, 0);
867 elm_object_focus_allow_set(bt, 0);
868 evas_object_show(bt);
870 bt = elm_button_add(win);
871 elm_object_text_set(bt, "End");
872 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, 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 elm_box_pack_end(bx, bx2);
881 evas_object_show(bx2);
883 bx2 = elm_box_add(win);
884 elm_box_horizontal_set(bx2, EINA_TRUE);
885 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
886 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
888 bt = elm_button_add(win);
889 elm_object_text_set(bt, "LBe");
890 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
891 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
892 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
893 elm_box_pack_end(bx2, bt);
894 evas_object_propagate_events_set(bt, 0);
895 elm_object_focus_allow_set(bt, 0);
896 evas_object_show(bt);
898 bt = elm_button_add(win);
899 elm_object_text_set(bt, "LEn");
900 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
901 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
902 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
903 elm_box_pack_end(bx2, bt);
904 evas_object_propagate_events_set(bt, 0);
905 elm_object_focus_allow_set(bt, 0);
906 evas_object_show(bt);
908 bt = elm_button_add(win);
909 elm_object_text_set(bt, "SBe");
910 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
911 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
912 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
913 elm_box_pack_end(bx2, bt);
914 evas_object_propagate_events_set(bt, 0);
915 elm_object_focus_allow_set(bt, 0);
916 evas_object_show(bt);
918 bt = elm_button_add(win);
919 elm_object_text_set(bt, "SEn");
920 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
921 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
922 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
923 elm_box_pack_end(bx2, bt);
924 evas_object_propagate_events_set(bt, 0);
925 elm_object_focus_allow_set(bt, 0);
926 evas_object_show(bt);
928 bt = elm_button_add(win);
929 elm_object_text_set(bt, "Fmt");
930 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
931 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
932 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
933 elm_box_pack_end(bx2, bt);
934 evas_object_propagate_events_set(bt, 0);
935 elm_object_focus_allow_set(bt, 0);
936 evas_object_show(bt);
938 bt = elm_button_add(win);
939 elm_object_text_set(bt, "VFm");
940 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, 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 elm_box_pack_end(bx, bx2);
949 evas_object_show(bx2);
951 bx2 = elm_box_add(win);
952 elm_box_horizontal_set(bx2, EINA_TRUE);
953 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
954 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
956 bt = elm_button_add(win);
957 elm_object_text_set(bt, "Chr");
958 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
959 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
960 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
961 elm_box_pack_end(bx2, bt);
962 evas_object_propagate_events_set(bt, 0);
963 elm_object_focus_allow_set(bt, 0);
964 evas_object_show(bt);
966 bt = elm_button_add(win);
967 elm_object_text_set(bt, "Cut");
968 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
969 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
970 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
971 elm_box_pack_end(bx2, bt);
972 evas_object_propagate_events_set(bt, 0);
973 elm_object_focus_allow_set(bt, 0);
974 evas_object_show(bt);
976 bt = elm_button_add(win);
977 elm_object_text_set(bt, "Cop");
978 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
979 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
980 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
981 elm_box_pack_end(bx2, bt);
982 evas_object_propagate_events_set(bt, 0);
983 elm_object_focus_allow_set(bt, 0);
984 evas_object_show(bt);
986 bt = elm_button_add(win);
987 elm_object_text_set(bt, "Pas");
988 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
989 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
990 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
991 elm_box_pack_end(bx2, bt);
992 evas_object_propagate_events_set(bt, 0);
993 elm_object_focus_allow_set(bt, 0);
994 evas_object_show(bt);
996 elm_box_pack_end(bx, bx2);
997 evas_object_show(bx2);
999 /* markup scrolled entry */
1000 en = elm_entry_add(win);
1001 elm_entry_scrollable_set(en, EINA_TRUE);
1002 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1003 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1004 elm_entry_entry_set(en,
1005 "This is an entry widget in this window that<br/>"
1006 "uses markup <b>like this</> for styling and<br/>"
1007 "formatting <em>like this</>, as well as<br/>"
1008 "<a href=X><link>links in the text</></a>, so enter text<br/>"
1009 "in here to edit it. By them way, links are<br/>"
1010 "called <a href=anc-02>Anchors</a> so you will need<br/>"
1011 "to refer to them this way. At the end here is a really long "
1012 "line to test line wrapping to see if it works. But just in "
1013 "case this line is not long enough I will add more here to "
1014 "really test it out, as Elementary really needs some "
1015 "good testing to see if entry widgets work as advertised."
1017 evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1018 elm_box_pack_end(bx, en);
1019 evas_object_show(en);
1021 bx2 = elm_box_add(win);
1022 elm_box_horizontal_set(bx2, EINA_TRUE);
1023 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1024 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1026 bt = elm_button_add(win);
1027 elm_object_text_set(bt, "Clr");
1028 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, en);
1029 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1030 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1031 elm_box_pack_end(bx2, bt);
1032 evas_object_propagate_events_set(bt, 0);
1033 elm_object_focus_allow_set(bt, 0);
1034 evas_object_show(bt);
1036 bt = elm_button_add(win);
1037 elm_object_text_set(bt, "Pri");
1038 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, en);
1039 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1040 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1041 elm_box_pack_end(bx2, bt);
1042 evas_object_propagate_events_set(bt, 0);
1043 elm_object_focus_allow_set(bt, 0);
1044 evas_object_show(bt);
1046 bt = elm_button_add(win);
1047 elm_object_text_set(bt, "Sel");
1048 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, en);
1049 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1050 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1051 elm_box_pack_end(bx2, bt);
1052 evas_object_propagate_events_set(bt, 0);
1053 elm_object_focus_allow_set(bt, 0);
1054 evas_object_show(bt);
1056 bt = elm_button_add(win);
1057 elm_object_text_set(bt, "All");
1058 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
1059 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1060 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1061 elm_box_pack_end(bx2, bt);
1062 evas_object_propagate_events_set(bt, 0);
1063 elm_object_focus_allow_set(bt, 0);
1064 evas_object_show(bt);
1066 bt = elm_button_add(win);
1067 elm_object_text_set(bt, "Non");
1068 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
1069 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1070 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1071 elm_box_pack_end(bx2, bt);
1072 evas_object_propagate_events_set(bt, 0);
1073 elm_object_focus_allow_set(bt, 0);
1074 evas_object_show(bt);
1076 bt = elm_button_add(win);
1077 elm_object_text_set(bt, "Ins");
1078 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, 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 elm_box_pack_end(bx, bx2);
1087 evas_object_show(bx2);
1089 bx2 = elm_box_add(win);
1090 elm_box_horizontal_set(bx2, EINA_TRUE);
1091 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1092 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1094 bt = elm_button_add(win);
1095 elm_object_text_set(bt, "Lef");
1096 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, en);
1097 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1098 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1099 elm_box_pack_end(bx2, bt);
1100 evas_object_propagate_events_set(bt, 0);
1101 elm_object_focus_allow_set(bt, 0);
1102 evas_object_show(bt);
1104 bt = elm_button_add(win);
1105 elm_object_text_set(bt, "Rig");
1106 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, en);
1107 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1108 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1109 elm_box_pack_end(bx2, bt);
1110 evas_object_propagate_events_set(bt, 0);
1111 elm_object_focus_allow_set(bt, 0);
1112 evas_object_show(bt);
1114 bt = elm_button_add(win);
1115 elm_object_text_set(bt, "Up ");
1116 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, en);
1117 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1118 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1119 elm_box_pack_end(bx2, bt);
1120 evas_object_propagate_events_set(bt, 0);
1121 elm_object_focus_allow_set(bt, 0);
1122 evas_object_show(bt);
1124 bt = elm_button_add(win);
1125 elm_object_text_set(bt, "Dow");
1126 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
1127 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1128 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1129 elm_box_pack_end(bx2, bt);
1130 evas_object_propagate_events_set(bt, 0);
1131 elm_object_focus_allow_set(bt, 0);
1132 evas_object_show(bt);
1134 bt = elm_button_add(win);
1135 elm_object_text_set(bt, "Beg");
1136 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
1137 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1138 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1139 elm_box_pack_end(bx2, bt);
1140 evas_object_propagate_events_set(bt, 0);
1141 elm_object_focus_allow_set(bt, 0);
1142 evas_object_show(bt);
1144 bt = elm_button_add(win);
1145 elm_object_text_set(bt, "End");
1146 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, 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 elm_box_pack_end(bx, bx2);
1155 evas_object_show(bx2);
1157 bx2 = elm_box_add(win);
1158 elm_box_horizontal_set(bx2, EINA_TRUE);
1159 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1160 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1162 bt = elm_button_add(win);
1163 elm_object_text_set(bt, "LBe");
1164 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, en);
1165 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1166 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1167 elm_box_pack_end(bx2, bt);
1168 evas_object_propagate_events_set(bt, 0);
1169 elm_object_focus_allow_set(bt, 0);
1170 evas_object_show(bt);
1172 bt = elm_button_add(win);
1173 elm_object_text_set(bt, "LEn");
1174 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, en);
1175 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1176 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1177 elm_box_pack_end(bx2, bt);
1178 evas_object_propagate_events_set(bt, 0);
1179 elm_object_focus_allow_set(bt, 0);
1180 evas_object_show(bt);
1182 bt = elm_button_add(win);
1183 elm_object_text_set(bt, "SBe");
1184 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, en);
1185 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1186 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1187 elm_box_pack_end(bx2, bt);
1188 evas_object_propagate_events_set(bt, 0);
1189 elm_object_focus_allow_set(bt, 0);
1190 evas_object_show(bt);
1192 bt = elm_button_add(win);
1193 elm_object_text_set(bt, "SEn");
1194 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
1195 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1196 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1197 elm_box_pack_end(bx2, bt);
1198 evas_object_propagate_events_set(bt, 0);
1199 elm_object_focus_allow_set(bt, 0);
1200 evas_object_show(bt);
1202 bt = elm_button_add(win);
1203 elm_object_text_set(bt, "Fmt");
1204 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
1205 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1206 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1207 elm_box_pack_end(bx2, bt);
1208 evas_object_propagate_events_set(bt, 0);
1209 elm_object_focus_allow_set(bt, 0);
1210 evas_object_show(bt);
1212 bt = elm_button_add(win);
1213 elm_object_text_set(bt, "VFm");
1214 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, 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 elm_box_pack_end(bx, bx2);
1223 evas_object_show(bx2);
1225 bx2 = elm_box_add(win);
1226 elm_box_horizontal_set(bx2, EINA_TRUE);
1227 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1228 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1230 bt = elm_button_add(win);
1231 elm_object_text_set(bt, "Chr");
1232 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, en);
1233 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1234 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1235 elm_box_pack_end(bx2, bt);
1236 evas_object_propagate_events_set(bt, 0);
1237 elm_object_focus_allow_set(bt, 0);
1238 evas_object_show(bt);
1240 bt = elm_button_add(win);
1241 elm_object_text_set(bt, "Cut");
1242 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
1243 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1244 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1245 elm_box_pack_end(bx2, bt);
1246 evas_object_propagate_events_set(bt, 0);
1247 elm_object_focus_allow_set(bt, 0);
1248 evas_object_show(bt);
1250 bt = elm_button_add(win);
1251 elm_object_text_set(bt, "Cop");
1252 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
1253 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1254 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1255 elm_box_pack_end(bx2, bt);
1256 evas_object_propagate_events_set(bt, 0);
1257 elm_object_focus_allow_set(bt, 0);
1258 evas_object_show(bt);
1260 bt = elm_button_add(win);
1261 elm_object_text_set(bt, "Pas");
1262 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
1263 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1264 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1265 elm_box_pack_end(bx2, bt);
1266 evas_object_propagate_events_set(bt, 0);
1267 elm_object_focus_allow_set(bt, 0);
1268 evas_object_show(bt);
1270 elm_box_pack_end(bx, bx2);
1271 evas_object_show(bx2);
1273 evas_object_resize(win, 320, 480);
1275 elm_object_focus_set(win, EINA_TRUE);
1276 evas_object_show(win);
1280 test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1282 Evas_Object *win, *bg, *ly, *en;
1285 win = elm_win_add(NULL, "entry4", ELM_WIN_BASIC);
1286 elm_win_title_set(win, "Entry 4");
1287 elm_win_autodel_set(win, EINA_TRUE);
1289 bg = elm_bg_add(win);
1290 elm_win_resize_object_add(win, bg);
1291 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1292 evas_object_show(bg);
1294 ly = elm_layout_add(win);
1295 snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
1296 elm_layout_file_set(ly, buf, "layout");
1297 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1298 elm_win_resize_object_add(win, ly);
1299 evas_object_show(ly);
1301 en = elm_entry_add(win);
1302 elm_entry_scrollable_set(en, EINA_TRUE);
1303 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
1304 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
1305 elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
1306 elm_entry_entry_set(en, "This is a single line");
1307 elm_entry_single_line_set(en, 1);
1308 elm_object_part_content_set(ly, "element1", en);
1309 evas_object_show(en);
1311 en = elm_entry_add(win);
1312 elm_entry_line_wrap_set(en, ELM_WRAP_NONE);
1313 elm_entry_entry_set(en,
1314 "This is an entry widget<br/>"
1315 "that uses markup<br/>"
1316 "<b>like this</> and has<br/>"
1317 "no scroller, so you can<br/>"
1318 "use it more flexibly.");
1319 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1320 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1321 elm_object_part_content_set(ly, "element2", en);
1322 evas_object_show(en);
1324 en = elm_entry_add(win);
1325 elm_entry_scrollable_set(en, EINA_TRUE);
1326 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1327 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1328 elm_entry_entry_set(en,
1329 "This is an entry widget in this window that<br/>"
1330 "uses markup <b>like this</> for styling and<br/>"
1331 "formatting <em>like this</>, as well as<br/>"
1332 "<a href=X><link>links in the text</></a>, so enter text<br/>"
1333 "in here to edit it. By them way, links are<br/>"
1334 "called <a href=anc-02>Anchors</a> so you will need<br/>"
1335 "to refer to them this way. At the end here is a really long "
1336 "line to test line wrapping to see if it works. But just in "
1337 "case this line is not long enough I will add more here to "
1338 "really test it out, as Elementary really needs some "
1339 "good testing to see if entry widgets work as advertised."
1341 evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1342 elm_object_part_content_set(ly, "element3", en);
1343 evas_object_show(en);
1345 evas_object_show(win);
1349 test_entry5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1351 Evas_Object *win, *bg, *bx, *bx2, *bt, *en;
1353 win = elm_win_add(NULL, "entry5", ELM_WIN_BASIC);
1354 elm_win_title_set(win, "Entry 5");
1355 elm_win_autodel_set(win, EINA_TRUE);
1357 bg = elm_bg_add(win);
1358 elm_win_resize_object_add(win, bg);
1359 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1360 evas_object_show(bg);
1362 bx = elm_box_add(win);
1363 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1364 elm_win_resize_object_add(win, bx);
1365 evas_object_show(bx);
1367 en = elm_entry_add(win);
1368 elm_entry_scrollable_set(en, EINA_TRUE);
1369 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1370 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1371 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1372 elm_entry_entry_set(en,
1373 "This is an entry widget in this window that "
1374 "uses markup like this for styling and "
1375 "formatting like this, as well as "
1376 "to refer to them this way. At the end here is a really long "
1377 "line to test line wrapping to see if it works. But just in "
1378 "case this line is not long enough I will add more here to "
1379 "really test it out, as Elementary really needs some "
1380 "good testing to see if entry widgets work as advertised."
1382 evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
1383 elm_box_pack_end(bx, en);
1384 evas_object_show(en);
1386 bx2 = elm_box_add(win);
1387 elm_box_horizontal_set(bx2, EINA_TRUE);
1388 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1389 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1391 bt = elm_button_add(win);
1392 elm_object_text_set(bt, "Clr");
1393 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_clr, 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, "Pri");
1403 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pri, 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, "Sel");
1413 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sel, 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 bt = elm_button_add(win);
1422 elm_object_text_set(bt, "All");
1423 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_all, en);
1424 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1425 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1426 elm_box_pack_end(bx2, bt);
1427 evas_object_propagate_events_set(bt, 0);
1428 elm_object_focus_allow_set(bt, 0);
1429 evas_object_show(bt);
1431 bt = elm_button_add(win);
1432 elm_object_text_set(bt, "Non");
1433 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_non, en);
1434 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1435 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1436 elm_box_pack_end(bx2, bt);
1437 evas_object_propagate_events_set(bt, 0);
1438 elm_object_focus_allow_set(bt, 0);
1439 evas_object_show(bt);
1441 bt = elm_button_add(win);
1442 elm_object_text_set(bt, "Ins");
1443 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_ins, en);
1444 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1445 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1446 elm_box_pack_end(bx2, bt);
1447 evas_object_propagate_events_set(bt, 0);
1448 elm_object_focus_allow_set(bt, 0);
1449 evas_object_show(bt);
1451 elm_box_pack_end(bx, bx2);
1452 evas_object_show(bx2);
1454 bx2 = elm_box_add(win);
1455 elm_box_horizontal_set(bx2, EINA_TRUE);
1456 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1457 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1459 bt = elm_button_add(win);
1460 elm_object_text_set(bt, "Lef");
1461 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lef, 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, "Rig");
1471 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_rig, 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, "Up ");
1481 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_up_, 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 bt = elm_button_add(win);
1490 elm_object_text_set(bt, "Dow");
1491 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_dow, en);
1492 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1493 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1494 elm_box_pack_end(bx2, bt);
1495 evas_object_propagate_events_set(bt, 0);
1496 elm_object_focus_allow_set(bt, 0);
1497 evas_object_show(bt);
1499 bt = elm_button_add(win);
1500 elm_object_text_set(bt, "Beg");
1501 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_beg, en);
1502 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1503 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1504 elm_box_pack_end(bx2, bt);
1505 evas_object_propagate_events_set(bt, 0);
1506 elm_object_focus_allow_set(bt, 0);
1507 evas_object_show(bt);
1509 bt = elm_button_add(win);
1510 elm_object_text_set(bt, "End");
1511 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_end, en);
1512 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1513 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1514 elm_box_pack_end(bx2, bt);
1515 evas_object_propagate_events_set(bt, 0);
1516 elm_object_focus_allow_set(bt, 0);
1517 evas_object_show(bt);
1519 elm_box_pack_end(bx, bx2);
1520 evas_object_show(bx2);
1522 bx2 = elm_box_add(win);
1523 elm_box_horizontal_set(bx2, EINA_TRUE);
1524 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1525 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1527 bt = elm_button_add(win);
1528 elm_object_text_set(bt, "LBe");
1529 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_lbe, 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, "LEn");
1539 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_len, 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, "SBe");
1549 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sbe, 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 bt = elm_button_add(win);
1558 elm_object_text_set(bt, "SEn");
1559 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_sen, en);
1560 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1561 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1562 elm_box_pack_end(bx2, bt);
1563 evas_object_propagate_events_set(bt, 0);
1564 elm_object_focus_allow_set(bt, 0);
1565 evas_object_show(bt);
1567 bt = elm_button_add(win);
1568 elm_object_text_set(bt, "Fmt");
1569 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_fmt, en);
1570 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1571 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1572 elm_box_pack_end(bx2, bt);
1573 evas_object_propagate_events_set(bt, 0);
1574 elm_object_focus_allow_set(bt, 0);
1575 evas_object_show(bt);
1577 bt = elm_button_add(win);
1578 elm_object_text_set(bt, "VFm");
1579 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_vfm, en);
1580 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1581 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1582 elm_box_pack_end(bx2, bt);
1583 evas_object_propagate_events_set(bt, 0);
1584 elm_object_focus_allow_set(bt, 0);
1585 evas_object_show(bt);
1587 elm_box_pack_end(bx, bx2);
1588 evas_object_show(bx2);
1590 bx2 = elm_box_add(win);
1591 elm_box_horizontal_set(bx2, EINA_TRUE);
1592 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1593 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1595 bt = elm_button_add(win);
1596 elm_object_text_set(bt, "Chr");
1597 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_chr, 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 bt = elm_button_add(win);
1606 elm_object_text_set(bt, "Cut");
1607 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cut, en);
1608 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1609 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1610 elm_box_pack_end(bx2, bt);
1611 evas_object_propagate_events_set(bt, 0);
1612 elm_object_focus_allow_set(bt, 0);
1613 evas_object_show(bt);
1615 bt = elm_button_add(win);
1616 elm_object_text_set(bt, "Cop");
1617 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_cop, en);
1618 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1619 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1620 elm_box_pack_end(bx2, bt);
1621 evas_object_propagate_events_set(bt, 0);
1622 elm_object_focus_allow_set(bt, 0);
1623 evas_object_show(bt);
1625 bt = elm_button_add(win);
1626 elm_object_text_set(bt, "Pas");
1627 evas_object_smart_callback_add(bt, "clicked", my_ent_bt_pas, en);
1628 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1629 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1630 elm_box_pack_end(bx2, bt);
1631 evas_object_propagate_events_set(bt, 0);
1632 elm_object_focus_allow_set(bt, 0);
1633 evas_object_show(bt);
1635 elm_box_pack_end(bx, bx2);
1636 evas_object_show(bx2);
1638 evas_object_resize(win, 320, 480);
1640 elm_object_focus_set(win, EINA_TRUE);
1641 evas_object_show(win);
1645 _scrolled_entry_clear(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1647 Evas_Object *en = data;
1648 elm_entry_entry_set(en, "");
1652 test_entry_notepad(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1654 Evas_Object *win, *bg, *bx, *bx2, *bt, *np;
1656 win = elm_win_add(NULL, "entry-notepad", ELM_WIN_BASIC);
1657 elm_win_title_set(win, "Entry Notepad");
1658 elm_win_autodel_set(win, EINA_TRUE);
1660 bg = elm_bg_add(win);
1661 elm_win_resize_object_add(win, bg);
1662 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1663 evas_object_show(bg);
1665 bx = elm_box_add(win);
1666 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1667 elm_win_resize_object_add(win, bx);
1668 evas_object_show(bx);
1670 np = elm_entry_add(win);
1671 elm_entry_scrollable_set(np, EINA_TRUE);
1672 elm_entry_file_set(np, "note.txt", ELM_TEXT_FORMAT_PLAIN_UTF8);
1673 evas_object_size_hint_weight_set(np, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1674 evas_object_size_hint_align_set(np, EVAS_HINT_FILL, EVAS_HINT_FILL);
1675 elm_box_pack_end(bx, np);
1676 evas_object_show(np);
1678 bx2 = elm_box_add(win);
1679 elm_box_horizontal_set(bx2, EINA_TRUE);
1680 elm_box_homogeneous_set(bx2, EINA_TRUE);
1681 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
1682 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
1684 bt = elm_button_add(win);
1685 elm_object_text_set(bt, "Clear");
1686 evas_object_smart_callback_add(bt, "clicked", _scrolled_entry_clear, np);
1687 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
1688 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1689 elm_box_pack_end(bx2, bt);
1690 evas_object_show(bt);
1692 elm_box_pack_end(bx, bx2);
1693 evas_object_show(bx2);
1695 evas_object_resize(win, 320, 300);
1697 elm_object_focus_set(win, EINA_TRUE);
1698 evas_object_show(win);