Hallo Leute! Ich habe ein Benutzerfenster erstellt, in dem Sie aus zwei Diagrammserien auswählen können. Die Serien sind "Nur Kurven" oder "Kurven und Datenpunkte". Mein Problem ist, dass ich auch die Optionen "Alle Kurven auswählen" und "Alle Kurven und Punkte auswählen" haben muss. Die beiden Kontrollkästchen "Alle auswählen" funktionieren hervorragend. Wenn ich jedoch etwas auf der Seite des Kurvendiagramms auswähle und NICHT das Kontrollkästchen "Alle Kurven und Punkte auswählen" (auch zum Auswählen und Abwählen) aktiviere, sondern eines oder mehrere einzeln auswähle, sind dies die ausgewählten Kurven- und Datenpunktdiagramme nicht in die Liste der zu erstellenden Diagramme eingetragen. Was mache ich falsch? Code enthalten. Vielen Dank im Voraus, dass Sie sich mein Problem angesehen haben!
//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 );Geben Sie jedem Kontrollkästchen eine eigene Funktion und stellen Sie sicher, dass alle Funktionen unterschiedliche Namen haben:
//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>