summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-11-01 01:52:48 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2013-11-01 01:52:48 +0200
commit944234bccdd02e53d14490373fa15930667bb50b (patch)
tree4acbfc7f477d19450664add6f75639ac5daaa182
parent7826e96e0176acadf31f02c14baf03873eef2f92 (diff)
Elementary: Examplifying examples.
-rwxr-xr-xexamples/elementary/test.py29
-rw-r--r--examples/elementary/test_3d.py35
-rw-r--r--examples/elementary/test_access.py42
-rw-r--r--examples/elementary/test_actionslider.py38
-rw-r--r--examples/elementary/test_bg.py9
-rw-r--r--examples/elementary/test_box.py15
-rw-r--r--examples/elementary/test_bubble.py19
-rw-r--r--examples/elementary/test_button.py3
-rw-r--r--examples/elementary/test_calendar.py3
-rw-r--r--examples/elementary/test_clock.py3
-rw-r--r--examples/elementary/test_cnp.py15
-rw-r--r--examples/elementary/test_colorselector.py25
-rw-r--r--examples/elementary/test_config.py129
-rw-r--r--examples/elementary/test_conform.py179
-rw-r--r--examples/elementary/test_core_evas_canvas_callbacks.py85
-rw-r--r--examples/elementary/test_core_evas_object_callbacks.py193
-rw-r--r--examples/elementary/test_core_evas_objects.py26
-rw-r--r--examples/elementary/test_ctxpopup.py64
-rw-r--r--examples/elementary/test_cursor.py167
-rw-r--r--examples/elementary/test_datetime.py44
-rw-r--r--examples/elementary/test_dayselector.py82
-rw-r--r--examples/elementary/test_diskselector.py84
-rw-r--r--examples/elementary/test_dnd.py48
-rw-r--r--examples/elementary/test_entry.py287
-rw-r--r--examples/elementary/test_evas_textgrid.py12
-rw-r--r--examples/elementary/test_external.py113
26 files changed, 687 insertions, 1062 deletions
diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index 42e0587..3a03fdf 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -38,6 +38,7 @@ items = [
38 ("Evas Objects", "test_core_evas_objects", "core_evas_objects_clicked"), 38 ("Evas Objects", "test_core_evas_objects", "core_evas_objects_clicked"),
39 ("Evas Canvas Callbacks", "test_core_evas_canvas_callbacks", "core_evas_canvas_callbacks_clicked"), 39 ("Evas Canvas Callbacks", "test_core_evas_canvas_callbacks", "core_evas_canvas_callbacks_clicked"),
40 ("Evas Object Callbacks", "test_core_evas_object_callbacks", "core_evas_object_callbacks_clicked"), 40 ("Evas Object Callbacks", "test_core_evas_object_callbacks", "core_evas_object_callbacks_clicked"),
41 ("Evas Textgrid", "test_evas_textgrid", "evas_textgrid_clicked"),
41 ]), 42 ]),
42 ("3D", [ 43 ("3D", [
43 ("Evas Map 3D", "test_3d", "evas3d_clicked"), 44 ("Evas Map 3D", "test_3d", "evas3d_clicked"),
@@ -207,17 +208,14 @@ def selected_cb(o, mod, func):
207def menu_create(search, win): 208def menu_create(search, win):
208 tbx.clear() 209 tbx.clear()
209 for category in items: 210 for category in items:
210 frame = Frame(win, 211 frame = Frame(win, size_hint_weight=EXPAND_BOTH,
211 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 212 size_hint_align=FILL_BOTH, text=category[0])
212 text=category[0]
213 )
214 frame.show() 213 frame.show()
215 tbx.pack_end(frame) 214 tbx.pack_end(frame)
216 215
217 tbx2 = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL, 216 tbx2 = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
218 size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 217 size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
219 size_hint_align=(EVAS_HINT_FILL, 0.0) 218 size_hint_align=(EVAS_HINT_FILL, 0.0))
220 )
221 frame.content_set(tbx2) 219 frame.content_set(tbx2)
222 tbx2.show() 220 tbx2.show()
223 221
@@ -269,11 +267,8 @@ if __name__ == "__main__":
269 box0.pack_end(tg) 267 box0.pack_end(tg)
270 tg.show() 268 tg.show()
271 269
272 bx1 = Box(win, 270 bx1 = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
273 size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 271 size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True)
274 size_hint_align=(EVAS_HINT_FILL, 0.0),
275 horizontal=True
276 )
277 box0.pack_end(bx1) 272 box0.pack_end(bx1)
278 bx1.show() 273 bx1.show()
279 274
@@ -282,23 +277,19 @@ if __name__ == "__main__":
282 lb.show() 277 lb.show()
283 278
284 en = Entry(win, single_line=True, scrollable=True, 279 en = Entry(win, single_line=True, scrollable=True,
285 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH 280 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
286 )
287 en.callback_changed_add(cb_filter, win) 281 en.callback_changed_add(cb_filter, win)
288 bx1.pack_end(en) 282 bx1.pack_end(en)
289 en.show() 283 en.show()
290 en.focus_set(True) 284 en.focus_set(True)
291 285
292 sc = Scroller(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 286 sc = Scroller(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
293 bounce=(False, True) 287 bounce=(False, True))
294 )
295 sc.show() 288 sc.show()
296 box0.pack_end(sc) 289 box0.pack_end(sc)
297 290
298 tbx = Box(win, 291 tbx = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
299 size_hint_weight=(EVAS_HINT_EXPAND, 0.0), 292 size_hint_align=(EVAS_HINT_FILL, 0.0))
300 size_hint_align=(EVAS_HINT_FILL, 0.0)
301 )
302 sc.content_set(tbx) 293 sc.content_set(tbx)
303 tbx.show() 294 tbx.show()
304 295
diff --git a/examples/elementary/test_3d.py b/examples/elementary/test_3d.py
index c7838e7..934a08c 100644
--- a/examples/elementary/test_3d.py
+++ b/examples/elementary/test_3d.py
@@ -172,57 +172,50 @@ def evas3d_clicked(obj, item=None):
172 vbox.show() 172 vbox.show()
173 173
174 sl = Slider(win, text="Rot X", unit_format="%1.0f units", span_size=360, 174 sl = Slider(win, text="Rot X", unit_format="%1.0f units", span_size=360,
175 min_max=(0, 360), 175 min_max=(0, 360), size_hint_align=FILL_HORIZ,
176 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 176 size_hint_weight=EXPAND_BOTH)
177 )
178 vbox.pack_end(sl) 177 vbox.pack_end(sl)
179 sl.callback_changed_add(ch_rot_x, cube) 178 sl.callback_changed_add(ch_rot_x, cube)
180 sl.show() 179 sl.show()
181 180
182 sl = Slider(win, text="Rot Y", unit_format="%1.0f units", span_size=360, 181 sl = Slider(win, text="Rot Y", unit_format="%1.0f units", span_size=360,
183 min_max=(0, 360), 182 min_max=(0, 360), size_hint_align=FILL_HORIZ,
184 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 183 size_hint_weight=EXPAND_BOTH)
185 )
186 vbox.pack_end(sl) 184 vbox.pack_end(sl)
187 sl.callback_changed_add(ch_rot_y, cube) 185 sl.callback_changed_add(ch_rot_y, cube)
188 sl.show() 186 sl.show()
189 187
190 sl = Slider(win, text="Rot Z", unit_format="%1.0f units", span_size=360, 188 sl = Slider(win, text="Rot Z", unit_format="%1.0f units", span_size=360,
191 min_max=(0, 360), 189 min_max=(0, 360), size_hint_align=FILL_HORIZ,
192 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 190 size_hint_weight=EXPAND_BOTH)
193 )
194 vbox.pack_end(sl) 191 vbox.pack_end(sl)
195 sl.callback_changed_add(ch_rot_z, cube) 192 sl.callback_changed_add(ch_rot_z, cube)
196 sl.show() 193 sl.show()
197 194
198 sl = Slider(win, text="CX Off", unit_format="%1.0f units", span_size=360, 195 sl = Slider(win, text="CX Off", unit_format="%1.0f units", span_size=360,
199 min_max=(-320, 320), value=cube.cxo, 196 min_max=(-320, 320), value=cube.cxo, size_hint_align=FILL_HORIZ,
200 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 197 size_hint_weight=EXPAND_BOTH)
201 )
202 vbox.pack_end(sl) 198 vbox.pack_end(sl)
203 sl.callback_changed_add(ch_cx, cube) 199 sl.callback_changed_add(ch_cx, cube)
204 sl.show() 200 sl.show()
205 201
206 sl = Slider(win, text="CY Off", unit_format="%1.0f units", span_size=360, 202 sl = Slider(win, text="CY Off", unit_format="%1.0f units", span_size=360,
207 min_max=(-320, 320), value=cube.cyo, 203 min_max=(-320, 320), value=cube.cyo, size_hint_align=FILL_HORIZ,
208 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 204 size_hint_weight=EXPAND_BOTH)
209 )
210 vbox.pack_end(sl) 205 vbox.pack_end(sl)
211 sl.callback_changed_add(ch_cy, cube) 206 sl.callback_changed_add(ch_cy, cube)
212 sl.show() 207 sl.show()
213 208
214 sl = Slider(win, text="Foc", unit_format="%1.0f units", span_size=360, 209 sl = Slider(win, text="Foc", unit_format="%1.0f units", span_size=360,
215 min_max=(1, 2000), value=cube.focv, 210 min_max=(1, 2000), value=cube.focv, size_hint_align=FILL_HORIZ,
216 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 211 size_hint_weight=EXPAND_BOTH)
217 )
218 vbox.pack_end(sl) 212 vbox.pack_end(sl)
219 sl.callback_changed_add(ch_foc, cube) 213 sl.callback_changed_add(ch_foc, cube)
220 sl.show() 214 sl.show()
221 215
222 sl = Slider(win, text="Z0", unit_format="%1.0f units", span_size=360, 216 sl = Slider(win, text="Z0", unit_format="%1.0f units", span_size=360,
223 min_max=(-2000, 2000), value=cube.z0v, 217 min_max=(-2000, 2000), value=cube.z0v, size_hint_align=FILL_HORIZ,
224 size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_BOTH 218 size_hint_weight=EXPAND_BOTH)
225 )
226 vbox.pack_end(sl) 219 vbox.pack_end(sl)
227 sl.callback_changed_add(ch_z0, cube) 220 sl.callback_changed_add(ch_z0, cube)
228 sl.show() 221 sl.show()
diff --git a/examples/elementary/test_access.py b/examples/elementary/test_access.py
index 54c8143..1ca0b15 100644
--- a/examples/elementary/test_access.py
+++ b/examples/elementary/test_access.py
@@ -35,13 +35,11 @@ class GLItC1(GenlistItemClass):
35 35
36 def content_get(self, gl, part, data): 36 def content_get(self, gl, part, data):
37 if not part == "elm.swallow.end": 37 if not part == "elm.swallow.end":
38 bt = Button(gl, text="OK", 38 bt = Button(gl, text="OK", size_hint_align=FILL_BOTH,
39 size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH, 39 size_hint_weight=EXPAND_BOTH)
40 )
41 else: 40 else:
42 bt = Icon(gl, file=os.path.join(img_path, "logo_small.png") 41 bt = Icon(gl, file=os.path.join(img_path, "logo_small.png"),
43 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1) 42 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
44 )
45 43
46 return bt 44 return bt
47 45
@@ -51,8 +49,7 @@ class GLItC2(GenlistItemClass):
51 49
52 grid = Gengrid(gl, horizontal=False, reorder_mode=True, 50 grid = Gengrid(gl, horizontal=False, reorder_mode=True,
53 item_size=(config.scale * 100, config.scale * 100), 51 item_size=(config.scale * 100, config.scale * 100),
54 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH 52 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
55 )
56 53
57 gic = GGItC(item_style="default") 54 gic = GGItC(item_style="default")
58 55
@@ -73,9 +70,8 @@ class GGItC(GengridItemClass):
73 if not part == "elm.swallow.icon": 70 if not part == "elm.swallow.icon":
74 ic = Icon(gg, scale=0.5, 71 ic = Icon(gg, scale=0.5,
75 file=os.path.join(img_path, "icon_%02i.png" % (data % 4)), 72 file=os.path.join(img_path, "icon_%02i.png" % (data % 4)),
76 resizable=(0, 0), 73 resizable=(0, 0), size_hint_weight=EXPAND_BOTH,
77 size_hint_weight=EXPAND_BOTH, size_hint_align=(0.5, 0.5) 74 size_hint_align=(0.5, 0.5))
78 )
79 ic.show() 75 ic.show()
80 return ic 76 return ic
81 77
@@ -111,8 +107,7 @@ def access_clicked(obj, item=None):
111 config.access = True 107 config.access = True
112 108
113 bx = Box(win, size_hint_weight=EXPAND_BOTH, homogeneous=True, 109 bx = Box(win, size_hint_weight=EXPAND_BOTH, homogeneous=True,
114 horizontal=True 110 horizontal=True)
115 )
116 win.resize_object_add(bx) 111 win.resize_object_add(bx)
117 bx.show() 112 bx.show()
118 113
@@ -292,35 +287,31 @@ def access_clicked(obj, item=None):
292 287
293if __name__ == "__main__": 288if __name__ == "__main__":
294 elementary.init() 289 elementary.init()
295 win = StandardWindow("test", "python-elementary test application") 290 win = StandardWindow("test", "python-elementary test application",
291 size=(320,520))
296 win.callback_delete_request_add(lambda o: elementary.exit()) 292 win.callback_delete_request_add(lambda o: elementary.exit())
297 293
298 box0 = Box(win) 294 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
299 box0.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
300 win.resize_object_add(box0) 295 win.resize_object_add(box0)
301 box0.show() 296 box0.show()
302 297
303 fr = Frame(win)
304 fr.text_set("Information")
305 box0.pack_end(fr)
306 fr.show()
307
308 lb = Label(win) 298 lb = Label(win)
309 lb.text_set("Please select a test from the list below<br>" 299 lb.text_set("Please select a test from the list below<br>"
310 "by clicking the test button to show the<br>" 300 "by clicking the test button to show the<br>"
311 "test window.") 301 "test window.")
312 fr.content_set(lb)
313 lb.show() 302 lb.show()
314 303
304 fr = Frame(win, text="Information", content=lb)
305 box0.pack_end(fr)
306 fr.show()
307
315 items = [ 308 items = [
316 ("Access 1", access_clicked), 309 ("Access 1", access_clicked),
317 #("Access 2", access2_clicked), 310 #("Access 2", access2_clicked),
318 #("Access 3", accesst3_clicked), 311 #("Access 3", accesst3_clicked),
319 ] 312 ]
320 313
321 li = List(win) 314 li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
322 li.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
323 li.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL)
324 box0.pack_end(li) 315 box0.pack_end(li)
325 li.show() 316 li.show()
326 317
@@ -329,7 +320,6 @@ if __name__ == "__main__":
329 320
330 li.go() 321 li.go()
331 322
332 win.resize(320,520)
333 win.show() 323 win.show()
334 elementary.run() 324 elementary.run()
335 elementary.shutdown() 325 elementary.shutdown()
diff --git a/examples/elementary/test_actionslider.py b/examples/elementary/test_actionslider.py
index 5af6446..17cc090 100644
--- a/examples/elementary/test_actionslider.py
+++ b/examples/elementary/test_actionslider.py
@@ -71,11 +71,10 @@ def actionslider_clicked(obj):
71 win.resize_object_add(bx) 71 win.resize_object_add(bx)
72 bx.show() 72 bx.show()
73 73
74 acts = Actionslider(win, 74 acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
75 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0), 75 size_hint_align=(EVAS_HINT_FILL, 0.0),
76 indicator_pos=ELM_ACTIONSLIDER_RIGHT, magnet_pos=ELM_ACTIONSLIDER_RIGHT, 76 indicator_pos=ELM_ACTIONSLIDER_RIGHT, magnet_pos=ELM_ACTIONSLIDER_RIGHT,
77 enabled_pos=(ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) 77 enabled_pos=(ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT))
78 )
79 acts.part_text_set("left", "Snooze") 78 acts.part_text_set("left", "Snooze")
80 acts.part_text_set("center", "") 79 acts.part_text_set("center", "")
81 acts.part_text_set("right", "Stop") 80 acts.part_text_set("right", "Stop")
@@ -84,12 +83,11 @@ def actionslider_clicked(obj):
84 bx.pack_end(acts) 83 bx.pack_end(acts)
85 acts.show() 84 acts.show()
86 85
87 acts = Actionslider(win, 86 acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
88 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0), 87 size_hint_align=(EVAS_HINT_FILL, 0.0),
89 indicator_pos=ELM_ACTIONSLIDER_CENTER, 88 indicator_pos=ELM_ACTIONSLIDER_CENTER,
90 magnet_pos=ELM_ACTIONSLIDER_CENTER, 89 magnet_pos=ELM_ACTIONSLIDER_CENTER,
91 enabled_pos=(ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) 90 enabled_pos=(ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT))
92 )
93 acts.part_text_set("left", "Snooze") 91 acts.part_text_set("left", "Snooze")
94 acts.part_text_set("center", "") 92 acts.part_text_set("center", "")
95 acts.part_text_set("right", "Stop") 93 acts.part_text_set("right", "Stop")
@@ -97,12 +95,11 @@ def actionslider_clicked(obj):
97 bx.pack_end(acts) 95 bx.pack_end(acts)
98 acts.show() 96 acts.show()
99 97
100 acts = Actionslider(win, style="bar", 98 acts = Actionslider(win, style="bar", size_hint_weight=EXPAND_HORIZ,
101 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0), 99 size_hint_align=(EVAS_HINT_FILL, 0.0),
102 indicator_pos=ELM_ACTIONSLIDER_LEFT, 100 indicator_pos=ELM_ACTIONSLIDER_LEFT,
103 magnet_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT), 101 magnet_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT),
104 enabled_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT) 102 enabled_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT))
105 )
106 acts.part_text_set("left", "") 103 acts.part_text_set("left", "")
107 acts.part_text_set("center", "Accept") 104 acts.part_text_set("center", "Accept")
108 acts.part_text_set("right", "Reject") 105 acts.part_text_set("right", "Reject")
@@ -112,8 +109,7 @@ def actionslider_clicked(obj):
112 109
113 acts = Actionslider(win, style="bar", text="Go", 110 acts = Actionslider(win, style="bar", text="Go",
114 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0), 111 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0),
115 indicator_pos=ELM_ACTIONSLIDER_LEFT, magnet_pos=ELM_ACTIONSLIDER_LEFT, 112 indicator_pos=ELM_ACTIONSLIDER_LEFT, magnet_pos=ELM_ACTIONSLIDER_LEFT)
116 )
117 acts.part_text_set("left", "") 113 acts.part_text_set("left", "")
118 acts.part_text_set("center", "Accept") 114 acts.part_text_set("center", "Accept")
119 acts.part_text_set("right", "Reject") 115 acts.part_text_set("right", "Reject")
@@ -122,10 +118,9 @@ def actionslider_clicked(obj):
122 bx.pack_end(acts) 118 bx.pack_end(acts)
123 acts.show() 119 acts.show()
124 120
125 acts = Actionslider(win, 121 acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
126 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0), 122 size_hint_align=(EVAS_HINT_FILL, 0.0),
127 indicator_pos=ELM_ACTIONSLIDER_LEFT, magnet_pos=ELM_ACTIONSLIDER_ALL 123 indicator_pos=ELM_ACTIONSLIDER_LEFT, magnet_pos=ELM_ACTIONSLIDER_ALL)
128 )
129 acts.part_text_set("left", "Left") 124 acts.part_text_set("left", "Left")
130 acts.part_text_set("center", "Center") 125 acts.part_text_set("center", "Center")
131 acts.part_text_set("right", "Right") 126 acts.part_text_set("right", "Right")
@@ -134,11 +129,10 @@ def actionslider_clicked(obj):
134 bx.pack_end(acts) 129 bx.pack_end(acts)
135 acts.show() 130 acts.show()
136 131
137 acts = Actionslider(win, 132 acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
138 size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0), 133 size_hint_align=(EVAS_HINT_FILL, 0.0),
139 indicator_pos=ELM_ACTIONSLIDER_CENTER, 134 indicator_pos=ELM_ACTIONSLIDER_CENTER,
140 magnet_pos=ELM_ACTIONSLIDER_CENTER 135 magnet_pos=ELM_ACTIONSLIDER_CENTER)
141 )
142 acts.part_text_set("left", "Enable") 136 acts.part_text_set("left", "Enable")
143 acts.part_text_set("center", "Magnet") 137 acts.part_text_set("center", "Magnet")
144 acts.part_text_set("right", "Disable") 138 acts.part_text_set("right", "Disable")
diff --git a/examples/elementary/test_bg.py b/examples/elementary/test_bg.py
index 00242eb..8e1d66a 100644
--- a/examples/elementary/test_bg.py
+++ b/examples/elementary/test_bg.py
@@ -19,8 +19,7 @@ ic_file = os.path.join(img_path, "plant_01.jpg")
19 19
20def bg_plain_clicked(obj, item=None): 20def bg_plain_clicked(obj, item=None):
21 win = Window("bg plain", ELM_WIN_BASIC, title="Bg Plain", autodel=True, 21 win = Window("bg plain", ELM_WIN_BASIC, title="Bg Plain", autodel=True,
22 size=(320, 320) 22 size=(320, 320))
23 )
24 23
25 bg = Background(win, size_hint_weight=EXPAND_BOTH) 24 bg = Background(win, size_hint_weight=EXPAND_BOTH)
26 win.resize_object_add(bg) 25 win.resize_object_add(bg)
@@ -31,12 +30,10 @@ def bg_plain_clicked(obj, item=None):
31 30
32def bg_image_clicked(obj, item=None): 31def bg_image_clicked(obj, item=None):
33 win = Window("bg-image", ELM_WIN_BASIC, title="Bg Image", autodel=True, 32 win = Window("bg-image", ELM_WIN_BASIC, title="Bg Image", autodel=True,
34 size=(320, 320), size_hint_min=(160, 160), size_hint_max=(320,320) 33 size=(320, 320), size_hint_min=(160, 160), size_hint_max=(320,320))
35 )
36 34
37 bg = Background(win, file=ic_file, option=ELM_BG_OPTION_SCALE, 35 bg = Background(win, file=ic_file, option=ELM_BG_OPTION_SCALE,
38 size_hint_weight=EXPAND_BOTH 36 size_hint_weight=EXPAND_BOTH)
39 )
40 win.resize_object_add(bg) 37 win.resize_object_add(bg)
41 bg.show() 38 bg.show()
42 39
diff --git a/examples/elementary/test_box.py b/examples/elementary/test_box.py
index c1b88fe..9f0ea30 100644
--- a/examples/elementary/test_box.py
+++ b/examples/elementary/test_box.py
@@ -48,8 +48,7 @@ def box_vert2_clicked(obj, item=None):
48 48
49 for i in range(5): 49 for i in range(5):
50 bt = Button(win, text="Button %d" % i, 50 bt = Button(win, text="Button %d" % i,
51 size_hint_align=FILL_BOTH, size_hint_weight=(0.0, 0.0) 51 size_hint_align=FILL_BOTH, size_hint_weight=(0.0, 0.0))
52 )
53 bt.callback_clicked_add(boxvert2_del_cb, bx) 52 bt.callback_clicked_add(boxvert2_del_cb, bx)
54 bx.pack_end(bt) 53 bx.pack_end(bt)
55 bt.show() 54 bt.show()
@@ -73,7 +72,8 @@ def box_horiz_clicked(obj, item=None):
73 72
74layout_list = ["horizontal","vertical","homogeneous_vertical", 73layout_list = ["horizontal","vertical","homogeneous_vertical",
75 "homogeneous_horizontal", "homogeneous_max_size_horizontal", 74 "homogeneous_horizontal", "homogeneous_max_size_horizontal",
76 "homogeneous_max_size_vertical", "flow_horizontal", "flow_vertical", "stack"] 75 "homogeneous_max_size_vertical", "flow_horizontal", "flow_vertical",
76 "stack"]
77current_layout = ELM_BOX_LAYOUT_HORIZONTAL 77current_layout = ELM_BOX_LAYOUT_HORIZONTAL
78 78
79 79
@@ -109,7 +109,8 @@ def box_layout_clicked(obj, item=None):
109 bt.show() 109 bt.show()
110 110
111 for i in range(5): 111 for i in range(5):
112 ic = Icon(win, file=ic_file, resizable=(0, 0), size_hint_align=(0.5, 0.5)) 112 ic = Icon(win, file=ic_file, resizable=(0, 0),
113 size_hint_align=(0.5, 0.5))
113 bx.pack_end(ic) 114 bx.pack_end(ic)
114 ic.show() 115 ic.show()
115 116
@@ -159,7 +160,8 @@ def box_transition_clicked(obj, item=None):
159 bt.show() 160 bt.show()
160 161
161 for i in range(4): 162 for i in range(4):
162 ic = Icon(win, file=ic_file, resizable=(0, 0), size_hint_align=(0.5, 0.5)) 163 ic = Icon(win, file=ic_file, resizable=(0, 0),
164 size_hint_align=(0.5, 0.5))
163 bx.pack_end(ic) 165 bx.pack_end(ic)
164 ic.show() 166 ic.show()
165 167
@@ -168,7 +170,8 @@ def box_transition_clicked(obj, item=None):
168 170
169if __name__ == "__main__": 171if __name__ == "__main__":
170 elementary.init() 172 elementary.init()
171 win = StandardWindow("test", "python-elementary test application", size=(320,520)) 173 win = StandardWindow("test", "python-elementary test application",
174 size=(320,520))
172 win.callback_delete_request_add(lambda x: elementary.exit()) 175 win.callback_delete_request_add(lambda x: elementary.exit())
173 176
174 box0 = Box(win, size_hint_weight=EXPAND_BOTH) 177 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
diff --git a/examples/elementary/test_bubble.py b/examples/elementary/test_bubble.py
index 78a1d24..89fec4b 100644
--- a/examples/elementary/test_bubble.py
+++ b/examples/elementary/test_bubble.py
@@ -31,19 +31,21 @@ def bubble_clicked(obj, item=None):
31 bx.show() 31 bx.show()
32 32
33 # bb 1 33 # bb 1
34 ic = Icon(win, file=ic_file, size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1)) 34 ic = Icon(win, file=ic_file,
35 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
35 lb = Label(win, text="Blah, Blah, Blah") 36 lb = Label(win, text="Blah, Blah, Blah")
36 37
37 bb = Bubble(win, text = "Message 1", content = lb, 38 bb = Bubble(win, text = "Message 1", content = lb,
38 pos = ELM_BUBBLE_POS_TOP_LEFT, 39 pos = ELM_BUBBLE_POS_TOP_LEFT, size_hint_weight = EXPAND_BOTH,
39 size_hint_weight = EXPAND_BOTH, size_hint_align = FILL_BOTH) 40 size_hint_align = FILL_BOTH)
40 bb.part_text_set("info", "Corner: top_left") 41 bb.part_text_set("info", "Corner: top_left")
41 bb.part_content_set("icon", ic) 42 bb.part_content_set("icon", ic)
42 bx.pack_end(bb) 43 bx.pack_end(bb)
43 bb.show() 44 bb.show()
44 45
45 # bb 2 46 # bb 2
46 ic = Icon(win, file=ic_file, size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1)) 47 ic = Icon(win, file=ic_file,
48 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
47 lb = Label(win, text="Blah, Blah, Blah") 49 lb = Label(win, text="Blah, Blah, Blah")
48 50
49 bb = Bubble(win, text = "Message 2", content = lb, 51 bb = Bubble(win, text = "Message 2", content = lb,
@@ -55,7 +57,8 @@ def bubble_clicked(obj, item=None):
55 bb.show() 57 bb.show()
56 58
57 # bb 3 59 # bb 3
58 ic = Icon(win, file=ic_file, size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1)) 60 ic = Icon(win, file=ic_file,
61 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
59 lb = Label(win, text="Blah, Blah, Blah") 62 lb = Label(win, text="Blah, Blah, Blah")
60 63
61 bb = Bubble(win, text = "Message 3", content = ic, 64 bb = Bubble(win, text = "Message 3", content = ic,
@@ -66,7 +69,8 @@ def bubble_clicked(obj, item=None):
66 bb.show() 69 bb.show()
67 70
68 # bb 4 71 # bb 4
69 ic = Icon(win, file=ic_file, size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1)) 72 ic = Icon(win, file=ic_file,
73 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
70 lb = Label(win, text="Blah, Blah, Blah") 74 lb = Label(win, text="Blah, Blah, Blah")
71 75
72 bb = Bubble(win, text = "Message 4", content = lb, 76 bb = Bubble(win, text = "Message 4", content = lb,
@@ -82,7 +86,8 @@ def bubble_clicked(obj, item=None):
82 86
83if __name__ == "__main__": 87if __name__ == "__main__":
84 elementary.init() 88 elementary.init()
85 win = StandardWindow("test", "python-elementary test application", size=(320,520)) 89 win = StandardWindow("test", "python-elementary test application",
90 size=(320,520))
86 win.callback_delete_request_add(lambda x: elementary.exit()) 91 win.callback_delete_request_add(lambda x: elementary.exit())
87 92
88 box0 = Box(win, size_hint_weight=EXPAND_BOTH) 93 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
diff --git a/examples/elementary/test_button.py b/examples/elementary/test_button.py
index da44d08..b5e6377 100644
--- a/examples/elementary/test_button.py
+++ b/examples/elementary/test_button.py
@@ -26,7 +26,8 @@ def buttons_clicked(obj):
26 win.resize_object_add(bx) 26 win.resize_object_add(bx)
27 bx.show() 27 bx.show()
28 28
29 ic = Icon(win, file=ic_file, size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1)) 29 ic = Icon(win, file=ic_file,
30 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
30 ic.show() 31 ic.show()
31 bt = Button(win, text="Icon sized to button", content=ic) 32 bt = Button(win, text="Icon sized to button", content=ic)
32 bx.pack_end(bt) 33 bx.pack_end(bt)
diff --git a/examples/elementary/test_calendar.py b/examples/elementary/test_calendar.py
index 15d6d9a..f774653 100644
--- a/examples/elementary/test_calendar.py
+++ b/examples/elementary/test_calendar.py
@@ -103,8 +103,7 @@ def calendar_clicked(obj):
103 the_time = datetime(2010, 12, 31) 103 the_time = datetime(2010, 12, 31)
104 cal = Calendar(win, first_day_of_week=ELM_DAY_MONDAY, 104 cal = Calendar(win, first_day_of_week=ELM_DAY_MONDAY,
105 size_hint_weight=EXPAND_BOTH, selected_time=the_time, 105 size_hint_weight=EXPAND_BOTH, selected_time=the_time,
106 min_max_year=(2010,2012) 106 min_max_year=(2010,2012))
107 )
108 bx.pack_end(cal) 107 bx.pack_end(cal)
109 108
110 cal.show() 109 cal.show()
diff --git a/examples/elementary/test_clock.py b/examples/elementary/test_clock.py
index ac98c34..239c3de 100644
--- a/examples/elementary/test_clock.py
+++ b/examples/elementary/test_clock.py
@@ -36,7 +36,8 @@ def clock_clicked(obj):
36 bx.pack_end(ck) 36 bx.pack_end(ck)
37 ck.show() 37 ck.show()
38 38
39 ck = Clock(win, edit=True, show_seconds=True, show_am_pm=True, time=(10, 11, 12)) 39 ck = Clock(win, edit=True, show_seconds=True, show_am_pm=True,
40 time=(10, 11, 12))
40 bx.pack_end(ck) 41 bx.pack_end(ck)
41 ck.show() 42 ck.show()
42 43
diff --git a/examples/elementary/test_cnp.py b/examples/elementary/test_cnp.py
index 11cea70..3aa7533 100644
--- a/examples/elementary/test_cnp.py
+++ b/examples/elementary/test_cnp.py
@@ -41,8 +41,7 @@ def cnp_clicked(obj):
41 41
42 en = Entry(win, scrollable=True, line_wrap=ELM_WRAP_CHAR, 42 en = Entry(win, scrollable=True, line_wrap=ELM_WRAP_CHAR,
43 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 43 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
44 text="Elementary provides " 44 text="Elementary provides ")
45 )
46 gd.pack(en, 10, 10, 60, 30) 45 gd.pack(en, 10, 10, 60, 30)
47 en.show() 46 en.show()
48 47
@@ -58,8 +57,7 @@ def cnp_clicked(obj):
58 57
59 en = Entry(win, scrollable=True, line_wrap=ELM_WRAP_CHAR, 58 en = Entry(win, scrollable=True, line_wrap=ELM_WRAP_CHAR,
60 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, 59 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
61 text="rich copying and pasting functionality," 60 text="rich copying and pasting functionality,")
62 )
63 gd.pack(en, 10, 40, 60, 30) 61 gd.pack(en, 10, 40, 60, 30)
64 en.show() 62 en.show()
65 63
@@ -68,15 +66,14 @@ def cnp_clicked(obj):
68 gd.pack(bt, 70, 40, 22, 30) 66 gd.pack(bt, 70, 40, 22, 30)
69 bt.show() 67 bt.show()
70 68
71 lb = Label(win, text="<b>Clipboard:</b>", 69 lb = Label(win, text="<b>Clipboard:</b>", size_hint_weight=(0.0, 0.0),
72 size_hint_weight=(0.0, 0.0), size_hint_align=FILL_BOTH 70 size_hint_align=FILL_BOTH)
73 )
74 gd.pack(lb, 10, 70, 60, 10) 71 gd.pack(lb, 10, 70, 60, 10)
75 lb.show() 72 lb.show()
76 73
77 global glb 74 global glb
78 glb = Label(win, text="", 75 glb = Label(win, text="", size_hint_weight=(0.0, 0.0),
79 size_hint_weight=(0.0, 0.0), size_hint_align=FILL_BOTH) 76 size_hint_align=FILL_BOTH)
80 gd.pack(glb, 10, 80, 60, 10) 77 gd.pack(glb, 10, 80, 60, 10)
81 glb.show() 78 glb.show()
82 79
diff --git a/examples/elementary/test_colorselector.py b/examples/elementary/test_colorselector.py
index f84d267..0ef99fa 100644
--- a/examples/elementary/test_colorselector.py
+++ b/examples/elementary/test_colorselector.py
@@ -42,8 +42,7 @@ def cb_cs_item_lp(cs, item, rect):
42 42
43def colorselector_clicked(obj): 43def colorselector_clicked(obj):
44 win = StandardWindow("colorselector", "ColorSelector test", 44 win = StandardWindow("colorselector", "ColorSelector test",
45 autodel=True, size=(350,350) 45 autodel=True, size=(350,350))
46 )
47 if obj is None: 46 if obj is None:
48 win.callback_delete_request_add(lambda o: elementary.exit()) 47 win.callback_delete_request_add(lambda o: elementary.exit())
49 48
@@ -56,23 +55,19 @@ def colorselector_clicked(obj):
56 re.show() 55 re.show()
57 56
58 fr = Frame(win, text="Color View", content=re, 57 fr = Frame(win, text="Color View", content=re,
59 size_hint_weight=EXPAND_HORIZ, 58 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
60 size_hint_align=FILL_BOTH
61 )
62 vbox.pack_end(fr) 59 vbox.pack_end(fr)
63 fr.show() 60 fr.show()
64 61
65 cs = Colorselector(win, size_hint_weight=EXPAND_BOTH, 62 cs = Colorselector(win, size_hint_weight=EXPAND_BOTH,
66 size_hint_align=FILL_BOTH, color=(255, 160, 132, 255) 63 size_hint_align=FILL_BOTH, color=(255, 160, 132, 255))
67 )
68 cs.callback_changed_add(cb_cs_changed, re) 64 cs.callback_changed_add(cb_cs_changed, re)
69 cs.callback_color_item_selected_add(cb_cs_item_sel, re) 65 cs.callback_color_item_selected_add(cb_cs_item_sel, re)
70 cs.callback_color_item_longpressed_add(cb_cs_item_lp, re) 66 cs.callback_color_item_longpressed_add(cb_cs_item_lp, re)
71 cs.show() 67 cs.show()
72 68
73 fr = Frame(win, text="Color Selector", content=cs, 69 fr = Frame(win, text="Color Selector", content=cs,
74 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH 70 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
75 )
76 vbox.pack_end(fr) 71 vbox.pack_end(fr)
77 fr.show() 72 fr.show()
78 73
@@ -91,28 +86,24 @@ def colorselector_clicked(obj):
91 cs.palette_color_add(133, 100, 255, 255) 86 cs.palette_color_add(133, 100, 255, 255)
92 87
93 hbox = Box(win, horizontal=True, size_hint_align=FILL_AND_ALIGN_TOP, 88 hbox = Box(win, horizontal=True, size_hint_align=FILL_AND_ALIGN_TOP,
94 size_hint_weight=EXPAND_HORIZ 89 size_hint_weight=EXPAND_HORIZ)
95 )
96 vbox.pack_end(hbox) 90 vbox.pack_end(hbox)
97 hbox.show() 91 hbox.show()
98 92
99 bt = Button(win, text="Palette", size_hint_align=FILL_AND_ALIGN_TOP, 93 bt = Button(win, text="Palette", size_hint_align=FILL_AND_ALIGN_TOP,
100 size_hint_weight=EXPAND_HORIZ 94 size_hint_weight=EXPAND_HORIZ)
101 )
102 bt.callback_clicked_add(lambda btn: cs.mode_set(ELM_COLORSELECTOR_PALETTE)) 95 bt.callback_clicked_add(lambda btn: cs.mode_set(ELM_COLORSELECTOR_PALETTE))
103 hbox.pack_end(bt) 96 hbox.pack_end(bt)
104 bt.show() 97 bt.show()
105 98
106 bt = Button(win, text="Components", size_hint_align=FILL_AND_ALIGN_TOP, 99 bt = Button(win, text="Components", size_hint_align=FILL_AND_ALIGN_TOP,
107 size_hint_weight=EXPAND_HORIZ 100 size_hint_weight=EXPAND_HORIZ)
108 )
109 bt.callback_clicked_add(lambda btn: cs.mode_set(ELM_COLORSELECTOR_COMPONENTS)) 101 bt.callback_clicked_add(lambda btn: cs.mode_set(ELM_COLORSELECTOR_COMPONENTS))
110 hbox.pack_end(bt) 102 hbox.pack_end(bt)
111 bt.show() 103 bt.show()
112 104
113 bt = Button(win, text="Both", size_hint_align=FILL_AND_ALIGN_TOP, 105 bt = Button(win, text="Both", size_hint_align=FILL_AND_ALIGN_TOP,
114 size_hint_weight=EXPAND_HORIZ 106 size_hint_weight=EXPAND_HORIZ)
115 )
116 bt.callback_clicked_add(lambda btn: cs.mode_set(ELM_COLORSELECTOR_BOTH)) 107 bt.callback_clicked_add(lambda btn: cs.mode_set(ELM_COLORSELECTOR_BOTH))
117 hbox.pack_end(bt) 108 hbox.pack_end(bt)
118 bt.show() 109 bt.show()
diff --git a/examples/elementary/test_config.py b/examples/elementary/test_config.py
index 345facd..19f8265 100644
--- a/examples/elementary/test_config.py
+++ b/examples/elementary/test_config.py
@@ -20,6 +20,11 @@ elm_conf = Configuration()
20 20
21from efl.evas import EVAS_HINT_FILL, EVAS_HINT_EXPAND 21from efl.evas import EVAS_HINT_FILL, EVAS_HINT_EXPAND
22 22
23EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
24EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
25FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
26FILL_HORIZ = EVAS_HINT_FILL, 0.5
27
23class Prof_Data(object): 28class Prof_Data(object):
24 rdg = None 29 rdg = None
25 cks = [] 30 cks = []
@@ -36,10 +41,8 @@ class App_Data(object):
36MAX_PROFILES = 20 41MAX_PROFILES = 20
37 42
38def LOG(win, m): 43def LOG(win, m):
39 lb = Label(win) 44 lb = Label(win, text=m, size_hint_weight=(0.0, 0.0),
40 lb.text = m 45 size_hint_align=FILL_BOTH)
41 lb.size_hint_weight = 0.0, 0.0
42 lb.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
43 lb.show() 46 lb.show()
44 return lb 47 return lb
45 48
@@ -117,29 +120,23 @@ def radio_add(win, bx):
117 120
118 i = 0 121 i = 0
119 122
120 bx2 = Box(win) 123 bx2 = Box(win, size_hint_weight=EXPAND_HORIZ,
121 bx2.size_hint_weight = EVAS_HINT_EXPAND, 0.0 124 size_hint_align=(EVAS_HINT_FILL, 0.0), align=(0.0, 0.5),
122 bx2.size_hint_align = EVAS_HINT_FILL, 0.0 125 horizontal = True)
123 bx2.align = 0.0, 0.5
124 bx2.horizontal = True
125 bx.pack_end(bx2) 126 bx.pack_end(bx2)
126 bx2.show() 127 bx2.show()
127 128
128 rdg = rd = Radio(win) 129 rdg = rd = Radio(win, state_value=i, text="Nothing",
129 rd.state_value = i 130 size_hint_weight=EXPAND_BOTH)
130 rd.group_add(rdg) 131 rd.group_add(rdg)
131 rd.text = "Nothing"
132 rd.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
133 bx2.pack_end(rd) 132 bx2.pack_end(rd)
134 rd.show() 133 rd.show()
135 i += 1 134 i += 1
136 135
137 for profile in ad.profiles: 136 for profile in ad.profiles:
138 rd = Radio(win) 137 rd = Radio(win, state_value=i, text=profile,
139 rd.state_value = i 138 size_hint_weight=EXPAND_BOTH)
140 rd.group_add(rdg) 139 rd.group_add(rdg)
141 rd.text = profile
142 rd.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
143 bx2.pack_end(rd) 140 bx2.pack_end(rd)
144 rd.show() 141 rd.show()
145 i += 1 142 i += 1
@@ -149,21 +146,17 @@ def radio_add(win, bx):
149def check_add(win, bx): 146def check_add(win, bx):
150 ad = win.data["ad"] 147 ad = win.data["ad"]
151 148
152 bx2 = Box(win) 149 bx2 = Box(win, size_hint_weight=EXPAND_HORIZ,
153 bx2.size_hint_weight = EVAS_HINT_EXPAND, 0.0 150 size_hint_align=(EVAS_HINT_FILL, 0.0), align=(0.0, 0.5),
154 bx2.size_hint_align = EVAS_HINT_FILL, 0.0 151 horizontal=True)
155 bx2.align = 0.0, 0.5
156 bx2.horizontal = True
157 bx.pack_end(bx2) 152 bx.pack_end(bx2)
158 bx2.show() 153 bx2.show()
159 154
160 ll = [] 155 ll = []
161 156
162 for profile in ad.profiles: 157 for profile in ad.profiles:
163 ck = Check(win) 158 ck = Check(win, text=profile, size_hint_weight=EXPAND_BOTH)
164 ck.text = profile
165 ck.data["profile"] = profile 159 ck.data["profile"] = profile
166 ck.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
167 bx2.pack_end(ck) 160 bx2.pack_end(ck)
168 ck.show() 161 ck.show()
169 162
@@ -172,17 +165,15 @@ def check_add(win, bx):
172 return ll 165 return ll
173 166
174def inlined_add(parent): 167def inlined_add(parent):
175 win = Window("inlined", ELM_WIN_INLINED_IMAGE, parent) 168 win = Window("inlined", ELM_WIN_INLINED_IMAGE, parent, pos=(10, 100),
169 size=(150, 70))
176 170
177 bg = Background(win) 171 bg = Background(win, color=(110, 210, 120), size_hint_weight=EXPAND_BOTH)
178 bg.color = 110, 210, 120
179 bg.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
180 win.resize_object_add(bg) 172 win.resize_object_add(bg)
181 bg.show() 173 bg.show()
182 174
183 bx = Box(win) 175 bx = Box(win, size_hint_weight=EXPAND_HORIZ,
184 bx.size_hint_weight = EVAS_HINT_EXPAND, 0.0 176 size_hint_align=(EVAS_HINT_FILL, 0.0))
185 bx.size_hint_align = EVAS_HINT_FILL, 0.0
186 bx.show() 177 bx.show()
187 178
188 lb = LOG(win, "ELM_WIN_INLINED_IMAGE") 179 lb = LOG(win, "ELM_WIN_INLINED_IMAGE")
@@ -192,8 +183,6 @@ def inlined_add(parent):
192 bx.pack_end(lb) 183 bx.pack_end(lb)
193 win.data["lb"] = lb 184 win.data["lb"] = lb
194 185
195 win.pos = 10, 100
196 win.size = 150, 70
197 win.inlined_image_object.pos = 10, 100 186 win.inlined_image_object.pos = 10, 100
198 win.inlined_image_object.size = 150, 70 187 win.inlined_image_object.size = 150, 70
199 188
@@ -203,7 +192,8 @@ def inlined_add(parent):
203 return win 192 return win
204 193
205def socket_add(name): 194def socket_add(name):
206 win = Window("socket image", ELM_WIN_SOCKET_IMAGE) 195 win = Window("socket image", ELM_WIN_SOCKET_IMAGE, pos=(0, 0),
196 size=(150, 200))
207 197
208 try: 198 try:
209 win.socket_listen(name, 0, False) 199 win.socket_listen(name, 0, False)
@@ -214,15 +204,12 @@ def socket_add(name):
214 else: 204 else:
215 win.autodel = True 205 win.autodel = True
216 206
217 bg = Background(win) 207 bg = Background(win, color=(80, 110, 205), size_hint_weight=EXPAND_BOTH)
218 bg.color = 80, 110, 205
219 bg.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
220 win.resize_object_add(bg) 208 win.resize_object_add(bg)
221 bg.show() 209 bg.show()
222 210
223 bx = Box(win) 211 bx = Box(win, size_hint_weight=EXPAND_HORIZ,
224 bx.size_hint_weight = EVAS_HINT_EXPAND, 0.0 212 size_hint_align=(EVAS_HINT_FILL, 0.0))
225 bx.size_hint_align = EVAS_HINT_FILL, 0.0
226 bx.show() 213 bx.show()
227 214
228 lb = LOG(win, "ELM_WIN_SOCKET_IMAGE") 215 lb = LOG(win, "ELM_WIN_SOCKET_IMAGE")
@@ -234,24 +221,18 @@ def socket_add(name):
234 221
235 inlined_add(win) 222 inlined_add(win)
236 223
237 win.pos = 0, 0
238 win.size = 150, 200
239
240 win.callback_profile_changed_add(win_profile_changed_cb) 224 win.callback_profile_changed_add(win_profile_changed_cb)
241 win.show() 225 win.show()
242 return win 226 return win
243 227
244def plug_add(win, bx, name): 228def plug_add(win, bx, name):
245 plug = Plug(win) 229 plug = Plug(win, size_hint_weight=EXPAND_BOTH)
246 230
247 if plug.connect(name, 0, False): 231 if plug.connect(name, 0, False):
248 ly = Layout(win) 232 ly = Layout(win, file=("test.edj", "win_config"),
249 ly.file = "test.edj", "win_config" 233 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
250 ly.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
251 ly.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
252 ly.show() 234 ly.show()
253 235
254 plug.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
255 bx.pack_end(ly) 236 bx.pack_end(ly)
256 ly.part_content_set("swallow", plug) 237 ly.part_content_set("swallow", plug)
257 plug.show() 238 plug.show()
@@ -263,47 +244,38 @@ def plug_add(win, bx, name):
263 return plug 244 return plug
264 245
265def FRAME(win, bx, t): 246def FRAME(win, bx, t):
266 fr = Frame(bx) 247 bx2 = Box(win, size_hint_weight=EXPAND_HORIZ,
267 fr.text = t 248 size_hint_align=(EVAS_HINT_FILL, 0.0), align=(0.0, 0.5))
268 fr.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 249 bx2.show()
269 fr.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL 250 fr = Frame(bx, text=t, content=bx2, size_hint_weight=EXPAND_BOTH,
251 size_hint_align=FILL_BOTH)
270 bx.pack_end(fr) 252 bx.pack_end(fr)
271 fr.show() 253 fr.show()
272 bx2 = Box(win)
273 bx2.size_hint_weight = EVAS_HINT_EXPAND, 0.0
274 bx2.size_hint_align = EVAS_HINT_FILL, 0.0
275 bx2.align = 0.0, 0.5
276 fr.content = bx2
277 bx2.show()
278 return fr, bx2 254 return fr, bx2
279 255
280def config_clicked(obj, data=None): 256def config_clicked(obj, data=None):
281 siname = "_TestConfigSocketImage_" 257 siname = "_TestConfigSocketImage_"
282 258
283 win = StandardWindow("config", "Configuration") 259 win = StandardWindow("config", "Configuration", autodel=True,
284 win.autodel = True 260 size=(400,500))
285 global ad 261 global ad
286 ad = App_Data() 262 ad = App_Data()
287 win.data["ad"] = ad 263 win.data["ad"] = ad
288 ad.win = win 264 ad.win = win
289 ad.profiles = elm_conf.profile_list 265 ad.profiles = elm_conf.profile_list
290 266
291 sc = Scroller(win) 267 bx = Box(win, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
292 sc.bounce = False, True 268 sc = Scroller(win, content=bx, bounce=(False, True),
293 sc.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 269 size_hint_weight=EXPAND_BOTH)
294 win.resize_object_add(sc) 270 win.resize_object_add(sc)
295 271
296 bx = Box(win)
297 bx.size_hint_weight = EVAS_HINT_EXPAND, 0.0
298 bx.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
299 sc.content = bx
300
301 fr, bx2 = FRAME(win, bx, "Current window profile") 272 fr, bx2 = FRAME(win, bx, "Current window profile")
302 # TODO: Add this code 273 # TODO: Add this code
303 #ee = ecore_evas_ecore_evas_get(evas_object_evas_get(win)); 274 #ee = ecore_evas_ecore_evas_get(evas_object_evas_get(win));
304 #supported = ecore_evas_window_profile_supported_get(ee); 275 #supported = ecore_evas_window_profile_supported_get(ee);
305 supported = True 276 supported = True
306 buf = "Virtual desktop window profile support: <b>{0}</b>".format("Yes" if supported else "No") 277 buf = "Virtual desktop window profile support: <b>{0}</b>".format(
278 "Yes" if supported else "No")
307 lb = LOG(win, buf) 279 lb = LOG(win, buf)
308 bx2.pack_end(lb) 280 bx2.pack_end(lb)
309 281
@@ -315,8 +287,7 @@ def config_clicked(obj, data=None):
315 bx2.pack_end(lb) 287 bx2.pack_end(lb)
316 ad.curr.rdg = radio_add(win, bx2) 288 ad.curr.rdg = radio_add(win, bx2)
317 289
318 bt = Button(win) 290 bt = Button(win, text="Set")
319 bt.text = "Set"
320 bt.callback_clicked_add(bt_profile_set, win) 291 bt.callback_clicked_add(bt_profile_set, win)
321 bx2.pack_end(bt) 292 bx2.pack_end(bt)
322 bt.show() 293 bt.show()
@@ -325,8 +296,7 @@ def config_clicked(obj, data=None):
325 bx2.pack_end(lb) 296 bx2.pack_end(lb)
326 ad.curr.cks = check_add(win, bx2) 297 ad.curr.cks = check_add(win, bx2)
327 298
328 bt = Button(win) 299 bt = Button(win, text="Set")
329 bt.text = "Set"
330 bt.callback_clicked_add(bt_available_profiles_set, win) 300 bt.callback_clicked_add(bt_available_profiles_set, win)
331 bx2.pack_end(bt) 301 bx2.pack_end(bt)
332 bt.show() 302 bt.show()
@@ -336,7 +306,10 @@ def config_clicked(obj, data=None):
336 lb = LOG(win, "Starting socket image.") 306 lb = LOG(win, "Starting socket image.")
337 bx2.pack_end(lb) 307 bx2.pack_end(lb)
338 else: 308 else:
339 lb = LOG(win, "Failed to create socket.<br/>Please check whether another test configuration window is<br/>already running and providing socket image.") 309 lb = LOG(win,
310 "Failed to create socket.<br/>Please check whether another "
311 "test configuration window is<br/>already running and providing "
312 "socket image.")
340 bx2.pack_end(lb) 313 bx2.pack_end(lb)
341 314
342 fr, bx2 = FRAME(win, bx, "Plug") 315 fr, bx2 = FRAME(win, bx, "Plug")
@@ -353,8 +326,7 @@ def config_clicked(obj, data=None):
353 bx2.pack_end(lb) 326 bx2.pack_end(lb)
354 ad.new.cks = check_add(win, bx2) 327 ad.new.cks = check_add(win, bx2)
355 328
356 bt = Button(win) 329 bt = Button(win, text="Create")
357 bt.text = "Create"
358 bt.callback_clicked_add(bt_win_add, win) 330 bt.callback_clicked_add(bt_win_add, win)
359 bx2.pack_end(bt) 331 bx2.pack_end(bt)
360 bt.show() 332 bt.show()
@@ -375,7 +347,6 @@ def config_clicked(obj, data=None):
375 bx.show() 347 bx.show()
376 sc.show() 348 sc.show()
377 349
378 win.size = 400, 500
379 win.show() 350 win.show()
380 351
381 352
diff --git a/examples/elementary/test_conform.py b/examples/elementary/test_conform.py
index d41a719..7af54f6 100644
--- a/examples/elementary/test_conform.py
+++ b/examples/elementary/test_conform.py
@@ -12,77 +12,66 @@ from efl.elementary.scroller import Scrollable
12 12
13from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL 13from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
14 14
15EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
16EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
17FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
18FILL_HORIZ = EVAS_HINT_FILL, 0.5
19
15class ScrollableEntry(Scrollable, Entry): 20class ScrollableEntry(Scrollable, Entry):
16 def __init__(self, canvas, *args, **kwargs): 21 def __init__(self, canvas, *args, **kwargs):
17 Entry.__init__(self, canvas) 22 Entry.__init__(self, canvas, *args, **kwargs)
18 self.scrollable = True 23 self.scrollable = True
19 24
20def conformant_clicked(obj, item=None): 25def conformant_clicked(obj, item=None):
21 win = StandardWindow("conformant", "Conformant") 26 win = StandardWindow("conformant", "Conformant", autodel=True,
22 win.autodel = True 27 conformant=True, size=(240,240))
23 win.conformant = True
24 28
25 conform = Conformant(win) 29 conform = Conformant(win, size_hint_weight=EXPAND_BOTH)
26 conform.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
27 win.resize_object_add(conform) 30 win.resize_object_add(conform)
28 conform.show() 31 conform.show()
29 32
30 bx = Box(win) 33 bx = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
31 bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
32 bx.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
33 34
34 en = ScrollableEntry(win) 35 en = ScrollableEntry(win, single_line=True, bounce=(True, False),
35 en.single_line = True 36 text="This is the top entry here", size_hint_weight=EXPAND_HORIZ,
36 en.bounce = True, False 37 size_hint_align=FILL_HORIZ)
37 en.text = "This is the top entry here"
38 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0
39 en.size_hint_align = EVAS_HINT_FILL, 0.5
40 en.show() 38 en.show()
41 bx.pack_end(en) 39 bx.pack_end(en)
42 40
43 btn = Button(win) 41 btn = Button(win, text="Test Conformant", size_hint_weight=EXPAND_HORIZ,
44 btn.text = "Test Conformant" 42 size_hint_align=FILL_BOTH)
45 btn.size_hint_weight = EVAS_HINT_EXPAND, 0.0
46 btn.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
47 bx.pack_end(btn) 43 bx.pack_end(btn)
48 btn.show() 44 btn.show()
49 45
50 en = ScrollableEntry(win) 46 en = ScrollableEntry(win, single_line=True, bounce=(True, False),
51 en.single_line = True 47 text="This is the middle entry here", size_hint_weight=EXPAND_HORIZ,
52 en.bounce = True, False 48 size_hint_align=FILL_HORIZ)
53 en.text = "This is the middle entry here"
54 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0
55 en.size_hint_align = EVAS_HINT_FILL, 0.5
56 en.show() 49 en.show()
57 bx.pack_end(en) 50 bx.pack_end(en)
58 51
59 btn = Button(win) 52 btn = Button(win, text="Test Conformant", size_hint_weight=EXPAND_BOTH,
60 btn.text = "Test Conformant" 53 size_hint_align=FILL_BOTH)
61 btn.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
62 btn.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
63 bx.pack_end(btn) 54 bx.pack_end(btn)
64 btn.show() 55 btn.show()
65 56
66 en = ScrollableEntry(win) 57 en = ScrollableEntry(win, bounce=(False, True),
67 en.bounce = False, True 58 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
68 en.text = "This is a multi-line entry at the bottom<br/>" \ 59 en.text = \
69 "This can contain more than 1 line of text and be " \ 60 "This is a multi-line entry at the bottom<br/>" \
70 "scrolled around to allow for entering of lots of " \ 61 "This can contain more than 1 line of text and be " \
71 "content. It is also to test to see that autoscroll " \ 62 "scrolled around to allow for entering of lots of " \
72 "moves to the right part of a larger multi-line " \ 63 "content. It is also to test to see that autoscroll " \
73 "text entry that is inside of a scroller than can be " \ 64 "moves to the right part of a larger multi-line " \
74 "scrolled around, thus changing the expected position " \ 65 "text entry that is inside of a scroller than can be " \
75 "as well as cursor changes updating auto-scroll when " \ 66 "scrolled around, thus changing the expected position " \
76 "it is enabled." 67 "as well as cursor changes updating auto-scroll when " \
77 en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 68 "it is enabled."
78 en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
79 en.show() 69 en.show()
80 bx.pack_end(en) 70 bx.pack_end(en)
81 71
82 conform.content = bx 72 conform.content = bx
83 bx.show() 73 bx.show()
84 74
85 win.size = 240, 240
86 win.show() 75 win.show()
87 76
88def popobj(obj, *args, **kwargs): 77def popobj(obj, *args, **kwargs):
@@ -90,63 +79,45 @@ def popobj(obj, *args, **kwargs):
90 nf.item_pop() 79 nf.item_pop()
91 80
92def conformant2_clicked(obj, item=None): 81def conformant2_clicked(obj, item=None):
93 win = StandardWindow("conformant2", "Conformant 2") 82 win = StandardWindow("conformant2", "Conformant 2", autodel=True,
94 win.autodel = True 83 conformant=True, size=(240,480))
95 win.conformant = True
96 84
97 bx = Box(win) 85 bx = Box(win, size_hint_weight=EXPAND_BOTH)
98 bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
99 win.resize_object_add(bx) 86 win.resize_object_add(bx)
100 bx.show() 87 bx.show()
101 88
102 en = ScrollableEntry(win) 89 en = ScrollableEntry(win, single_line=True, bounce=(True, False),
103 en.single_line = True 90 text="This is the top entry here", size_hint_weight=EXPAND_HORIZ,
104 en.bounce = True, False 91 size_hint_align=FILL_HORIZ)
105 en.text = "This is the top entry here"
106 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0
107 en.size_hint_align = EVAS_HINT_FILL, 0.5
108 bx.pack_end(en) 92 bx.pack_end(en)
109 en.show() 93 en.show()
110 94
111 btn = Button(win) 95 btn = Button(win, focus_allow=False, text="Delete Below",
112 btn.focus_allow = False 96 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
113 btn.text = "Delete Below"
114 btn.size_hint_weight = EVAS_HINT_EXPAND, 0.0
115 btn.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
116 bx.pack_end(btn) 97 bx.pack_end(btn)
117 btn.show() 98 btn.show()
118 99
119 pg = Naviframe(win) 100 pg = Naviframe(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
120 pg.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
121 pg.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
122 bx.pack_end(pg) 101 bx.pack_end(pg)
123 pg.show() 102 pg.show()
124 103
125 btn.callback_clicked_add(popobj, pg) 104 btn.callback_clicked_add(popobj, pg)
126 105
127 conform = Conformant(win) 106 conform = Conformant(win, size_hint_weight=EXPAND_BOTH,
128 conform.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 107 size_hint_align=FILL_BOTH)
129 conform.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
130 pg.item_simple_push(conform) 108 pg.item_simple_push(conform)
131 conform.show() 109 conform.show()
132 110
133 bx = Box(win) 111 bx = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
134 bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
135 bx.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
136 112
137 en = ScrollableEntry(win) 113 en = ScrollableEntry(win, bounce=(False, True),
138 en.bounce = False, True 114 text="This entry and button below get deleted.",
139 en.text = "This entry and button below get deleted." 115 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
140 en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
141 en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
142 en.show() 116 en.show()
143 bx.pack_end(en) 117 bx.pack_end(en)
144 118
145 btn = Button(win) 119 btn = Button(win, focus_allow=False, text="Delete this bottom bit 1",
146 btn.focus_allow = False 120 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
147 btn.text = "Delete this bottom bit 1"
148 btn.size_hint_weight = EVAS_HINT_EXPAND, 0.0
149 btn.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
150 bx.pack_end(btn) 121 bx.pack_end(btn)
151 btn.show() 122 btn.show()
152 123
@@ -155,29 +126,21 @@ def conformant2_clicked(obj, item=None):
155 conform.content = bx 126 conform.content = bx
156 bx.show() 127 bx.show()
157 128
158 conform = Conformant(win) 129 conform = Conformant(win, size_hint_weight=EXPAND_BOTH,
159 conform.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 130 size_hint_align=FILL_BOTH)
160 conform.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
161 pg.item_simple_push(conform) 131 pg.item_simple_push(conform)
162 conform.show() 132 conform.show()
163 133
164 bx = Box(win) 134 bx = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
165 bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
166 bx.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
167 135
168 en = ScrollableEntry(win) 136 en = ScrollableEntry(win, bounce=(False, True),
169 en.bounce = False, True 137 text="This entry and button below get deleted.",
170 en.text = "This entry and button below get deleted." 138 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
171 en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
172 en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
173 en.show() 139 en.show()
174 bx.pack_end(en) 140 bx.pack_end(en)
175 141
176 btn = Button(win) 142 btn = Button(win, focus_allow=False, text="Delete this bottom bit 2",
177 btn.focus_allow = False 143 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
178 btn.text = "Delete this bottom bit 2"
179 btn.size_hint_weight = EVAS_HINT_EXPAND, 0.0
180 btn.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
181 bx.pack_end(btn) 144 bx.pack_end(btn)
182 btn.show() 145 btn.show()
183 146
@@ -186,39 +149,34 @@ def conformant2_clicked(obj, item=None):
186 conform.content = bx 149 conform.content = bx
187 bx.show() 150 bx.show()
188 151
189 win.size = 240, 480
190 win.show() 152 win.show()
191 153
192if __name__ == "__main__": 154if __name__ == "__main__":
193 elementary.init() 155 elementary.init()
194 win = StandardWindow("test", "python-elementary test application") 156 win = StandardWindow("test", "python-elementary test application",
157 size=(320,520))
195 win.callback_delete_request_add(lambda o: elementary.exit()) 158 win.callback_delete_request_add(lambda o: elementary.exit())
196 159
197 box0 = Box(win) 160 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
198 box0.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
199 win.resize_object_add(box0) 161 win.resize_object_add(box0)
200 box0.show() 162 box0.show()
201 163
202 fr = Frame(win)
203 fr.text = "Information"
204 box0.pack_end(fr)
205 fr.show()
206
207 lb = Label(win) 164 lb = Label(win)
208 lb.text = "Please select a test from the list below<br>" \ 165 lb.text_set("Please select a test from the list below<br>"
209 "by clicking the test button to show the<br>" \ 166 "by clicking the test button to show the<br>"
210 "test window." 167 "test window.")
211 fr.content_set(lb)
212 lb.show() 168 lb.show()
213 169
170 fr = Frame(win, text="Information", content=lb)
171 box0.pack_end(fr)
172 fr.show()
173
214 items = [ 174 items = [
215 ("Conformant", conformant_clicked), 175 ("Conformant", conformant_clicked),
216 ("Conformant 2", conformant2_clicked), 176 ("Conformant 2", conformant2_clicked),
217 ] 177 ]
218 178
219 li = List(win) 179 li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
220 li.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
221 li.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL)
222 box0.pack_end(li) 180 box0.pack_end(li)
223 li.show() 181 li.show()
224 182
@@ -227,7 +185,6 @@ if __name__ == "__main__":
227 185
228 li.go() 186 li.go()
229 187
230 win.resize(320,520)
231 win.show() 188 win.show()
232 elementary.run() 189 elementary.run()
233 elementary.shutdown() 190 elementary.shutdown()
diff --git a/examples/elementary/test_core_evas_canvas_callbacks.py b/examples/elementary/test_core_evas_canvas_callbacks.py
index 35e56e8..8a1f5c8 100644
--- a/examples/elementary/test_core_evas_canvas_callbacks.py
+++ b/examples/elementary/test_core_evas_canvas_callbacks.py
@@ -1,7 +1,13 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, \
5 EVAS_CALLBACK_RENDER_PRE, EVAS_CALLBACK_RENDER_POST, \
6 EVAS_CALLBACK_CANVAS_FOCUS_IN, EVAS_CALLBACK_CANVAS_FOCUS_OUT, \
7 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, \
8 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, \
9 EVAS_CALLBACK_RENDER_FLUSH_PRE, EVAS_CALLBACK_RENDER_FLUSH_POST, \
10 Text, Rectangle
5 11
6# edje is imported because the canvas callbacks point to an edje obj, 12# edje is imported because the canvas callbacks point to an edje obj,
7# an instance cannot be created unless the class is available. 13# an instance cannot be created unless the class is available.
@@ -9,21 +15,23 @@ from efl import evas
9from efl import edje 15from efl import edje
10 16
11from efl import elementary 17from efl import elementary
12from efl.elementary.window import Window 18from efl.elementary.window import StandardWindow
13from efl.elementary.background import Background
14from efl.elementary.box import Box 19from efl.elementary.box import Box
15from efl.elementary.button import Button 20from efl.elementary.button import Button
16 21
22EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
23FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
24
17def btn_del_cbs_cb(button): 25def btn_del_cbs_cb(button):
18 canvas = button.evas_get() 26 canvas = button.evas_get()
19 canvas.event_callback_del(evas.EVAS_CALLBACK_CANVAS_FOCUS_IN, events_cb1) 27 canvas.event_callback_del(EVAS_CALLBACK_CANVAS_FOCUS_IN, events_cb1)
20 canvas.event_callback_del(evas.EVAS_CALLBACK_CANVAS_FOCUS_OUT, events_cb1) 28 canvas.event_callback_del(EVAS_CALLBACK_CANVAS_FOCUS_OUT, events_cb1)
21 canvas.event_callback_del(evas.EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, events_cb2) 29 canvas.event_callback_del(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, events_cb2)
22 canvas.event_callback_del(evas.EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, events_cb2) 30 canvas.event_callback_del(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, events_cb2)
23 canvas.event_callback_del(evas.EVAS_CALLBACK_RENDER_FLUSH_PRE, events_cb1) 31 canvas.event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_PRE, events_cb1)
24 canvas.event_callback_del(evas.EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1) 32 canvas.event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1)
25 canvas.event_callback_del(evas.EVAS_CALLBACK_RENDER_PRE, events_cb1) 33 canvas.event_callback_del(EVAS_CALLBACK_RENDER_PRE, events_cb1)
26 canvas.event_callback_del(evas.EVAS_CALLBACK_RENDER_POST, events_cb1) 34 canvas.event_callback_del(EVAS_CALLBACK_RENDER_POST, events_cb1)
27 35
28 36
29def events_cb1(rect, event_name): 37def events_cb1(rect, event_name):
@@ -34,52 +42,49 @@ def events_cb2(rect, evtinfo, event_name):
34 42
35 43
36def core_evas_canvas_callbacks_clicked(obj, item=None): 44def core_evas_canvas_callbacks_clicked(obj, item=None):
37 win = Window("evascanvascbs", elementary.ELM_WIN_BASIC) 45 win = StandardWindow("evascanvascbs", "Evas canvas callbacks", autodel=True,
38 win.title_set("Evas canvas callbacks") 46 size=(320,320))
39 win.autodel_set(True)
40 if obj is None: 47 if obj is None:
41 win.callback_delete_request_add(lambda o: elementary.exit()) 48 win.callback_delete_request_add(lambda o: elementary.exit())
42 49
43 bg = Background(win) 50 text = Text(win.evas, text="Events printed on console", size=(300, 30),
44 win.resize_object_add(bg) 51 color=(0,0,0,255))
45 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
46 bg.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
47 bg.show()
48
49 text = evas.Text(win.evas, text="Events printed on console", size=(300, 30), color=(0,0,0,255))
50 text.font_set("Sans", 12) 52 text.font_set("Sans", 12)
51 text.pos = (10, 10) 53 text.pos = (10, 10)
52 text.show() 54 text.show()
53 55
54 canvas = win.evas_get() 56 canvas = win.evas_get()
55 canvas.event_callback_add(evas.EVAS_CALLBACK_CANVAS_FOCUS_IN, events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_IN") 57 canvas.event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_IN,
56 canvas.event_callback_add(evas.EVAS_CALLBACK_CANVAS_FOCUS_OUT, events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_OUT") 58 events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_IN")
57 canvas.event_callback_add(evas.EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, events_cb2, "EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN") 59 canvas.event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_OUT,
58 canvas.event_callback_add(evas.EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, events_cb2, "EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT") 60 events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_OUT")
59 61 canvas.event_callback_add(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
60 canvas.event_callback_add(evas.EVAS_CALLBACK_RENDER_FLUSH_PRE, events_cb1, "EVAS_CALLBACK_RENDER_FLUSH_PRE") 62 events_cb2, "EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN")
61 canvas.event_callback_add(evas.EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1, "EVAS_CALLBACK_RENDER_FLUSH_POST") 63 canvas.event_callback_add(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
62 canvas.event_callback_add(evas.EVAS_CALLBACK_RENDER_PRE, events_cb1, "EVAS_CALLBACK_RENDER_PRE") 64 events_cb2, "EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT")
63 canvas.event_callback_add(evas.EVAS_CALLBACK_RENDER_POST, events_cb1, "EVAS_CALLBACK_RENDER_POST") 65
64 66 canvas.event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_PRE,
65 r2 = evas.Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70)) 67 events_cb1, "EVAS_CALLBACK_RENDER_FLUSH_PRE")
68 canvas.event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_POST,
69 events_cb1, "EVAS_CALLBACK_RENDER_FLUSH_POST")
70 canvas.event_callback_add(EVAS_CALLBACK_RENDER_PRE,
71 events_cb1, "EVAS_CALLBACK_RENDER_PRE")
72 canvas.event_callback_add(EVAS_CALLBACK_RENDER_POST,
73 events_cb1, "EVAS_CALLBACK_RENDER_POST")
74
75 r2 = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
66 r2.show() 76 r2.show()
67 77
68 hbox = Box(win) 78 hbox = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
79 horizontal=True)
69 win.resize_object_add(hbox) 80 win.resize_object_add(hbox)
70 hbox.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
71 hbox.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
72 hbox.horizontal = True
73 hbox.show() 81 hbox.show()
74 82
75 b = Button(win) 83 b = Button(win, text="del cbs", size_hint_align=(0.5, 1.0))
76 b.text = "del cbs"
77 b.size_hint_align_set(0.5, 1.0)
78 hbox.pack_end(b) 84 hbox.pack_end(b)
79 b.callback_clicked_add(btn_del_cbs_cb) 85 b.callback_clicked_add(btn_del_cbs_cb)
80 b.show() 86 b.show()
81 87
82 win.resize(320, 320)
83 win.show() 88 win.show()
84 89
85 90
diff --git a/examples/elementary/test_core_evas_object_callbacks.py b/examples/elementary/test_core_evas_object_callbacks.py
index c2b439c..5d2a1f8 100644
--- a/examples/elementary/test_core_evas_object_callbacks.py
+++ b/examples/elementary/test_core_evas_object_callbacks.py
@@ -1,39 +1,52 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import EVAS_CALLBACK_MOUSE_IN, EVAS_CALLBACK_MOUSE_OUT, \
5 EVAS_CALLBACK_MOUSE_DOWN, EVAS_CALLBACK_MOUSE_UP, \
6 EVAS_CALLBACK_MOUSE_MOVE, EVAS_CALLBACK_MOUSE_WHEEL, \
7 EVAS_CALLBACK_MULTI_DOWN, EVAS_CALLBACK_MULTI_UP, \
8 EVAS_CALLBACK_MULTI_MOVE, EVAS_CALLBACK_FREE, \
9 EVAS_CALLBACK_KEY_DOWN, EVAS_CALLBACK_KEY_UP, \
10 EVAS_CALLBACK_FOCUS_IN, EVAS_CALLBACK_FOCUS_OUT, \
11 EVAS_CALLBACK_SHOW, EVAS_CALLBACK_HIDE, EVAS_CALLBACK_MOVE, \
12 EVAS_CALLBACK_RESIZE, EVAS_CALLBACK_RESTACK, \
13 EVAS_CALLBACK_DEL, EVAS_CALLBACK_HOLD, \
14 EVAS_CALLBACK_CHANGED_SIZE_HINTS, \
15 EVAS_CALLBACK_IMAGE_PRELOADED, EVAS_CALLBACK_IMAGE_UNLOADED, \
16 Text, Rectangle, EVAS_HINT_EXPAND, EVAS_HINT_FILL
5from efl import elementary 17from efl import elementary
6from efl.elementary.window import Window 18from efl.elementary.window import StandardWindow
7from efl.elementary.background import Background
8from efl.elementary.box import Box 19from efl.elementary.box import Box
9from efl.elementary.button import Button 20from efl.elementary.button import Button
10 21
22EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
23FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
11 24
12def btn_del_cbs_cb(button, rect): 25def btn_del_cbs_cb(button, rect):
13 rect.event_callback_del(evas.EVAS_CALLBACK_MOUSE_IN, events_cb2) 26 rect.event_callback_del(EVAS_CALLBACK_MOUSE_IN, events_cb2)
14 rect.event_callback_del(evas.EVAS_CALLBACK_MOUSE_OUT, events_cb2) 27 rect.event_callback_del(EVAS_CALLBACK_MOUSE_OUT, events_cb2)
15 rect.event_callback_del(evas.EVAS_CALLBACK_MOUSE_DOWN, events_cb2) 28 rect.event_callback_del(EVAS_CALLBACK_MOUSE_DOWN, events_cb2)
16 rect.event_callback_del(evas.EVAS_CALLBACK_MOUSE_UP, events_cb2) 29 rect.event_callback_del(EVAS_CALLBACK_MOUSE_UP, events_cb2)
17 rect.event_callback_del(evas.EVAS_CALLBACK_MOUSE_MOVE, events_cb2) 30 rect.event_callback_del(EVAS_CALLBACK_MOUSE_MOVE, events_cb2)
18 rect.event_callback_del(evas.EVAS_CALLBACK_MOUSE_WHEEL, events_cb2) 31 rect.event_callback_del(EVAS_CALLBACK_MOUSE_WHEEL, events_cb2)
19 rect.event_callback_del(evas.EVAS_CALLBACK_MULTI_DOWN, events_cb2) 32 rect.event_callback_del(EVAS_CALLBACK_MULTI_DOWN, events_cb2)
20 rect.event_callback_del(evas.EVAS_CALLBACK_MULTI_UP, events_cb2) 33 rect.event_callback_del(EVAS_CALLBACK_MULTI_UP, events_cb2)
21 rect.event_callback_del(evas.EVAS_CALLBACK_MULTI_MOVE, events_cb2) 34 rect.event_callback_del(EVAS_CALLBACK_MULTI_MOVE, events_cb2)
22 rect.event_callback_del(evas.EVAS_CALLBACK_FREE, events_cb1) 35 rect.event_callback_del(EVAS_CALLBACK_FREE, events_cb1)
23 rect.event_callback_del(evas.EVAS_CALLBACK_KEY_DOWN, events_cb2) 36 rect.event_callback_del(EVAS_CALLBACK_KEY_DOWN, events_cb2)
24 rect.event_callback_del(evas.EVAS_CALLBACK_KEY_UP, events_cb2) 37 rect.event_callback_del(EVAS_CALLBACK_KEY_UP, events_cb2)
25 rect.event_callback_del(evas.EVAS_CALLBACK_FOCUS_IN, events_cb2) 38 rect.event_callback_del(EVAS_CALLBACK_FOCUS_IN, events_cb2)
26 rect.event_callback_del(evas.EVAS_CALLBACK_FOCUS_OUT, events_cb2) 39 rect.event_callback_del(EVAS_CALLBACK_FOCUS_OUT, events_cb2)
27 rect.event_callback_del(evas.EVAS_CALLBACK_SHOW, events_cb1) 40 rect.event_callback_del(EVAS_CALLBACK_SHOW, events_cb1)
28 rect.event_callback_del(evas.EVAS_CALLBACK_HIDE, events_cb1) 41 rect.event_callback_del(EVAS_CALLBACK_HIDE, events_cb1)
29 rect.event_callback_del(evas.EVAS_CALLBACK_MOVE, events_cb1) 42 rect.event_callback_del(EVAS_CALLBACK_MOVE, events_cb1)
30 rect.event_callback_del(evas.EVAS_CALLBACK_RESIZE, events_cb1) 43 rect.event_callback_del(EVAS_CALLBACK_RESIZE, events_cb1)
31 rect.event_callback_del(evas.EVAS_CALLBACK_RESTACK, events_cb1) 44 rect.event_callback_del(EVAS_CALLBACK_RESTACK, events_cb1)
32 rect.event_callback_del(evas.EVAS_CALLBACK_DEL, events_cb1) 45 rect.event_callback_del(EVAS_CALLBACK_DEL, events_cb1)
33 rect.event_callback_del(evas.EVAS_CALLBACK_HOLD, events_cb1) 46 rect.event_callback_del(EVAS_CALLBACK_HOLD, events_cb1)
34 rect.event_callback_del(evas.EVAS_CALLBACK_CHANGED_SIZE_HINTS, events_cb1) 47 rect.event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, events_cb1)
35 rect.event_callback_del(evas.EVAS_CALLBACK_IMAGE_PRELOADED, events_cb1) 48 rect.event_callback_del(EVAS_CALLBACK_IMAGE_PRELOADED, events_cb1)
36 rect.event_callback_del(evas.EVAS_CALLBACK_IMAGE_UNLOADED, events_cb1) 49 rect.event_callback_del(EVAS_CALLBACK_IMAGE_UNLOADED, events_cb1)
37 50
38 51
39def events_cb1(rect, event_name): 52def events_cb1(rect, event_name):
@@ -44,121 +57,98 @@ def events_cb2(rect, evtinfo, event_name):
44 57
45 58
46def core_evas_object_callbacks_clicked(obj, item=None): 59def core_evas_object_callbacks_clicked(obj, item=None):
47 win = Window("evas3d", elementary.ELM_WIN_BASIC) 60 win = StandardWindow("evas3d", "Evas object callbacks", autodel=True,
48 win.title_set("Evas object callbacks") 61 size=(320,320))
49 win.autodel_set(True)
50 if obj is None: 62 if obj is None:
51 win.callback_delete_request_add(lambda o: elementary.exit()) 63 win.callback_delete_request_add(lambda o: elementary.exit())
52 64
53 bg = Background(win) 65 text = Text(win.evas, text="Events printed on console", size=(300, 30),
54 win.resize_object_add(bg) 66 color=(0,0,0,255))
55 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
56 bg.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
57 bg.show()
58
59 text = evas.Text(win.evas, text="Events printed on console", size=(300, 30), color=(0,0,0,255))
60 text.font_set("Sans", 12) 67 text.font_set("Sans", 12)
61 text.pos = (10, 10) 68 text.pos = (10, 10)
62 text.show() 69 text.show()
63 70
64 r = evas.Rectangle(win.evas, size=(100,100), color=(100,0,0,200), pos=(50,50)) 71 r = Rectangle(win.evas, size=(100,100), color=(100,0,0,200), pos=(50,50))
65 r.event_callback_add(evas.EVAS_CALLBACK_MOUSE_IN, events_cb2, "EVAS_CALLBACK_MOUSE_IN") 72 r.event_callback_add(EVAS_CALLBACK_MOUSE_IN, events_cb2, "EVAS_CALLBACK_MOUSE_IN")
66 r.event_callback_add(evas.EVAS_CALLBACK_MOUSE_OUT, events_cb2, "EVAS_CALLBACK_MOUSE_OUT") 73 r.event_callback_add(EVAS_CALLBACK_MOUSE_OUT, events_cb2, "EVAS_CALLBACK_MOUSE_OUT")
67 r.event_callback_add(evas.EVAS_CALLBACK_MOUSE_DOWN, events_cb2, "EVAS_CALLBACK_MOUSE_DOWN") 74 r.event_callback_add(EVAS_CALLBACK_MOUSE_DOWN, events_cb2, "EVAS_CALLBACK_MOUSE_DOWN")
68 r.event_callback_add(evas.EVAS_CALLBACK_MOUSE_UP, events_cb2, "EVAS_CALLBACK_MOUSE_UP") 75 r.event_callback_add(EVAS_CALLBACK_MOUSE_UP, events_cb2, "EVAS_CALLBACK_MOUSE_UP")
69 r.event_callback_add(evas.EVAS_CALLBACK_MOUSE_MOVE, events_cb2, "EVAS_CALLBACK_MOUSE_MOVE") 76 r.event_callback_add(EVAS_CALLBACK_MOUSE_MOVE, events_cb2, "EVAS_CALLBACK_MOUSE_MOVE")
70 r.event_callback_add(evas.EVAS_CALLBACK_MOUSE_WHEEL, events_cb2, "EVAS_CALLBACK_MOUSE_WHEEL") 77 r.event_callback_add(EVAS_CALLBACK_MOUSE_WHEEL, events_cb2, "EVAS_CALLBACK_MOUSE_WHEEL")
71 r.event_callback_add(evas.EVAS_CALLBACK_MULTI_DOWN, events_cb2, "EVAS_CALLBACK_MULTI_DOWN") 78 r.event_callback_add(EVAS_CALLBACK_MULTI_DOWN, events_cb2, "EVAS_CALLBACK_MULTI_DOWN")
72 r.event_callback_add(evas.EVAS_CALLBACK_MULTI_UP, events_cb2, "EVAS_CALLBACK_MULTI_UP") 79 r.event_callback_add(EVAS_CALLBACK_MULTI_UP, events_cb2, "EVAS_CALLBACK_MULTI_UP")
73 r.event_callback_add(evas.EVAS_CALLBACK_MULTI_MOVE, events_cb2, "EVAS_CALLBACK_MULTI_MOVE") 80 r.event_callback_add(EVAS_CALLBACK_MULTI_MOVE, events_cb2, "EVAS_CALLBACK_MULTI_MOVE")
74 r.event_callback_add(evas.EVAS_CALLBACK_FREE, events_cb1, "EVAS_CALLBACK_FREE") 81 r.event_callback_add(EVAS_CALLBACK_FREE, events_cb1, "EVAS_CALLBACK_FREE")
75 r.event_callback_add(evas.EVAS_CALLBACK_KEY_DOWN, events_cb2, "EVAS_CALLBACK_KEY_DOWN") 82 r.event_callback_add(EVAS_CALLBACK_KEY_DOWN, events_cb2, "EVAS_CALLBACK_KEY_DOWN")
76 r.event_callback_add(evas.EVAS_CALLBACK_KEY_UP, events_cb2, "EVAS_CALLBACK_KEY_UP") 83 r.event_callback_add(EVAS_CALLBACK_KEY_UP, events_cb2, "EVAS_CALLBACK_KEY_UP")
77 r.event_callback_add(evas.EVAS_CALLBACK_FOCUS_IN, events_cb2, "EVAS_CALLBACK_FOCUS_IN") 84 r.event_callback_add(EVAS_CALLBACK_FOCUS_IN, events_cb2, "EVAS_CALLBACK_FOCUS_IN")
78 r.event_callback_add(evas.EVAS_CALLBACK_FOCUS_OUT, events_cb2, "EVAS_CALLBACK_FOCUS_OUT") 85 r.event_callback_add(EVAS_CALLBACK_FOCUS_OUT, events_cb2, "EVAS_CALLBACK_FOCUS_OUT")
79 r.event_callback_add(evas.EVAS_CALLBACK_SHOW, events_cb1, "EVAS_CALLBACK_SHOW") 86 r.event_callback_add(EVAS_CALLBACK_SHOW, events_cb1, "EVAS_CALLBACK_SHOW")
80 r.event_callback_add(evas.EVAS_CALLBACK_HIDE, events_cb1, "EVAS_CALLBACK_HIDE") 87 r.event_callback_add(EVAS_CALLBACK_HIDE, events_cb1, "EVAS_CALLBACK_HIDE")
81 r.event_callback_add(evas.EVAS_CALLBACK_MOVE, events_cb1, "EVAS_CALLBACK_MOVE") 88 r.event_callback_add(EVAS_CALLBACK_MOVE, events_cb1, "EVAS_CALLBACK_MOVE")
82 r.event_callback_add(evas.EVAS_CALLBACK_RESIZE, events_cb1, "EVAS_CALLBACK_RESIZE") 89 r.event_callback_add(EVAS_CALLBACK_RESIZE, events_cb1, "EVAS_CALLBACK_RESIZE")
83 r.event_callback_add(evas.EVAS_CALLBACK_RESTACK, events_cb1, "EVAS_CALLBACK_RESTACK") 90 r.event_callback_add(EVAS_CALLBACK_RESTACK, events_cb1, "EVAS_CALLBACK_RESTACK")
84 r.event_callback_add(evas.EVAS_CALLBACK_DEL, events_cb1, "EVAS_CALLBACK_DEL") 91 r.event_callback_add(EVAS_CALLBACK_DEL, events_cb1, "EVAS_CALLBACK_DEL")
85 r.event_callback_add(evas.EVAS_CALLBACK_HOLD, events_cb1, "EVAS_CALLBACK_HOLD") 92 r.event_callback_add(EVAS_CALLBACK_HOLD, events_cb1, "EVAS_CALLBACK_HOLD")
86 r.event_callback_add(evas.EVAS_CALLBACK_CHANGED_SIZE_HINTS, events_cb1, "EVAS_CALLBACK_CHANGED_SIZE_HINTS") 93 r.event_callback_add(EVAS_CALLBACK_CHANGED_SIZE_HINTS, events_cb1, "EVAS_CALLBACK_CHANGED_SIZE_HINTS")
87 r.event_callback_add(evas.EVAS_CALLBACK_IMAGE_PRELOADED, events_cb1, "EVAS_CALLBACK_IMAGE_PRELOADED") 94 r.event_callback_add(EVAS_CALLBACK_IMAGE_PRELOADED, events_cb1, "EVAS_CALLBACK_IMAGE_PRELOADED")
88 r.event_callback_add(evas.EVAS_CALLBACK_IMAGE_UNLOADED, events_cb1, "EVAS_CALLBACK_IMAGE_UNLOADED") 95 r.event_callback_add(EVAS_CALLBACK_IMAGE_UNLOADED, events_cb1, "EVAS_CALLBACK_IMAGE_UNLOADED")
89 ## r.event_callback_add(evas.EVAS_CALLBACK_CANVAS_FOCUS_IN, events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_IN") 96 ## r.event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_IN, events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_IN")
90 ## r.event_callback_add(evas.EVAS_CALLBACK_CANVAS_FOCUS_OUT, events_cb1, "") 97 ## r.event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_OUT, events_cb1, "")
91 ## r.event_callback_add(evas.EVAS_CALLBACK_RENDER_FLUSH_PRE, events_cb1, "") 98 ## r.event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_PRE, events_cb1, "")
92 ## r.event_callback_add(evas.EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1, "") 99 ## r.event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1, "")
93 ## r.event_callback_add(evas.EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, events_cb1, "") 100 ## r.event_callback_add(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, events_cb1, "")
94 ## r.event_callback_add(evas.EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, events_cb1, "") 101 ## r.event_callback_add(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, events_cb1, "")
95 102
96 ## r.event_callback_add(evas.EVAS_CALLBACK_RENDER_PRE, events_cb1, "") 103 ## r.event_callback_add(EVAS_CALLBACK_RENDER_PRE, events_cb1, "")
97 ## r.event_callback_add(evas.EVAS_CALLBACK_RENDER_POST, events_cb1, "") 104 ## r.event_callback_add(EVAS_CALLBACK_RENDER_POST, events_cb1, "")
98 #? r.event_callback_add(evas.EVAS_CALLBACK_IMAGE_RESIZE, events_cb1, "") 105 #? r.event_callback_add(EVAS_CALLBACK_IMAGE_RESIZE, events_cb1, "")
99 #? r.event_callback_add(evas.EVAS_CALLBACK_DEVICE_CHANGED, events_cb1, "") 106 #? r.event_callback_add(EVAS_CALLBACK_DEVICE_CHANGED, events_cb1, "")
100 r.show() 107 r.show()
101 108
102 r2 = evas.Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70)) 109 r2 = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
103 r2.show() 110 r2.show()
104 111
105 hbox = Box(win) 112 hbox = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
113 horizontal=True)
106 win.resize_object_add(hbox) 114 win.resize_object_add(hbox)
107 hbox.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
108 hbox.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
109 hbox.horizontal = True
110 hbox.show() 115 hbox.show()
111 116
112 b = Button(win) 117 b = Button(win, text="show / hide", size_hint_align=(0.5, 1.0))
113 b.text = "show / hide"
114 b.size_hint_align_set(0.5, 1.0)
115 hbox.pack_end(b) 118 hbox.pack_end(b)
116 b.callback_clicked_add(lambda b, r: r.hide() if r.visible else r.show(), r) 119 b.callback_clicked_add(lambda b, r: r.hide() if r.visible else r.show(), r)
117 b.show() 120 b.show()
118 121
119 b = Button(win) 122 b = Button(win, text="move", size_hint_align=(0.5, 1.0))
120 b.text = "move"
121 b.size_hint_align_set(0.5, 1.0)
122 hbox.pack_end(b) 123 hbox.pack_end(b)
123 b.callback_clicked_add(lambda b, t: r.pos_set(r.pos[0] + 1, r.pos[1]), r) 124 b.callback_clicked_add(lambda b, t: r.pos_set(r.pos[0] + 1, r.pos[1]), r)
124 b.show() 125 b.show()
125 126
126 b = Button(win) 127 b = Button(win, text="resize", size_hint_align=(0.5, 1.0))
127 b.text = "resize"
128 b.size_hint_align_set(0.5, 1.0)
129 hbox.pack_end(b) 128 hbox.pack_end(b)
130 b.callback_clicked_add(lambda b, r: r.size_set(r.size[0] + 1, r.size[1] + 1), r) 129 b.callback_clicked_add(lambda b, r: r.size_set(r.size[0] + 1, r.size[1] + 1), r)
131 b.show() 130 b.show()
132 131
133 b = Button(win) 132 b = Button(win, text="delete", size_hint_align=(0.5, 1.0))
134 b.text = "delete"
135 b.size_hint_align_set(0.5, 1.0)
136 hbox.pack_end(b) 133 hbox.pack_end(b)
137 b.callback_clicked_add(lambda b, r: r.delete(), r) 134 b.callback_clicked_add(lambda b, r: r.delete(), r)
138 b.show() 135 b.show()
139 136
140 b = Button(win) 137 b = Button(win, text="raise", size_hint_align=(0.5, 1.0))
141 b.text = "raise"
142 b.size_hint_align_set(0.5, 1.0)
143 hbox.pack_end(b) 138 hbox.pack_end(b)
144 b.callback_clicked_add(lambda b, r: r.raise_(), r) 139 b.callback_clicked_add(lambda b, r: r.raise_(), r)
145 b.show() 140 b.show()
146 141
147 b = Button(win) 142 b = Button(win, text="hints", size_hint_align=(0.5, 1.0))
148 b.text = "hints"
149 b.size_hint_align_set(0.5, 1.0)
150 hbox.pack_end(b) 143 hbox.pack_end(b)
151 b.callback_clicked_add(lambda b, r: r.size_hint_align_set(0.0, 0.0), r) 144 b.callback_clicked_add(lambda b, r: r.size_hint_align_set(0.0, 0.0), r)
152 b.show() 145 b.show()
153 146
154 b = Button(win) 147 b = Button(win, text="del cbs", size_hint_align=(0.5, 1.0))
155 b.text = "del cbs"
156 b.size_hint_align_set(0.5, 1.0)
157 hbox.pack_end(b) 148 hbox.pack_end(b)
158 b.callback_clicked_add(btn_del_cbs_cb, r) 149 b.callback_clicked_add(btn_del_cbs_cb, r)
159 b.show() 150 b.show()
160 151
161 win.resize(320, 320)
162 win.show() 152 win.show()
163 153
164 154
@@ -169,4 +159,3 @@ if __name__ == "__main__":
169 159
170 elementary.run() 160 elementary.run()
171 elementary.shutdown() 161 elementary.shutdown()
172 evas.shutdown()
diff --git a/examples/elementary/test_core_evas_objects.py b/examples/elementary/test_core_evas_objects.py
index d6ca46d..b51431f 100644
--- a/examples/elementary/test_core_evas_objects.py
+++ b/examples/elementary/test_core_evas_objects.py
@@ -1,11 +1,9 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import Rectangle, Line, Text, Polygon
5from efl import elementary 5from efl import elementary
6from efl.elementary.window import Window 6from efl.elementary.window import StandardWindow
7from efl.elementary.background import Background
8
9 7
10def events_cb1(rect, event_name): 8def events_cb1(rect, event_name):
11 print(event_name + " No data for event") 9 print(event_name + " No data for event")
@@ -13,33 +11,23 @@ def events_cb1(rect, event_name):
13def events_cb2(rect, evtinfo, event_name): 11def events_cb2(rect, evtinfo, event_name):
14 print(event_name + " " + str(evtinfo)) 12 print(event_name + " " + str(evtinfo))
15 13
16
17def core_evas_objects_clicked(obj, item=None): 14def core_evas_objects_clicked(obj, item=None):
18 15 win = StandardWindow("evasobjects", "Evas Objects Test", autodel=True)
19 win = Window("evasobjects", elementary.ELM_WIN_BASIC)
20 win.title_set("Evas Objects Test")
21 win.autodel_set(True)
22 if obj is None: 16 if obj is None:
23 win.callback_delete_request_add(lambda o: elementary.exit()) 17 win.callback_delete_request_add(lambda o: elementary.exit())
24 18
25 bg = Background(win) 19 rect = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
26 win.resize_object_add(bg)
27 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
28 bg.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
29 bg.show()
30
31 rect = evas.Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
32 rect.show() 20 rect.show()
33 21
34 line = evas.Line(win.evas, start=(20,40), end=(200,100), color=(255,0,0,255)) 22 line = Line(win.evas, start=(20,40), end=(200,100), color=(255,0,0,255))
35 line.show() 23 line.show()
36 24
37 text = evas.Text(win.evas, text="Evas Text Object", size=(300, 30), color=(0,0,0,255)) 25 text = Text(win.evas, text="Evas Text Object", size=(300, 30), color=(0,0,0,255))
38 text.font_set("Sans", 16) 26 text.font_set("Sans", 16)
39 text.pos = (40, 20) 27 text.pos = (40, 20)
40 text.show() 28 text.show()
41 29
42 poly = evas.Polygon(win.evas, color=(200, 0, 200, 200)) 30 poly = Polygon(win.evas, color=(200, 0, 200, 200))
43 poly.point_add(10,100) 31 poly.point_add(10,100)
44 poly.point_add(100,120) 32 poly.point_add(100,120)
45 poly.point_add(20,30) 33 poly.point_add(20,30)
diff --git a/examples/elementary/test_ctxpopup.py b/examples/elementary/test_ctxpopup.py
index 25b2eb3..6b13b3d 100644
--- a/examples/elementary/test_ctxpopup.py
+++ b/examples/elementary/test_ctxpopup.py
@@ -1,25 +1,25 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, FilledImage
5from efl import elementary 5from efl import elementary
6from efl.elementary.window import Window 6from efl.elementary.window import StandardWindow
7from efl.elementary.background import Background
8from efl.elementary.box import Box 7from efl.elementary.box import Box
9from efl.elementary.icon import Icon 8from efl.elementary.icon import Icon
10from efl.elementary.button import Button 9from efl.elementary.button import Button
11from efl.elementary.list import List 10from efl.elementary.list import List, ELM_LIST_COMPRESS
12from efl.elementary.ctxpopup import Ctxpopup 11from efl.elementary.ctxpopup import Ctxpopup
13from efl.elementary.scroller import Scroller 12from efl.elementary.scroller import Scroller
14 13
14EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
15FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
16
15def cb_items(li, item): 17def cb_items(li, item):
16 print(("ctxpopup item selected: %s" % (item.text))) 18 print(("ctxpopup item selected: %s" % (item.text)))
17 19
18def item_new(cp, label, icon = None): 20def item_new(cp, label, icon = None):
19 if icon: 21 if icon:
20 ic = Icon(cp) 22 ic = Icon(cp, standard=icon, resizable=(False,False))
21 ic.standard_set(icon)
22 ic.resizable_set(False, False)
23 return cp.item_append(label, ic, cb_items) 23 return cp.item_append(label, ic, cb_items)
24 else: 24 else:
25 return cp.item_append(label, None, cb_items) 25 return cp.item_append(label, None, cb_items)
@@ -28,7 +28,7 @@ def cb_btn(btn):
28 cp = btn.data["ctxpopup"] 28 cp = btn.data["ctxpopup"]
29 if "img" in cp.data: 29 if "img" in cp.data:
30 return 30 return
31 img = evas.FilledImage(btn.evas) 31 img = FilledImage(btn.evas)
32 img.file_set("images/sky_04.jpg") 32 img.file_set("images/sky_04.jpg")
33 img.move(40, 40) 33 img.move(40, 40)
34 img.resize(320, 320) 34 img.resize(320, 320)
@@ -101,70 +101,51 @@ def cb_item4(li, item):
101 cp.show() 101 cp.show()
102 102
103def cb_item5(li, item): 103def cb_item5(li, item):
104 box = Box(li) 104 box = Box(li, size_hint_min=(150, 150))
105 box.size_hint_min = (150, 150)
106 105
107 sc = Scroller(li) 106 sc = Scroller(li, bounce=(False, True), size_hint_align=FILL_BOTH,
108 sc.bounce = (False, True) 107 size_hint_weight=EXPAND_BOTH)
109 sc.size_hint_align = (evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
110 sc.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
111 sc.show() 108 sc.show()
112 109
113 bt = Button(li) 110 bt = Button(li, text="Enlightenment", size_hint_min=(140, 140))
114 bt.text = "Enlightenment"
115 bt.size_hint_min = (140, 140)
116 111
117 sc.content = bt 112 sc.content = bt
118 box.pack_end(sc) 113 box.pack_end(sc)
119 114
120 cp = Ctxpopup(li) 115 cp = Ctxpopup(li, content = box)
121 cp.content = box
122 (x, y) = li.evas.pointer_canvas_xy_get() 116 (x, y) = li.evas.pointer_canvas_xy_get()
123 cp.move(x, y) 117 cp.move(x, y)
124 cp.show() 118 cp.show()
125 119
126def cb_item6(li, item): 120def cb_item6(li, item):
127 box = Box(li) 121 box = Box(li, size_hint_min=(200, 150))
128 box.size_hint_min = (200, 150)
129 122
130 sc = Scroller(li) 123 sc = Scroller(li, bounce=(False, True), size_hint_align=FILL_BOTH,
131 sc.bounce = (False, True) 124 size_hint_weight=EXPAND_BOTH)
132 sc.size_hint_align = (evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
133 sc.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
134 sc.show() 125 sc.show()
135 126
136 bt = Button(li) 127 bt = Button(li, text="Ctxpop will be on the top of layer",
137 bt.text = "Ctxpop will be on the top of layer" 128 size_hint_min=(190, 140))
138 bt.callback_clicked_add(cb_btn) 129 bt.callback_clicked_add(cb_btn)
139 bt.size_hint_min = (190, 140)
140 130
141 sc.content = bt 131 sc.content = bt
142 box.pack_end(sc) 132 box.pack_end(sc)
143 133
144 cp = Ctxpopup(li) 134 cp = Ctxpopup(li, content=box)
145 cp.callback_dismissed_add(cb_dismissed) 135 cp.callback_dismissed_add(cb_dismissed)
146 cp.content = box
147 (x, y) = li.evas.pointer_canvas_xy_get() 136 (x, y) = li.evas.pointer_canvas_xy_get()
148 cp.move(x, y) 137 cp.move(x, y)
149 cp.show() 138 cp.show()
150 bt.data["ctxpopup"] = cp 139 bt.data["ctxpopup"] = cp
151 140
152def ctxpopup_clicked(obj): 141def ctxpopup_clicked(obj):
153 win = Window("ctxpopup", elementary.ELM_WIN_BASIC) 142 win = StandardWindow("ctxpopup", "Context popup test", autodel=True,
154 win.title = "Context popup test" 143 size=(400,400))
155 win.autodel = True
156 if obj is None: 144 if obj is None:
157 win.callback_delete_request_add(lambda o: elementary.exit()) 145 win.callback_delete_request_add(lambda o: elementary.exit())
158 146
159 bg = Background(win) 147 li = List(win, size_hint_weight=EXPAND_BOTH, mode=ELM_LIST_COMPRESS)
160 win.resize_object_add(bg)
161 bg.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
162 bg.show()
163
164 li = List(win)
165 win.resize_object_add(li) 148 win.resize_object_add(li)
166 li.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
167 li.mode = elementary.ELM_LIST_COMPRESS
168 li.show() 149 li.show()
169 150
170 li.item_append("Ctxpopup with icons and labels", callback=cb_item1) 151 li.item_append("Ctxpopup with icons and labels", callback=cb_item1)
@@ -175,7 +156,6 @@ def ctxpopup_clicked(obj):
175 li.item_append("Ctxpopup with restacking", callback=cb_item6) 156 li.item_append("Ctxpopup with restacking", callback=cb_item6)
176 li.go() 157 li.go()
177 158
178 win.resize(400, 400)
179 win.show() 159 win.show()
180 160
181 161
diff --git a/examples/elementary/test_cursor.py b/examples/elementary/test_cursor.py
index d4b18e2..c3c51e6 100644
--- a/examples/elementary/test_cursor.py
+++ b/examples/elementary/test_cursor.py
@@ -2,10 +2,9 @@
2# encoding: utf-8 2# encoding: utf-8
3 3
4 4
5from efl import evas 5from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
6from efl import elementary 6from efl import elementary
7from efl.elementary.window import Window 7from efl.elementary.window import StandardWindow
8from efl.elementary.background import Background
9from efl.elementary.box import Box 8from efl.elementary.box import Box
10from efl.elementary.button import Button 9from efl.elementary.button import Button
11from efl.elementary.label import Label 10from efl.elementary.label import Label
@@ -15,180 +14,132 @@ from efl.elementary.clock import Clock
15from efl.elementary.entry import Entry 14from efl.elementary.entry import Entry
16from efl.elementary.toolbar import Toolbar 15from efl.elementary.toolbar import Toolbar
17 16
17EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
18EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
19FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
20FILL_HORIZ = EVAS_HINT_FILL, 0.5
21
18def cursor_clicked(obj, item=None): 22def cursor_clicked(obj, item=None):
19 win = Window("cursors", elementary.ELM_WIN_BASIC) 23 win = StandardWindow("cursors", "Cursors", autodel=True, size=(320,480))
20 win.title_set("Cursors")
21 win.autodel_set(True) 24 win.autodel_set(True)
22 25
23 bg = Background(win) 26 bx = Box(win, size_hint_weight=EXPAND_BOTH)
24 win.resize_object_add(bg)
25 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
26 bg.show()
27
28 bx = Box(win)
29 win.resize_object_add(bx) 27 win.resize_object_add(bx)
30 bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
31 bx.show() 28 bx.show()
32 29
33 ck = Clock(win) 30 ck = Clock(win, cursor="clock")
34 ck.cursor_set("clock")
35 bx.pack_end(ck) 31 bx.pack_end(ck)
36 ck.show() 32 ck.show()
37 33
38 bt = Button(win) 34 bt = Button(win, text="Coffee Mug", cursor="coffee_mug")
39 bt.text_set("Coffee Mug")
40 bt.cursor_set("coffee_mug")
41 bx.pack_end(bt) 35 bx.pack_end(bt)
42 bt.show() 36 bt.show()
43 37
44 bt = Button(win) 38 bt = Button(win, text="Cursor unset", cursor="bogosity")
45 bt.text_set("Cursor unset")
46 bt.cursor_set("bogosity")
47 bt.cursor_unset() 39 bt.cursor_unset()
48 bx.pack_end(bt) 40 bx.pack_end(bt)
49 bt.show() 41 bt.show()
50 42
51 lst = List(win) 43 lst = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
44 cursor="watch")
52 lst.item_append("watch over list") 45 lst.item_append("watch over list")
53 lst.item_append("watch over list") 46 lst.item_append("watch over list")
54 lst.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
55 lst.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
56 lst.cursor_set("watch")
57 bx.pack_end(lst) 47 bx.pack_end(lst)
58 lst.go() 48 lst.go()
59 lst.show() 49 lst.show()
60 50
61 en = Entry(win) 51 en = Entry(win, scrollable=True, single_line=True, entry="Xterm cursor"
62 en.scrollable_set(True) 52 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ,
63 en.single_line_set(True) 53 cursor="xterm")
64 en.entry_set("Xterm cursor")
65 en.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
66 en.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5)
67 en.cursor_set("xterm")
68 bx.pack_end(en) 54 bx.pack_end(en)
69 en.show() 55 en.show()
70 56
71 win.resize(320, 480)
72 win.show() 57 win.show()
73 58
74 59
75def cursor2_clicked(obj, item=None): 60def cursor2_clicked(obj, item=None):
76 win = Window("cursors", elementary.ELM_WIN_BASIC) 61 win = StandardWindow("cursors", "Cursors 2", autodel=True, size=(320, 480))
77 win.title_set("Cursors 2")
78 win.autodel_set(True)
79
80 bg = Background(win)
81 win.resize_object_add(bg)
82 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
83 bg.show()
84 62
85 bx = Box(win) 63 bx = Box(win, size_hint_weight=EXPAND_BOTH)
86 win.resize_object_add(bx) 64 win.resize_object_add(bx)
87 bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
88 bx.show() 65 bx.show()
89 66
90 tb = Toolbar(win) 67 tb = Toolbar(win, size_hint_weight=(0.0, 0.0),
68 size_hint_align=(EVAS_HINT_FILL, 0.0))
91 ti = tb.item_append("folder-new", "Bogosity", None, None) 69 ti = tb.item_append("folder-new", "Bogosity", None, None)
92 ti.cursor_set("bogosity") 70 ti.cursor_set("bogosity")
93 ti = tb.item_append("clock", "Unset", None, None) 71 ti = tb.item_append("clock", "Unset", None, None)
94 ti.cursor_unset() 72 ti.cursor_unset()
95 ti = tb.item_append("document-print", "Xterm", None, None) 73 ti = tb.item_append("document-print", "Xterm", None, None)
96 ti.cursor_set("xterm") 74 ti.cursor_set("xterm")
97 tb.size_hint_weight_set(0.0, 0.0)
98 tb.size_hint_align_set(evas.EVAS_HINT_FILL, 0.0)
99 bx.pack_end(tb) 75 bx.pack_end(tb)
100 tb.show() 76 tb.show()
101 77
102 lst = List(win) 78 lst = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
103 li = lst.item_append("cursor bogosity") 79 li = lst.item_append("cursor bogosity")
104 li.cursor_set("bogosity") 80 li.cursor_set("bogosity")
105 li = lst.item_append("cursor unset") 81 li = lst.item_append("cursor unset")
106 li.cursor_unset() 82 li.cursor_unset()
107 li = lst.item_append("cursor xterm") 83 li = lst.item_append("cursor xterm")
108 li.cursor_set("xterm") 84 li.cursor_set("xterm")
109 lst.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
110 lst.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
111 bx.pack_end(lst) 85 bx.pack_end(lst)
112 lst.go() 86 lst.go()
113 lst.show() 87 lst.show()
114 88
115 win.resize(320, 480)
116 win.show() 89 win.show()
117 90
118 91
119def cursor3_clicked(obj, item=None): 92def cursor3_clicked(obj, item=None):
120 win = Window("cursors", elementary.ELM_WIN_BASIC) 93 win = StandardWindow("cursors", "Cursors 3", autodel=True, size=(320, 480))
121 win.title_set("Cursors 3")
122 win.autodel_set(True)
123 94
124 elementary.theme_extension_add("./cursors.edj") 95 elementary.theme_extension_add("./cursors.edj")
125 bg = Background(win)
126 win.resize_object_add(bg)
127 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
128 bg.show()
129 96
130 bx = Box(win) 97 bx = Box(win, size_hint_weight=EXPAND_BOTH)
131 win.resize_object_add(bx) 98 win.resize_object_add(bx)
132 bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
133 bx.show() 99 bx.show()
134 100
135 bt = Button(win) 101 bt = Button(win, text="hand1", cursor="hand1",
136 bt.text_set("hand1") 102 cursor_theme_search_enabled=False)
137 bt.cursor_set("hand1")
138 bt.cursor_theme_search_enabled_set(False)
139 bx.pack_end(bt) 103 bx.pack_end(bt)
140 bt.show() 104 bt.show()
141 105
142 bt = Button(win) 106 bt = Button(win, text="hand2 x", cursor="hand2")
143 bt.text_set("hand2 x")
144 bt.cursor_set("hand2")
145 bx.pack_end(bt) 107 bx.pack_end(bt)
146 bt.show() 108 bt.show()
147 109
148 bt = Button(win) 110 bt = Button(win, text="hand2", cursor="hand2",
149 bt.text_set("hand2") 111 cursor_theme_search_enabled=False)
150 bt.cursor_set("hand2")
151 bt.cursor_theme_search_enabled_set(False)
152 bx.pack_end(bt) 112 bx.pack_end(bt)
153 bt.show() 113 bt.show()
154 114
155 bt = Button(win) 115 bt = Button(win, text="hand3", cursor="hand3",
156 bt.text_set("hand3") 116 cursor_theme_search_enabled=False)
157 bt.cursor_set("hand3")
158 bt.cursor_theme_search_enabled_set(False)
159 bx.pack_end(bt) 117 bx.pack_end(bt)
160 bt.show() 118 bt.show()
161 119
162 bt = Button(win) 120 bt = Button(win, text="hand3", cursor="hand3",
163 bt.text_set("hand3") 121 cursor_theme_search_enabled=False, cursor_style="transparent")
164 bt.cursor_set("hand3")
165 bt.cursor_theme_search_enabled_set(False)
166 bt.cursor_style_set("transparent")
167 bx.pack_end(bt) 122 bx.pack_end(bt)
168 bt.show() 123 bt.show()
169 124
170 bt = Button(win) 125 bt = Button(win, text="not existent", cursor="hand4",
171 bt.text_set("not existent") 126 cursor_theme_search_enabled=False)
172 bt.cursor_set("hand4")
173 bt.cursor_theme_search_enabled_set(False)
174 bx.pack_end(bt) 127 bx.pack_end(bt)
175 bt.show() 128 bt.show()
176 129
177 elementary.cursor_engine_only_set(False) 130 elementary.cursor_engine_only_set(False)
178 bt = Button(win) 131
179 bt.text_set("hand 2 engine only config false") 132 bt = Button(win, text="hand 2 engine only config false", cursor="hand2")
180 bt.cursor_set("hand2")
181 bx.pack_end(bt) 133 bx.pack_end(bt)
182 bt.show() 134 bt.show()
183 135
184 elementary.cursor_engine_only_set(True) 136 elementary.cursor_engine_only_set(True)
185 bt = Button(win) 137
186 bt.text_set("hand 2 engine only config true") 138 bt = Button(win, text="hand 2 engine only config true", cursor="hand2")
187 bt.cursor_set("hand2")
188 bx.pack_end(bt) 139 bx.pack_end(bt)
189 bt.show() 140 bt.show()
190 141
191 lst = List(win) 142 lst = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
192 li = lst.item_append("cursor hand2 x") 143 li = lst.item_append("cursor hand2 x")
193 li.cursor_set("hand2") 144 li.cursor_set("hand2")
194 li = lst.item_append("cursor hand2") 145 li = lst.item_append("cursor hand2")
@@ -199,56 +150,40 @@ def cursor3_clicked(obj, item=None):
199 li.cursor_engine_only_set(False) 150 li.cursor_engine_only_set(False)
200 li = lst.item_append("cursor hand3 transparent") 151 li = lst.item_append("cursor hand3 transparent")
201 li.cursor_set("hand3") 152 li.cursor_set("hand3")
202 bt.cursor_style_set("transparent") 153 li.cursor_style_set("transparent")
203 li.cursor_engine_only_set(False) 154 li.cursor_engine_only_set(False)
204 lst.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
205 lst.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
206 bx.pack_end(lst) 155 bx.pack_end(lst)
207 lst.go() 156 lst.go()
208 lst.show() 157 lst.show()
209 158
210 win.resize(320, 480)
211 win.show() 159 win.show()
212 160
213 161
214if __name__ == "__main__": 162if __name__ == "__main__":
215 def destroy(obj):
216 elementary.exit()
217
218 elementary.init() 163 elementary.init()
219 win = Window("test", elementary.ELM_WIN_BASIC) 164 win = StandardWindow("test", "python-elementary test application",
220 win.title_set("python-elementary test application") 165 size=(320,520))
221 win.callback_delete_request_add(destroy) 166 win.callback_delete_request_add(lambda o: elementary.exit())
222 167
223 bg = Background(win) 168 box0 = Box(win, size_hint_weight=EXPAND_BOTH)
224 win.resize_object_add(bg)
225 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
226 bg.show()
227
228 box0 = Box(win)
229 box0.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
230 win.resize_object_add(box0) 169 win.resize_object_add(box0)
231 box0.show() 170 box0.show()
232 171
233 fr = Frame(win)
234 fr.text_set("Information")
235 box0.pack_end(fr)
236 fr.show()
237
238 lb = Label(win) 172 lb = Label(win)
239 lb.text_set("Please select a test from the list below<br>" 173 lb.text_set("Please select a test from the list below<br>"
240 "by clicking the test button to show the<br>" 174 "by clicking the test button to show the<br>"
241 "test window.") 175 "test window.")
242 fr.content_set(lb)
243 lb.show() 176 lb.show()
244 177
178 fr = Frame(win, text="Information", content=lb)
179 box0.pack_end(fr)
180 fr.show()
181
245 items = [("Cursor", cursor_clicked), 182 items = [("Cursor", cursor_clicked),
246 ("Cursor 2", cursor2_clicked), 183 ("Cursor 2", cursor2_clicked),
247 ("Cursor 3", cursor3_clicked)] 184 ("Cursor 3", cursor3_clicked)]
248 185
249 li = List(win) 186 li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
250 li.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
251 li.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
252 box0.pack_end(li) 187 box0.pack_end(li)
253 li.show() 188 li.show()
254 189
@@ -257,8 +192,6 @@ if __name__ == "__main__":
257 192
258 li.go() 193 li.go()
259 194
260 win.resize(320, 480)
261 win.show() 195 win.show()
262 elementary.run() 196 elementary.run()
263 elementary.shutdown() 197 elementary.shutdown()
264
diff --git a/examples/elementary/test_datetime.py b/examples/elementary/test_datetime.py
index 0aff5cb..faba10a 100644
--- a/examples/elementary/test_datetime.py
+++ b/examples/elementary/test_datetime.py
@@ -2,52 +2,48 @@
2# encoding: utf-8 2# encoding: utf-8
3 3
4 4
5from efl import evas 5from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
6from efl import elementary 6from efl import elementary
7from efl.elementary.window import StandardWindow 7from efl.elementary.window import StandardWindow
8from efl.elementary.background import Background 8from efl.elementary.background import Background
9from efl.elementary.box import Box 9from efl.elementary.box import Box
10from efl.elementary.datetime_elm import Datetime 10from efl.elementary.datetime_elm import Datetime, ELM_DATETIME_MINUTE, \
11 11 ELM_DATETIME_HOUR, ELM_DATETIME_AMPM, ELM_DATETIME_DATE, \
12 ELM_DATETIME_MONTH, ELM_DATETIME_YEAR
12 13
13from datetime import datetime 14from datetime import datetime
14 15
16EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
17FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
18FILL_HORIZ = EVAS_HINT_FILL, 0.5
15 19
16def changed_cb(obj): 20def changed_cb(obj):
17 printf("Datetime value is changed\n") 21 print("Datetime value is changed")
18 22
19def datetime_clicked(obj): 23def datetime_clicked(obj):
20 win = StandardWindow("dt", "DateTime") 24 win = StandardWindow("dt", "DateTime")
21 win.autodel = True 25 win.autodel = True
22 26
23 bx = Box(win) 27 bx = Box(win, size_hint_weight=EXPAND_BOTH, horizontal=False,
24 bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 28 size_hint_min=(360, 240))
25 win.resize_object_add(bx) 29 win.resize_object_add(bx)
26 bx.horizontal = False
27 bx.show() 30 bx.show()
28 bx.size_hint_min_set(360, 240)
29 31
30 dt = Datetime(bx) 32 dt = Datetime(bx, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ)
31 dt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 33 dt.field_visible_set(ELM_DATETIME_HOUR, False)
32 dt.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) 34 dt.field_visible_set(ELM_DATETIME_MINUTE, False)
33 dt.field_visible_set(elementary.ELM_DATETIME_HOUR, False) 35 dt.field_visible_set(ELM_DATETIME_AMPM, False)
34 dt.field_visible_set(elementary.ELM_DATETIME_MINUTE, False)
35 dt.field_visible_set(elementary.ELM_DATETIME_AMPM, False)
36 bx.pack_end(dt) 36 bx.pack_end(dt)
37 dt.show() 37 dt.show()
38 38
39 dt = Datetime(bx) 39 dt = Datetime(bx, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ)
40 dt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 40 dt.field_visible_set(ELM_DATETIME_YEAR, False)
41 dt.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) 41 dt.field_visible_set(ELM_DATETIME_MONTH, False)
42 dt.field_visible_set(elementary.ELM_DATETIME_YEAR, False) 42 dt.field_visible_set(ELM_DATETIME_DATE, False)
43 dt.field_visible_set(elementary.ELM_DATETIME_MONTH, False)
44 dt.field_visible_set(elementary.ELM_DATETIME_DATE, False)
45 bx.pack_end(dt) 43 bx.pack_end(dt)
46 dt.show() 44 dt.show()
47 45
48 dt = Datetime(bx) 46 dt = Datetime(bx, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ)
49 dt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
50 dt.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5)
51 47
52 # get the current local time 48 # get the current local time
53 time1 = datetime.now() 49 time1 = datetime.now()
@@ -58,7 +54,7 @@ def datetime_clicked(obj):
58 time1.replace(year = 80, month = 4, day = 10, hour = 14, minute = 30) 54 time1.replace(year = 80, month = 4, day = 10, hour = 14, minute = 30)
59 dt.value_min = time1 55 dt.value_min = time1
60 # minutes can be input only in between 15 and 45 56 # minutes can be input only in between 15 and 45
61 dt.field_limit = (elementary.ELM_DATETIME_MINUTE, 15, 45) 57 dt.field_limit_set(ELM_DATETIME_MINUTE, 15, 45)
62 dt.callback_changed_add(changed_cb) 58 dt.callback_changed_add(changed_cb)
63 bx.pack_end(dt) 59 bx.pack_end(dt)
64 dt.show() 60 dt.show()
diff --git a/examples/elementary/test_dayselector.py b/examples/elementary/test_dayselector.py
index ed4460f..45b1a9e 100644
--- a/examples/elementary/test_dayselector.py
+++ b/examples/elementary/test_dayselector.py
@@ -1,79 +1,71 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
5from efl import elementary 5from efl import elementary
6from efl.elementary.window import Window 6from efl.elementary.window import StandardWindow
7from efl.elementary.background import Background
8from efl.elementary.box import Box 7from efl.elementary.box import Box
9from efl.elementary.dayselector import Dayselector 8
9# XXX: Check needs to be imported here to make part_content_get work.
10#
11# We should make object_from_instance more intelligent,
12# importing on demand.
13from efl.elementary.check import Check
14
15from efl.elementary.dayselector import Dayselector, ELM_DAYSELECTOR_SUN, \
16 ELM_DAYSELECTOR_MON, ELM_DAYSELECTOR_TUE, ELM_DAYSELECTOR_WED, \
17 ELM_DAYSELECTOR_THU, ELM_DAYSELECTOR_FRI, ELM_DAYSELECTOR_SAT
18
19EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
20FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
21FILL_HORIZ = EVAS_HINT_FILL, 0.5
10 22
11def cb_changed(ds): 23def cb_changed(ds):
12 print("\nSelected Days:") 24 print("\nSelected Days:")
13 print(("Sun:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_SUN))) 25 print("Sun: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_SUN)))
14 print(("Mon:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_MON))) 26 print("Mon: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_MON)))
15 print(("Tue:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_TUE))) 27 print("Tue: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_TUE)))
16 print(("Wed:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_WED))) 28 print("Wed: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_WED)))
17 print(("Thu:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_THU))) 29 print("Thu: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_THU)))
18 print(("Fri:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_FRI))) 30 print("Fri: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_FRI)))
19 print(("Sat:", ds.day_selected_get(elementary.ELM_DAYSELECTOR_SAT))) 31 print("Sat: {0}".format(ds.day_selected_get(ELM_DAYSELECTOR_SAT)))
20 32
21 33
22def dayselector_clicked(obj): 34def dayselector_clicked(obj):
23 win = Window("dayselector", elementary.ELM_WIN_BASIC) 35 win = StandardWindow("dayselector", "Dayselector test", autodel=True,
24 win.title = "Dayselector test" 36 size=(350, 120))
25 win.autodel = True
26 if obj is None: 37 if obj is None:
27 win.callback_delete_request_add(lambda o: elementary.exit()) 38 win.callback_delete_request_add(lambda o: elementary.exit())
28 39
29 bg = Background(win) 40 box = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
30 win.resize_object_add(bg)
31 bg.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
32 bg.show()
33
34 box = Box(win)
35 box.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
36 box.size_hint_align = (evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
37 win.resize_object_add(box) 41 win.resize_object_add(box)
38 box.show() 42 box.show()
39 43
40 # default 44 # default
41 ds = Dayselector(win) 45 ds = Dayselector(win, size_hint_weight=EXPAND_BOTH,
42 ds.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 46 size_hint_align=FILL_HORIZ)
43 ds.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
44 box.pack_end(ds) 47 box.pack_end(ds)
45 ds.show() 48 ds.show()
46 ds.callback_dayselector_changed_add(cb_changed) 49 ds.callback_dayselector_changed_add(cb_changed)
47 50
48 # Sunday first 51 # Sunday first
49 ds = Dayselector(win) 52 ds = Dayselector(win, size_hint_weight=EXPAND_BOTH,
50 ds.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 53 size_hint_align=FILL_HORIZ, week_start=ELM_DAYSELECTOR_SUN)
51 ds.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
52 box.pack_end(ds) 54 box.pack_end(ds)
53 ds.show() 55 ds.show()
54 ds.callback_dayselector_changed_add(cb_changed) 56 ds.callback_dayselector_changed_add(cb_changed)
55 try: 57 sunday = ds.part_content_get("day0")
56 sunday = ds.part_content_get("day0") 58 sunday.signal_emit("elm,type,weekend,style1", "")
57 sunday.signal_emit("elm,type,weekend,style1", "")
58 except:
59 print("BUG HERE !!!")
60 59
61 # Monday first 60 # Monday first
62 ds = Dayselector(win) 61 ds = Dayselector(win, size_hint_weight=EXPAND_BOTH,
63 ds.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 62 size_hint_align=FILL_HORIZ, week_start=ELM_DAYSELECTOR_MON)
64 ds.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
65 ds.callback_dayselector_changed_add(cb_changed) 63 ds.callback_dayselector_changed_add(cb_changed)
66 box.pack_end(ds) 64 box.pack_end(ds)
67 ds.show() 65 ds.show()
68 ds.week_start = elementary.ELM_DAY_MONDAY 66 sunday = ds.part_content_get("day0")
69 try: 67 sunday.signal_emit("elm,type,weekend,style1", "")
70 sunday = ds.part_content_get("day0")
71 sunday.signal_emit("elm,type,weekend,style1", "")
72 except:
73 print("BUG HERE !!!")
74
75 68
76 win.resize(350, 120)
77 win.show() 69 win.show()
78 70
79 71
diff --git a/examples/elementary/test_diskselector.py b/examples/elementary/test_diskselector.py
index e95a79d..b068301 100644
--- a/examples/elementary/test_diskselector.py
+++ b/examples/elementary/test_diskselector.py
@@ -1,20 +1,29 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4import os
5
6from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
5from efl import elementary 7from efl import elementary
6from efl.elementary.window import Window 8from efl.elementary.window import StandardWindow
7from efl.elementary.background import Background
8from efl.elementary.box import Box 9from efl.elementary.box import Box
9from efl.elementary.icon import Icon 10from efl.elementary.icon import Icon
10from efl.elementary.diskselector import Diskselector 11from efl.elementary.diskselector import Diskselector
11 12
13EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
14FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
15FILL_HORIZ = EVAS_HINT_FILL, 0.5
16
12months=["January", "February", "March", "April", "May", "June", "August", "September", "October", "November", "December"] 17months=["January", "February", "March", "April", "May", "June", "August", "September", "October", "November", "December"]
13weekdays=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 18weekdays=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
14months_short=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] 19months_short=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
15 20
16def disk_create(win, rnd): 21img_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "images")
17 di = Diskselector(win) 22ic_file = os.path.join(img_path, "logo_small.png")
23
24
25def disk_create(win, rnd, **kwargs):
26 di = Diskselector(win, round_enabled=rnd, **kwargs)
18 for m in months: 27 for m in months:
19 if m == "August": 28 if m == "August":
20 it = di.item_append(m) 29 it = di.item_append(m)
@@ -22,109 +31,84 @@ def disk_create(win, rnd):
22 di.item_append(m) 31 di.item_append(m)
23 32
24 it.selected = True 33 it.selected = True
25 di.round_enabled = rnd
26 34
27 return di 35 return di
28 36
29def cb_sel(ds, item): 37def cb_sel(ds, item):
30 print(("Selected item: %s" % (item.text.encode("UTF-8")))) 38 print("Selected item: " + item.text.encode("utf-8"))
31 39
32 40
33def diskselector_clicked(obj): 41def diskselector_clicked(obj):
34 win = Window("diskselector", elementary.ELM_WIN_BASIC) 42 win = StandardWindow("diskselector", "Diskselector test", autodel=True,
35 win.title = "Diskselector test" 43 size=(320, 480))
36 win.autodel = True
37 if obj is None: 44 if obj is None:
38 win.callback_delete_request_add(lambda o: elementary.exit()) 45 win.callback_delete_request_add(lambda o: elementary.exit())
39 46
40 bg = Background(win) 47 vbox = Box(win, size_hint_weight=EXPAND_BOTH)
41 win.resize_object_add(bg)
42 bg.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
43 bg.show()
44
45 vbox = Box(win)
46 vbox.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
47 win.resize_object_add(vbox) 48 win.resize_object_add(vbox)
48 vbox.show() 49 vbox.show()
49 50
50 di = disk_create(win, True) 51 di = disk_create(win, rnd=True, size_hint_weight=EXPAND_BOTH,
51 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 52 size_hint_align=FILL_HORIZ)
52 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
53 di.callback_selected_add(cb_sel) 53 di.callback_selected_add(cb_sel)
54 vbox.pack_end(di) 54 vbox.pack_end(di)
55 di.show() 55 di.show()
56 di.first_item.selected = True 56 di.first_item.selected = True
57 57
58 di = disk_create(win, False) 58 di = disk_create(win, rnd=False, size_hint_weight=EXPAND_BOTH,
59 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 59 size_hint_align=FILL_HORIZ)
60 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
61 di.callback_selected_add(cb_sel) 60 di.callback_selected_add(cb_sel)
62 vbox.pack_end(di) 61 vbox.pack_end(di)
63 di.show() 62 di.show()
64 di.first_item.next.selected = True 63 di.first_item.next.selected = True
65 64
66 di = disk_create(win, False) 65 di = disk_create(win, rnd=False, size_hint_weight=EXPAND_BOTH,
67 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 66 size_hint_align=FILL_HORIZ, side_text_max_length=4)
68 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
69 di.callback_selected_add(cb_sel) 67 di.callback_selected_add(cb_sel)
70 vbox.pack_end(di) 68 vbox.pack_end(di)
71 di.show() 69 di.show()
72 di.side_text_max_length = 4
73 70
74 ic = Icon(win) 71 ic = Icon(win, file=ic_file)
75 ic.file = "images/logo_small.png" 72 di = Diskselector(win, size_hint_weight=EXPAND_BOTH,
76 di = Diskselector(win) 73 size_hint_align=FILL_HORIZ)
77 di.item_append("Sunday", ic) 74 di.item_append("Sunday", ic)
78 for day in weekdays: 75 for day in weekdays:
79 di.item_append(day) 76 di.item_append(day)
80 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
81 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
82 di.callback_selected_add(cb_sel) 77 di.callback_selected_add(cb_sel)
83 vbox.pack_end(di) 78 vbox.pack_end(di)
84 di.show() 79 di.show()
85 80
86 ic = Icon(win) 81 ic = Icon(win, file=ic_file)
87 ic.file = "images/logo_small.png" 82 di = Diskselector(win, round_enabled=True, size_hint_weight=EXPAND_BOTH,
88 di = Diskselector(win) 83 size_hint_align=FILL_HORIZ)
89 di.item_append("머리스타일", ic) 84 di.item_append("머리스타일", ic)
90 for lan in ["プロが伝授する", "生上访要求政府", "English", "والشريعة", "עִבְרִית", "Grüßen"]: 85 for lan in ["プロが伝授する", "生上访要求政府", "English", "والشريعة", "עִבְרִית", "Grüßen"]:
91 di.item_append(lan) 86 di.item_append(lan)
92 di.round_enabled = True
93 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
94 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
95 di.callback_selected_add(cb_sel) 87 di.callback_selected_add(cb_sel)
96 vbox.pack_end(di) 88 vbox.pack_end(di)
97 di.show() 89 di.show()
98 90
99 di = Diskselector(win) 91 di = Diskselector(win, display_item_num=5, round_enabled=True,
100 di.display_item_num = 5 92 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ)
101 for m in months_short: 93 for m in months_short:
102 di.item_append(m) 94 di.item_append(m)
103 di.round_enabled = True
104 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
105 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
106 di.callback_selected_add(cb_sel) 95 di.callback_selected_add(cb_sel)
107 vbox.pack_end(di) 96 vbox.pack_end(di)
108 di.show() 97 di.show()
109 di.last_item.selected = True 98 di.last_item.selected = True
110 99
111 di = Diskselector(win) 100 di = Diskselector(win, display_item_num=7, round_enabled=True,
101 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ)
112 di.display_item_num = 7 102 di.display_item_num = 7
113 for i in range(31): 103 for i in range(31):
114 di.item_append(str(i)) 104 di.item_append(str(i))
115 di.round_enabled = True
116 di.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
117 di.size_hint_align = (evas.EVAS_HINT_FILL, 0.5)
118 di.callback_selected_add(cb_sel) 105 di.callback_selected_add(cb_sel)
119 vbox.pack_end(di) 106 vbox.pack_end(di)
120 di.show() 107 di.show()
121 di.last_item.selected = True 108 di.last_item.selected = True
122 109
123
124 win.resize(320, 480)
125 win.show() 110 win.show()
126 111
127
128if __name__ == "__main__": 112if __name__ == "__main__":
129 elementary.init() 113 elementary.init()
130 114
diff --git a/examples/elementary/test_dnd.py b/examples/elementary/test_dnd.py
index f989aa5..2534fd9 100644
--- a/examples/elementary/test_dnd.py
+++ b/examples/elementary/test_dnd.py
@@ -1,7 +1,10 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, \
5 EVAS_ASPECT_CONTROL_VERTICAL, EVAS_CALLBACK_MOUSE_MOVE, \
6 EVAS_CALLBACK_MOUSE_UP, EVAS_CALLBACK_MOUSE_DOWN, \
7 EVAS_EVENT_FLAG_ON_HOLD
5from efl import elementary 8from efl import elementary
6from efl.elementary.box import Box 9from efl.elementary.box import Box
7from efl.elementary.window import StandardWindow 10from efl.elementary.window import StandardWindow
@@ -9,6 +12,9 @@ from efl.elementary.icon import Icon
9from efl.elementary.genlist import Genlist, GenlistItemClass, \ 12from efl.elementary.genlist import Genlist, GenlistItemClass, \
10 ELM_SEL_FORMAT_TARGETS, ELM_GENLIST_ITEM_NONE, DragUserInfo 13 ELM_SEL_FORMAT_TARGETS, ELM_GENLIST_ITEM_NONE, DragUserInfo
11 14
15EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
16FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
17
12img = ( 18img = (
13 "panel_01.jpg", 19 "panel_01.jpg",
14 "plant_01.jpg", 20 "plant_01.jpg",
@@ -45,9 +51,8 @@ class DndItemClass(GenlistItemClass):
45 51
46 def content_get(self, obj, part, data, *args): 52 def content_get(self, obj, part, data, *args):
47 if part == "elm.swallow.icon": 53 if part == "elm.swallow.icon":
48 icon = Icon(obj) 54 icon = Icon(obj, file=data,
49 icon.file = data 55 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
50 icon.size_hint_aspect = evas.EVAS_ASPECT_CONTROL_VERTICAL, 1, 1
51 icon.show() 56 icon.show()
52 return icon 57 return icon
53 return None 58 return None
@@ -293,10 +298,8 @@ def gl_createicon(win, xoff, yoff, data):
293 if yoff is not None: 298 if yoff is not None:
294 yoff = ym - (h/2) 299 yoff = ym - (h/2)
295 300
296 icon = Icon(win) 301 icon = Icon(win, file=(f, g), size_hint_weight=EXPAND_BOTH,
297 icon.file = f, g 302 size_hint_align=FILL_BOTH)
298 icon.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
299 icon.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
300 303
301 if (xoff is not None) and (yoff is not None): 304 if (xoff is not None) and (yoff is not None):
302 icon.move(xoff, yoff) 305 icon.move(xoff, yoff)
@@ -327,16 +330,12 @@ def gl_icons_get(data):
327 330
328 if o is not None: 331 if o is not None:
329 f, g = o.file 332 f, g = o.file
330 ic = Icon(gl)
331 ic.file = f, g
332 x, y, w, h = o.geometry 333 x, y, w, h = o.geometry
333 ic.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
334 ic.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
335 334
336 ic.move(x, y) 335 ic = Icon(gl, file=(f, g), size_hint_align=FILL_BOTH,
337 ic.resize(w, h) 336 size_hint_weight=EXPAND_BOTH, pos=(x,y), size=(w,h))
338 ic.show()
339 337
338 ic.show()
340 icons.append(ic) 339 icons.append(ic)
341 340
342 return icons 341 return icons
@@ -513,32 +512,30 @@ def gl_dnd_default_anim_data_getcb(gl, it):
513# return False 512# return False
514 513
515def dnd_genlist_default_anim_clicked(*args): 514def dnd_genlist_default_anim_clicked(*args):
516 win = StandardWindow("dnd-genlist-default-anim", "DnD-Genlist-Default-Anim") 515 win = StandardWindow("dnd-genlist-default-anim",
516 "DnD-Genlist-Default-Anim", autodel=True, size=(680, 800))
517 win.autodel = True 517 win.autodel = True
518 518
519 bxx = Box(win) 519 bxx = Box(win, horizontal=True, size_hint_weight=EXPAND_BOTH)
520 bxx.horizontal = True
521 bxx.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
522 win.resize_object_add(bxx) 520 win.resize_object_add(bxx)
523 bxx.show() 521 bxx.show()
524 522
525 for j in range(2): 523 for j in range(2):
526 gl = Genlist(win) 524 gl = Genlist(win, multi_select=True, size_hint_weight=EXPAND_BOTH,
525 size_hint_align=FILL_BOTH)
527 526
528 # START Drag and Drop handling 527 # START Drag and Drop handling
529 win.callback_delete_request_add(win_del, gl) 528 win.callback_delete_request_add(win_del, gl)
530 gl.multi_select = True # We allow multi drag
531 gl.drop_item_container_add(ELM_SEL_FORMAT_TARGETS, 529 gl.drop_item_container_add(ELM_SEL_FORMAT_TARGETS,
532 gl_item_getcb, dropcb=gl_dropcb) 530 gl_item_getcb, dropcb=gl_dropcb)
533 531
534 gl.drag_item_container_add(ANIM_TIME, DRAG_TIMEOUT, 532 gl.drag_item_container_add(ANIM_TIME, DRAG_TIMEOUT,
535 gl_item_getcb, gl_dnd_default_anim_data_getcb) 533 gl_item_getcb, gl_dnd_default_anim_data_getcb)
536 534
537 # FIXME: This causes genlist to resize the horiz axis very slowly :( 535 # FIXME: This causes genlist to resize the horiz axis very slowly :(
538 # Reenable this and resize the window horizontally, then try to resize it back 536 # Reenable this and resize the window horizontally, then try
537 # to resize it back.
539 #elm_genlist_mode_set(gl, ELM_LIST_LIMIT) 538 #elm_genlist_mode_set(gl, ELM_LIST_LIMIT)
540 gl.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
541 gl.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
542 bxx.pack_end(gl) 539 bxx.pack_end(gl)
543 gl.show() 540 gl.show()
544 541
@@ -547,7 +544,6 @@ def dnd_genlist_default_anim_clicked(*args):
547 for i in range (20): 544 for i in range (20):
548 gl.item_append(itc1, "images/{0}".format(img[i % 9]), flags=ELM_GENLIST_ITEM_NONE) 545 gl.item_append(itc1, "images/{0}".format(img[i % 9]), flags=ELM_GENLIST_ITEM_NONE)
549 546
550 win.resize(680, 800)
551 win.show() 547 win.show()
552 548
553# def test_dnd_genlist_user_anim(obj, event_info, data): 549# def test_dnd_genlist_user_anim(obj, event_info, data):
diff --git a/examples/elementary/test_entry.py b/examples/elementary/test_entry.py
index d7f2b80..5141295 100644
--- a/examples/elementary/test_entry.py
+++ b/examples/elementary/test_entry.py
@@ -1,9 +1,9 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl import evas 4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
5from efl import elementary 5from efl import elementary
6from efl.elementary.window import Window, StandardWindow 6from efl.elementary.window import StandardWindow
7from efl.elementary.background import Background 7from efl.elementary.background import Background
8from efl.elementary.box import Box 8from efl.elementary.box import Box
9from efl.elementary.button import Button 9from efl.elementary.button import Button
@@ -14,15 +14,22 @@ from efl.elementary.frame import Frame
14from efl.elementary.label import Label 14from efl.elementary.label import Label
15from efl.elementary.separator import Separator 15from efl.elementary.separator import Separator
16from efl.elementary.icon import Icon 16from efl.elementary.icon import Icon
17from efl.elementary.scroller import Scrollable 17from efl.elementary.scroller import Scrollable, ELM_SCROLLER_POLICY_OFF, \
18 ELM_SCROLLER_POLICY_ON
19
20EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
21EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
22FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
23FILL_HORIZ = EVAS_HINT_FILL, 0.5
24
25SCROLL_POLICY_OFF = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF
26SCROLL_POLICY_ON = ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON
18 27
19class ScrollableEntry(Scrollable, Entry): 28class ScrollableEntry(Scrollable, Entry):
20 def __init__(self, canvas, *args, **kwargs): 29 def __init__(self, canvas, *args, **kwargs):
21 Entry.__init__(self, canvas) 30 Entry.__init__(self, canvas, *args, **kwargs)
22 self.scrollable = True 31 self.scrollable = True
23 32
24from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
25
26def my_entry_bt_1(bt, en): 33def my_entry_bt_1(bt, en):
27 en.entry_set("") 34 en.entry_set("")
28 35
@@ -42,22 +49,14 @@ def my_entry_anchor_test(obj, anchor, en, *args, **kwargs):
42 49
43 50
44def entry_clicked(obj, item=None): 51def entry_clicked(obj, item=None):
45 win = Window("entry", elementary.ELM_WIN_BASIC) 52 win = StandardWindow("entry", "Entry", autodel=True)
46 win.title_set("Entry")
47 win.autodel_set(True)
48 53
49 bg = Background(win) 54 bx = Box(win, size_hint_weight=EXPAND_BOTH)
50 win.resize_object_add(bg)
51 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
52 bg.show()
53
54 bx = Box(win)
55 win.resize_object_add(bx) 55 win.resize_object_add(bx)
56 bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
57 bx.show() 56 bx.show()
58 57
59 en = Entry(win) 58 en = Entry(win, line_wrap=False, size_hint_weight=EXPAND_BOTH,
60 en.line_wrap_set(False) 59 size_hint_align=FILL_BOTH)
61 en.entry_set("This is an entry widget in this window that<br>" 60 en.entry_set("This is an entry widget in this window that<br>"
62 "uses markup <b>like this</> for styling and<br>" 61 "uses markup <b>like this</> for styling and<br>"
63 "formatting <em>like this</>, as well as<br>" 62 "formatting <em>like this</>, as well as<br>"
@@ -66,45 +65,33 @@ def entry_clicked(obj, item=None):
66 "called <a href=anc-02>Anchors</a> so you will need<br>" 65 "called <a href=anc-02>Anchors</a> so you will need<br>"
67 "to refer to them this way.") 66 "to refer to them this way.")
68 en.callback_anchor_clicked_add(my_entry_anchor_test, en) 67 en.callback_anchor_clicked_add(my_entry_anchor_test, en)
69 en.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
70 en.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
71 bx.pack_end(en) 68 bx.pack_end(en)
72 en.show() 69 en.show()
73 70
74 bx2 = Box(win) 71 bx2 = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ,
75 bx2.horizontal_set(True) 72 size_hint_align=FILL_BOTH)
76 bx2.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
77 bx2.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
78 73
79 bt = Button(win) 74 bt = Button(win, text="Clear", size_hint_weight=EXPAND_HORIZ,
80 bt.text_set("Clear") 75 size_hint_align=FILL_BOTH)
81 bt.callback_clicked_add(my_entry_bt_1, en) 76 bt.callback_clicked_add(my_entry_bt_1, en)
82 bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
83 bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
84 bx2.pack_end(bt) 77 bx2.pack_end(bt)
85 bt.show() 78 bt.show()
86 79
87 bt = Button(win) 80 bt = Button(win, text="Print", size_hint_weight=EXPAND_HORIZ,
88 bt.text_set("Print") 81 size_hint_align=FILL_BOTH)
89 bt.callback_clicked_add(my_entry_bt_2, en) 82 bt.callback_clicked_add(my_entry_bt_2, en)
90 bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
91 bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
92 bx2.pack_end(bt) 83 bx2.pack_end(bt)
93 bt.show() 84 bt.show()
94 85
95 bt = Button(win) 86 bt = Button(win, text="Selection", size_hint_weight=EXPAND_HORIZ,
96 bt.text_set("Selection") 87 size_hint_align=FILL_BOTH)
97 bt.callback_clicked_add(my_entry_bt_3, en) 88 bt.callback_clicked_add(my_entry_bt_3, en)
98 bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
99 bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
100 bx2.pack_end(bt) 89 bx2.pack_end(bt)
101 bt.show() 90 bt.show()
102 91
103 bt = Button(win) 92 bt = Button(win, text="Insert", size_hint_weight=EXPAND_HORIZ,
104 bt.text_set("Insert") 93 size_hint_align=FILL_BOTH)
105 bt.callback_clicked_add(my_entry_bt_4, en) 94 bt.callback_clicked_add(my_entry_bt_4, en)
106 bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
107 bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
108 bx2.pack_end(bt) 95 bx2.pack_end(bt)
109 bt.show() 96 bt.show()
110 97
@@ -162,43 +149,32 @@ def entry_scrolled_clicked(obj, item = None):
162 #static Elm_Entry_Filter_Limit_Size limit_filter_data, limit_filter_data2; 149 #static Elm_Entry_Filter_Limit_Size limit_filter_data, limit_filter_data2;
163 150
164 151
165 win = StandardWindow("entry-scrolled", "Entry Scrolled") 152 win = StandardWindow("entry-scrolled", "Entry Scrolled", autodel=True,
166 win.autodel = True 153 size=(320, 300))
167 154
168 bx = Box(win) 155 bx = Box(win, size_hint_weight=EXPAND_BOTH)
169 bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
170 win.resize_object_add(bx) 156 win.resize_object_add(bx)
171 bx.show() 157 bx.show()
172 158
173 # disabled entry 159 # disabled entry
174 en = ScrollableEntry(win) 160 en = ScrollableEntry(win, size_hint_weight=EXPAND_HORIZ,
175 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0 161 size_hint_align=FILL_HORIZ, scrollbar_policy=SCROLL_POLICY_OFF,
176 en.size_hint_align = EVAS_HINT_FILL, 0.5 162 text="Disabled entry", single_line=True, disabled=True)
177 en.scrollbar_policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF
178 en.text = "Disabled entry"
179 en.single_line = True
180 en.disabled = True
181 en.show() 163 en.show()
182 bx.pack_end(en) 164 bx.pack_end(en)
183 165
184 # password entry 166 # password entry
185 en = ScrollableEntry(win) 167 en = ScrollableEntry(win, size_hint_weight=EXPAND_HORIZ,
186 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0 168 size_hint_align=FILL_HORIZ, scrollbar_policy=SCROLL_POLICY_OFF,
187 en.size_hint_align = EVAS_HINT_FILL, 0.5 169 password=True, single_line=True, text="Access denied, give up!",
188 en.scrollbar_policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF 170 disabled=True)
189 en.password = True
190 en.single_line = True
191 en.text = "Access denied, give up!"
192 en.disabled = True
193 en.show() 171 en.show()
194 bx.pack_end(en) 172 bx.pack_end(en)
195 173
196 # multi-line disable entry 174 # multi-line disable entry
197 en = ScrollableEntry(win) 175 en = ScrollableEntry(win, size_hint_weight=EXPAND_BOTH,
198 en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 176 size_hint_align=FILL_BOTH, scrollbar_policy=SCROLL_POLICY_ON,
199 en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL 177 disabled=True)
200 en.scrollbar_policy = ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON
201 en.disabled = True
202 en.context_menu_item_add("Hello") 178 en.context_menu_item_add("Hello")
203 en.context_menu_item_add("World") 179 en.context_menu_item_add("World")
204 en.text = "Multi-line disabled entry widget :)<br/>"\ 180 en.text = "Multi-line disabled entry widget :)<br/>"\
@@ -209,29 +185,22 @@ def entry_scrolled_clicked(obj, item = None):
209 en.show() 185 en.show()
210 bx.pack_end(en) 186 bx.pack_end(en)
211 187
212 sp = Separator(win) 188 sp = Separator(win, horizontal=True)
213 sp.horizontal = True
214 bx.pack_end(sp) 189 bx.pack_end(sp)
215 sp.show() 190 sp.show()
216 191
217 # Single line selected entry 192 # Single line selected entry
218 en = ScrollableEntry(win) 193 en = ScrollableEntry(win, size_hint_weight=EXPAND_HORIZ,
219 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0 194 size_hint_align=FILL_HORIZ, text="This is a single line",
220 en.size_hint_align = EVAS_HINT_FILL, 0.5 195 scrollbar_policy=SCROLL_POLICY_OFF, single_line=True)
221 en.text = "This is a single line"
222 en.scrollbar_policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF
223 en.single_line = True
224 en.select_all() 196 en.select_all()
225 en.show() 197 en.show()
226 bx.pack_end(en) 198 bx.pack_end(en)
227 199
228 # Filter test 200 # Filter test
229 en = ScrollableEntry(win) 201 en = ScrollableEntry(win, size_hint_weight=EXPAND_HORIZ,
230 en.size_hint_weight = EVAS_HINT_EXPAND, 0.0 202 size_hint_align=FILL_HORIZ, text="Filter test",
231 en.size_hint_align = EVAS_HINT_FILL, 0.5 203 scrollbar_policy=SCROLL_POLICY_OFF, single_line=True)
232 en.text = "Filter test"
233 en.scrollbar_policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF
234 en.single_line = True
235 en.show() 204 en.show()
236 bx.pack_end(en) 205 bx.pack_end(en)
237 206
@@ -294,44 +263,30 @@ def entry_scrolled_clicked(obj, item = None):
294 # en.markup_filter_append(elm_entry_filter_limit_size, limit_filter_data2) 263 # en.markup_filter_append(elm_entry_filter_limit_size, limit_filter_data2)
295 264
296 # Single line password entry 265 # Single line password entry
297 en_p = ScrollableEntry(win) 266 en_p = ScrollableEntry(win, size_hint_weight=EXPAND_HORIZ,
298 en_p.scrollable = True 267 size_hint_align=FILL_HORIZ, scrollbar_policy=SCROLL_POLICY_OFF,
299 en_p.size_hint_weight = EVAS_HINT_EXPAND, 0.0 268 text="Password here", single_line=True, password=True)
300 en_p.size_hint_align = EVAS_HINT_FILL, 0.5
301 en_p.scrollbar_policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF
302 en_p.text = "Password here"
303 en_p.single_line = True
304 en_p.password = True
305 en_p.show() 269 en_p.show()
306 bx.pack_end(en_p) 270 bx.pack_end(en_p)
307 271
308 # entry with icon/end widgets 272 # entry with icon/end widgets
309 en = ScrollableEntry(win) 273 en = ScrollableEntry(win, scrollbar_policy=SCROLL_POLICY_OFF,
310 en.scrollbar_policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF 274 single_line=True, size_hint_weight=EXPAND_BOTH,
311 en.single_line = True 275 size_hint_align=FILL_BOTH, text="entry with icon and end objects")
312 en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 276 bt = Icon(win, standard="home", size_hint_min=(48, 48),
313 en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL 277 color=(128, 0, 0, 128))
314 bt = Icon(win)
315 bt.standard = "home"
316 bt.size_hint_min = 48, 48
317 bt.color = 128, 0, 0, 128
318 bt.show() 278 bt.show()
319 en.part_content_set("icon", bt) 279 en.part_content_set("icon", bt)
320 bt = Icon(win) 280 bt = Icon(win, standard="delete", size_hint_min=(48, 48),
321 bt.standard = "delete" 281 color=(128, 0, 0, 128))
322 bt.color = 128, 0, 0, 128
323 bt.size_hint_min = 48, 48
324 bt.show() 282 bt.show()
325 en.part_content_set("end", bt) 283 en.part_content_set("end", bt)
326 en.text = "entry with icon and end objects"
327 en.show() 284 en.show()
328 bx.pack_end(en) 285 bx.pack_end(en)
329 286
330 # markup entry 287 # markup entry
331 en = ScrollableEntry(win) 288 en = ScrollableEntry(win, size_hint_weight=EXPAND_BOTH,
332 en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 289 size_hint_align=FILL_BOTH, scrollbar_policy=SCROLL_POLICY_ON)
333 en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
334 en.scrollbar_policy = ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON
335 en.text = "This is an entry widget in this window that<br/>"\ 290 en.text = "This is an entry widget in this window that<br/>"\
336 "uses markup <b>like this</> for styling and<br/>"\ 291 "uses markup <b>like this</> for styling and<br/>"\
337 "formatting <em>like this</>, as well as<br/>"\ 292 "formatting <em>like this</>, as well as<br/>"\
@@ -347,158 +302,111 @@ def entry_scrolled_clicked(obj, item = None):
347 en.show() 302 en.show()
348 bx.pack_end(en) 303 bx.pack_end(en)
349 304
350 bx2 = Box(win) 305 bx2 = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ,
351 bx2.horizontal = True 306 size_hint_align=FILL_BOTH)
352 bx2.size_hint_weight = EVAS_HINT_EXPAND, 0.0
353 bx2.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
354 307
355 bt = Button(win) 308 bt = Button(win, text="Clear", size_hint_align=FILL_BOTH,
356 bt.text = "Clear" 309 size_hint_weight=EXPAND_HORIZ, propagate_events=False,
310 focus_allow=False)
357 bt.callback_clicked_add(scrolled_entry_bt_1, en) 311 bt.callback_clicked_add(scrolled_entry_bt_1, en)
358 bt.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
359 bt.size_hint_weight = EVAS_HINT_EXPAND, 0.0
360 bx2.pack_end(bt) 312 bx2.pack_end(bt)
361 bt.propagate_events = 0
362 bt.focus_allow = 0
363 bt.show() 313 bt.show()
364 314
365 bt = Button(win) 315 bt = Button(win, text="Print", size_hint_align=FILL_BOTH,
366 bt.text = "Print" 316 size_hint_weight=EXPAND_HORIZ, propagate_events=False,
317 focus_allow=False)
367 bt.callback_clicked_add(scrolled_entry_bt_2, en) 318 bt.callback_clicked_add(scrolled_entry_bt_2, en)
368 bt.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
369 bt.size_hint_weight = EVAS_HINT_EXPAND, 0.0
370 bx2.pack_end(bt) 319 bx2.pack_end(bt)
371 bt.propagate_events = 0
372 bt.focus_allow = 0
373 bt.show() 320 bt.show()
374 321
375 bt = Button(win) 322 bt = Button(win, text="Print pwd", size_hint_align=FILL_BOTH,
376 bt.text = "Print pwd" 323 size_hint_weight=EXPAND_HORIZ, propagate_events=False,
324 focus_allow=False)
377 bt.callback_clicked_add(scrolled_entry_bt_5, en_p) 325 bt.callback_clicked_add(scrolled_entry_bt_5, en_p)
378 bt.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
379 bt.size_hint_weight = EVAS_HINT_EXPAND, 0.0
380 bx2.pack_end(bt) 326 bx2.pack_end(bt)
381 bt.propagate_events = 0
382 bt.focus_allow = 0
383 bt.show() 327 bt.show()
384 328
385 bt = Button(win) 329 bt = Button(win, text="Selection", size_hint_align=FILL_BOTH,
386 bt.text = "Selection" 330 size_hint_weight=EXPAND_HORIZ, propagate_events=False,
331 focus_allow=False)
387 bt.callback_clicked_add(scrolled_entry_bt_3, en) 332 bt.callback_clicked_add(scrolled_entry_bt_3, en)
388 bt.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
389 bt.size_hint_weight = EVAS_HINT_EXPAND, 0.0
390 bx2.pack_end(bt) 333 bx2.pack_end(bt)
391 bt.propagate_events = 0
392 bt.focus_allow = 0
393 bt.show() 334 bt.show()
394 335
395 bt = Button(win) 336 bt = Button(win, text="Insert", size_hint_align=FILL_BOTH,
396 bt.text = "Insert" 337 size_hint_weight=EXPAND_HORIZ, propagate_events=False,
338 focus_allow=False)
397 bt.callback_clicked_add(scrolled_entry_bt_4, en) 339 bt.callback_clicked_add(scrolled_entry_bt_4, en)
398 bt.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
399 bt.size_hint_weight = EVAS_HINT_EXPAND, 0.0
400 bx2.pack_end(bt) 340 bx2.pack_end(bt)
401 bt.propagate_events = 0
402 bt.focus_allow = 0
403 bt.show() 341 bt.show()
404 342
405 bx.pack_end(bx2) 343 bx.pack_end(bx2)
406 bx2.show() 344 bx2.show()
407 345
408 win.size = 320, 300
409
410 win.focus_set(True) 346 win.focus_set(True)
411 win.show() 347 win.show()
412 348
413def anchor_clicked(obj, event_info): 349def anchor_clicked(obj, event_info):
414 print(("Entry object is %s" % (obj))) 350 print("Entry object is %s" % (obj))
415 print(("We should have EntryAnchorInfo here: %s" % (str(event_info)))) 351 print("We should have EntryAnchorInfo here: %s" % (str(event_info)))
416 print(("EntryAnchorInfo has the following properties and methods: %s" % (dir(event_info)))) 352 print("EntryAnchorInfo has the following properties and methods: %s" % (dir(event_info)))
417 print(event_info.name) 353 print(event_info.name)
418 354
419def anchor_hover_opened(obj, event_info): 355def anchor_hover_opened(obj, event_info):
420 print(("We should have EntryAnchorHoverInfo here: %s" % (event_info))) 356 print("We should have EntryAnchorHoverInfo here: %s" % (event_info))
421 print(("EntryAnchorHoverInfo has the following properties and methods: %s" % (dir(event_info)))) 357 print("EntryAnchorHoverInfo has the following properties and methods: %s" % (dir(event_info)))
422 print(event_info.anchor_info.name) 358 print(event_info.anchor_info.name)
423 btn = Button(obj) 359 btn = Button(obj, text="Testing entry anchor")
424 btn.text_set("Testing entry anchor")
425 event_info.hover.part_content_set("middle", btn) 360 event_info.hover.part_content_set("middle", btn)
426 btn.show() 361 btn.show()
427 362
428def entry_anchor_clicked(obj, item=None): 363def entry_anchor_clicked(obj, item=None):
429 win = Window("entry", elementary.ELM_WIN_BASIC) 364 win = StandardWindow("entry", "Entry Anchor", autodel=True, size=(400,400))
430 win.title_set("Entry Anchor")
431 win.autodel_set(True)
432 365
433 bg = Background(win) 366 box = Box(win, size_hint_weight=EXPAND_BOTH)
434 bg.size_hint_weight_set(1.0, 1.0)
435 win.resize_object_add(bg)
436 bg.show()
437
438 box = Box(win)
439 box.size_hint_weight_set(1.0, 1.0)
440 win.resize_object_add(box) 367 win.resize_object_add(box)
441 368
442 entry = Entry(win) 369 entry = Entry(win, anchor_hover_style="popout", anchor_hover_parent=win)
443 entry.text_set("<a href=url:http://www.enlightenment.org/>Enlightenment</a>") 370 entry.text = "<a href=url:http://www.enlightenment.org/>Enlightenment</a>"
444 entry.callback_anchor_clicked_add(anchor_clicked) 371 entry.callback_anchor_clicked_add(anchor_clicked)
445 entry.anchor_hover_style_set("popout")
446 entry.anchor_hover_parent_set(win)
447 entry.callback_anchor_hover_opened_add(anchor_hover_opened) 372 entry.callback_anchor_hover_opened_add(anchor_hover_opened)
448 entry.show() 373 entry.show()
449 374
450 frame = Frame(win) 375 frame = Frame(win, size_hint_align=FILL_BOTH, text="Entry test",
451 frame.size_hint_align_set(-1.0, -1.0) 376 content=entry)
452 frame.text_set("Entry test")
453 frame.content_set(entry)
454 frame.show() 377 frame.show()
455 378
456 box.pack_end(frame) 379 box.pack_end(frame)
457 box.show() 380 box.show()
458 381
459 win.resize(400, 400)
460 win.show() 382 win.show()
461 383
462
463if __name__ == "__main__": 38