I have a problem, I start to develop a ui of an app, and in one of the frames in this project I added 25 controls in it, but I need add more, when I try to add a checkbox text and edit text appears only edit text, and the text and the check not appear, in my code I have checks and texts previously put.
What can I do? I try to see the controls moving the margins of each control in problem only if the controls are created out of the frame, just if apply the case, but don't works, the controls refused to appear.
This is the code:
//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
lay.SetBackColor( "#00bcff" );
lframe = app.CreateLayout( "linear","left,FillXY");
lframe.SetBackColor( "#5f5f5f" );
lframe.SetVisibility( "Show" );
//Creando ventanitas de app
//Creando ventana crear examen, encuesta
Vlc = app.CreateLayout( "Linear","left,FillXY" );
//Vlc.SetSize( 100,100 );
Vlc.SetVisibility( "Hide" );
Vlc.SetBackColor( "#008200" );
Vlc.SetMargins( 0.025, 0.001, 0.025, 0.025 );
//titulo ventana
var Tx = "<u>Crear</u>"
Titvlc = app.CreateText( Tx,0.6,-1,"Html" );
Titvlc.SetTextColor( "#000000" );
Titvlc.SetTextSize( 16 );
Titvlc.SetMargins( 0.15, 0.01, 0.01, 0.01 );
Vlc.AddChild( Titvlc );
//txtpara guardar el archivo
Txtar = app.CreateText( "Nombre del Archivo:" );
Txtar.SetTextColor( "#000000" );
Txtar.SetTextSize( 12 );
Txtar.SetMargins( 0.025, 0.01, 0.01, 0.01 );
Tedna = app.CreateTextEdit( "",0.5,0.040 );
Tedna.SetTextColor( "#000000" );
Tedna.SetTextSize( 12 );
Tedna.SetMargins( 0.30, -0.04, 0.01, 0.01 );
Vlc.AddChild( Txtar );
Vlc.AddChild( Tedna );
//Selección del tipo de atchivo y cuestionario
var Txc = "<u>Tipo de Cuestionario:</u>"
var Txp = "<u>Tipo de Pregunta:</u>"
Barrah = app.CreateImage( null, 0.9,0.01 );
Barrah.SetPaintColor( "#000000" );
Barrah.DrawLine( 0.0,0.1,1.0,0.1 );
Barrah.SetMargins( 0.025, 0.0, 0.0, 0.0 );
Barrav = app.CreateImage( null, 0.01,0.2 );
Barrav.SetPaintColor( "#000000" );
Barrav.DrawLine( 0.0,0.1,0.0, 0.8 );
Barrav.SetMargins( 0.35, -0.12, 0.0, 0.0 );
//titulo 1
Txtc = app.CreateText( Txc,0.3,-1,"Html" );
Txtc.SetTextColor( "#000000" );
Txtc.SetTextSize( 12 );
Txtc.SetMargins( 0.02, 0.0, 0.0, 0.0 );
Rbtc1 = app.CreateCheckBox( "Encuesta" );
Rbtc1.SetTextSize( 12 );
Rbtc1.SetMargins( 0.02, 0.0, 0.0, 0.0 );
Rbtc2 = app.CreateCheckBox( "Examen" );
Rbtc2.SetTextSize( 12 );
Rbtc2.SetMargins( 0.02, 0.0, 0.0, 0.0 );
// Segundo título
Txtp = app.CreateText( Txp,0.3,-1,"Html" );
Txtp.SetTextSize( 12 );
Txtp.SetTextColor( "#000000" );
Txtp.SetMargins( 0.35, -0.181, 0.0, 0.0 );
// RadioButtons
// Rbtp1
Rbtp1 = app.CreateCheckBox( "INR" );
Rbtp1.SetTextSize( 12 );
Rbtp1.SetMargins( 0.38, 0.0, 0.0, 0.0 );
// Rbtp2
Rbtp2 = app.CreateCheckBox( "IRM1R" );
Rbtp2.SetTextSize( 12 );
Rbtp2.SetMargins( 0.38, 0.0, 0.0, 0.0 );
// Rbtp3
Rbtp3 = app.CreateCheckBox( "IRMMR" );
Rbtp3.SetTextSize( 12 );
Rbtp3.SetMargins( 0.38, 0.0, 0.0, 0.0 );
// Rbtp4
Rbtp4 = app.CreateCheckBox( "RM1R" );
Rbtp4.SetTextSize( 12 );
Rbtp4.SetMargins( 0.58, -0.09, 0.0, 0.0 );
// Rhtp5
Rbtp5 = app.CreateCheckBox( "RMMR" );
Rbtp5.SetTextSize( 12 );
Rbtp5.SetMargins( 0.58, 0.0, 0.0, 0.0 );
//barrah2
barrah2 = app.CreateImage( null, 0.9,0.01 );
barrah2.SetPaintColor( "#000000" );
barrah2.DrawLine( 0.0,0.1,1.0,0.1 );
barrah2.SetMargins( 0.025, 0.03, 0.0, 0.0 );
//ID Cuestionario
Txid = app.CreateText( "ID del Cuestionario:" );
Txid.SetTextColor( "#000000" );
Txid.SetTextSize( 12 );
Txid.SetMargins( 0.03, 0.0, 0.0, 0.0 );
//texto que muestra el id autogenerado
Txidd = app.CreateText( " " );
Txidd.SetTextColor( "#000000" );
Txidd.SetTextSize( 12 );
Txidd.SetBackColor( "#7f7f7f" );
//Txidd.SetText( "12" );
Txidd.SetMargins( 0.30, -0.027, 0.0, 0.0 );
//opcion para imprimir numeros
Tximpn = app.CreateText( "¿Imprimir Números?" );
Tximpn.SetTextSize( 12 );
Tximpn.SetTextColor( "#000000" );
Tximpn.SetMargins( 0.35,- 0.03, 0.0, 0.0 );
//spinner de los números
l="Sel,0,1,2";
spn = app.CreateSpinner( l,0.12 );
spn.SetTextSize( 12 );
spn.SetTextColor( "#000000" );
spn.SetMargins( 0.43,-0.0,0.0, 0.0 );
//Opciones
Txop = app.CreateText( "Opciones:" );
Txop.SetTextSize( 12 );
Txop.SetTextColor( "#000000" );
Txop.SetMargins( 0.70, -0.07, 0.0, 0.0 );
//numerador
var n=100;
var l2="";
//estas opciones deven de leer los números de orden ya programados y excluirlos de la lista en cada cambio
for(var i=1;i<=n;i++){
if(i==n){
l2=l2+ new String(i);//
}else{
l2=l2 + new String(i) +",";//
}
}
num = app.CreateSpinner( l2,0.12 );
num.SetTextSize( 12 );
num.SetTextColor( "#000000" );
num.SetMargins( 0.70, 0.0, 0.0, 0.0 );
//texto indicativo de la pregunta
Tp = app.CreateText( "Escriba la pregunta " );
Tp.SetTextSize( 12 );
Tp.SetTextColor( "#000000" );
Tp.SetMargins( 0.025, -0.03, 0.01, 0.01 );
//text area para capturar la pregunta
Ta1 = app.CreateTextEdit( "",0.9,0.15,"Left Bold" );
Ta1.SetTextSize( 12 );
Ta1.SetTextColor( "#000000" );
Ta1.SetBackColor( "#33ffffff" );
Ta1.SetMargins( 0.025, -0.01, 0.01, 0.01 );
//srparador horizontal
barrah3 = app.CreateImage( null, 0.9,0.01 );
barrah3.SetPaintColor( "#000000" );
barrah3.DrawLine( 0.0,0.1,1.0,0.1 );
barrah3.SetMargins( 0.025, 0.0, 0.0, 0.0 );
//texto para escribir las respuestas
Tr = app.CreateText( "Escriba la Respuesta " );
Tr.SetTextSize( 12 );
Tr.SetTextColor( "#000000" );
Tr.SetMargins( 0.025, 0.0, 0.01, 0.01 );
//indicador de respuestas
Ir = app.CreateText( "Respuestas: " );
Ir.SetTextSize( 12 );
Ir.SetTextColor( "#000000" );
Ir.SetMargins( 0.65, -0.038, 0.01, 0.01 );
//barra horizontal psra el número de Respuestas
Barrah4 = app.CreateImage( null, 0.5,0.01 );
Barrah4.SetPaintColor( "#000000" );
Barrah4.DrawLine( 0.0,0.1,0.21,0.1 );
Barrah4.SetMargins( 0.82, -0.01, 0.01, 0.01 );
//textedit para las respuestas
Txr = app.CreateTextEdit( "",0.9,0.15,"Left Bold" );
Txr.SetTextSize( 12 );
Txr.SetTextColor( "#000000" );
Txr.SetBackColor( "#33ffffff" );
Txr.SetMargins( 0.025, -0.01, 0.01, 0.01 );
//check respuedta correcta
Dfr = app.CreateText( "hola" );
Dfr.SetTextSize( 12 );
Chr = app.CreateCheckBox( "Respuesta correcta" );
Chr.SetTextSize( 12 );
Chr.SetTextColor( "#000000" );
Chr.SetMargins( 0.01, 0.01, 0.01, 0.01 );
//texto valor
Txv = app.CreateText( "Valor: " );
Txv.SetTextSize( 12 );
Txv.SetTextColor( "#000000" );
Txv.SetMargins( 0.01, 0.01, 0.01, 0.01 );
//text edit para capturar el valor de la respuesta correcta
Txtv = app.CreateTextEdit( "",0.1,0.04 );
Txtv.SetTextSize( 12 );
Txtv.SetTextColor( "#000000" );
Txtv.SetBackColor( "#33ffffff" );
Txtv.SetMargins( 0.03, 0.01, 0.01, 0.0 );
// Add to Vlc
Vlc.AddChild( Barrah );
Vlc.AddChild( Txtc );
Vlc.AddChild( Rbtc1 );
Vlc.AddChild( Rbtc2 );
Vlc.AddChild( Barrav );
Vlc.AddChild( Txtp );
Vlc.AddChild( Rbtp1 );
Vlc.AddChild( Rbtp2 );
Vlc.AddChild( Rbtp3 );
Vlc.AddChild( Rbtp4 );
Vlc.AddChild( Rbtp5 );
Vlc.AddChild( barrah2 );
Vlc.AddChild( Txid );
Vlc.AddChild( Txidd );
Vlc.AddChild( Tximpn );
Vlc.AddChild( spn );
Vlc.AddChild( Txop );
Vlc.AddChild( num );
Vlc.AddChild( Tp );
Vlc.AddChild( Ta1 );
Vlc.AddChild( barrah3 );
Vlc.AddChild( Tr );
Vlc.AddChild( Ir );
Vlc.AddChild( Barrah4 );
Vlc.AddChild( Txr );
Vlc.AddChild( Dfr );
Vlc.AddChild( Chr );//->not appear
Vlc.AddChild( Txv );//->not appear
Vlc.AddChild( Txtv );//->this appear
//Creando ventana aplica examen, encuesta
// Vlaplica
//Creando ventana califica examen, encuesta
// Vlcal
//Creando la ventana graficar
//Vlgraf
//Crate de first Spinner
sp = app.CreateSpinner("Seleccione:,Crear,Aplicar,Calificar,Graficar",0.25 );
sp.SetMargins( 0.01, 0, 0.01, 0 );
sp.SetOnChange( seleccion );
sp.SelectItem( null );
//Create a text label and add it to layout.
txt = app.CreateText( "Creador de Encuesyas y Exámenes V0.1 Alpha" );
txt.SetTextSize( 16 );
txt.SetTextColor( "#000000" );
txt1 = app.CreateText( "Menú " );
txt1.SetTextSize( 16 );
txt1.SetTextColor( "#000000" );
txt1.SetMargins( 0.07, 0.01, 0.01, 0 );
lay.AddChild( txt );
lframe.AddChild( txt1 );
lframe.AddChild( sp );
//Add layout to app.
app.AddLayout( lay );
lay.AddChild(lframe );
lframe.AddChild( Vlc );
}
function seleccion(sel)
{//ini seleccion
switch(sel){
case "Crear":
app.ShowPopup( "Entró a crear","short Bottom" );
Vlc.SetVisibility( "Show" );
//app.ShowPopup( Titvlc.GetWidth( ));
break;
case "Aplicar":
app.ShowPopup( "Entró a Aplicar" );
break;
case "Calificar":
app.ShowPopup( "Entró a Calificar" );
break;
case "Graficar":
app.ShowPopup( "Entró a Graficar" );
break;
case "Seleccione:":
app.ShowPopup( "Escoja una opción de la lista del combo!!!" );
break;
}
}//end seleccion
This produces this error:
The screen width a problem missing controls
Please could you help me?