summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2016-12-07 14:49:43 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-02-22 18:56:30 -0300
commiteb041fb6a06296cd7232c53c32fcc81c8c01ec3f (patch)
treeaf54a02bb7957187641bd261cb3ed9729ccb7c03 /src
parent26f62542250d026269522787a61f807e5e4a1d8a (diff)
js: Update examples, including window api changes.
Window now inherits from Container instead of Pack. Also removed some deprecated stuff.
Diffstat (limited to 'src')
-rw-r--r--src/examples/elementary/bg_example_01.js2
-rw-r--r--src/examples/elementary/bg_example_02.js2
-rw-r--r--src/examples/elementary/box_js_example_01.js4
-rw-r--r--src/examples/elementary/box_js_example_02.js7
-rw-r--r--src/examples/elementary/bubble_example_01.js55
-rw-r--r--src/examples/elementary/button_example_01.js16
-rw-r--r--src/examples/elementary/calendar_example_01.js2
-rw-r--r--src/examples/elementary/calendar_example_02.js2
-rw-r--r--src/examples/elementary/calendar_example_03.js5
-rw-r--r--src/examples/elementary/calendar_example_04.js3
-rw-r--r--src/examples/elementary/calendar_example_05.js2
-rw-r--r--src/examples/elementary/clock_example.js2
-rw-r--r--src/examples/elementary/datetime_example.js43
-rw-r--r--src/examples/elementary/icon_example_01.js13
-rw-r--r--src/examples/elementary/layout_example.js6
-rw-r--r--src/examples/elementary/menu_example_01.js2
-rw-r--r--src/examples/elementary/radio_example_01.js6
-rw-r--r--src/examples/elementary/separator_example_01.js41
-rw-r--r--src/examples/elementary/slider_example.js6
-rw-r--r--src/examples/elementary/spinner_example.js2
-rw-r--r--src/examples/elementary/thumb_example_01.js6
-rw-r--r--src/examples/elementary/twitter_example_01.js104
22 files changed, 95 insertions, 236 deletions
diff --git a/src/examples/elementary/bg_example_01.js b/src/examples/elementary/bg_example_01.js
index 2a4e9214d7..5b8756fa9e 100644
--- a/src/examples/elementary/bg_example_01.js
+++ b/src/examples/elementary/bg_example_01.js
@@ -8,7 +8,7 @@ win.setAutohide(true);
8bg = new efl.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setColor(255, 0,0,255) 9bg.setColor(255, 0,0,255)
10bg.setHintWeight(1.0, 1.0); 10bg.setHintWeight(1.0, 1.0);
11win.pack(bg); 11win.setContent(bg);
12bg.setVisible(true); 12bg.setVisible(true);
13 13
14win.setSize(320,320); 14win.setSize(320,320);
diff --git a/src/examples/elementary/bg_example_02.js b/src/examples/elementary/bg_example_02.js
index 72a9f49d60..b38cae9281 100644
--- a/src/examples/elementary/bg_example_02.js
+++ b/src/examples/elementary/bg_example_02.js
@@ -12,7 +12,7 @@ bg.setOption(efl.Elm.Bg.Option.CENTER);
12//TODO: elm_app_data_dir_get 12//TODO: elm_app_data_dir_get
13bg.setFile(__dirname + '/../../../data/elementary/images/plant_01.jpg', null); 13bg.setFile(__dirname + '/../../../data/elementary/images/plant_01.jpg', null);
14bg.setHintWeight(1.0, 1.0); 14bg.setHintWeight(1.0, 1.0);
15win.pack(bg); 15win.setContent(bg);
16bg.setVisible(true); 16bg.setVisible(true);
17 17
18win.setSize(320, 320); 18win.setSize(320, 320);
diff --git a/src/examples/elementary/box_js_example_01.js b/src/examples/elementary/box_js_example_01.js
index e09d56abbc..1cb3b9c5f0 100644
--- a/src/examples/elementary/box_js_example_01.js
+++ b/src/examples/elementary/box_js_example_01.js
@@ -7,12 +7,12 @@ win.setAutohide(true);
7 7
8bg = new efl.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setHintWeight(1.0, 1.0); 9bg.setHintWeight(1.0, 1.0);
10win.pack(bg); 10win.setContent(bg);
11bg.setVisible(true); 11bg.setVisible(true);
12 12
13bx = new efl.Efl.Ui.Box(win); 13bx = new efl.Efl.Ui.Box(win);
14bx.setHintWeight(1.0, 1.0); 14bx.setHintWeight(1.0, 1.0);
15win.pack(bx); 15win.setContent(bx);
16 16
17entry = new efl.Elm.Label(win); 17entry = new efl.Elm.Label(win);
18entry.setSize(100, 100); 18entry.setSize(100, 100);
diff --git a/src/examples/elementary/box_js_example_02.js b/src/examples/elementary/box_js_example_02.js
index 9966704553..156ee16921 100644
--- a/src/examples/elementary/box_js_example_02.js
+++ b/src/examples/elementary/box_js_example_02.js
@@ -21,14 +21,9 @@ win = new efl.Efl.Ui.Win.Standard(null);
21win.setText("Box example"); 21win.setText("Box example");
22win.setAutohide(true); 22win.setAutohide(true);
23 23
24bg = new efl.Elm.Bg(win);
25bg.setHintWeight(1.0, 1.0);
26win.pack(bg);
27bg.setVisible(true);
28
29bigbox = new efl.Efl.Ui.Box(win) 24bigbox = new efl.Efl.Ui.Box(win)
30bigbox.setHintWeight(1.0, 1.0); 25bigbox.setHintWeight(1.0, 1.0);
31win.pack(bigbox); 26win.setContent(bigbox);
32 27
33bx = new efl.Efl.Ui.Box(win); 28bx = new efl.Efl.Ui.Box(win);
34bx.setHintWeight(1.0, 1.0); 29bx.setHintWeight(1.0, 1.0);
diff --git a/src/examples/elementary/bubble_example_01.js b/src/examples/elementary/bubble_example_01.js
deleted file mode 100644
index 9e91202940..0000000000
--- a/src/examples/elementary/bubble_example_01.js
+++ /dev/null
@@ -1,55 +0,0 @@
1
2efl = require('efl');
3
4win = new efl.Efl.Ui.Win.Standard(null);
5win.setText("Bg Plain");
6win.setAutohide(true);
7
8bg = new efl.Elm.Bg(win);
9bg.setHintWeight(1.0, 1.0);
10win.pack(bg);
11bg.setVisible(true);
12
13label1 = new efl.Elm.Label(win);
14label1.setText(null, "Bubble with icon, info and label");
15label1.setVisible(true);
16
17console.log(efl);
18
19icon = new efl.Efl.Canvas.Rectangle(win);
20icon.setColor( 0, 0, 255, 255);
21icon.setVisible(true);
22
23bubble1 = new efl.Elm.Bubble(win);
24icon_eo = bubble1.part("icon");
25icon_container = icon_eo.cast("Efl.Container");
26icon_container.setContent(icon);
27bubble1.setText("info", "INFO");
28bubble1.setText(null, "LABEL");
29bubble1.setContent(label1);
30bubble1.setSize(300, 100);
31bubble1.setVisible(true);
32
33corner = 0;
34bubble1.on('clicked',
35 function()
36 {
37 ++corner;
38 if (corner > 3)
39 bubble1.setPos(corner = 0);
40 else
41 bubble1.setPos(corner);
42 });
43
44label2 = new efl.Elm.Label(win);
45label2.setText(null, "Bubble with no icon, info or label");
46label2.setVisible(true);
47
48bubble2 = new efl.Elm.Bubble(win);
49bubble2.setContent(label2);
50bubble2.setSize(200, 50);
51bubble2.setPosition(0, 110);
52bubble2.setVisible(true);
53
54win.setSize(300, 200);
55win.setVisible(true);
diff --git a/src/examples/elementary/button_example_01.js b/src/examples/elementary/button_example_01.js
index 5bb14fa832..a6c2df856f 100644
--- a/src/examples/elementary/button_example_01.js
+++ b/src/examples/elementary/button_example_01.js
@@ -35,7 +35,7 @@ _btn_cursors_move = function(_btn) {
35 console.log ("cursor move: ", size[0], size[1]); 35 console.log ("cursor move: ", size[0], size[1]);
36 36
37 if (!icon_still) { 37 if (!icon_still) {
38 var icon = new efl.Elm.Icon(mid); 38 var icon = new efl.Efl.Ui.Image(mid);
39 var icon_still_p = mid.contentUnset("icon"); 39 var icon_still_p = mid.contentUnset("icon");
40 if (icon_still_p) { 40 if (icon_still_p) {
41 icon_still_p.setVisible(false); 41 icon_still_p.setVisible(false);
@@ -68,7 +68,7 @@ win = new efl.Efl.Ui.Win.Standard(null);
68win.setText("Button example"); 68win.setText("Button example");
69win.setAutohide(true); 69win.setAutohide(true);
70 70
71icon_still = new efl.Elm.Icon(win); 71icon_still = new efl.Efl.Ui.Image(win);
72mid = new efl.Elm.Button(win); 72mid = new efl.Elm.Button(win);
73up = new efl.Elm.Button(win); 73up = new efl.Elm.Button(win);
74down = new efl.Elm.Button(win); 74down = new efl.Elm.Button(win);
@@ -85,7 +85,7 @@ _btn_cursors_release = function() {
85 85
86box = new efl.Efl.Ui.Box(win); 86box = new efl.Efl.Ui.Box(win);
87box.setHintWeight(1.0, 1.0); 87box.setHintWeight(1.0, 1.0);
88win.pack(box); 88win.setContent(box);
89box.setVisible(true); 89box.setVisible(true);
90 90
91box_initial = new efl.Efl.Ui.Box(win); 91box_initial = new efl.Efl.Ui.Box(win);
@@ -146,7 +146,7 @@ box.packEnd(up);
146up.setVisible(true); 146up.setVisible(true);
147up.on('repeated', _btn_cursors_move) 147up.on('repeated', _btn_cursors_move)
148up.on('unpressed', _btn_cursors_release); 148up.on('unpressed', _btn_cursors_release);
149icon_up = new efl.Elm.Icon(win); 149icon_up = new efl.Efl.Ui.Image(win);
150icon_up.setIcon("arrow_up"); 150icon_up.setIcon("arrow_up");
151setIcon(up, icon_up); 151setIcon(up, icon_up);
152 152
@@ -167,7 +167,7 @@ left.setVisible(true);
167left.on('repeated', _btn_cursors_move) 167left.on('repeated', _btn_cursors_move)
168left.on('unpressed', _btn_cursors_release); 168left.on('unpressed', _btn_cursors_release);
169 169
170icon_left = new efl.Elm.Icon(win); 170icon_left = new efl.Efl.Ui.Image(win);
171icon_left.setIcon("arrow_left"); 171icon_left.setIcon("arrow_left");
172setIcon(left, icon_left); 172setIcon(left, icon_left);
173 173
@@ -175,7 +175,7 @@ mid.setHintWeight(1.0, 1.0);
175box_inferior.packEnd(mid); 175box_inferior.packEnd(mid);
176mid.setVisible(true); 176mid.setVisible(true);
177 177
178icon_mid = new efl.Elm.Icon(win); 178icon_mid = new efl.Efl.Ui.Image(win);
179icon_mid.setIcon("close"); 179icon_mid.setIcon("close");
180setIcon(mid, icon_mid); 180setIcon(mid, icon_mid);
181 181
@@ -189,7 +189,7 @@ right.setVisible(true);
189right.on('repeated', _btn_cursors_move); 189right.on('repeated', _btn_cursors_move);
190right.on('unpressed', _btn_cursors_release); 190right.on('unpressed', _btn_cursors_release);
191 191
192icon_right = new efl.Elm.Icon(win); 192icon_right = new efl.Efl.Ui.Image(win);
193icon_right.setIcon("arrow_right"); 193icon_right.setIcon("arrow_right");
194setIcon(right, icon_right); 194setIcon(right, icon_right);
195 195
@@ -203,7 +203,7 @@ down.setVisible(true);
203down.on('repeated', _btn_cursors_move); 203down.on('repeated', _btn_cursors_move);
204down.on('unpressed', _btn_cursors_release); 204down.on('unpressed', _btn_cursors_release);
205 205
206icon_down = new efl.Elm.Icon(win); 206icon_down = new efl.Efl.Ui.Image(win);
207icon_down.setIcon("arrow_down"); 207icon_down.setIcon("arrow_down");
208setIcon(down, icon_down); 208setIcon(down, icon_down);
209 209
diff --git a/src/examples/elementary/calendar_example_01.js b/src/examples/elementary/calendar_example_01.js
index bd0f1113ca..f106c13a07 100644
--- a/src/examples/elementary/calendar_example_01.js
+++ b/src/examples/elementary/calendar_example_01.js
@@ -7,7 +7,7 @@ win.setAutohide(true);
7 7
8cal = new efl.Elm.Calendar(win); 8cal = new efl.Elm.Calendar(win);
9cal.setHintWeight(1.0, 1.0); 9cal.setHintWeight(1.0, 1.0);
10win.pack(cal); 10win.setContent(cal);
11win.setSize(240, 240); 11win.setSize(240, 240);
12cal.setVisible(true); 12cal.setVisible(true);
13 13
diff --git a/src/examples/elementary/calendar_example_02.js b/src/examples/elementary/calendar_example_02.js
index 535519266b..98b0eb9f5e 100644
--- a/src/examples/elementary/calendar_example_02.js
+++ b/src/examples/elementary/calendar_example_02.js
@@ -9,7 +9,7 @@ win.setAutohide(true);
9cal = new efl.Elm.Calendar(win); 9cal = new efl.Elm.Calendar(win);
10cal.setHintWeight(1.0, 1.0); 10cal.setHintWeight(1.0, 1.0);
11 11
12win.pack(cal); 12win.setContent(cal);
13win.setSize(240, 240); 13win.setSize(240, 240);
14//cal.format_function_set(funtion); 14//cal.format_function_set(funtion);
15//cal.weekdays_names_set(weekdays); 15//cal.weekdays_names_set(weekdays);
diff --git a/src/examples/elementary/calendar_example_03.js b/src/examples/elementary/calendar_example_03.js
index af6ed84148..2a7df8e82a 100644
--- a/src/examples/elementary/calendar_example_03.js
+++ b/src/examples/elementary/calendar_example_03.js
@@ -7,9 +7,10 @@ win.setAutohide(true);
7 7
8cal = new efl.Elm.Calendar(win); 8cal = new efl.Elm.Calendar(win);
9cal.setHintWeight(1.0, 1.0); 9cal.setHintWeight(1.0, 1.0);
10win.pack(cal); 10win.setContent(cal);
11win.setSize(240, 240); 11win.setSize(240, 240);
12cal.setMinMaxYear(2020,2022); 12// FIXME Add support to Efl.Time and Efl.Ui.Calendar
13// cal.setMinMaxYear(2020,2022);
13cal.setVisible(true); 14cal.setVisible(true);
14 15
15win.setVisible(true); 16win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_04.js b/src/examples/elementary/calendar_example_04.js
index 5f2352593b..1afa80878d 100644
--- a/src/examples/elementary/calendar_example_04.js
+++ b/src/examples/elementary/calendar_example_04.js
@@ -7,14 +7,13 @@ win.setAutohide(true);
7 7
8box = new efl.Efl.Ui.Box(win); 8box = new efl.Efl.Ui.Box(win);
9box.setHintWeight(1.0, 1.0); 9box.setHintWeight(1.0, 1.0);
10win.pack(box); 10win.setContent(box);
11box.setVisible(true); 11box.setVisible(true);
12 12
13cal = new efl.Elm.Calendar(win); 13cal = new efl.Elm.Calendar(win);
14cal.setHintWeight(1.0, 1.0); 14cal.setHintWeight(1.0, 1.0);
15cal.setHintAlign(-1.0, -1.0); 15cal.setHintAlign(-1.0, -1.0);
16cal.setSelectMode(efl.Elm.Calendar.Select.Mode.NONE); 16cal.setSelectMode(efl.Elm.Calendar.Select.Mode.NONE);
17win.pack(cal);
18cal.setVisible(true); 17cal.setVisible(true);
19box.packEnd(cal); 18box.packEnd(cal);
20 19
diff --git a/src/examples/elementary/calendar_example_05.js b/src/examples/elementary/calendar_example_05.js
index d29f8b58b4..b9cfdde457 100644
--- a/src/examples/elementary/calendar_example_05.js
+++ b/src/examples/elementary/calendar_example_05.js
@@ -21,7 +21,7 @@ win.setAutohide(true);
21 21
22cal = new efl.Elm.Calendar(win); 22cal = new efl.Elm.Calendar(win);
23cal.setHintWeight(1.0, 1.0); 23cal.setHintWeight(1.0, 1.0);
24win.pack(cal); 24win.setContent(cal);
25win.setSize(240, 240); 25win.setSize(240, 240);
26 26
27cal.on('changed', _print_cal_info_cb); 27cal.on('changed', _print_cal_info_cb);
diff --git a/src/examples/elementary/clock_example.js b/src/examples/elementary/clock_example.js
index 313a30d3a0..7c2872d796 100644
--- a/src/examples/elementary/clock_example.js
+++ b/src/examples/elementary/clock_example.js
@@ -7,7 +7,7 @@ win.setSize(480, 240);
7 7
8bx = new efl.Efl.Ui.Box(win); 8bx = new efl.Efl.Ui.Box(win);
9bx.setHintWeight(1.0, 1.0); 9bx.setHintWeight(1.0, 1.0);
10win.pack(bx); 10win.setContent(bx);
11bx.setVisible(true); 11bx.setVisible(true);
12bx.setOrientation(efl.Efl.Orient.VERTICAL); 12bx.setOrientation(efl.Efl.Orient.VERTICAL);
13 13
diff --git a/src/examples/elementary/datetime_example.js b/src/examples/elementary/datetime_example.js
deleted file mode 100644
index 0047d03c24..0000000000
--- a/src/examples/elementary/datetime_example.js
+++ /dev/null
@@ -1,43 +0,0 @@
1
2efl = require('efl');
3
4win = new efl.Efl.Ui.Win.Standard(null);
5win.setText("Datetime");
6win.setAutohide(true);
7win.setSize(320,240);
8
9bg = new efl.Elm.Bg(win);
10bg.setHintWeight(1.0, 1.0);
11win.pack(bg);
12bg.setVisible(true);
13
14bx = new efl.Efl.Ui.Box(win);
15bx.setHintWeight(1.0, 1.0);
16win.pack(bx);
17bx.setVisible(true);
18
19datetime = new efl.Elm.Datetime(bx);
20datetime.setHintWeight(1.0, 1.0);
21datetime.setHintAlign(-1.0, 0.5);
22datetime.setFieldVisible(efl.Elm.Datetime.FieldType.HOUR, false);
23datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MINUTE, false);
24datetime.setFieldVisible(efl.Elm.Datetime.FieldType.AMPM, false);
25bx.packEnd(datetime);
26datetime.setVisible(true);
27
28datetime = new efl.Elm.Datetime(bx);
29datetime.setHintWeight(1.0, 1.0);
30datetime.setHintAlign(-1.0, 0.5);
31datetime.setFieldVisible(efl.Elm.Datetime.FieldType.YEAR, false);
32datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MONTH, false);
33datetime.setFieldVisible(efl.Elm.Datetime.FieldType.DATE, false);
34bx.packEnd(datetime);
35datetime.setVisible(true);
36
37datetime = new efl.Elm.Datetime(bx);
38datetime.setHintWeight(1.0, 1.0);
39datetime.setHintAlign(-1.0, 0.5);
40bx.packEnd(datetime);
41datetime.setVisible(true);
42
43win.setVisible(true);
diff --git a/src/examples/elementary/icon_example_01.js b/src/examples/elementary/icon_example_01.js
index 78f6e2b1e1..cf1d5e49f3 100644
--- a/src/examples/elementary/icon_example_01.js
+++ b/src/examples/elementary/icon_example_01.js
@@ -5,9 +5,9 @@ win = new efl.Efl.Ui.Win.Standard(null);
5win.setText("Icon Plain"); 5win.setText("Icon Plain");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8icon = new efl.Elm.Icon(win); 8icon = new efl.Efl.Ui.Image(win);
9//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default 9//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default
10icon.setStandard("home"); 10icon.setIcon("home");
11 11
12var path, group; 12var path, group;
13r = icon.getFile(path, group); 13r = icon.getFile(path, group);
@@ -16,16 +16,13 @@ gruop = r[1];
16console.log("path = " + path + ", group = " + group); 16console.log("path = " + path + ", group = " + group);
17 17
18var name; 18var name;
19name = icon.getStandard(); 19name = icon.getIcon();
20console.log("name = " + name); 20console.log("name = " + name);
21 21
22icon.setNoScale(true); 22icon.setScaleType(efl.Efl.Ui.Image.ScaleType.NONE);
23icon.setResizable(false, true);
24icon.setSmooth(false);
25icon.setFillOutside(true);
26 23
27icon.setHintWeight(1.0, 1.0); 24icon.setHintWeight(1.0, 1.0);
28win.pack(icon); 25win.setContent(icon);
29icon.setVisible(true); 26icon.setVisible(true);
30 27
31win.setSize(320, 320); 28win.setSize(320, 320);
diff --git a/src/examples/elementary/layout_example.js b/src/examples/elementary/layout_example.js
index 0221d40161..b2e1013cd7 100644
--- a/src/examples/elementary/layout_example.js
+++ b/src/examples/elementary/layout_example.js
@@ -9,7 +9,7 @@ win.setAutohide(true);
9 9
10box = new efl.Efl.Ui.Box(win); 10box = new efl.Efl.Ui.Box(win);
11box.setHintWeight(1.0, 1.0); 11box.setHintWeight(1.0, 1.0);
12win.pack(box); 12win.setContent(box);
13box.setVisible(true); 13box.setVisible(true);
14 14
15ly = new Elm.Layout(box); 15ly = new Elm.Layout(box);
@@ -25,7 +25,7 @@ ly.setHintAlign(1.0, 1.0);
25box.packEnd(ly); 25box.packEnd(ly);
26ly.setVisible(true); 26ly.setVisible(true);
27 27
28bt = new Elm.Icon(ly); 28bt = new efl.Efl.Ui.Image(ly);
29bt.setIcon('chat'); 29bt.setIcon('chat');
30bt.setHintMin(20, 20); 30bt.setHintMin(20, 20);
31// elm_layout_icon_set(ly, bt); 31// elm_layout_icon_set(ly, bt);
@@ -33,7 +33,7 @@ icon_container = ly.part('elm.swallow.icon').cast('Efl.Container');
33icon_container.setContent(bt); 33icon_container.setContent(bt);
34ly.emitSignal('elm,state,icon,visible', 'elm'); 34ly.emitSignal('elm,state,icon,visible', 'elm');
35 35
36bt = new Elm.Icon(ly); 36bt = new efl.Efl.Ui.Image(ly);
37bt.setIcon('close'); 37bt.setIcon('close');
38bt.setHintMin(20, 20); 38bt.setHintMin(20, 20);
39// elm_layout_end_set(ly, bt); 39// elm_layout_end_set(ly, bt);
diff --git a/src/examples/elementary/menu_example_01.js b/src/examples/elementary/menu_example_01.js
index e9277943b4..58a4f69867 100644
--- a/src/examples/elementary/menu_example_01.js
+++ b/src/examples/elementary/menu_example_01.js
@@ -5,7 +5,7 @@ win.setText("Menu");
5win.setAutohide(true); 5win.setAutohide(true);
6 6
7rect = new efl.Efl.Canvas.Rectangle(win); 7rect = new efl.Efl.Canvas.Rectangle(win);
8win.pack(rect); 8win.setContent(rect);
9rect.setHintMin( 0, 0); 9rect.setHintMin( 0, 0);
10rect.setColor( 0, 0, 0, 0); 10rect.setColor( 0, 0, 0, 0);
11rect.setVisible(true); 11rect.setVisible(true);
diff --git a/src/examples/elementary/radio_example_01.js b/src/examples/elementary/radio_example_01.js
index 5d6b9a08cb..55589a760f 100644
--- a/src/examples/elementary/radio_example_01.js
+++ b/src/examples/elementary/radio_example_01.js
@@ -12,14 +12,14 @@ win.setAutohide(true);
12bx = new efl.Efl.Ui.Box(win); 12bx = new efl.Efl.Ui.Box(win);
13bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL); 13bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
14bx.setHintWeight(1.0, 1.0); 14bx.setHintWeight(1.0, 1.0);
15win.pack(bx); 15win.setContent(bx);
16bx.setVisible(true); 16bx.setVisible(true);
17 17
18radio_g = new efl.Elm.Radio(win); 18radio_g = new efl.Elm.Radio(win);
19radio_g.setText("elm.text", "Radio 1"); 19radio_g.setText("elm.text", "Radio 1");
20radio_g.setStateValue(1); 20radio_g.setStateValue(1);
21radio_g.setValue(1); 21radio_g.setValue(1);
22ic = new efl.Elm.Icon(win); 22ic = new efl.Efl.Ui.Image(win);
23ic.setIcon("home"); 23ic.setIcon("home");
24radio_g.part("icon").cast("Efl.Container").setContent(ic); 24radio_g.part("icon").cast("Efl.Container").setContent(ic);
25bx.packEnd(radio_g); 25bx.packEnd(radio_g);
@@ -32,7 +32,7 @@ radio = new efl.Elm.Radio(win);
32radio.setText("elm.text", "Radio 2"); 32radio.setText("elm.text", "Radio 2");
33radio.setStateValue(2); 33radio.setStateValue(2);
34radio.addGroup(radio_g); 34radio.addGroup(radio_g);
35ic = new efl.Elm.Icon(win); 35ic = new efl.Efl.Ui.Image(win);
36ic.setIcon("file"); 36ic.setIcon("file");
37radio.part("icon").cast("Efl.Container").setContent(ic); 37radio.part("icon").cast("Efl.Container").setContent(ic);
38bx.packEnd(radio); 38bx.packEnd(radio);
diff --git a/src/examples/elementary/separator_example_01.js b/src/examples/elementary/separator_example_01.js
deleted file mode 100644
index fa4097f37b..0000000000
--- a/src/examples/elementary/separator_example_01.js
+++ /dev/null
@@ -1,41 +0,0 @@
1
2efl = require('efl');
3
4win = new efl.Efl.Ui.Win.Standard(null);
5win.setText("Separator");
6win.setAutohide(true);
7
8bg = new efl.Elm.Bg(win);
9bg.setHintWeight(1.0, 1.0);
10win.setSize(640, 480);
11win.pack(bg);
12bg.setVisible(true);
13
14bx = new efl.Efl.Ui.Box(win);
15bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
16bx.setHintWeight(1.0, 1.0);
17win.pack(bx);
18bx.setVisible(true);
19
20rect = new efl.Efl.Canvas.Rectangle(win);
21rect.setColor( 0, 255, 0, 255)
22rect.setHintMin( 90, 200);
23rect.setHintWeight(1.0, 1.0);
24rect.setHintAlign(-1.0, -1.0);
25rect.setVisible(true);
26bx.packEnd(rect);
27
28separator = new efl.Elm.Separator(win);
29separator.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
30separator.setVisible(true);
31bx.packEnd(separator);
32
33rect2 = new efl.Efl.Canvas.Rectangle(win);
34rect2.setColor( 0, 0, 255, 255);
35rect2.setHintMin( 90, 200);
36rect2.setHintWeight(1.0, 1.0);
37rect2.setHintAlign(-1.0, -1.0);
38rect2.setVisible(true);
39bx.packEnd(rect2);
40
41win.setVisible(true);
diff --git a/src/examples/elementary/slider_example.js b/src/examples/elementary/slider_example.js
index 59675fc43e..e1c317c971 100644
--- a/src/examples/elementary/slider_example.js
+++ b/src/examples/elementary/slider_example.js
@@ -8,7 +8,7 @@ win.setAutohide(true);
8bx = new efl.Efl.Ui.Box(win); 8bx = new efl.Efl.Ui.Box(win);
9bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL); 9bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
10bx.setHintWeight(1.0, 1.0); 10bx.setHintWeight(1.0, 1.0);
11win.pack(bx); 11win.setContent(bx);
12bx.setVisible(true); 12bx.setVisible(true);
13 13
14sl = new efl.Elm.Slider(win); 14sl = new efl.Elm.Slider(win);
@@ -21,12 +21,12 @@ sl.setVisible(true);
21sl = new efl.Elm.Slider(win); 21sl = new efl.Elm.Slider(win);
22sl.setText("elm.text", "Counter"); 22sl.setText("elm.text", "Counter");
23 23
24ic = new efl.Elm.Icon(win); 24ic = new efl.Efl.Ui.Image(win);
25ic.setIcon("home"); 25ic.setIcon("home");
26// ic.setResizable(false, false); 26// ic.setResizable(false, false);
27sl.part("icon").cast("Efl.Container").setContent(ic); 27sl.part("icon").cast("Efl.Container").setContent(ic);
28 28
29ic = new efl.Elm.Icon(win); 29ic = new efl.Efl.Ui.Image(win);
30ic.setIcon("folder"); 30ic.setIcon("folder");
31// ic.setResizable(false, false); 31// ic.setResizable(false, false);
32sl.part("end").cast("Efl.Container").setContent(ic); 32sl.part("end").cast("Efl.Container").setContent(ic);
diff --git a/src/examples/elementary/spinner_example.js b/src/examples/elementary/spinner_example.js
index c01f34d6e3..c64f7bc898 100644
--- a/src/examples/elementary/spinner_example.js
+++ b/src/examples/elementary/spinner_example.js
@@ -7,7 +7,7 @@ win.setAutohide(true);
7 7
8bx = new efl.Efl.Ui.Box(win); 8bx = new efl.Efl.Ui.Box(win);
9bx.setHintWeight(1.0, 1.0); 9bx.setHintWeight(1.0, 1.0);
10win.pack(bx); 10win.setContent(bx);
11bx.setVisible(true); 11bx.setVisible(true);
12 12
13sp = new efl.Elm.Spinner(win); 13sp = new efl.Elm.Spinner(win);
diff --git a/src/examples/elementary/thumb_example_01.js b/src/examples/elementary/thumb_example_01.js
index 34165ae17c..e4c7c135f6 100644
--- a/src/examples/elementary/thumb_example_01.js
+++ b/src/examples/elementary/thumb_example_01.js
@@ -25,7 +25,7 @@ win = new efl.Efl.Ui.Win.Standard(null);
25win.setText("Thumb example."); 25win.setText("Thumb example.");
26win.setAutohide(true); 26win.setAutohide(true);
27 27
28thumb = new efl.Elm.Thumb(win); 28thumb = new efl.Efl.Ui.Image(win);
29 29
30thumb.on('generate,start', _generation_started_cb); 30thumb.on('generate,start', _generation_started_cb);
31thumb.on('generate,stop', _generation_finished_cb); 31thumb.on('generate,stop', _generation_finished_cb);
@@ -34,14 +34,14 @@ thumb.on('generate,error', _generation_error_cb);
34thumb.setSize(160, 160); 34thumb.setSize(160, 160);
35// legacy 35// legacy
36// thumb.setEditable(false); 36// thumb.setEditable(false);
37filename = path.join(__dirname, "../../../data/images/plant_01.jpg"); 37filename = path.join(__dirname, "../../../data/elementary/images/plant_01.jpg");
38filename = process.argv[2] || filename; 38filename = process.argv[2] || filename;
39thumb.setFile(filename, null); 39thumb.setFile(filename, null);
40// legacy 40// legacy
41// thumb.reload(); 41// thumb.reload();
42 42
43thumb.setHintWeight(1.0, 1.0); 43thumb.setHintWeight(1.0, 1.0);
44win.pack(thumb); 44win.setContent(thumb);
45 45
46thumb.setVisible(true); 46thumb.setVisible(true);
47win.setSize(320, 320); 47win.setSize(320, 320);
diff --git a/src/examples/elementary/twitter_example_01.js b/src/examples/elementary/twitter_example_01.js
index 62c4a7fd83..3d1a2a67dd 100644
--- a/src/examples/elementary/twitter_example_01.js
+++ b/src/examples/elementary/twitter_example_01.js
@@ -1,14 +1,16 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3 3
4// Standard node modules
4util = require('util'); 5util = require('util');
5path = require('path'); 6path = require('path');
6fs = require('fs'); 7fs = require('fs');
7 8
8user_acount = 'EnlightenmentKo' 9// External modules, use 'npm install request twitter'
10request = require('request');
11Twitter = require('twitter');
9 12
10request = require('request'); //need "npm install request" 13user_acount = 'EnlightenmentKo'
11Twitter = require('twitter'); //need "npm install twitter"
12 14
13var twit = new Twitter({ 15var twit = new Twitter({
14 consumer_key: 'ZbSM93w5Sp2cyZ2SG0XuCvoHV', 16 consumer_key: 'ZbSM93w5Sp2cyZ2SG0XuCvoHV',
@@ -18,12 +20,12 @@ var twit = new Twitter({
18}); 20});
19 21
20win = new efl.Efl.Ui.Win.Standard(null); 22win = new efl.Efl.Ui.Win.Standard(null);
21win.title = "Twitter App"; 23win.setText("Twitter App");
22win.autohide = true; 24win.setAutohide(true);
23 25
24box = new efl.Efl.Ui.Box(win); 26box = new efl.Efl.Ui.Box(win);
25box.setHintWeight(1.0, 1.0); 27box.setHintWeight(1.0, 1.0);
26win.pack(box); 28win.setContent(box);
27box.setVisible(true); 29box.setVisible(true);
28 30
29tweet_box = new efl.Efl.Ui.Box(win); 31tweet_box = new efl.Efl.Ui.Box(win);
@@ -31,58 +33,62 @@ tweet_box.setHintWeight(1.0, 1.0);
31tweet_box.setHintAlign(-1.0, -1.0); 33tweet_box.setHintAlign(-1.0, -1.0);
32tweet_box.setPackPadding(0.0, 30.0, true); 34tweet_box.setPackPadding(0.0, 30.0, true);
33box.packEnd(tweet_box); 35box.packEnd(tweet_box);
36
34tweet_box_orient = tweet_box.cast("Efl.Orientation"); 37tweet_box_orient = tweet_box.cast("Efl.Orientation");
35tweet_box_orient.setOrientation(efl.Efl.Orient.VERTICAL); 38tweet_box_orient.setOrientation(efl.Efl.Orient.VERTICAL);
36 39
37
38icon_array = new Array(); 40icon_array = new Array();
39 41
40twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, function(error, tweets, response) { 42twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, function(error, tweets, response) {
41 if (!error){ 43 if (error)
42 file = fs.createWriteStream('/tmp/twitter_pic.jpg'); 44 return;
43 file.on('finish', function() { 45
44 console.log("finished"); 46 for(i=0; i < tweets.length; i++){
45 for (i=0; i < icon_array.length; i++) { 47 var user_name = tweets[i].user.name;
46 console.log(i); 48 var screen_name = tweets[i].user.screen_name;
47 icon_array[i].setFile("/tmp/twitter_pic.jpg", null); 49 var text = tweets[i].text;
48 } 50
49 }); 51 var layout = new efl.Elm.Layout(win);
50 if (tweets.length > 0) { 52 var filename = path.join(__dirname, 'twitter_example_01.edj');
51 request(tweets[0].user.profile_image_url).pipe(file); 53 layout.setFile(filename, "tweet");
52 } 54
55 layout.setText("user_name", screen_name);
56 layout.setText("screen_name", " - @"+screen_name);
57
58 var entry = new efl.Elm.Entry(win);
59 entry.setText("elm.text", text);
60 entry.setEditable(false);
61 part = layout.part("tweet_text").cast("Efl.Container");
62 part.setContent(entry);
63
64 layout.setHintMin(127, 96);
65 layout.setHintWeight(1.0, 1.0);
66 layout.setHintAlign(-1.0, -1.0);
67
68 var icon = new efl.Efl.Ui.Image(win);
69 icon.fillInside = true;
70 icon_array.push(icon);
71 user_icon = layout.part("user_icon").cast("Efl.Container");
72 user_icon.setContent(icon);
73 item = tweet_box.packEnd(layout);
74 layout.setVisible(true);
75 }
53 76
54 for(i=0; i < tweets.length; i++){ 77 var icon_filename = '/tmp/twitter_pic.jpg';
55 var layout = new efl.Elm.Layout(win); 78 var file = fs.createWriteStream(icon_filename);
56 var filename = path.join(__dirname, 'twitter_example_01.edj'); 79 file.on('finish', function() {
57 layout.setFile(filename, "tweet"); 80 console.log("finished loading the icon file.");
58 81 for (i=0; i < icon_array.length; i++) {
59 var user_name = tweets[i].user.name; 82 icon_array[i].setFile(icon_filename, null);
60 var screen_name = tweets[i].user.screen_name;
61 var user_icon_url = tweets[i].user.profile_image_url;
62 var text = tweets[i].text;
63
64 layout.setText("user_name", screen_name);
65 layout.setText("screen_name", " - @"+screen_name);
66 var entry = new efl.Elm.Entry(win);
67 entry.setText("elm.text", text);
68 console.log(text);
69 part = layout.part("tweet_text").cast("Efl.Container");
70 part.setContent(entry);
71
72 layout.setHintMin(127, 96);
73 layout.setHintWeight(1.0, 1.0);
74 layout.setHintAlign(-1.0, -1.0);
75
76 var icon = new efl.Efl.Ui.Image(win);
77 icon.fillInside = true;
78 icon_array.push(icon);
79 user_icon = layout.part("user_icon").cast("Efl.Container");
80 user_icon.setContent(icon);
81 item = tweet_box.packEnd(layout);
82 layout.setVisible(true);
83 } 83 }
84 tweet_box.setVisible(true); 84 });
85
86 // Load the tweet icons
87 if (tweets.length > 0) {
88 request(tweets[0].user.profile_image_url).pipe(file);
85 } 89 }
90
91 tweet_box.setVisible(true);
86}); 92});
87 93
88win.setSize(380, 400); 94win.setSize(380, 400);