选择后附加一个打开的窗口我一直在寻找一种解决方案,能够在从日历框中进行选择后附加一个打开的窗口。
选择开始日期和结束日期后,我想打开包含日历的面板框正下方的另一个框
下面是我在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>