//Called when application is started function OnStart() { app.LoadScript("DlgColorpicker.js") //Create a layout with objects vertically centered. lay = app.CreateLayout("linear", "VCenter,FillXY"); //Create a Button and add it to layout. btn = app.CreateButton("Get Hex-Colorcode"); lay.AddChild( btn ); btn.SetOnTouch(btn_OnTouch); //Create a Textedit and add it to Layout edt = app.CreateTextEdit("",0.7,-1); lay.AddChild( edt ); //Create a Button and add it to layout. btn2 = app.CreateButton("Change Textcolor"); btn2.SetMargins(0,0.05,0,0); lay.AddChild( btn2 ); btn2.SetOnTouch(btn2_OnTouch); //Create a Spinner and add it to layout. spin = app.CreateSpinner("Change Textcolor, Item2, Item3",0.7,-1); lay.AddChild( spin ); //Create a Button and add it to layout. btn3 = app.CreateButton("Change Backcolor"); btn3.SetMargins(0,0.05,0,0) lay.AddChild( btn3 ); btn3.SetOnTouch(btn3_OnTouch); //Create a list and add it to layout. lst = app.CreateList("Change Backcolor, Item2, Item3",0.7,-1); lay.AddChild( lst ); //Add layout to app. app.AddLayout( lay ); }//function Onstart() function btn_OnTouch() { // use GetString as first parameter to return the Hex-Colorcode as String // if edt as second parameter is a Textedit, it writes the // Colorcode within " (double quotes) at the Cursorposition // use true or false as third optional parameter to put the // colorcode in the clipboard (standard is false) //pick = new ColorPicker(GetString, edt); // or Write this to copy the code just in the clipboard // write null as second parameter and it do not paste // any text in the textedit // the Clipboardtext is without " (double quotes) pick = new ColorPicker(GetString, null, true); // Show the Picker pick.Show(); }//function btn_OnTouch() function btn2_OnTouch() { // use SetText as first parameter // to Set the Textcolor of the contol pick = new ColorPicker(SetText, spin, true); pick.Show(); }//function btn_OnTouch() function btn3_OnTouch() { // Use SetBackground as first parameter // to set the Backgroundcolor of the control pick = new ColorPicker(SetBackground, lst, true); pick.Show(); }//function btn_OnTouch()