¡Hola gente! He generado una ventana de usuario para seleccionar cualquiera de las 2 series de gráficos. Las series son "Solo curvas" o "Curvas y puntos de datos". Mi problema es que también necesito tener las opciones "Seleccionar todas las curvas" y "Seleccionar todas las curvas y puntos". Las dos casillas de verificación "Seleccionar todo" funcionan muy bien. Sin embargo, si selecciono algo en el lado del gráfico de Curvas y NO selecciono la casilla de verificación "Seleccionar todas las curvas y puntos" (incluso para seleccionar y deseleccionar), en vez de eso selecciono uno o más individualmente, los gráficos seleccionados de Curva y Punto de datos no son entró en la lista de gráficos para producir. ¿Qué estoy haciendo mal? Código incluido ¡Gracias a todos de antemano por mirar mi problema!
//Generate charts for selected data
GetCharts = {};
GetDPCharts = {};
//Window for user to select which charts to be generated
WhatCharts = New Window( "Select Curve Charts to Generate", << Modal,
<< On open( WhatCharts << Window Size( 200, 100 ) ),
H List Box(
//All charts wtih ONLY curves
cbAllCharts = Check Box( {"By Condition", "By Cond No", "By Sample", "Average by Condition"} ),
Spacer Box( Size( 10, 0 ) ),
//Charts with Data Points AND Curves
cbAllDPCharts = Check Box( {"By Condition w/ Data Points", "By Cond No w/ Data Points", "By Sample w/ Data Points", "Average by Condition w/ Data Points"})
),
//Allow the user to select all charts
H List Box(
cbAll = Check Box( " ",
<< Set Function(
Function( {this},
cbAllCharts << Set All( this << Get, run script( 1 ) )
)
),
),
Text Box( "Select All Curve Plots" ),
Spacer Box( Size( 9, 0 ) ),
cbAll2 = Check Box( " ",
<< Set Function(
Function( {this},
cbAllDPCharts << Set All( this << Get, run script( 1 ) )
)
),
),
Text Box( "Select all Points and Curve Plots" ),
),
H Center Box( Button Box( "OK", GetChkBoxes )
)
);
//Place all selections into one list
if( N Items( GetDPCharts ) > 0,
For( i = 1, i<= N Items( GetDPCharts ), i++,
Insert Into( GetCharts, GetDPCharts[i] )
)
);
//Expressions
GetChkBoxes = Expr(
GetCharts = cbAllCharts << Get Selected;
GetDPCharts = cbAllDPCharts << Get Selected;
);
Print( GetCharts, GetDPCharts );Asigne a cada casilla su propia función y asegúrese de que todas las funciones tengan nombres diferentes:
//Generate charts for selected databutton
GetCharts = {};
GetDPCharts = {};
//Window for user to select which charts to be generated
WhatCharts = New Window( "Select Curve Charts to Generate", << Modal, << Return Result,
//<< On open( WhatCharts << Window Size( 200, 100 ) ),
H List Box(
//All charts wtih ONLY curves
cbAllCharts = Check Box( {"By Condition", "By Cond No", "By Sample", "Average by Condition"},
<<SETFUNCTION> 0,
For( i = 1, i<= N Items( GetDPCharts ), i++,
Insert Into( GetCharts, GetDPCharts[i] )
)
);
Print( GetCharts, GetDPCharts );</SETFUNCTION>