var chg = false;
var clicked = false;
//Called when application is started.
function OnStart() {
//setup///////
app.SetOrientation("Portrait");
app.EnableBackKey(false);
////////////////////////////
appl = app.CreateLayout("Linear", "VCenter,FillXY");
scroll = app.CreateScroller(1.0, 1.0);
appl.AddChild(scroll);
app.AddLayout(appl);
lay = app.CreateLayout("Linear", "VCenter,FillXY");
scroll.AddChild(lay);
lay.SetBackColor("#222222");
///app
var code = "var text = 'TEST';\n" +
"g = Graphics.createArrayBuffer(5,5,1);\n" +
"g.flip = function(){show(this.buffer);};\n" +
"var x = 0;\n" +
"\n" +
"function draw()\n" +
"{\n" +
"if( x++ > text.length*5 ) x=0;\n" +
"g.clear();\n" +
"g.drawString( text, 5-x);\n" +
"g.flip();\n" +
"}\n" +
"\n" +
"setInterval(draw,150);\n";
layup = app.CreateLayout("Linear", "Horizontal,FillX");
layup.SetBackGradient("#ffffff", "#a7a7a7");
lay.SetBackColor("#a7a7a7");
bl = app.CreateButton("[fa-bluetooth]", -1, 0.12, "FontAwesome,Custom");
bl.SetStyle("#0000ff", "#0000aa", 10);
bl.SetTextSize(32);
bl.SetTextShadow(2, 0, 1, "#880000");
layup.AddChild(bl);
btl = app.CreateButton("[fa-bug]", -1, 0.12, "FontAwesome,Custom");
btl.SetStyle("#0000ff", "#0000aa", 10);
btl.SetTextSize(32);
btl.SetTextShadow(2, 0, 1, "#880000");
layup.AddChild(btl);
bvl = app.CreateButton("[fa-upload]", -1, 0.12, "FontAwesome,Custom");
bvl.SetStyle("#0000ff", "#0000aa", 10);
bvl.SetTextSize(32);
bvl.SetTextShadow(2, 0, 1, "#880000");
layup.AddChild(bvl);
bsl = app.CreateButton("[fa-eraser]", -1, 0.12, "FontAwesome,Custom");
bsl.SetStyle("#0000ff", "#0000aa", 10);
bsl.SetTextSize(32);
bsl.SetTextShadow(2, 0, 1, "#880000");
layup.AddChild(bsl);
bl = app.CreateButton("[fa-download]", -1, 0.12, "FontAwesome,Custom");
bl.SetStyle("#0000ff", "#0000aa", 10);
bl.SetTextSize(32);
bl.SetTextShadow(2, 0, 1, "#880000");
layup.AddChild(bl);
lay.AddChild(layup);
layab = app.CreateLayout("Absolute", "VCenter");
lay.AddChild(layab);
txt = app.CreateTextEdit(code, 0.98, 0.88, "MultiLine");
txt.SetBackColor("#e5e5e5");
txt.SetTextColor("Black");
txt.Focus();
app.ShowKeyboard(txt);
layab.AddChild(txt);
//(my notes) make layout{ and put on scroller(, then make lay{ {and put lay with buttons} and make {another lay with txtedit} })}
}
function OnStart()
{
lay = app.CreateLayout( "linear", "Top,FillXY" );
txt = app.CreateTextEdit("My Code", 0.98, 0.88);
txt.SetTextSize( 32 );
lay.AddChild( txt );
app.SetOnShowKeyboard( keybd );
app.AddLayout( lay );
txt.Focus();
app.ShowKeyboard( txt );
}
function keybd(shown)
{
var width = app.GetScreenWidth( )*0.98
var height = app.GetScreenHeight()*0.88
height -= app.GetKeyboardHeight();
txt.SetSize( width,height,"px");
}