efl_js: Update JS examples
Changing imports, functions, etc. Also export "cast" function for all eolian_js generated classes.
This commit is contained in:
parent
c08eedfd11
commit
4f52588b3c
|
@ -997,6 +997,9 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
functions_ss << "\n prototype->Set(::efl::eina::js::compatibility_new<v8::String>(isolate, \"cast\"),\n"
|
||||
" ::efl::eina::js::compatibility_new<v8::FunctionTemplate>(isolate, &efl::eina::js::cast_function)->GetFunction());\n\n";
|
||||
|
||||
// generate all events
|
||||
std::stringstream events_ss;
|
||||
auto generate_events = [&] (Eolian_Class const* klass)
|
||||
|
|
|
@ -73,6 +73,7 @@ EAPI void register_ecore_audio_out_sndfile(v8::Handle<v8::Object> global, v8::Is
|
|||
|
||||
namespace efl {
|
||||
EAPI void register_animator(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_container(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_control(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_file(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_image(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
|
@ -87,6 +88,7 @@ EAPI void register_video(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
|||
EAPI void register_flip(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_frame(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_box(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
EAPI void register_image(v8::Handle<v8::Object> global, v8::Isolate* isolate);
|
||||
}}
|
||||
|
||||
namespace efl { namespace ui { namespace win {
|
||||
|
@ -380,7 +382,7 @@ EAPI void init(v8::Handle<v8::Object> exports)
|
|||
// elm::register_combobox(exports, v8::Isolate::GetCurrent());
|
||||
|
||||
// doesn't exist
|
||||
// elm::register_container(exports, v8::Isolate::GetCurrent());
|
||||
efl::register_container(exports, v8::Isolate::GetCurrent());
|
||||
|
||||
elm::register_ctxpopup(exports, v8::Isolate::GetCurrent());
|
||||
elm::register_datetime(exports, v8::Isolate::GetCurrent());
|
||||
|
@ -398,6 +400,7 @@ EAPI void init(v8::Handle<v8::Object> exports)
|
|||
elm::register_flipselector(exports, v8::Isolate::GetCurrent());
|
||||
efl::ui::register_frame(exports, v8::Isolate::GetCurrent());
|
||||
efl::ui::register_box(exports, v8::Isolate::GetCurrent());
|
||||
efl::ui::register_image(exports, v8::Isolate::GetCurrent());
|
||||
|
||||
// crash
|
||||
// elm::register_gengrid(exports, v8::Isolate::GetCurrent());
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
|
||||
var elm = require('elm')
|
||||
var efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Bg Plain");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Bg Plain");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setColor(255, 0,0,255)
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
win.setSize(320,320);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
|
||||
elm = require('elm');
|
||||
var efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Bg Image");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Bg Plain");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setLoadSize(20,20);
|
||||
bg.setOption(elm.Elm.Bg.Option.CENTER);
|
||||
bg.setOption(efl.Elm.Bg.Option.CENTER);
|
||||
|
||||
//TODO: elm_app_data_dir_get
|
||||
bg.setFile('../../data/images/plant_01.jpg', null);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg.setFile(__dirname + '/../../../data/elementary/images/plant_01.jpg', null);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
win.setSize(320, 320);
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
|
||||
var elm = require('elm')
|
||||
var efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle('title');
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText('title');
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
|
||||
entry = new elm.Elm.Label(win);
|
||||
entry = new efl.Elm.Label(win);
|
||||
entry.setSize(100, 100);
|
||||
entry.setText(null, "Texto");
|
||||
|
||||
console.log('Texto: ', entry.getText(null));
|
||||
|
||||
entry.setSizeHintWeight(1.0, 1.0);
|
||||
entry.setSizeHintAlign(-1.0, -1.0);
|
||||
entry.setHintWeight(1.0, 1.0);
|
||||
entry.setHintAlign(-1.0, -1.0);
|
||||
entry.setWrapWidth(50);
|
||||
bx.packEnd(entry);
|
||||
entry.setVisible(true);
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
|
||||
var efl = require('efl')
|
||||
var elm = require('elm')
|
||||
|
||||
_add_cb = function(){
|
||||
var btn = new elm.Elm.Button(win);
|
||||
var btn = new efl.Elm.Button(win);
|
||||
btn.setText("elm.text", "I do nothing");
|
||||
bx.packEnd(btn);
|
||||
btn.setVisible(true);
|
||||
}
|
||||
|
||||
_clear_cb = function(){
|
||||
bx.clear();
|
||||
bx.clearPack();
|
||||
}
|
||||
|
||||
_unpack_cb = function(btn){
|
||||
|
@ -18,61 +17,63 @@ _unpack_cb = function(btn){
|
|||
btn.setColor(128, 64, 0, 128)
|
||||
}
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Box example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Box example");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bigbox = new elm.Elm.Box(win)
|
||||
bigbox.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bigbox);
|
||||
bigbox = new efl.Efl.Ui.Box(win)
|
||||
bigbox.setHintWeight(1.0, 1.0);
|
||||
win.pack(bigbox);
|
||||
|
||||
bx = new elm.Elm.Box(win)
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
bx.setHorizontal(true);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
bx_orient = bx.cast("Efl.Orientation");
|
||||
bx_orient.setOrientation(efl.Efl.Orient.VERTICAL);
|
||||
bigbox.packEnd(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
bt = new elm.Elm.Button(win);
|
||||
bt = new efl.Elm.Button(win);
|
||||
bt.setText("elm.text", "Add");
|
||||
bx.packEnd(bt);
|
||||
bt.setVisible(true);
|
||||
bt.on('clicked', _add_cb);
|
||||
|
||||
bt = new elm.Elm.Button(win);
|
||||
bt = new efl.Elm.Button(win);
|
||||
bt.setText("elm.text", "Clear");
|
||||
bx.packEnd(bt);
|
||||
bt.setVisible(true);
|
||||
bt.on('clicked', _clear_cb);
|
||||
|
||||
bx = new elm.Elm.Box(win)
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
bx.setSizeHintAlign(-1.0, -1.0);
|
||||
bx.setHorizontal(true);
|
||||
bx = new efl.Efl.Ui.Box(win)
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
bx.setHintAlign(-1.0, -1.0);
|
||||
bx_orient = bx.cast("Efl.Orientation");
|
||||
bx_orient.setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bigbox.packEnd(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
bt = new elm.Elm.Button(win);
|
||||
bt = new efl.Elm.Button(win);
|
||||
bt.setText("elm.text", "Button 1");
|
||||
bx.packEnd(bt);
|
||||
bt.setSizeHintWeight(1.0, 1.0);
|
||||
bt.setSizeHintAlign(-1.0, -1.0);
|
||||
bt.setHintWeight(1.0, 1.0);
|
||||
bt.setHintAlign(-1.0, -1.0);
|
||||
bt.setVisible(true);
|
||||
bt.on('clicked', _unpack_cb);
|
||||
|
||||
bt = new elm.Elm.Button(win);
|
||||
bt = new efl.Elm.Button(win);
|
||||
bt.setText("elm.text", "Button 2");
|
||||
bx.packEnd(bt);
|
||||
bt.setSizeHintWeight(1.0, 0.0);
|
||||
bt.setSizeHintAlign(1.0, 0.5);
|
||||
bt.setHintWeight(1.0, 0.0);
|
||||
bt.setHintAlign(1.0, 0.5);
|
||||
bt.setVisible(true);
|
||||
bt.on('clicked', _unpack_cb);
|
||||
|
||||
bt = new elm.Elm.Button(win);
|
||||
bt = new efl.Elm.Button(win);
|
||||
bt.setText("elm.text", "Button 3");
|
||||
bx.packEnd(bt);
|
||||
bt.setVisible(true);
|
||||
|
|
|
@ -1,31 +1,32 @@
|
|||
|
||||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Bg Plain");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Bg Plain");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
label1 = new elm.Elm.Label(win);
|
||||
label1.setText(null, "Bubble with no icon, info or label");
|
||||
label1 = new efl.Elm.Label(win);
|
||||
label1.setText(null, "Bubble with icon, info and label");
|
||||
label1.setVisible(true);
|
||||
|
||||
console.log(efl);
|
||||
|
||||
icon = new efl.Evas.Rectangle(win);
|
||||
icon = new efl.Efl.Canvas.Rectangle(win);
|
||||
icon.setColor( 0, 0, 255, 255);
|
||||
icon.setVisible(true);
|
||||
|
||||
bubble1 = new elm.Elm.Bubble(win);
|
||||
bubble1.contentSet("icon", icon);
|
||||
bubble1 = new efl.Elm.Bubble(win);
|
||||
icon_eo = bubble1.part("icon");
|
||||
icon_container = icon_eo.cast("Efl.Container");
|
||||
icon_container.setContent(icon);
|
||||
bubble1.setText("info", "INFO");
|
||||
bubble1.setText(null, "LABEL");
|
||||
bubble1.contentSet(null, label1);
|
||||
bubble1.setContent(label1);
|
||||
bubble1.setSize(300, 100);
|
||||
bubble1.setVisible(true);
|
||||
|
||||
|
@ -40,12 +41,12 @@ bubble1.on('clicked',
|
|||
bubble1.setPos(corner);
|
||||
});
|
||||
|
||||
label2 = new elm.Elm.Label(win);
|
||||
label2 = new efl.Elm.Label(win);
|
||||
label2.setText(null, "Bubble with no icon, info or label");
|
||||
label2.setVisible(true);
|
||||
|
||||
bubble2 = new elm.Elm.Bubble(win);
|
||||
bubble2.contentSet(null, label2);
|
||||
bubble2 = new efl.Elm.Bubble(win);
|
||||
bubble2.setContent(label2);
|
||||
bubble2.setSize(200, 50);
|
||||
bubble2.setPosition(0, 110);
|
||||
bubble2.setVisible(true);
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
|
||||
efl = require('efl');
|
||||
|
||||
win = new efl.Elm.Win.Standard(null);
|
||||
win.setTitle("Hello, World!");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Hello, World!");
|
||||
win.setAutohide(true);
|
||||
|
||||
btn = new efl.Elm.Button(win);
|
||||
btn.setText(null, "Good-Bye, World!");
|
||||
btn.setSize(120, 30);
|
||||
btn.setPosition(60, 15);
|
||||
btn.setSizeHintWeight(1.0, 1.0);
|
||||
btn.setSizeHintAlign(1.0, 1.0);
|
||||
btn.setHintWeight(1.0, 1.0);
|
||||
btn.setHintAlign(1.0, 1.0);
|
||||
btn.setVisible(true);
|
||||
|
||||
btn.on('clicked', function () { console.log('clicked'); } );
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
function setIcon(widget, icon) {
|
||||
container = widget.part("icon").cast("Efl.Container");
|
||||
container.setContent(icon);
|
||||
}
|
||||
|
||||
_btn_options_cb = function(_btn) {
|
||||
var text = _btn.getText("elm.text");
|
||||
|
@ -31,13 +35,13 @@ _btn_cursors_move = function(_btn) {
|
|||
console.log ("cursor move: ", size[0], size[1]);
|
||||
|
||||
if (!icon_still) {
|
||||
var icon = new elm.Elm.Icon(mid);
|
||||
var icon = new efl.Elm.Icon(mid);
|
||||
var icon_still_p = mid.contentUnset("icon");
|
||||
if (icon_still_p) {
|
||||
icon_still_p.setVisible(false);
|
||||
}
|
||||
icon.setStandard("chat");
|
||||
mid.contentSet("icon", icon);
|
||||
icon.setIcon("chat");
|
||||
setIcon(mid, icon);
|
||||
}
|
||||
|
||||
if (_btn.getPosition()[1] == up.getPosition()[1]) {
|
||||
|
@ -56,78 +60,78 @@ _btn_cursors_move = function(_btn) {
|
|||
ax += 0.05;
|
||||
if (ax > 1.0) ax = 1.0;
|
||||
}
|
||||
mid.setSizeHintAlign(ax, ay);
|
||||
mid.setHintAlign(ax, ay);
|
||||
}
|
||||
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Button example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Button example");
|
||||
win.setAutohide(true);
|
||||
|
||||
icon_still = new elm.Elm.Icon(win);
|
||||
mid = new elm.Elm.Button(win);
|
||||
up = new elm.Elm.Button(win);
|
||||
down = new elm.Elm.Button(win);
|
||||
left = new elm.Elm.Button(win);
|
||||
right = new elm.Elm.Button(win);
|
||||
icon_still = new efl.Elm.Icon(win);
|
||||
mid = new efl.Elm.Button(win);
|
||||
up = new efl.Elm.Button(win);
|
||||
down = new efl.Elm.Button(win);
|
||||
left = new efl.Elm.Button(win);
|
||||
right = new efl.Elm.Button(win);
|
||||
|
||||
_btn_cursors_release = function() {
|
||||
if (icon_still)
|
||||
{
|
||||
mid.contentSet("icon", icon_still);
|
||||
setIcon(mid, icon_still);
|
||||
icon_still = null;
|
||||
}
|
||||
}
|
||||
|
||||
box = new elm.Elm.Box(win);
|
||||
box.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(box);
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
box.setVisible(true);
|
||||
|
||||
box_initial = new elm.Elm.Box(win);
|
||||
box_initial.setHorizontal(true);
|
||||
box_initial.setSizeHintWeight(1.0, 0.0);
|
||||
box_initial = new efl.Efl.Ui.Box(win);
|
||||
box_initial.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
box_initial.setHintWeight(1.0, 0.0);
|
||||
box.packEnd(box_initial);
|
||||
box_initial.setVisible(true);
|
||||
|
||||
btn = new elm.Elm.Button(win);
|
||||
btn = new efl.Elm.Button(win);
|
||||
btn.setText("elm.text", "Initial: 0.0");
|
||||
box_initial.packEnd(btn);
|
||||
btn.setVisible(true);
|
||||
|
||||
btn.on('clicked', _btn_options_cb);
|
||||
|
||||
btn2 = new elm.Elm.Button(win);
|
||||
btn2 = new efl.Elm.Button(win);
|
||||
btn2.setText("elm.text", "Initial: 1.0");
|
||||
box_initial.packEnd(btn2);
|
||||
btn2.setVisible(true);
|
||||
btn2.on('clicked', _btn_options_cb);
|
||||
|
||||
btn3 = new elm.Elm.Button(win);
|
||||
btn3 = new efl.Elm.Button(win);
|
||||
btn3.setText("elm.text", "Initial: 5.0");
|
||||
box_initial.packEnd(btn3);
|
||||
btn3.setVisible(true);
|
||||
btn3.on('clicked', _btn_options_cb);
|
||||
|
||||
box_gap = new elm.Elm.Box(win);
|
||||
box_gap.setHorizontal(true);
|
||||
box_gap.setSizeHintWeight(1.0, 0.0);
|
||||
box_gap = new efl.Efl.Ui.Box(win);
|
||||
box_gap.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
box_gap.setHintWeight(1.0, 0.0);
|
||||
box.packEnd(box_gap);
|
||||
box_gap.setVisible(true);
|
||||
|
||||
btn4 = new elm.Elm.Button(win);
|
||||
btn4 = new efl.Elm.Button(win);
|
||||
btn4.setText("elm.text", "Gap: 0.1");
|
||||
box_gap.packEnd(btn4);
|
||||
btn4.setVisible(true);
|
||||
btn4.on('clicked', _btn_options_cb);
|
||||
|
||||
btn5 = new elm.Elm.Button(win);
|
||||
btn5 = new efl.Elm.Button(win);
|
||||
btn5.setText("elm.text", "Gap: 0.5");
|
||||
box_gap.packEnd(btn5);
|
||||
btn5.setVisible(true);
|
||||
btn5.on('clicked', _btn_options_cb);
|
||||
|
||||
btn6 = new elm.Elm.Button(win);
|
||||
btn6 = new efl.Elm.Button(win);
|
||||
btn6.setText("elm.text", "Gap: 1.0");
|
||||
box_gap.packEnd(btn6);
|
||||
btn6.setVisible(true);
|
||||
|
@ -136,72 +140,72 @@ btn6.on('clicked', _btn_options_cb);
|
|||
up.setAutorepeat(true);
|
||||
up.setAutorepeatInitialTimeout(1.0);
|
||||
up.setAutorepeatGapTimeout(0.5);
|
||||
up.setSizeHintWeight(1.0, 0.0);
|
||||
up.setSizeHintAlign(-1.0, 0.0);
|
||||
up.setHintWeight(1.0, 0.0);
|
||||
up.setHintAlign(-1.0, 0.0);
|
||||
box.packEnd(up);
|
||||
up.setVisible(true);
|
||||
up.on('repeated', _btn_cursors_move)
|
||||
up.on('unpressed', _btn_cursors_release);
|
||||
icon_up = new elm.Elm.Icon(win);
|
||||
icon_up.setStandard("arrow_up");
|
||||
up.contentSet("icon", icon_up);
|
||||
icon_up = new efl.Elm.Icon(win);
|
||||
icon_up.setIcon("arrow_up");
|
||||
setIcon(up, icon_up);
|
||||
|
||||
box_inferior = new elm.Elm.Box(win);
|
||||
box_inferior.setHorizontal(true);
|
||||
box_inferior.setSizeHintWeight(1.0, 1.0);
|
||||
box_inferior.setSizeHintAlign(-1.0, -1.0);
|
||||
box_inferior = new efl.Efl.Ui.Box(win);
|
||||
box_inferior.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
box_inferior.setHintWeight(1.0, 1.0);
|
||||
box_inferior.setHintAlign(-1.0, -1.0);
|
||||
box.packEnd(box_inferior);
|
||||
box_inferior.setVisible(true);
|
||||
|
||||
left.setAutorepeat(true);
|
||||
left.setAutorepeatInitialTimeout(1.0);
|
||||
left.setAutorepeatGapTimeout(0.5);
|
||||
left.setSizeHintWeight(0.0, 1.0);
|
||||
left.setSizeHintAlign(0.0, -1.0);
|
||||
left.setHintWeight(0.0, 1.0);
|
||||
left.setHintAlign(0.0, -1.0);
|
||||
box_inferior.packEnd(left);
|
||||
left.setVisible(true);
|
||||
left.on('repeated', _btn_cursors_move)
|
||||
left.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_left = new elm.Elm.Icon(win);
|
||||
icon_left.setStandard("arrow_left");
|
||||
left.contentSet("icon", icon_left);
|
||||
icon_left = new efl.Elm.Icon(win);
|
||||
icon_left.setIcon("arrow_left");
|
||||
setIcon(left, icon_left);
|
||||
|
||||
mid.setSizeHintWeight(1.0, 1.0);
|
||||
mid.setHintWeight(1.0, 1.0);
|
||||
box_inferior.packEnd(mid);
|
||||
mid.setVisible(true);
|
||||
|
||||
icon_mid = new elm.Elm.Icon(win);
|
||||
icon_mid.setStandard("close");
|
||||
mid.contentSet("icon", icon_mid);
|
||||
icon_mid = new efl.Elm.Icon(win);
|
||||
icon_mid.setIcon("close");
|
||||
setIcon(mid, icon_mid);
|
||||
|
||||
right.setAutorepeat(true);
|
||||
right.setAutorepeatInitialTimeout(1.0);
|
||||
right.setAutorepeatGapTimeout(0.5);
|
||||
right.setSizeHintWeight(0.0, 1.0);
|
||||
right.setSizeHintAlign(0.0, -1.0);
|
||||
right.setHintWeight(0.0, 1.0);
|
||||
right.setHintAlign(0.0, -1.0);
|
||||
box_inferior.packEnd(right);
|
||||
right.setVisible(true);
|
||||
right.on('repeated', _btn_cursors_move);
|
||||
right.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_right = new elm.Elm.Icon(win);
|
||||
icon_right.setStandard("arrow_right");
|
||||
right.contentSet("icon", icon_right);
|
||||
icon_right = new efl.Elm.Icon(win);
|
||||
icon_right.setIcon("arrow_right");
|
||||
setIcon(right, icon_right);
|
||||
|
||||
down.setAutorepeat(true);
|
||||
down.setAutorepeatInitialTimeout(1.0);
|
||||
down.setAutorepeatGapTimeout(0.5);
|
||||
down.setSizeHintWeight(1.0, 0.0);
|
||||
down.setSizeHintAlign(-1.0, 0.0);
|
||||
down.setHintWeight(1.0, 0.0);
|
||||
down.setHintAlign(-1.0, 0.0);
|
||||
box.packEnd(down);
|
||||
down.setVisible(true);
|
||||
down.on('repeated', _btn_cursors_move);
|
||||
down.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_down = new elm.Elm.Icon(win);
|
||||
icon_down.setStandard("arrow_down");
|
||||
down.contentSet("icon", icon_down);
|
||||
icon_down = new efl.Elm.Icon(win);
|
||||
icon_down.setIcon("arrow_down");
|
||||
setIcon(down, icon_down);
|
||||
|
||||
win.setSize(300, 320);
|
||||
win.setVisible(true);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Calendar Creation Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Calendar Creation Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
cal = new elm.Elm.Calendar(win);
|
||||
cal.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(cal);
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
win.pack(cal);
|
||||
win.setSize(240, 240);
|
||||
cal.setVisible(true);
|
||||
|
||||
win.setVisible(true);
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
//var weekdays = ["S", "M", "T", "W", "T", "F", "S"];
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Calendar Layout Formatting Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Calendar Layout Formatting Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
cal = new elm.Elm.Calendar(win);
|
||||
cal.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(cal);
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
|
||||
win.pack(cal);
|
||||
win.setSize(240, 240);
|
||||
//cal.format_function_set(funtion);
|
||||
//cal.weekdays_names_set(weekdays);
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Calendar Min/Max Year Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Calendar Min/Max Year Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
cal = new elm.Elm.Calendar(win);
|
||||
cal.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(cal);
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
win.pack(cal);
|
||||
win.setSize(240, 240);
|
||||
cal.setMinMaxYear(2020,2022);
|
||||
cal.setVisible(true);
|
||||
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
|
||||
elm = require('efl');
|
||||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Calendar Day Selection Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Calendar Day Selection Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
box = new elm.Elm.Box(win);
|
||||
box.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(box);
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
box.setVisible(true);
|
||||
|
||||
cal = new elm.Elm.Calendar(win);
|
||||
cal.setSizeHintWeight(1.0, 1.0);
|
||||
cal.setSizeHintAlign(-1.0, -1.0);
|
||||
cal.setSelectMode(elm.Elm.Calendar.Select.Mode.NONE);
|
||||
win.resizeObjectAdd(cal);
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
cal.setHintAlign(-1.0, -1.0);
|
||||
cal.setSelectMode(efl.Elm.Calendar.Select.Mode.NONE);
|
||||
win.pack(cal);
|
||||
cal.setVisible(true);
|
||||
box.packEnd(cal);
|
||||
|
||||
cal2 = new elm.Elm.Calendar(win);
|
||||
cal2.setSizeHintWeight(1.0, 1.0);
|
||||
cal2.setSizeHintAlign(-1.0, -1.0);
|
||||
cal2 = new efl.Elm.Calendar(win);
|
||||
cal2.setHintWeight(1.0, 1.0);
|
||||
cal2.setHintAlign(-1.0, -1.0);
|
||||
// selected_time_set uses tm* struct
|
||||
//dateCurrent = new Date();
|
||||
//dateSelected = dateCurrent.getSeconds() + 2 * 3600 * 24;
|
||||
|
@ -29,4 +28,5 @@ cal2.setSizeHintAlign(-1.0, -1.0);
|
|||
cal2.setVisible(true);
|
||||
box.packEnd(cal2);
|
||||
|
||||
win.setSize(240, 480);
|
||||
win.setVisible(true);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
_print_cal_info_cb = function ()
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ _print_cal_info_cb = function ()
|
|||
|
||||
var interval = cal.getInterval();
|
||||
var mm_yr = cal.getMinMaxYear();
|
||||
var sel_enable = cal.getSelectMode() != elm.Elm.Calendar.Select.Mode.NONE;
|
||||
var sel_enable = cal.getSelectMode() != efl.Elm.Calendar.Select.Mode.NONE;
|
||||
var wds = cal.getWeekdaysNames();
|
||||
|
||||
console.log("weekdays= " + wds + ", interval= " + interval +
|
||||
|
@ -15,13 +15,14 @@ _print_cal_info_cb = function ()
|
|||
}
|
||||
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Calendar Getters Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Calendar Getters Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
cal = new elm.Elm.Calendar(win);
|
||||
cal.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(cal);
|
||||
cal = new efl.Elm.Calendar(win);
|
||||
cal.setHintWeight(1.0, 1.0);
|
||||
win.pack(cal);
|
||||
win.setSize(240, 240);
|
||||
|
||||
cal.on('changed', _print_cal_info_cb);
|
||||
|
||||
|
|
|
@ -1,30 +1,32 @@
|
|||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Clock Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Clock Example");
|
||||
win.setAutohide(true);
|
||||
win.setSize(480, 240);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
bx.setOrientation(efl.Efl.Orient.VERTICAL);
|
||||
|
||||
ck = new elm.Elm.Clock(win);
|
||||
ck = new efl.Elm.Clock(win);
|
||||
bx.packEnd(ck);
|
||||
ck.setVisible(true);
|
||||
|
||||
ck2 = new elm.Elm.Clock(win);
|
||||
ck2 = new efl.Elm.Clock(win);
|
||||
ck2.setShowAmPm(true);
|
||||
bx.packEnd(ck2);
|
||||
ck2.setVisible(true);
|
||||
|
||||
ck3 = new elm.Elm.Clock(win);
|
||||
ck3 = new efl.Elm.Clock(win);
|
||||
ck3.setShowSeconds(true);
|
||||
ck3.setTime(10, 11, 12);
|
||||
bx.packEnd(ck3);
|
||||
ck3.setVisible(true);
|
||||
|
||||
ck4 = new elm.Elm.Clock(win);
|
||||
ck4 = new efl.Elm.Clock(win);
|
||||
ck4.setEdit(true);
|
||||
ck4.setShowSeconds(true);
|
||||
ck4.setShowAmPm(true);
|
||||
|
@ -32,12 +34,13 @@ ck4.setTime(10, 11, 12);
|
|||
bx.packEnd(ck4);
|
||||
ck4.setVisible(true);
|
||||
|
||||
ck5 = new elm.Elm.Clock(win);
|
||||
ck5 = new efl.Elm.Clock(win);
|
||||
ck5.setShowSeconds(true);
|
||||
ck5.setEdit(true);
|
||||
digedit = elm.Elm.Clock.EditMode.HOUR_UNIT | elm.Elm.Clock.EditMode.MIN_UNIT | elm.Elm.Clock.EditMode.SEC_UNIT;
|
||||
digedit = efl.Elm.Clock.EditMode.HOUR_UNIT | efl.Elm.Clock.EditMode.MIN_UNIT | efl.Elm.Clock.EditMode.SEC_UNIT;
|
||||
ck5.setEditMode(digedit);
|
||||
bx.packEnd(ck5);
|
||||
ck5.setVisible(true);
|
||||
|
||||
|
||||
win.setVisible(true);
|
||||
|
|
|
@ -1,41 +1,42 @@
|
|||
|
||||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Datetime");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Datetime");
|
||||
win.setAutohide(true);
|
||||
win.setSize(320,240);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
datetime = new elm.Elm.Datetime(bx);
|
||||
datetime.setSizeHintWeight(1.0, 1.0);
|
||||
datetime.setSizeHintAlign(-1.0, 0.5);
|
||||
datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.HOUR, false);
|
||||
datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MINUTE, false);
|
||||
datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.AMPM, false);
|
||||
datetime = new efl.Elm.Datetime(bx);
|
||||
datetime.setHintWeight(1.0, 1.0);
|
||||
datetime.setHintAlign(-1.0, 0.5);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.HOUR, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MINUTE, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.AMPM, false);
|
||||
bx.packEnd(datetime);
|
||||
datetime.setVisible(true);
|
||||
|
||||
datetime = new elm.Elm.Datetime(bx);
|
||||
datetime.setSizeHintWeight(1.0, 1.0);
|
||||
datetime.setSizeHintAlign(-1.0, 0.5);
|
||||
datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.YEAR, false);
|
||||
datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MONTH, false);
|
||||
datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.DATE, false);
|
||||
datetime = new efl.Elm.Datetime(bx);
|
||||
datetime.setHintWeight(1.0, 1.0);
|
||||
datetime.setHintAlign(-1.0, 0.5);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.YEAR, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MONTH, false);
|
||||
datetime.setFieldVisible(efl.Elm.Datetime.FieldType.DATE, false);
|
||||
bx.packEnd(datetime);
|
||||
datetime.setVisible(true);
|
||||
|
||||
datetime = new elm.Elm.Datetime(bx);
|
||||
datetime.setSizeHintWeight(1.0, 1.0);
|
||||
datetime.setSizeHintAlign(-1.0, 0.5);
|
||||
datetime = new efl.Elm.Datetime(bx);
|
||||
datetime.setHintWeight(1.0, 1.0);
|
||||
datetime.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(datetime);
|
||||
datetime.setVisible(true);
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Icon Plain");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Icon Plain");
|
||||
win.setAutohide(true);
|
||||
|
||||
icon = new elm.Elm.Icon(win);
|
||||
icon = new efl.Elm.Icon(win);
|
||||
//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default
|
||||
icon.setStandard("home");
|
||||
|
||||
|
@ -25,8 +24,8 @@ icon.setResizable(false, true);
|
|||
icon.setSmooth(false);
|
||||
icon.setFillOutside(true);
|
||||
|
||||
icon.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(icon);
|
||||
icon.setHintWeight(1.0, 1.0);
|
||||
win.pack(icon);
|
||||
icon.setVisible(true);
|
||||
|
||||
win.setSize(320, 320);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
|
||||
Elm = require('elm').Elm;
|
||||
path = require('path');
|
||||
efl = require('efl');
|
||||
Evas = efl.Evas;
|
||||
Elm = efl.Elm;
|
||||
|
||||
win = new Elm.WinStandard(null);
|
||||
win.setTitle("Layout");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText('Layout');
|
||||
win.setAutohide(true);
|
||||
|
||||
box = new Elm.Box(win);
|
||||
box.setSizeHintWeight(1.0, 1.0);
|
||||
win.addResizeObject(box);
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
box.setVisible(true);
|
||||
|
||||
ly = new Elm.Layout(box);
|
||||
|
@ -20,28 +20,31 @@ if (!ly.setTheme("layout", "application", "titlebar"))
|
|||
}
|
||||
|
||||
ly.setPartText('elm.text', 'Some title');
|
||||
ly.setSizeHintWeight(1.0, 1.0);
|
||||
ly.setSizeHintAlign(1.0, 1.0);
|
||||
ly.setHintWeight(1.0, 1.0);
|
||||
ly.setHintAlign(1.0, 1.0);
|
||||
box.packEnd(ly);
|
||||
ly.setVisible(true);
|
||||
|
||||
bt = new Elm.Icon(ly);
|
||||
bt.setStandard('chat');
|
||||
bt.setSizeHintMin(20, 20);
|
||||
bt.setIcon('chat');
|
||||
bt.setHintMin(20, 20);
|
||||
// elm_layout_icon_set(ly, bt);
|
||||
ly.setContent('elm.swallow.icon', bt);
|
||||
icon_container = ly.part('elm.swallow.icon').cast('Efl.Container');
|
||||
icon_container.setContent(bt);
|
||||
ly.emitSignal('elm,state,icon,visible', 'elm');
|
||||
|
||||
bt = new Elm.Icon(ly);
|
||||
bt.setStandard('close');
|
||||
bt.setSizeHintMin(20, 20);
|
||||
bt.setIcon('close');
|
||||
bt.setHintMin(20, 20);
|
||||
// elm_layout_end_set(ly, bt);
|
||||
ly.setContent('elm.swallow.end', bt);
|
||||
end_container = ly.part('elm.swallow.end').cast('Efl.Container');
|
||||
end_container.setContent(bt);
|
||||
ly.emitSignal('elm,state,end,visible', 'elm');
|
||||
|
||||
ly = new Elm.Layout(box);
|
||||
ly.setFile('/home/felipe/dev/samsung/upstream/elementary/build/data/objects/test.edj', "layout");
|
||||
ly.setSizeHintWeight(1.0, 1.0);
|
||||
filename = path.join(__dirname, 'layout_example.edj');
|
||||
ly.setFile(filename, 'example/mylayout');
|
||||
ly.setHintWeight(1.0, 1.0);
|
||||
box.packEnd(ly);
|
||||
ly.setVisible(true);
|
||||
|
||||
|
@ -52,11 +55,14 @@ ly.setVisible(true);
|
|||
|
||||
bt = new Elm.Button(ly);
|
||||
bt.setPartText(null, "Button 1");
|
||||
ly.setContent("element1", bt);
|
||||
console.log("Will get part");
|
||||
element_container = ly.part('example/custom').cast('Efl.Container');
|
||||
console.log("Will setcontent on part");
|
||||
element_container.setContent(bt);
|
||||
|
||||
bt.on("clicked", function() { console.log('button clicked'); });
|
||||
|
||||
ly.setPartCursor("text", 'watch');
|
||||
ly.setPartCursor("example/title", 'watch');
|
||||
ly.on('mouse,down', function() { console.log('layout mouse down') });
|
||||
ly.on('mouse,up', function() { console.log('layout mouse up') });
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Menu");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Menu");
|
||||
win.setAutohide(true);
|
||||
|
||||
rect = new efl.Evas.Rectangle(win);
|
||||
win.resizeObjectAdd(rect);
|
||||
rect.setSizeHintMin( 0, 0);
|
||||
rect = new efl.Efl.Canvas.Rectangle(win);
|
||||
win.pack(rect);
|
||||
rect.setHintMin( 0, 0);
|
||||
rect.setColor( 0, 0, 0, 0);
|
||||
rect.setVisible(true);
|
||||
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Popup");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Popup");
|
||||
win.setAutohide(true);
|
||||
|
||||
content = new elm.Elm.Label(win);
|
||||
content = new efl.Elm.Label(win);
|
||||
content.setText("elm.text", "<align=center>Content</align>");
|
||||
|
||||
popup = new elm.Elm.Popup(win);
|
||||
popup = new efl.Elm.Popup(win);
|
||||
popup.setTimeout(3);
|
||||
|
||||
popup.on('timeout', function()
|
||||
|
@ -17,7 +16,8 @@ popup.on('timeout', function()
|
|||
popup.setVisible(false);
|
||||
});
|
||||
|
||||
popup.contentSet("elm.swallow.content", content);
|
||||
content_container = popup.part("elm.swallow.content").cast("Efl.Container");
|
||||
content_container.setContent(content);
|
||||
|
||||
popup.setText("title,text", "Title");
|
||||
popup.setVisible(true);
|
||||
|
|
|
@ -1,63 +1,63 @@
|
|||
|
||||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
_cb = function(obj){
|
||||
console.log(obj.getText("elm.text"), "state value:", obj.getStateValue());
|
||||
}
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Radio");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Radio");
|
||||
win.setAutohide(true);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
bx.setHorizontal(true);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
radio_g = new elm.Elm.Radio(win);
|
||||
radio_g = new efl.Elm.Radio(win);
|
||||
radio_g.setText("elm.text", "Radio 1");
|
||||
radio_g.setStateValue(1);
|
||||
radio_g.setValue(1);
|
||||
ic = new elm.Elm.Icon(win);
|
||||
ic.setStandard("home");
|
||||
radio_g.contentSet("icon", ic);
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic.setIcon("home");
|
||||
radio_g.part("icon").cast("Efl.Container").setContent(ic);
|
||||
bx.packEnd(radio_g);
|
||||
radio_g.setSizeHintWeight(1.0, 1.0);
|
||||
radio_g.setSizeHintAlign(-1.0, -1.0);
|
||||
radio_g.setHintWeight(1.0, 1.0);
|
||||
radio_g.setHintAlign(-1.0, -1.0);
|
||||
radio_g.on('changed', _cb);
|
||||
radio_g.setVisible(true);
|
||||
|
||||
radio = new elm.Elm.Radio(win);
|
||||
radio = new efl.Elm.Radio(win);
|
||||
radio.setText("elm.text", "Radio 2");
|
||||
radio.setStateValue(2);
|
||||
radio.groupAdd(radio_g);
|
||||
ic = new elm.Elm.Icon(win);
|
||||
ic.setStandard("file");
|
||||
radio.contentSet("icon", ic);
|
||||
radio.addGroup(radio_g);
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic.setIcon("file");
|
||||
radio.part("icon").cast("Efl.Container").setContent(ic);
|
||||
bx.packEnd(radio);
|
||||
radio.setSizeHintWeight(1.0, 1.0);
|
||||
radio.setSizeHintAlign(-1.0, -1.0);
|
||||
radio.setHintWeight(1.0, 1.0);
|
||||
radio.setHintAlign(-1.0, -1.0);
|
||||
radio.on('changed', _cb);
|
||||
radio.setVisible(true);
|
||||
|
||||
radio = new elm.Elm.Radio(win);
|
||||
radio = new efl.Elm.Radio(win);
|
||||
radio.setText("elm.text", "Radio 3");
|
||||
radio.setStateValue(3);
|
||||
radio.groupAdd(radio_g);
|
||||
radio.addGroup(radio_g);
|
||||
bx.packEnd(radio);
|
||||
radio.setSizeHintWeight(1.0, 1.0);
|
||||
radio.setSizeHintAlign(-1.0, -1.0);
|
||||
radio.setHintWeight(1.0, 1.0);
|
||||
radio.setHintAlign(-1.0, -1.0);
|
||||
radio.on('changed', _cb);
|
||||
radio.setVisible(true);
|
||||
|
||||
radio = new elm.Elm.Radio(win);
|
||||
radio = new efl.Elm.Radio(win);
|
||||
radio.setText("elm.text", "Radio 4");
|
||||
radio.setStateValue(4);
|
||||
radio.groupAdd(radio_g);
|
||||
radio.addGroup(radio_g);
|
||||
bx.packEnd(radio);
|
||||
radio.setSizeHintWeight(1.0, 1.0);
|
||||
radio.setSizeHintAlign(-1.0, -1.0);
|
||||
radio.setHintWeight(1.0, 1.0);
|
||||
radio.setHintAlign(-1.0, -1.0);
|
||||
radio.on('changed', _cb);
|
||||
radio.setVisible(true);
|
||||
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
|
||||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Separator");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Separator");
|
||||
win.setAutohide(true);
|
||||
|
||||
bg = new elm.Elm.Bg(win);
|
||||
bg.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bg);
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.setSize(640, 480);
|
||||
win.pack(bg);
|
||||
bg.setVisible(true);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
bx.setHorizontal(true);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
rect = new efl.Evas.Rectangle(win);
|
||||
rect = new efl.Efl.Canvas.Rectangle(win);
|
||||
rect.setColor( 0, 255, 0, 255)
|
||||
rect.setSizeHintMin( 90, 200);
|
||||
rect.setSizeHintWeight(1.0, 1.0);
|
||||
rect.setSizeHintAlign(-1.0, -1.0);
|
||||
rect.setHintMin( 90, 200);
|
||||
rect.setHintWeight(1.0, 1.0);
|
||||
rect.setHintAlign(-1.0, -1.0);
|
||||
rect.setVisible(true);
|
||||
bx.packEnd(rect);
|
||||
|
||||
separator = new elm.Elm.Separator(win);
|
||||
separator.setHorizontal(true);
|
||||
separator = new efl.Elm.Separator(win);
|
||||
separator.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
separator.setVisible(true);
|
||||
bx.packEnd(separator);
|
||||
|
||||
rect2 = new efl.Evas.Rectangle(win);
|
||||
rect2 = new efl.Efl.Canvas.Rectangle(win);
|
||||
rect2.setColor( 0, 0, 255, 255);
|
||||
rect2.setSizeHintMin( 90, 200);
|
||||
rect2.setSizeHintWeight(1.0, 1.0);
|
||||
rect2.setSizeHintAlign(-1.0, -1.0);
|
||||
rect2.setHintMin( 90, 200);
|
||||
rect2.setHintWeight(1.0, 1.0);
|
||||
rect2.setHintAlign(-1.0, -1.0);
|
||||
rect2.setVisible(true);
|
||||
bx.packEnd(rect2);
|
||||
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
|
||||
efl = require('efl');
|
||||
elm = require('elm');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Slider Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Slider Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
//bx.setHorizontal(true);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl.setSizeHintAlign(-1.0, 0.5);
|
||||
sl.setSizeHintWeight(1.0, 1.0);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.setHintAlign(-1.0, 0.5);
|
||||
sl.setHintWeight(1.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
/* with icon, end and label */
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.setText("elm.text", "Counter");
|
||||
|
||||
ic = new elm.Elm.Icon(win);
|
||||
ic.setStandard("home");
|
||||
ic.setResizable(false, false);
|
||||
sl.contentSet("icon", ic);
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic.setIcon("home");
|
||||
// ic.setResizable(false, false);
|
||||
sl.part("icon").cast("Efl.Container").setContent(ic);
|
||||
|
||||
ic = new elm.Elm.Icon(win);
|
||||
ic.setStandard("folder");
|
||||
ic.setResizable(false, false);
|
||||
sl.contentSet("end", ic);
|
||||
ic = new efl.Elm.Icon(win);
|
||||
ic.setIcon("folder");
|
||||
// ic.setResizable(false, false);
|
||||
sl.part("end").cast("Efl.Container").setContent(ic);
|
||||
|
||||
sl.setSizeHintAlign(-1.0, 0.5);
|
||||
sl.setSizeHintWeight(1.0, 1.0);
|
||||
sl.setHintAlign(-1.0, 0.5);
|
||||
sl.setHintWeight(1.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
/* value set and span size */
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl.setValue(1);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.setProgressValue(1);
|
||||
sl.setSpanSize(200);
|
||||
sl.setSizeHintAlign(-1.0, 0.5);
|
||||
sl.setSizeHintWeight(1.0, 1.0);
|
||||
sl.setHintAlign(-1.0, 0.5);
|
||||
sl.setHintWeight(1.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
/* with unit label and min - max */
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.setUnitFormat("%1.0f units");
|
||||
sl.setMinMax(0, 100);
|
||||
sl.setSizeHintAlign(-1.0, 0.5);
|
||||
sl.setSizeHintWeight(1.0, 1.0);
|
||||
sl.setHintAlign(-1.0, 0.5);
|
||||
sl.setHintWeight(1.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
/* with indicator label and inverted */
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.setIndicatorFormat("%1.2f");
|
||||
sl.setInverted(true);
|
||||
sl.setSizeHintAlign(-1.0, 0.5);
|
||||
sl.setSizeHintWeight(1.0, 1.0);
|
||||
// legacy function, not supported.
|
||||
// sl.setInverted(true);
|
||||
sl.setHintAlign(-1.0, 0.5);
|
||||
sl.setHintWeight(1.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
/* vertical with indicator format func */
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl.setHorizontal(false);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.VERTICAL);
|
||||
//indicator_format = function()
|
||||
// {
|
||||
// indicator = new char[32];
|
||||
|
@ -76,28 +76,28 @@ sl.setHorizontal(false);
|
|||
//indicator_free = function() {console.log("free")}
|
||||
//sl.indicator_format_function_set(indicator_format, indicator_free);
|
||||
|
||||
sl.setSizeHintAlign(0.5, -1.0);
|
||||
sl.setSizeHintWeight(0.0, 1.0);
|
||||
sl.setHintAlign(0.5, -1.0);
|
||||
sl.setHintWeight(0.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
/* callbacks */
|
||||
sl = new elm.Elm.Slider(win);
|
||||
sl = new efl.Elm.Slider(win);
|
||||
sl.setUnitFormat("%1.3f units");
|
||||
sl.setSizeHintAlign(-1.0, 0.5);
|
||||
sl.setSizeHintWeight(1.0, 1.0);
|
||||
sl.setHintAlign(-1.0, 0.5);
|
||||
sl.setHintWeight(1.0, 1.0);
|
||||
bx.packEnd(sl);
|
||||
sl.setVisible(true);
|
||||
|
||||
sl.on('changed', function(obj)
|
||||
{
|
||||
val = obj.getValue();
|
||||
val = obj.getProgressValue();
|
||||
console.log("Changed to " + val);
|
||||
});
|
||||
|
||||
sl.on('delay_changed', function(obj)
|
||||
{
|
||||
val = obj.getValue();
|
||||
val = obj.getProgressValue();
|
||||
console.log("Delay changed to " + val);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,76 +1,76 @@
|
|||
|
||||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Spinner Example");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Spinner Example");
|
||||
win.setAutohide(true);
|
||||
|
||||
bx = new elm.Elm.Box(win);
|
||||
bx.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(bx);
|
||||
bx = new efl.Efl.Ui.Box(win);
|
||||
bx.setHintWeight(1.0, 1.0);
|
||||
win.pack(bx);
|
||||
bx.setVisible(true);
|
||||
|
||||
sp = new elm.Elm.Spinner(win);
|
||||
sp.setSizeHintWeight(1.0, 1.0);
|
||||
sp.setSizeHintAlign(-1.0, 0.5);
|
||||
sp = new efl.Elm.Spinner(win);
|
||||
sp.setHintWeight(1.0, 1.0);
|
||||
sp.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp);
|
||||
sp.setVisible(true);
|
||||
|
||||
sp2 = new elm.Elm.Spinner(win);
|
||||
sp2 = new efl.Elm.Spinner(win);
|
||||
sp2.setLabelFormat("Percentage %%%1.2f something");
|
||||
sp2.setSizeHintWeight(1.0, 1.0);
|
||||
sp2.setSizeHintAlign(-1.0, 0.5);
|
||||
sp2.setHintWeight(1.0, 1.0);
|
||||
sp2.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp2);
|
||||
sp2.setVisible(true);
|
||||
|
||||
sp3 = new elm.Elm.Spinner(win);
|
||||
sp3 = new efl.Elm.Spinner(win);
|
||||
sp3.setLabelFormat("%1.1f units");
|
||||
sp3.setStep(1.5);
|
||||
sp3.setWrap(true);
|
||||
sp3.setMinMax(-50.0, 250.0);
|
||||
sp3.setSizeHintWeight(1.0, 1.0);
|
||||
sp3.setSizeHintAlign(-1.0, 0.5);
|
||||
sp3.setHintWeight(1.0, 1.0);
|
||||
sp3.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp3);
|
||||
sp3.setVisible(true);
|
||||
|
||||
sp4 = new elm.Elm.Spinner(win);
|
||||
sp4 = new efl.Elm.Spinner(win);
|
||||
sp4.setStyle("vertical");
|
||||
sp4.setInterval(0.2);
|
||||
sp4.setSizeHintWeight(1.0, 1.0);
|
||||
sp4.setSizeHintAlign(-1.0, 0.5);
|
||||
sp4.setHintWeight(1.0, 1.0);
|
||||
sp4.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp4);
|
||||
sp4.setVisible(true);
|
||||
|
||||
sp5 = new elm.Elm.Spinner(win);
|
||||
sp5 = new efl.Elm.Spinner(win);
|
||||
sp5.setEditable(false);
|
||||
sp5.setSizeHintWeight(1.0, 1.0);
|
||||
sp5.setSizeHintAlign(-1.0, 0.5);
|
||||
sp5.setHintWeight(1.0, 1.0);
|
||||
sp5.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp5);
|
||||
sp5.setVisible(true);
|
||||
|
||||
sp6 = new elm.Elm.Spinner(win);
|
||||
sp6 = new efl.Elm.Spinner(win);
|
||||
sp6.setEditable(false);
|
||||
sp6.setMinMax(1, 12);
|
||||
sp6.specialValueAdd(1, "January");
|
||||
sp6.specialValueAdd(2, "February");
|
||||
sp6.specialValueAdd(3, "March");
|
||||
sp6.specialValueAdd(4, "April");
|
||||
sp6.specialValueAdd(5, "May");
|
||||
sp6.specialValueAdd(6, "June");
|
||||
sp6.specialValueAdd(7, "July");
|
||||
sp6.specialValueAdd(8, "August");
|
||||
sp6.specialValueAdd(9, "September");
|
||||
sp6.specialValueAdd(10, "October");
|
||||
sp6.specialValueAdd(11, "November");
|
||||
sp6.specialValueAdd(12, "December");
|
||||
sp6.setSizeHintWeight(1.0, 1.0);
|
||||
sp6.setSizeHintAlign(-1.0, 0.5);
|
||||
sp6.addSpecialValue(1, "January");
|
||||
sp6.addSpecialValue(2, "February");
|
||||
sp6.addSpecialValue(3, "March");
|
||||
sp6.addSpecialValue(4, "April");
|
||||
sp6.addSpecialValue(5, "May");
|
||||
sp6.addSpecialValue(6, "June");
|
||||
sp6.addSpecialValue(7, "July");
|
||||
sp6.addSpecialValue(8, "August");
|
||||
sp6.addSpecialValue(9, "September");
|
||||
sp6.addSpecialValue(10, "October");
|
||||
sp6.addSpecialValue(11, "November");
|
||||
sp6.addSpecialValue(12, "December");
|
||||
sp6.setHintWeight(1.0, 1.0);
|
||||
sp6.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp6);
|
||||
sp6.setVisible(true);
|
||||
|
||||
sp7 = new elm.Elm.Spinner(win);
|
||||
sp7.setSizeHintWeight(1.0, 1.0);
|
||||
sp7.setSizeHintAlign(-1.0, 0.5);
|
||||
sp7 = new efl.Elm.Spinner(win);
|
||||
sp7.setHintWeight(1.0, 1.0);
|
||||
sp7.setHintAlign(-1.0, 0.5);
|
||||
bx.packEnd(sp7);
|
||||
sp7.setVisible(true);
|
||||
sp7.setEditable(true);
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
|
||||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Table");
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Table");
|
||||
win.setAutohide(true);
|
||||
|
||||
table = new elm.Elm.Table(win);
|
||||
table = new efl.Elm.Table(win);
|
||||
win.resizeObjectAdd(table);
|
||||
table.setVisible(true);
|
||||
table.setPadding(5, 5);
|
||||
table.setHomogeneous(true);
|
||||
|
||||
label = new elm.Elm.Label(win);
|
||||
label = new efl.Elm.Label(win);
|
||||
label.setText("elm.text", "label 0");
|
||||
label.setVisible(true);
|
||||
table.pack(label, 0, 0, 1, 1);
|
||||
|
||||
label = new elm.Elm.Label(win);
|
||||
label = new efl.Elm.Label(win);
|
||||
label.setText("elm.text", "label 1");
|
||||
label.setVisible(true);
|
||||
table.pack(label, 1, 0, 1, 1);
|
||||
|
||||
label = new elm.Elm.Label(win);
|
||||
label = new efl.Elm.Label(win);
|
||||
label.setText("elm.text", "label 2");
|
||||
label.setVisible(true);
|
||||
table.pack(label, 0, 1, 1, 1);
|
||||
|
||||
label = new elm.Elm.Label(win);
|
||||
label = new efl.Elm.Label(win);
|
||||
label.setText("elm.text", "label 3");
|
||||
label.setVisible(true);
|
||||
table.pack(label, 1, 1, 1, 1);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
elm = require('elm');
|
||||
efl = require('efl');
|
||||
path = require('path');
|
||||
|
||||
_generation_started_cb = function(obj)
|
||||
{
|
||||
|
@ -15,23 +16,32 @@ _generation_error_cb = function(obj)
|
|||
console.log("thumbnail generation error.");
|
||||
}
|
||||
|
||||
win = new elm.Elm.WinStandard(null);
|
||||
win.setTitle("Table");
|
||||
_client_connected_cb = function(obj)
|
||||
{
|
||||
console.log("Connected client to ethumb daemon");
|
||||
}
|
||||
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.setText("Thumb example.");
|
||||
win.setAutohide(true);
|
||||
|
||||
thumb = new elm.Elm.Thumb(win);
|
||||
thumb = new efl.Elm.Thumb(win);
|
||||
|
||||
thumb.on('generate_start', _generation_started_cb);
|
||||
thumb.on('generate_stop', _generation_finished_cb);
|
||||
thumb.on('generate_error', _generation_error_cb);
|
||||
thumb.on('generate,start', _generation_started_cb);
|
||||
thumb.on('generate,stop', _generation_finished_cb);
|
||||
thumb.on('generate,error', _generation_error_cb);
|
||||
|
||||
thumb.setSize(160, 160);
|
||||
thumb.setEditable(false);
|
||||
thumb.setFile("../../data/images/plant_01.jpg", null);
|
||||
thumb.reload();
|
||||
// legacy
|
||||
// thumb.setEditable(false);
|
||||
filename = path.join(__dirname, "../../../data/images/plant_01.jpg");
|
||||
filename = process.argv[2] || filename;
|
||||
thumb.setFile(filename, null);
|
||||
// legacy
|
||||
// thumb.reload();
|
||||
|
||||
thumb.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(thumb);
|
||||
thumb.setHintWeight(1.0, 1.0);
|
||||
win.pack(thumb);
|
||||
|
||||
thumb.setVisible(true);
|
||||
win.setSize(320, 320);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
efl = require('efl');
|
||||
|
||||
util = require('util');
|
||||
path = require('path');
|
||||
fs = require('fs');
|
||||
|
||||
user_acount = 'EnlightenmentKo'
|
||||
|
@ -16,20 +17,23 @@ var twit = new Twitter({
|
|||
access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD'
|
||||
});
|
||||
|
||||
win = new efl.ui.WinStandard(null);
|
||||
win = new efl.Efl.Ui.Win.Standard(null);
|
||||
win.title = "Twitter App";
|
||||
win.autohide = true;
|
||||
|
||||
box = new efl.ui.Box(win);
|
||||
box.setSizeHintWeight(1.0, 1.0);
|
||||
win.resizeObjectAdd(box);
|
||||
box = new efl.Efl.Ui.Box(win);
|
||||
box.setHintWeight(1.0, 1.0);
|
||||
win.pack(box);
|
||||
box.setVisible(true);
|
||||
|
||||
list = new efl.List(win);
|
||||
list.setSizeHintWeight(1.0, 1.0);
|
||||
list.setSizeHintAlign(-1.0, -1.0);
|
||||
box.packEnd(list);
|
||||
list.setVisible(true);
|
||||
tweet_box = new efl.Efl.Ui.Box(win);
|
||||
tweet_box.setHintWeight(1.0, 1.0);
|
||||
tweet_box.setHintAlign(-1.0, -1.0);
|
||||
tweet_box.setPackPadding(0.0, 30.0, true);
|
||||
box.packEnd(tweet_box);
|
||||
tweet_box_orient = tweet_box.cast("Efl.Orientation");
|
||||
tweet_box_orient.setOrientation(efl.Efl.Orient.VERTICAL);
|
||||
|
||||
|
||||
icon_array = new Array();
|
||||
|
||||
|
@ -40,7 +44,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
console.log("finished");
|
||||
for (i=0; i < icon_array.length; i++) {
|
||||
console.log(i);
|
||||
icon_array[i].file = "/tmp/twitter_pic.jpg";
|
||||
icon_array[i].setFile("/tmp/twitter_pic.jpg", null);
|
||||
}
|
||||
});
|
||||
if (tweets.length > 0) {
|
||||
|
@ -48,8 +52,9 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
}
|
||||
|
||||
for(i=0; i < tweets.length; i++){
|
||||
var layout = new efl.ui.Layout(win);
|
||||
layout.file["tweet"] = "twitter_example_01.edj";
|
||||
var layout = new efl.Elm.Layout(win);
|
||||
var filename = path.join(__dirname, 'twitter_example_01.edj');
|
||||
layout.setFile(filename, "tweet");
|
||||
|
||||
var user_name = tweets[i].user.name;
|
||||
var screen_name = tweets[i].user.screen_name;
|
||||
|
@ -58,24 +63,27 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
|
||||
layout.setText("user_name", screen_name);
|
||||
layout.setText("screen_name", " - @"+screen_name);
|
||||
var entry = new efl.ui.Entry(win);
|
||||
entry.text["elm.text"] = text;
|
||||
var entry = new efl.Elm.Entry(win);
|
||||
entry.setText("elm.text", text);
|
||||
console.log(text);
|
||||
layout.content["tweet_text"] = entry;
|
||||
part = layout.part("tweet_text").cast("Efl.Container");
|
||||
part.setContent(entry);
|
||||
|
||||
layout.sizeHintMin = {127, 96};
|
||||
layout.sizeHintWeight = {1.0, 1.0};
|
||||
layout.sizeHintAlign = {-1.0, -1.0};
|
||||
layout.setHintMin(127, 96);
|
||||
layout.setHintWeight(1.0, 1.0);
|
||||
layout.setHintAlign(-1.0, -1.0);
|
||||
|
||||
var icon = new efl.ui.Image(win);
|
||||
var icon = new efl.Efl.Ui.Image(win);
|
||||
icon.fillInside = true;
|
||||
icon_array.push(icon);
|
||||
layout.content["user_icon"] = icon;
|
||||
item = list.itemAppend("", layout, null, null, null);
|
||||
user_icon = layout.part("user_icon").cast("Efl.Container");
|
||||
user_icon.setContent(icon);
|
||||
item = tweet_box.packEnd(layout);
|
||||
layout.setVisible(true);
|
||||
}
|
||||
list.go();
|
||||
tweet_box.setVisible(true);
|
||||
}
|
||||
});
|
||||
|
||||
win.size = {380,400};
|
||||
win.visible = {true};
|
||||
win.setSize(380, 400);
|
||||
win.setVisible(true);
|
||||
|
|
Loading…
Reference in New Issue