
edt = app.CreateTextEdit( "", 0.8, 0.4 );
edt.SetTextColor( "#ff000000" );
edt.SetBackColor( "#ffaa00ff" );
lay.SetBackColor( "#ffaa00ff" );
edt2 = app.CreateTextEdit( "", 0.8, 0.1);
edt2.SetTextColor( "#ff000000" );
edt2.SetBackColor( "#ffaa00ff" );
edt3 = app.CreateText( "client id", 0.8,0.1);
edt3.SetTextColor( "#ff000000" );
edt3.SetBackColor( "#ffaa00ff" );
lay.AddChild( edt3 );
lay.AddChild( edt2 );
edt4 = app.CreateText( "client name", 0.8,0.1);
edt4.SetTextColor( "#ff000000" );
edt4.SetBackColor( "#ffaa00ff" );
lay.AddChild( edt4 );
lay.AddChild( edt );
btn2 = app.CreateButton( "add client" );
btn2.SetOnTouch( lload );
lay.AddChild( btn2 );
//Add layout to app.
app.AddLayout( lay );
}
function lload ()
{
i=edt2.GetText()+idd;
n=edt.GetText()+namee;
i=i.slice(0,11)+nn;
n=n.slice(0,30)+nn;
n=i+n;
app.WriteFile("/sdcard/clients.dat",n,"Append");
app.Alert ("client saved");
}
function OnStart(){ //Create the main layout. lay = app.CreateLayout( "linear", "FillXY" ); //Create a full screen scroller var scroll = app.CreateScroller( 1.0, 1.0 ); lay.AddChild( scroll ); //Create a layout inside scroller. layScroll = app.CreateLayout( "Linear", "Left" ); scroll.AddChild( layScroll ); //Create an image twice the screen size. img = app.CreateImage( "/Sys/Img/Hello.png", 2.0, 2.0 ); layScroll.AddChild( img );
lay.SetBackColor( "#ffaa00ff" );
function OnStart() { //Create the main layout. lay = app.CreateLayout("linear", "FillXY");
//Create a full screen scroller var scroll = app.CreateScroller(1.0, 1.0); lay.AddChild(scroll);
//Create a layout inside scroller. layScroll = app.CreateLayout("Linear", "Left"); scroll.AddChild(layScroll); scroll.SetBackColor("#ffff0000"); //Create an image twice the screen size. var a = 0; var txt = Array(); for (a = 0; a < 40; a++) {
txt[a] = app.CreateText("item " + a, 1, -1, "Left"); //this make the text full widht txt[a].SetPadding(0.03, 0, 0, 0); //this move it a little from the left edge txt[a].SetMargins(0,0,0,0.01); //this separates from the following text txt[a].SetTextColor("#ff000000"); txt[a].SetTextSize(22);
layScroll.AddChild(txt[a]); }
//Add layout to app. app.AddLayout(lay);}
Add event on click