選択した後に開くウィンドウを追加するカレンダーボックスから選択した後に、開いているウィンドウを追加できるようにするための解決策を探しています。
開始日と終了日を選択したら、カレンダーを保持するパネルボックスのすぐ下に別のボックスを開きます。
下記は私が単純化したバージョンで試している例です。私の実際のアプリケーションでは、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" )
)
)
)
)
);
再:選択が行われた後に開いているウィンドウを追加するどうもありがとうございました.. その部分の間でWait()を試していました
コード.. 私がフォーラムを読んでいたとき、私は前にPauseについて何かを見ました
スクリプトを実行してビープ音()を見た
そこにそれを入れて..
どうもありがとうございます。
再:選択が行われた後に開いているウィンドウを追加するもちろん私はあなたの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>
再:選択が行われた後に開いているウィンドウを追加する可能であれば、私はそれを拡張することができます。
テキストボックスを操作するための解決策は、Set Datesを押すと入力されるチェックボックスを配置することです。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>
再:選択が行われた後に開いているウィンドウを追加するそれはうまくいっていなかったのでそれはクレイジーです... それを指摘してくれてありがとう再:選択が行われた後に開いているウィンドウを追加する急いで仕事をしていて、私があなたのオリジナルに何をしたのかよくわかりません。しかし、以下のコードは実際に機能します。一般的に、アクションを名前付きの式として定義してから、その名前を使用してそれらを呼び出すことが、読みやすさと保守性に役立つことがわかりました。
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>