Aggiungi una finestra aperta dopo aver effettuato una selezioneHo cercato una soluzione per poter aggiungere una finestra aperta dopo aver fatto una selezione da una casella del calendario.
Una volta selezionate la data di inizio e la data di fine, vorrei aprire un'altra casella proprio sotto la casella del pannello che contiene i calendari
Di seguito è riportato un esempio che sto cercando nella versione semplificata. Nella mia applicazione effettiva vorrei aprire un elenco di caselle di controllo () in base alle date selezionate da un database basato su uno script sql ..
Grazie
<BR />nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start",
StartDate = Calendar Box(
<< Set Function(
Function(
{f1},
sqlstartA = StartDate << Get Date();
)
)
)
), // End StartDate Calendar Box
Panel Box( "Select End",
EndDate = Calendar Box(
<< Set Function(
Function(
{f2},
sqlendA = EndDate << Get Date();
)
)
)
) // End EndDate Calendar Box
),
H List Box(
bb1 = Button Box( "Set Dates",
sqlstart = format(sqlstartA, "yyyy-mm-dd");
sqlend = format(sqlendA, "yyyy-mm-dd");
show(sqlstart, sqlend);
),
bb2 = Button Box( "Cancel" )
),
Wait( 0.1 ),
pb << Append(
Text Box( "Why isn't this working" )
)
)
)
)
);
Ri: Aggiungi una finestra aperta dopo aver effettuato una selezioneGrazie mille.. Stavo cercando un Wait () tra quella parte del
codice.. Quando stavo leggendo i forum ho visto qualcosa su Pause prima
eseguendo una sceneggiatura e visto il beep () tuttavia non ci ho nemmeno pensato
mettendo quello lì dentro ..
Grazie mille ancora ..
Ri: Aggiungi una finestra aperta dopo aver effettuato una selezioneCerto che non ho il tuo DB. Ma, apportando le corrispondenti semplificazioni al codice, questo mostra la meccanica di aggiungere la casella di controllo all'interfaccia utente.
/* -----------------------------------------------------------*/
/* Calendar Box to Select Start and End Dates */
/* -----------------------------------------------------------*/
nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start", StartDate = Calendar Box( <<SET function=""></SET>
Ri: Aggiungi una finestra aperta dopo aver effettuato una selezionePermettetemi di espanderlo se posso.
Ora che hai capito che funziona con una casella di testo, la soluzione che sto cercando di risolvere è posizionare una casella di controllo che viene popolata quando premi Set Dates. Ho provato ad inserire LotListBox = Check Box (LotList, doListChoice); al posto della casella di testo () e sto solo ottenendo la finestra del pannello ..
Da quello che posso raccogliere gli ultimi 4 set di script non sono in esecuzione quindi basta inviare una finestra vuota.
/* -----------------------------------------------------------*/
/* Calendar Box to Select Start and End Dates */
/* -----------------------------------------------------------*/
nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start",
StartDate = Calendar Box(
<<SET function="">= ' " || sqlstart || " '
AND t1.testdate <= ' " || sqlend || " '
AND (t1.wafer_number NOT RLIKE '-ATL' )
ORDER BY t1.testdate DESC
"
);
/*****************************************************************************/
/* */
/* Brings in the list of wafers from the SQL Query */
/* */
/*****************************************************************************/
/**************************************************************/
/* Opens Database based on Calendar Dates and Lists Lots */
/**************************************************************/
// Tried to put this in an expression to execute in the main window
dtLotList = Expr(
dt_LotList = Open Database( <DATABASE string="">, SQLcode, "LotList" );
Summarize( LotList = By( :wafer_number ) );
Close( dt_lotlist, No Save );
);
// Original script to bring in a list of wafers within the date range
dt_LotList = Open Database( <DATABASE string="">, SQLcode, "LotList" );
Summarize( LotList = By( :wafer_number ) );
Close( dt_lotlist, No Save );
/**************************************************************/
/* Lists Lot List in Check Box Format */
/**************************************************************/
// This is what i would like to be appended in the first window
LotListBox = Check Box( LotList, doListChoice );
/**************************************************************/
/* Allows for Multiple Lots to be Selected */
/**************************************************************/
doListChoice = Expr(
SelectedLot = LotListBox << get selected; //get the selected items
If( N Items( SelectedLot ) > 0, //run through each selected item if there are any
For( i = 1, i <= N Items( SelectedLot ), i++,
Print( SelectedLot[i] )
)
);
LotListSQLString = "";
For( i = 1, i <= N Items( SelectedLot ), i++,
LotListSQLString = LotListSQLString || "'" || Char( SelectedLot[i] );
If( i == N Items( SelectedLot ),
LotListSQLString = LotListSQLString || "'",
LotListSQLString = LotListSQLString || "',"
);
);
Show( SelectedLot );
);</DATABASE></DATABASE></SET>
Ri: Aggiungi una finestra aperta dopo aver effettuato una selezioneÈ pazzesco perché non funzionava ... Grazie per averlo indicatoRi: Aggiungi una finestra aperta dopo aver effettuato una selezioneLavorando di fretta, non sono sicuro di quello che ho fatto al tuo originale. Ma il codice qui sotto funziona davvero. In genere trovo che aiuti la leggibilità e la manutenibilità a definire azioni come espressioni con un nome, quindi a chiamarle usando quel nome.
nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start",
StartDate = Calendar Box(
<<SET function=""></SET>