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