選擇後附加一個打開的窗口我一直在尋找一種解決方案,能夠在從日曆框中進行選擇後附加一個打開的窗口。
選擇開始日期和結束日期後,我想打開包含日曆的面板框正下方的另一個框
下面是我在simplfied版本中嘗試的一個例子。在我的實際應用程序中,我想打開一個複選框()列表,該列表基於從基於sql腳本的數據庫中選擇的日期。
謝謝
<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" )
)
)
)
)
);
Re:選擇後附加一個打開的窗口非常感謝你.. 我在那部分之間嘗試了Wait()
碼.. 當我在閱讀論壇時,我看到了一些關於暫停的事情
執行一個腳本,看到了嘟嘟聲(),但我甚至沒有想到
把它放在那裡..
再次感謝你...
Re:選擇後附加一個打開的窗口我當然沒有你的DB。但是,對代碼進行相應的簡化,這顯示了將復選框添加到UI的機制。
/* -----------------------------------------------------------*/
/* 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>
Re:選擇後附加一個打開的窗口如果可以的話,請允許我擴展一下。
現在您已經使用了一個文本框,我試圖解決的實際解決方案是放置一個複選框,當您按下設置日期時,該複選框將被填充。我試圖插入LotListBox = Check Box(LotList,doListChoice);取代文本框(),我只得到面板窗口..
從我可以收集到的最後4組腳本不執行因此只是發送一個空窗口。
/* -----------------------------------------------------------*/
/* 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>
Re:選擇後附加一個打開的窗口這很瘋狂,因為它不起作用...... 謝謝你指出這一點Re:選擇後附加一個打開的窗口匆忙工作,我不確定我對你的原創做了什麼。但下面的代碼確實有效。通常我發現將操作定義為具有名稱的表達式有助於可讀性和可維護性,然後使用該名稱調用它們。
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>