summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2015-11-24 17:41:30 +0200
committerDaniel Hirt <daniel.hirt@samsung.com>2015-11-24 17:41:30 +0200
commit37d93fd75059c79bba50dd171c8592c65f3bf037 (patch)
treea571fd990b87986526ce5df1650a2a637c1ab747
parent000464a512293b2447ba34dadb0ff9c25a094397 (diff)
populate tabledemo_table
-rw-r--r--demo.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/demo.c b/demo.c
index e62d398..8a21a62 100644
--- a/demo.c
+++ b/demo.c
@@ -97,18 +97,19 @@ _pack_obj_at(Evas_Object *table, Evas_Object *obj, int r, int c)
97 elm_table_pack(table, obj, r, c, 1, 1); 97 elm_table_pack(table, obj, r, c, 1, 1);
98} 98}
99 99
100#define BLACK "<color=#000 shadow_color=#f00 font_weight=bold font_size=14>"
100static void 101static void
101_set_wrap_labels(Evas_Object *table) 102_set_wrap_labels(Evas_Object *table)
102{ 103{
103 Evas_Object *label; 104 Evas_Object *label;
104 105
105 label = elm_label_add(table); 106 label = elm_label_add(table);
106 elm_object_text_set(label, "word"); 107 elm_object_text_set(label, BLACK "Word");
107 _pack_obj_at(table, label, 0, 0); 108 _pack_obj_at(table, label, 0, 0);
108 evas_object_show(label); 109 evas_object_show(label);
109 110
110 label = elm_label_add(table); 111 label = elm_label_add(table);
111 elm_object_text_set(label, "hyphen"); 112 elm_object_text_set(label, BLACK "Hyphen");
112 _pack_obj_at(table, label, 0, 1); 113 _pack_obj_at(table, label, 0, 1);
113 evas_object_show(label); 114 evas_object_show(label);
114} 115}
@@ -126,15 +127,17 @@ _add_entry(Evas_Object *table, const char *text, int r, int c)
126 return entry; 127 return entry;
127} 128}
128 129
130#define HYPH "<wrap=hyphenation font_size=20>"
131
129static void 132static void
130_set_entries(Evas_Object *table) 133_set_entries(Evas_Object *table)
131{ 134{
132 Evas_Object *entry; 135 Evas_Object *entry;
133 136
134 entry = _add_entry(table, "English", 1, 0); 137 entry = _add_entry(table, HYPH "<lang=en_US>" "Hyphenation", 1, 0);
135 entry = _add_entry(table, "English (long)", 2, 0); 138 entry = _add_entry(table, HYPH "<lang=en_US>" "I hyphenate all day", 2, 0);
136 entry = _add_entry(table, "Dutch (long)", 1, 1); 139 entry = _add_entry(table, HYPH "<lang=nl_NL>" "Vliegtuigmodus", 1, 1);
137 entry = _add_entry(table, "Dutch (long)", 2, 1); 140 entry = _add_entry(table, HYPH "<lang=nl_NL>" "Alle mensen worden vrij", 2, 1);
138} 141}
139 142
140static void 143static void
@@ -146,7 +149,7 @@ _init_demo(void)
146 Evas_Object *boxt, *boxb; 149 Evas_Object *boxt, *boxb;
147 Evas_Object *entry; 150 Evas_Object *entry;
148 Evas_Object *table; 151 Evas_Object *table;
149 Evas_Coord w = 600, h = 600; 152 Evas_Coord w = 300, h = 300;
150 153
151 /* Window */ 154 /* Window */
152 win = elm_win_util_standard_add("demo-win", "Hyphenation Demo"); 155 win = elm_win_util_standard_add("demo-win", "Hyphenation Demo");
@@ -165,10 +168,11 @@ _init_demo(void)
165 168
166 /* Layout */ 169 /* Layout */
167 table = elm_table_add(win); 170 table = elm_table_add(win);
168 elm_win_resize_object_add(win, table);
169 _prep_contained_obj(table); 171 _prep_contained_obj(table);
172 elm_win_resize_object_add(win, table);
170 evas_object_show(table); 173 evas_object_show(table);
171 174
175 _set_wrap_labels(table);
172 _set_entries(table); 176 _set_entries(table);
173 177
174// 178//