summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2016-07-26 18:21:02 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2016-08-02 14:13:40 -0300
commitfa58855f7765bcbfc1a5bd9b666fc017298ea62c (patch)
tree98a1bbf0cba7cd9c2637972616939dfaa8160e8a
parentff82752590a4d73fcadb486a3d7e0388f0bec782 (diff)
efl_js: Update JS examplesdevs/felipealmeida/js-next
Changing imports, functions, etc.
-rw-r--r--src/examples/elementary/bg_example_01.js13
-rw-r--r--src/examples/elementary/bg_example_02.js16
-rw-r--r--src/examples/elementary/box_js_example_01.js24
-rw-r--r--src/examples/elementary/box_js_example_02.js55
-rw-r--r--src/examples/elementary/bubble_example_01.js29
-rw-r--r--src/examples/elementary/button_example_00.js8
-rw-r--r--src/examples/elementary/button_example_01.js129
-rw-r--r--src/examples/elementary/calendar_example_01.js12
-rw-r--r--src/examples/elementary/calendar_example_02.js13
-rw-r--r--src/examples/elementary/calendar_example_03.js12
-rw-r--r--src/examples/elementary/calendar_example_04.js30
-rw-r--r--src/examples/elementary/calendar_example_05.js15
-rw-r--r--src/examples/elementary/clock_example.js27
-rw-r--r--src/examples/elementary/datetime_example.js49
-rw-r--r--src/examples/elementary/icon_example_01.js11
15 files changed, 231 insertions, 212 deletions
diff --git a/src/examples/elementary/bg_example_01.js b/src/examples/elementary/bg_example_01.js
index 227259b63a..2a4e9214d7 100644
--- a/src/examples/elementary/bg_example_01.js
+++ b/src/examples/elementary/bg_example_01.js
@@ -1,13 +1,14 @@
1 1
2var elm = require('elm') 2var efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Bg Plain"); 5win.setText("Bg Plain");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0); 9bg.setColor(255, 0,0,255)
10win.resizeObjectAdd(bg); 10bg.setHintWeight(1.0, 1.0);
11win.pack(bg);
11bg.setVisible(true); 12bg.setVisible(true);
12 13
13win.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 e8e1a63e0f..72a9f49d60 100644
--- a/src/examples/elementary/bg_example_02.js
+++ b/src/examples/elementary/bg_example_02.js
@@ -1,18 +1,18 @@
1 1
2elm = require('elm'); 2var efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Bg Image"); 5win.setText("Bg Plain");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setLoadSize(20,20); 9bg.setLoadSize(20,20);
10bg.setOption(elm.Elm.Bg.Option.CENTER); 10bg.setOption(efl.Elm.Bg.Option.CENTER);
11 11
12//TODO: elm_app_data_dir_get 12//TODO: elm_app_data_dir_get
13bg.setFile('../../data/images/plant_01.jpg', null); 13bg.setFile(__dirname + '/../../../data/elementary/images/plant_01.jpg', null);
14bg.setSizeHintWeight(1.0, 1.0); 14bg.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bg); 15win.pack(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 ba7761da5c..e09d56abbc 100644
--- a/src/examples/elementary/box_js_example_01.js
+++ b/src/examples/elementary/box_js_example_01.js
@@ -1,27 +1,27 @@
1 1
2var elm = require('elm') 2var efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle('title'); 5win.setText('title');
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0); 9bg.setHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg); 10win.pack(bg);
11bg.setVisible(true); 11bg.setVisible(true);
12 12
13bx = new elm.Elm.Box(win); 13bx = new efl.Efl.Ui.Box(win);
14bx.setSizeHintWeight(1.0, 1.0); 14bx.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx); 15win.pack(bx);
16 16
17entry = new elm.Elm.Label(win); 17entry = new efl.Elm.Label(win);
18entry.setSize(100, 100); 18entry.setSize(100, 100);
19entry.setText(null, "Texto"); 19entry.setText(null, "Texto");
20 20
21console.log('Texto: ', entry.getText(null)); 21console.log('Texto: ', entry.getText(null));
22 22
23entry.setSizeHintWeight(1.0, 1.0); 23entry.setHintWeight(1.0, 1.0);
24entry.setSizeHintAlign(-1.0, -1.0); 24entry.setHintAlign(-1.0, -1.0);
25entry.setWrapWidth(50); 25entry.setWrapWidth(50);
26bx.packEnd(entry); 26bx.packEnd(entry);
27entry.setVisible(true); 27entry.setVisible(true);
diff --git a/src/examples/elementary/box_js_example_02.js b/src/examples/elementary/box_js_example_02.js
index 63684df026..99e74f58ea 100644
--- a/src/examples/elementary/box_js_example_02.js
+++ b/src/examples/elementary/box_js_example_02.js
@@ -1,16 +1,15 @@
1 1
2var efl = require('efl') 2var efl = require('efl')
3var elm = require('elm')
4 3
5_add_cb = function(){ 4_add_cb = function(){
6 var btn = new elm.Elm.Button(win); 5 var btn = new efl.Elm.Button(win);
7 btn.setText("elm.text", "I do nothing"); 6 btn.setText("elm.text", "I do nothing");
8 bx.packEnd(btn); 7 bx.packEnd(btn);
9 btn.setVisible(true); 8 btn.setVisible(true);
10} 9}
11 10
12_clear_cb = function(){ 11_clear_cb = function(){
13 bx.clear(); 12 bx.clearPack();
14} 13}
15 14
16_unpack_cb = function(btn){ 15_unpack_cb = function(btn){
@@ -18,61 +17,63 @@ _unpack_cb = function(btn){
18 btn.setColor(128, 64, 0, 128) 17 btn.setColor(128, 64, 0, 128)
19} 18}
20 19
21win = new elm.Elm.WinStandard(null); 20win = new efl.Efl.Ui.Win.Standard(null);
22win.setTitle("Box example"); 21win.setText("Box example");
23win.setAutohide(true); 22win.setAutohide(true);
24 23
25bg = new elm.Elm.Bg(win); 24bg = new efl.Elm.Bg(win);
26bg.setSizeHintWeight(1.0, 1.0); 25bg.setHintWeight(1.0, 1.0);
27win.resizeObjectAdd(bg); 26win.pack(bg);
28bg.setVisible(true); 27bg.setVisible(true);
29 28
30bigbox = new elm.Elm.Box(win) 29bigbox = new efl.Efl.Ui.Box(win)
31bigbox.setSizeHintWeight(1.0, 1.0); 30bigbox.setHintWeight(1.0, 1.0);
32win.resizeObjectAdd(bigbox); 31win.pack(bigbox);
33 32
34bx = new elm.Elm.Box(win) 33bx = new efl.Efl.Ui.Box(win);
35bx.setSizeHintWeight(1.0, 1.0); 34bx.setHintWeight(1.0, 1.0);
36bx.setHorizontal(true); 35// conflicts from Efl.Orientation and Elm.Widget
36bx.setOrientation(efl.Efl.Orient.HORIZONTAL);
37bigbox.packEnd(bx); 37bigbox.packEnd(bx);
38bx.setVisible(true); 38bx.setVisible(true);
39 39
40bt = new elm.Elm.Button(win); 40bt = new efl.Elm.Button(win);
41bt.setText("elm.text", "Add"); 41bt.setText("elm.text", "Add");
42bx.packEnd(bt); 42bx.packEnd(bt);
43bt.setVisible(true); 43bt.setVisible(true);
44bt.on('clicked', _add_cb); 44bt.on('clicked', _add_cb);
45 45
46bt = new elm.Elm.Button(win); 46bt = new efl.Elm.Button(win);
47bt.setText("elm.text", "Clear"); 47bt.setText("elm.text", "Clear");
48bx.packEnd(bt); 48bx.packEnd(bt);
49bt.setVisible(true); 49bt.setVisible(true);
50bt.on('clicked', _clear_cb); 50bt.on('clicked', _clear_cb);
51 51
52bx = new elm.Elm.Box(win) 52bx = new efl.Efl.Ui.Box(win)
53bx.setSizeHintWeight(1.0, 1.0); 53bx.setHintWeight(1.0, 1.0);
54bx.setSizeHintAlign(-1.0, -1.0); 54bx.setHintAlign(-1.0, -1.0);
55bx.setHorizontal(true); 55// conflicts from Efl.Orientation and Elm.Widget
56bx.setOrientation(efl.Efl.Orient.HORIZONTAL);
56bigbox.packEnd(bx); 57bigbox.packEnd(bx);
57bx.setVisible(true); 58bx.setVisible(true);
58 59
59bt = new elm.Elm.Button(win); 60bt = new efl.Elm.Button(win);
60bt.setText("elm.text", "Button 1"); 61bt.setText("elm.text", "Button 1");
61bx.packEnd(bt); 62bx.packEnd(bt);
62bt.setSizeHintWeight(1.0, 1.0); 63bt.setHintWeight(1.0, 1.0);
63bt.setSizeHintAlign(-1.0, -1.0); 64bt.setHintAlign(-1.0, -1.0);
64bt.setVisible(true); 65bt.setVisible(true);
65bt.on('clicked', _unpack_cb); 66bt.on('clicked', _unpack_cb);
66 67
67bt = new elm.Elm.Button(win); 68bt = new efl.Elm.Button(win);
68bt.setText("elm.text", "Button 2"); 69bt.setText("elm.text", "Button 2");
69bx.packEnd(bt); 70bx.packEnd(bt);
70bt.setSizeHintWeight(1.0, 0.0); 71bt.setHintWeight(1.0, 0.0);
71bt.setSizeHintAlign(1.0, 0.5); 72bt.setHintAlign(1.0, 0.5);
72bt.setVisible(true); 73bt.setVisible(true);
73bt.on('clicked', _unpack_cb); 74bt.on('clicked', _unpack_cb);
74 75
75bt = new elm.Elm.Button(win); 76bt = new efl.Elm.Button(win);
76bt.setText("elm.text", "Button 3"); 77bt.setText("elm.text", "Button 3");
77bx.packEnd(bt); 78bx.packEnd(bt);
78bt.setVisible(true); 79bt.setVisible(true);
diff --git a/src/examples/elementary/bubble_example_01.js b/src/examples/elementary/bubble_example_01.js
index d7b912b378..dcd889572c 100644
--- a/src/examples/elementary/bubble_example_01.js
+++ b/src/examples/elementary/bubble_example_01.js
@@ -1,31 +1,30 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Bg Plain"); 5win.setText("Bg Plain");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
10bg.setSizeHintWeight(1.0, 1.0); 9bg.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(bg); 10win.pack(bg);
12bg.setVisible(true); 11bg.setVisible(true);
13 12
14label1 = new elm.Elm.Label(win); 13label1 = new efl.Elm.Label(win);
15label1.setText(null, "Bubble with no icon, info or label"); 14label1.setText(null, "Bubble with icon, info and label");
16label1.setVisible(true); 15label1.setVisible(true);
17 16
18console.log(efl); 17console.log(efl);
19 18
20icon = new efl.Evas.Rectangle(win); 19icon = new efl.Efl.Canvas.Rectangle(win);
21icon.setColor( 0, 0, 255, 255); 20icon.setColor( 0, 0, 255, 255);
22icon.setVisible(true); 21icon.setVisible(true);
23 22
24bubble1 = new elm.Elm.Bubble(win); 23bubble1 = new efl.Elm.Bubble(win);
25bubble1.contentSet("icon", icon); 24// bubble1.setContent(icon);
26bubble1.setText("info", "INFO"); 25bubble1.setText("info", "INFO");
27bubble1.setText(null, "LABEL"); 26bubble1.setText(null, "LABEL");
28bubble1.contentSet(null, label1); 27bubble1.setContent(label1);
29bubble1.setSize(300, 100); 28bubble1.setSize(300, 100);
30bubble1.setVisible(true); 29bubble1.setVisible(true);
31 30
@@ -40,12 +39,12 @@ bubble1.on('clicked',
40 bubble1.setPos(corner); 39 bubble1.setPos(corner);
41 }); 40 });
42 41
43label2 = new elm.Elm.Label(win); 42label2 = new efl.Elm.Label(win);
44label2.setText(null, "Bubble with no icon, info or label"); 43label2.setText(null, "Bubble with no icon, info or label");
45label2.setVisible(true); 44label2.setVisible(true);
46 45
47bubble2 = new elm.Elm.Bubble(win); 46bubble2 = new efl.Elm.Bubble(win);
48bubble2.contentSet(null, label2); 47bubble2.setContent(label2);
49bubble2.setSize(200, 50); 48bubble2.setSize(200, 50);
50bubble2.setPosition(0, 110); 49bubble2.setPosition(0, 110);
51bubble2.setVisible(true); 50bubble2.setVisible(true);
diff --git a/src/examples/elementary/button_example_00.js b/src/examples/elementary/button_example_00.js
index f122bf1994..5a3674a71e 100644
--- a/src/examples/elementary/button_example_00.js
+++ b/src/examples/elementary/button_example_00.js
@@ -1,16 +1,16 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3 3
4win = new efl.Elm.Win.Standard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Hello, World!"); 5win.setText("Hello, World!");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8btn = new efl.Elm.Button(win); 8btn = new efl.Elm.Button(win);
9btn.setText(null, "Good-Bye, World!"); 9btn.setText(null, "Good-Bye, World!");
10btn.setSize(120, 30); 10btn.setSize(120, 30);
11btn.setPosition(60, 15); 11btn.setPosition(60, 15);
12btn.setSizeHintWeight(1.0, 1.0); 12btn.setHintWeight(1.0, 1.0);
13btn.setSizeHintAlign(1.0, 1.0); 13btn.setHintAlign(1.0, 1.0);
14btn.setVisible(true); 14btn.setVisible(true);
15 15
16btn.on('clicked', function () { console.log('clicked'); } ); 16btn.on('clicked', function () { console.log('clicked'); } );
diff --git a/src/examples/elementary/button_example_01.js b/src/examples/elementary/button_example_01.js
index a959427c91..31e51d7b8d 100644
--- a/src/examples/elementary/button_example_01.js
+++ b/src/examples/elementary/button_example_01.js
@@ -1,5 +1,4 @@
1efl = require('efl'); 1efl = require('efl');
2elm = require('elm');
3 2
4_btn_options_cb = function(_btn) { 3_btn_options_cb = function(_btn) {
5 var text = _btn.getText("elm.text"); 4 var text = _btn.getText("elm.text");
@@ -31,13 +30,15 @@ _btn_cursors_move = function(_btn) {
31 console.log ("cursor move: ", size[0], size[1]); 30 console.log ("cursor move: ", size[0], size[1]);
32 31
33 if (!icon_still) { 32 if (!icon_still) {
34 var icon = new elm.Elm.Icon(mid); 33 var icon = new efl.Elm.Icon(mid);
35 var icon_still_p = mid.contentUnset("icon"); 34 var icon_still_p = mid.contentUnset("icon");
36 if (icon_still_p) { 35 if (icon_still_p) {
37 icon_still_p.setVisible(false); 36 icon_still_p.setVisible(false);
38 } 37 }
39 icon.setStandard("chat"); 38 // FIXME fix icon support
40 mid.contentSet("icon", icon); 39 // icon.setStandard("chat");
40 // mid.setContent("icon", icon);
41 mid.setText("elm.text", "chat");
41 } 42 }
42 43
43 if (_btn.getPosition()[1] == up.getPosition()[1]) { 44 if (_btn.getPosition()[1] == up.getPosition()[1]) {
@@ -56,78 +57,80 @@ _btn_cursors_move = function(_btn) {
56 ax += 0.05; 57 ax += 0.05;
57 if (ax > 1.0) ax = 1.0; 58 if (ax > 1.0) ax = 1.0;
58 } 59 }
59 mid.setSizeHintAlign(ax, ay); 60 mid.setHintAlign(ax, ay);
60} 61}
61 62
62 63
63win = new elm.Elm.WinStandard(null); 64win = new efl.Efl.Ui.Win.Standard(null);
64win.setTitle("Button example"); 65win.setText("Button example");
65win.setAutohide(true); 66win.setAutohide(true);
66 67
67icon_still = new elm.Elm.Icon(win); 68icon_still = new efl.Elm.Icon(win);
68mid = new elm.Elm.Button(win); 69mid = new efl.Elm.Button(win);
69up = new elm.Elm.Button(win); 70up = new efl.Elm.Button(win);
70down = new elm.Elm.Button(win); 71down = new efl.Elm.Button(win);
71left = new elm.Elm.Button(win); 72left = new efl.Elm.Button(win);
72right = new elm.Elm.Button(win); 73right = new efl.Elm.Button(win);
73 74
74_btn_cursors_release = function() { 75_btn_cursors_release = function() {
75 if (icon_still) 76 if (icon_still)
76 { 77 {
77 mid.contentSet("icon", icon_still); 78 // FIXME fix icon support
79 // mid.setContent("icon", icon_still);
78 icon_still = null; 80 icon_still = null;
81 mid.setText("elm.text", "icon_still");
79 } 82 }
80} 83}
81 84
82box = new elm.Elm.Box(win); 85box = new efl.Efl.Ui.Box(win);
83box.setSizeHintWeight(1.0, 1.0); 86box.setHintWeight(1.0, 1.0);
84win.resizeObjectAdd(box); 87win.pack(box);
85box.setVisible(true); 88box.setVisible(true);
86 89
87box_initial = new elm.Elm.Box(win); 90box_initial = new efl.Efl.Ui.Box(win);
88box_initial.setHorizontal(true); 91box_initial.setOrientation(efl.Efl.Orient.HORIZONTAL);
89box_initial.setSizeHintWeight(1.0, 0.0); 92box_initial.setHintWeight(1.0, 0.0);
90box.packEnd(box_initial); 93box.packEnd(box_initial);
91box_initial.setVisible(true); 94box_initial.setVisible(true);
92 95
93btn = new elm.Elm.Button(win); 96btn = new efl.Elm.Button(win);
94btn.setText("elm.text", "Initial: 0.0"); 97btn.setText("elm.text", "Initial: 0.0");
95box_initial.packEnd(btn); 98box_initial.packEnd(btn);
96btn.setVisible(true); 99btn.setVisible(true);
97 100
98btn.on('clicked', _btn_options_cb); 101btn.on('clicked', _btn_options_cb);
99 102
100btn2 = new elm.Elm.Button(win); 103btn2 = new efl.Elm.Button(win);
101btn2.setText("elm.text", "Initial: 1.0"); 104btn2.setText("elm.text", "Initial: 1.0");
102box_initial.packEnd(btn2); 105box_initial.packEnd(btn2);
103btn2.setVisible(true); 106btn2.setVisible(true);
104btn2.on('clicked', _btn_options_cb); 107btn2.on('clicked', _btn_options_cb);
105 108
106btn3 = new elm.Elm.Button(win); 109btn3 = new efl.Elm.Button(win);
107btn3.setText("elm.text", "Initial: 5.0"); 110btn3.setText("elm.text", "Initial: 5.0");
108box_initial.packEnd(btn3); 111box_initial.packEnd(btn3);
109btn3.setVisible(true); 112btn3.setVisible(true);
110btn3.on('clicked', _btn_options_cb); 113btn3.on('clicked', _btn_options_cb);
111 114
112box_gap = new elm.Elm.Box(win); 115box_gap = new efl.Efl.Ui.Box(win);
113box_gap.setHorizontal(true); 116box_gap.setOrientation(efl.Efl.Orient.HORIZONTAL);
114box_gap.setSizeHintWeight(1.0, 0.0); 117box_gap.setHintWeight(1.0, 0.0);
115box.packEnd(box_gap); 118box.packEnd(box_gap);
116box_gap.setVisible(true); 119box_gap.setVisible(true);
117 120
118btn4 = new elm.Elm.Button(win); 121btn4 = new efl.Elm.Button(win);
119btn4.setText("elm.text", "Gap: 0.1"); 122btn4.setText("elm.text", "Gap: 0.1");
120box_gap.packEnd(btn4); 123box_gap.packEnd(btn4);
121btn4.setVisible(true); 124btn4.setVisible(true);
122btn4.on('clicked', _btn_options_cb); 125btn4.on('clicked', _btn_options_cb);
123 126
124btn5 = new elm.Elm.Button(win); 127btn5 = new efl.Elm.Button(win);
125btn5.setText("elm.text", "Gap: 0.5"); 128btn5.setText("elm.text", "Gap: 0.5");
126box_gap.packEnd(btn5); 129box_gap.packEnd(btn5);
127btn5.setVisible(true); 130btn5.setVisible(true);
128btn5.on('clicked', _btn_options_cb); 131btn5.on('clicked', _btn_options_cb);
129 132
130btn6 = new elm.Elm.Button(win); 133btn6 = new efl.Elm.Button(win);
131btn6.setText("elm.text", "Gap: 1.0"); 134btn6.setText("elm.text", "Gap: 1.0");
132box_gap.packEnd(btn6); 135box_gap.packEnd(btn6);
133btn6.setVisible(true); 136btn6.setVisible(true);
@@ -136,72 +139,82 @@ btn6.on('clicked', _btn_options_cb);
136up.setAutorepeat(true); 139up.setAutorepeat(true);
137up.setAutorepeatInitialTimeout(1.0); 140up.setAutorepeatInitialTimeout(1.0);
138up.setAutorepeatGapTimeout(0.5); 141up.setAutorepeatGapTimeout(0.5);
139up.setSizeHintWeight(1.0, 0.0); 142up.setHintWeight(1.0, 0.0);
140up.setSizeHintAlign(-1.0, 0.0); 143up.setHintAlign(-1.0, 0.0);
141box.packEnd(up); 144box.packEnd(up);
142up.setVisible(true); 145up.setVisible(true);
143up.on('repeated', _btn_cursors_move) 146up.on('repeated', _btn_cursors_move)
144up.on('unpressed', _btn_cursors_release); 147up.on('unpressed', _btn_cursors_release);
145icon_up = new elm.Elm.Icon(win); 148// FIXME fix icon support.
146icon_up.setStandard("arrow_up"); 149// icon_up = new efl.Elm.Icon(win);
147up.contentSet("icon", icon_up); 150// icon_up.setIcon("arrow_up");
148 151// up.setIcon(icon_up);
149box_inferior = new elm.Elm.Box(win); 152up.setText("elm.text", "up");
150box_inferior.setHorizontal(true); 153
151box_inferior.setSizeHintWeight(1.0, 1.0); 154box_inferior = new efl.Efl.Ui.Box(win);
152box_inferior.setSizeHintAlign(-1.0, -1.0); 155box_inferior.setOrientation(efl.Efl.Orient.HORIZONTAL);
156box_inferior.setHintWeight(1.0, 1.0);
157box_inferior.setHintAlign(-1.0, -1.0);
153box.packEnd(box_inferior); 158box.packEnd(box_inferior);
154box_inferior.setVisible(true); 159box_inferior.setVisible(true);
155 160
156left.setAutorepeat(true); 161left.setAutorepeat(true);
157left.setAutorepeatInitialTimeout(1.0); 162left.setAutorepeatInitialTimeout(1.0);
158left.setAutorepeatGapTimeout(0.5); 163left.setAutorepeatGapTimeout(0.5);
159left.setSizeHintWeight(0.0, 1.0); 164left.setHintWeight(0.0, 1.0);
160left.setSizeHintAlign(0.0, -1.0); 165left.setHintAlign(0.0, -1.0);
161box_inferior.packEnd(left); 166box_inferior.packEnd(left);
162left.setVisible(true); 167left.setVisible(true);
163left.on('repeated', _btn_cursors_move) 168left.on('repeated', _btn_cursors_move)
164left.on('unpressed', _btn_cursors_release); 169left.on('unpressed', _btn_cursors_release);
165 170
166icon_left = new elm.Elm.Icon(win); 171// FIXME fix icon support
167icon_left.setStandard("arrow_left"); 172// icon_left = new efl.Elm.Icon(win);
168left.contentSet("icon", icon_left); 173// icon_left.setStandard("arrow_left");
174// left.setContent("icon", icon_left);
175left.setText("elm.text", "left");
169 176
170mid.setSizeHintWeight(1.0, 1.0); 177mid.setHintWeight(1.0, 1.0);
171box_inferior.packEnd(mid); 178box_inferior.packEnd(mid);
172mid.setVisible(true); 179mid.setVisible(true);
173 180
174icon_mid = new elm.Elm.Icon(win); 181// FIXME fix icon support
175icon_mid.setStandard("close"); 182// icon_mid = new efl.Elm.Icon(win);
176mid.contentSet("icon", icon_mid); 183// icon_mid.setStandard("close");
184// mid.setContent("icon", icon_mid);
185mid.setText("elm.text", "Close");
177 186
178right.setAutorepeat(true); 187right.setAutorepeat(true);
179right.setAutorepeatInitialTimeout(1.0); 188right.setAutorepeatInitialTimeout(1.0);
180right.setAutorepeatGapTimeout(0.5); 189right.setAutorepeatGapTimeout(0.5);
181right.setSizeHintWeight(0.0, 1.0); 190right.setHintWeight(0.0, 1.0);
182right.setSizeHintAlign(0.0, -1.0); 191right.setHintAlign(0.0, -1.0);
183box_inferior.packEnd(right); 192box_inferior.packEnd(right);
184right.setVisible(true); 193right.setVisible(true);
185right.on('repeated', _btn_cursors_move); 194right.on('repeated', _btn_cursors_move);
186right.on('unpressed', _btn_cursors_release); 195right.on('unpressed', _btn_cursors_release);
187 196
188icon_right = new elm.Elm.Icon(win); 197// FIXME fix icon support
189icon_right.setStandard("arrow_right"); 198// icon_right = new efl.Elm.Icon(win);
190right.contentSet("icon", icon_right); 199// icon_right.setStandard("arrow_right");
200// right.setIcon(icon_right);
201right.setText("elm.text", "right");
191 202
192down.setAutorepeat(true); 203down.setAutorepeat(true);
193down.setAutorepeatInitialTimeout(1.0); 204down.setAutorepeatInitialTimeout(1.0);
194down.setAutorepeatGapTimeout(0.5); 205down.setAutorepeatGapTimeout(0.5);
195down.setSizeHintWeight(1.0, 0.0); 206down.setHintWeight(1.0, 0.0);
196down.setSizeHintAlign(-1.0, 0.0); 207down.setHintAlign(-1.0, 0.0);
197box.packEnd(down); 208box.packEnd(down);
198down.setVisible(true); 209down.setVisible(true);
199down.on('repeated', _btn_cursors_move); 210down.on('repeated', _btn_cursors_move);
200down.on('unpressed', _btn_cursors_release); 211down.on('unpressed', _btn_cursors_release);
201 212
202icon_down = new elm.Elm.Icon(win); 213// FIXME fix icon support
203icon_down.setStandard("arrow_down"); 214// icon_down = new efl.Elm.Icon(win);
204down.contentSet("icon", icon_down); 215// icon_down.setStandard("arrow_down");
216// down.setIcon(icon_down);
217down.setText("elm.text", "Down");
205 218
206win.setSize(300, 320); 219win.setSize(300, 320);
207win.setVisible(true); 220win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_01.js b/src/examples/elementary/calendar_example_01.js
index 980bf83a29..bd0f1113ca 100644
--- a/src/examples/elementary/calendar_example_01.js
+++ b/src/examples/elementary/calendar_example_01.js
@@ -1,14 +1,14 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Creation Example"); 5win.setText("Calendar Creation Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9cal = new elm.Elm.Calendar(win); 8cal = new efl.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0); 9cal.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal); 10win.pack(cal);
11win.setSize(240, 240);
12cal.setVisible(true); 12cal.setVisible(true);
13 13
14win.setVisible(true); 14win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_02.js b/src/examples/elementary/calendar_example_02.js
index c8b53fd755..535519266b 100644
--- a/src/examples/elementary/calendar_example_02.js
+++ b/src/examples/elementary/calendar_example_02.js
@@ -1,15 +1,16 @@
1elm = require('elm'); 1efl = require('efl');
2 2
3//var weekdays = ["S", "M", "T", "W", "T", "F", "S"]; 3//var weekdays = ["S", "M", "T", "W", "T", "F", "S"];
4 4
5win = new elm.Elm.WinStandard(null); 5win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Layout Formatting Example"); 6win.setText("Calendar Layout Formatting Example");
7win.setAutohide(true); 7win.setAutohide(true);
8 8
9cal = new elm.Elm.Calendar(win); 9cal = new efl.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0); 10cal.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal);
12 11
12win.pack(cal);
13win.setSize(240, 240);
13//cal.format_function_set(funtion); 14//cal.format_function_set(funtion);
14//cal.weekdays_names_set(weekdays); 15//cal.weekdays_names_set(weekdays);
15 16
diff --git a/src/examples/elementary/calendar_example_03.js b/src/examples/elementary/calendar_example_03.js
index 481079fc68..af6ed84148 100644
--- a/src/examples/elementary/calendar_example_03.js
+++ b/src/examples/elementary/calendar_example_03.js
@@ -1,14 +1,14 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Min/Max Year Example"); 5win.setText("Calendar Min/Max Year Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9cal = new elm.Elm.Calendar(win); 8cal = new efl.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0); 9cal.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal); 10win.pack(cal);
11win.setSize(240, 240);
12cal.setMinMaxYear(2020,2022); 12cal.setMinMaxYear(2020,2022);
13cal.setVisible(true); 13cal.setVisible(true);
14 14
diff --git a/src/examples/elementary/calendar_example_04.js b/src/examples/elementary/calendar_example_04.js
index 7f1094149a..5f2352593b 100644
--- a/src/examples/elementary/calendar_example_04.js
+++ b/src/examples/elementary/calendar_example_04.js
@@ -1,27 +1,26 @@
1 1
2elm = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Day Selection Example"); 5win.setText("Calendar Day Selection Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9box = new elm.Elm.Box(win); 8box = new efl.Efl.Ui.Box(win);
10box.setSizeHintWeight(1.0, 1.0); 9box.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(box); 10win.pack(box);
12box.setVisible(true); 11box.setVisible(true);
13 12
14cal = new elm.Elm.Calendar(win); 13cal = new efl.Elm.Calendar(win);
15cal.setSizeHintWeight(1.0, 1.0); 14cal.setHintWeight(1.0, 1.0);
16cal.setSizeHintAlign(-1.0, -1.0); 15cal.setHintAlign(-1.0, -1.0);
17cal.setSelectMode(elm.Elm.Calendar.Select.Mode.NONE); 16cal.setSelectMode(efl.Elm.Calendar.Select.Mode.NONE);
18win.resizeObjectAdd(cal); 17win.pack(cal);
19cal.setVisible(true); 18cal.setVisible(true);
20box.packEnd(cal); 19box.packEnd(cal);
21 20
22cal2 = new elm.Elm.Calendar(win); 21cal2 = new efl.Elm.Calendar(win);
23cal2.setSizeHintWeight(1.0, 1.0); 22cal2.setHintWeight(1.0, 1.0);
24cal2.setSizeHintAlign(-1.0, -1.0); 23cal2.setHintAlign(-1.0, -1.0);
25// selected_time_set uses tm* struct 24// selected_time_set uses tm* struct
26//dateCurrent = new Date(); 25//dateCurrent = new Date();
27//dateSelected = dateCurrent.getSeconds() + 2 * 3600 * 24; 26//dateSelected = dateCurrent.getSeconds() + 2 * 3600 * 24;
@@ -29,4 +28,5 @@ cal2.setSizeHintAlign(-1.0, -1.0);
29cal2.setVisible(true); 28cal2.setVisible(true);
30box.packEnd(cal2); 29box.packEnd(cal2);
31 30
31win.setSize(240, 480);
32win.setVisible(true); 32win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_05.js b/src/examples/elementary/calendar_example_05.js
index 7759b2da8b..d29f8b58b4 100644
--- a/src/examples/elementary/calendar_example_05.js
+++ b/src/examples/elementary/calendar_example_05.js
@@ -1,5 +1,5 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4_print_cal_info_cb = function () 4_print_cal_info_cb = function ()
5{ 5{
@@ -7,7 +7,7 @@ _print_cal_info_cb = function ()
7 7
8 var interval = cal.getInterval(); 8 var interval = cal.getInterval();
9 var mm_yr = cal.getMinMaxYear(); 9 var mm_yr = cal.getMinMaxYear();
10 var sel_enable = cal.getSelectMode() != elm.Elm.Calendar.Select.Mode.NONE; 10 var sel_enable = cal.getSelectMode() != efl.Elm.Calendar.Select.Mode.NONE;
11 var wds = cal.getWeekdaysNames(); 11 var wds = cal.getWeekdaysNames();
12 12
13 console.log("weekdays= " + wds + ", interval= " + interval + 13 console.log("weekdays= " + wds + ", interval= " + interval +
@@ -15,13 +15,14 @@ _print_cal_info_cb = function ()
15} 15}
16 16
17 17
18win = new elm.Elm.WinStandard(null); 18win = new efl.Efl.Ui.Win.Standard(null);
19win.setTitle("Calendar Getters Example"); 19win.setText("Calendar Getters Example");
20win.setAutohide(true); 20win.setAutohide(true);
21 21
22cal = new elm.Elm.Calendar(win); 22cal = new efl.Elm.Calendar(win);
23cal.setSizeHintWeight(1.0, 1.0); 23cal.setHintWeight(1.0, 1.0);
24win.resizeObjectAdd(cal); 24win.pack(cal);
25win.setSize(240, 240);
25 26
26cal.on('changed', _print_cal_info_cb); 27cal.on('changed', _print_cal_info_cb);
27 28
diff --git a/src/examples/elementary/clock_example.js b/src/examples/elementary/clock_example.js
index f13c07e721..313a30d3a0 100644
--- a/src/examples/elementary/clock_example.js
+++ b/src/examples/elementary/clock_example.js
@@ -1,30 +1,32 @@
1elm = require('elm'); 1efl = require('efl');
2 2
3win = new elm.Elm.WinStandard(null); 3win = new efl.Efl.Ui.Win.Standard(null);
4win.setTitle("Clock Example"); 4win.setText("Clock Example");
5win.setAutohide(true); 5win.setAutohide(true);
6win.setSize(480, 240);
6 7
7bx = new elm.Elm.Box(win); 8bx = new efl.Efl.Ui.Box(win);
8bx.setSizeHintWeight(1.0, 1.0); 9bx.setHintWeight(1.0, 1.0);
9win.resizeObjectAdd(bx); 10win.pack(bx);
10bx.setVisible(true); 11bx.setVisible(true);
12bx.setOrientation(efl.Efl.Orient.VERTICAL);
11 13
12ck = new elm.Elm.Clock(win); 14ck = new efl.Elm.Clock(win);
13bx.packEnd(ck); 15bx.packEnd(ck);
14ck.setVisible(true); 16ck.setVisible(true);
15 17
16ck2 = new elm.Elm.Clock(win); 18ck2 = new efl.Elm.Clock(win);
17ck2.setShowAmPm(true); 19ck2.setShowAmPm(true);
18bx.packEnd(ck2); 20bx.packEnd(ck2);
19ck2.setVisible(true); 21ck2.setVisible(true);
20 22
21ck3 = new elm.Elm.Clock(win); 23ck3 = new efl.Elm.Clock(win);
22ck3.setShowSeconds(true); 24ck3.setShowSeconds(true);
23ck3.setTime(10, 11, 12); 25ck3.setTime(10, 11, 12);
24bx.packEnd(ck3); 26bx.packEnd(ck3);
25ck3.setVisible(true); 27ck3.setVisible(true);
26 28
27ck4 = new elm.Elm.Clock(win); 29ck4 = new efl.Elm.Clock(win);
28ck4.setEdit(true); 30ck4.setEdit(true);
29ck4.setShowSeconds(true); 31ck4.setShowSeconds(true);
30ck4.setShowAmPm(true); 32ck4.setShowAmPm(true);
@@ -32,12 +34,13 @@ ck4.setTime(10, 11, 12);
32bx.packEnd(ck4); 34bx.packEnd(ck4);
33ck4.setVisible(true); 35ck4.setVisible(true);
34 36
35ck5 = new elm.Elm.Clock(win); 37ck5 = new efl.Elm.Clock(win);
36ck5.setShowSeconds(true); 38ck5.setShowSeconds(true);
37ck5.setEdit(true); 39ck5.setEdit(true);
38digedit = elm.Elm.Clock.EditMode.HOUR_UNIT | elm.Elm.Clock.EditMode.MIN_UNIT | elm.Elm.Clock.EditMode.SEC_UNIT; 40digedit = efl.Elm.Clock.EditMode.HOUR_UNIT | efl.Elm.Clock.EditMode.MIN_UNIT | efl.Elm.Clock.EditMode.SEC_UNIT;
39ck5.setEditMode(digedit); 41ck5.setEditMode(digedit);
40bx.packEnd(ck5); 42bx.packEnd(ck5);
41ck5.setVisible(true); 43ck5.setVisible(true);
42 44
45
43win.setVisible(true); 46win.setVisible(true);
diff --git a/src/examples/elementary/datetime_example.js b/src/examples/elementary/datetime_example.js
index 92b361ec8a..0047d03c24 100644
--- a/src/examples/elementary/datetime_example.js
+++ b/src/examples/elementary/datetime_example.js
@@ -1,41 +1,42 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Datetime"); 5win.setText("Datetime");
6win.setAutohide(true); 6win.setAutohide(true);
7win.setSize(320,240);
7 8
8bg = new elm.Elm.Bg(win); 9bg = new efl.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0); 10bg.setHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg); 11win.pack(bg);
11bg.setVisible(true); 12bg.setVisible(true);
12 13
13bx = new elm.Elm.Box(win); 14bx = new efl.Efl.Ui.Box(win);
14bx.setSizeHintWeight(1.0, 1.0); 15bx.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx); 16win.pack(bx);
16bx.setVisible(true); 17bx.setVisible(true);
17 18
18datetime = new elm.Elm.Datetime(bx); 19datetime = new efl.Elm.Datetime(bx);
19datetime.setSizeHintWeight(1.0, 1.0); 20datetime.setHintWeight(1.0, 1.0);
20datetime.setSizeHintAlign(-1.0, 0.5); 21datetime.setHintAlign(-1.0, 0.5);
21datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.HOUR, false); 22datetime.setFieldVisible(efl.Elm.Datetime.FieldType.HOUR, false);
22datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MINUTE, false); 23datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MINUTE, false);
23datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.AMPM, false); 24datetime.setFieldVisible(efl.Elm.Datetime.FieldType.AMPM, false);
24bx.packEnd(datetime); 25bx.packEnd(datetime);
25datetime.setVisible(true); 26datetime.setVisible(true);
26 27
27datetime = new elm.Elm.Datetime(bx); 28datetime = new efl.Elm.Datetime(bx);
28datetime.setSizeHintWeight(1.0, 1.0); 29datetime.setHintWeight(1.0, 1.0);
29datetime.setSizeHintAlign(-1.0, 0.5); 30datetime.setHintAlign(-1.0, 0.5);
30datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.YEAR, false); 31datetime.setFieldVisible(efl.Elm.Datetime.FieldType.YEAR, false);
31datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MONTH, false); 32datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MONTH, false);
32datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.DATE, false); 33datetime.setFieldVisible(efl.Elm.Datetime.FieldType.DATE, false);
33bx.packEnd(datetime); 34bx.packEnd(datetime);
34datetime.setVisible(true); 35datetime.setVisible(true);
35 36
36datetime = new elm.Elm.Datetime(bx); 37datetime = new efl.Elm.Datetime(bx);
37datetime.setSizeHintWeight(1.0, 1.0); 38datetime.setHintWeight(1.0, 1.0);
38datetime.setSizeHintAlign(-1.0, 0.5); 39datetime.setHintAlign(-1.0, 0.5);
39bx.packEnd(datetime); 40bx.packEnd(datetime);
40datetime.setVisible(true); 41datetime.setVisible(true);
41 42
diff --git a/src/examples/elementary/icon_example_01.js b/src/examples/elementary/icon_example_01.js
index a1689349c9..78f6e2b1e1 100644
--- a/src/examples/elementary/icon_example_01.js
+++ b/src/examples/elementary/icon_example_01.js
@@ -1,12 +1,11 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Icon Plain"); 5win.setText("Icon Plain");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9icon = new elm.Elm.Icon(win); 8icon = new efl.Elm.Icon(win);
10//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
11icon.setStandard("home"); 10icon.setStandard("home");
12 11
@@ -25,8 +24,8 @@ icon.setResizable(false, true);
25icon.setSmooth(false); 24icon.setSmooth(false);
26icon.setFillOutside(true); 25icon.setFillOutside(true);
27 26
28icon.setSizeHintWeight(1.0, 1.0); 27icon.setHintWeight(1.0, 1.0);
29win.resizeObjectAdd(icon); 28win.pack(icon);
30icon.setVisible(true); 29icon.setVisible(true);
31 30
32win.setSize(320, 320); 31win.setSize(320, 320);