需要有關編寫面板框腳本的幫助我有一個帶有 V 列錶框的面板框,其中有組合框和兩個內容不同大小的 If 框。 根據組合框的選擇,我會顯示較小的 If 框或較大的 If 框。
notReadyTablesText = "Need to join tables";
readyTableText = "I have the table";
selectorOptions = Eval List( {notReadyTablesText, readyTableText} );
Panel Box( "Select tables",
stVLB = V List Box(
readyTablesSelector = Combo Box(
selectorOptions,
selector = readyTablesSelector << Get Selected();
Show( selector );
If(
selector == notReadyTablesText,
notReadyTables << Set( 1 );
readyTables << Set( 0 );,
selector == readyTableText,
notReadyTables << Set( 0 );
readyTables << Set( 1 );
)
;
),
notReadyTables = If Box(
1,
V List Box(
Button Box( "Table 1", t1Open ),
Button Box( "Table 2", t2Open ),
join = Button Box( "Join Tables",
notImplemented;
)
)
),
readyTables = If Box( 0, Button Box( "Load Tables", loadTable ) )
)
);
當我切換組合框時,面板框的大小會發生變化,並且該面板框下方的所有內容都會跳躍。 如何保持面板盒尺寸相同?
我嘗試了設置高度、設置自動拉伸、設置最小尺寸()等。
內容組織數據存取大規模定制回复:需要有關編寫面板框腳本的幫助多謝!
我不太擅長表達等等。 我需要先閱讀它才能理解您的代碼:)
例如,我不明白,為什麼我必須說
Eval(Eval Expr(self = Namespace(Expr(self << Get Name)););)
當我可以說
self = Namespace(self << Get Name);
然後,我為什麼還要這麼說呢? 為什麼我不能通過“self”引用名稱空間來使用它?
回复:需要有關編寫面板框腳本的幫助另一種方法是使用 Spacer Box(),其一個方向的大小為 0,您可以在此處看到它的使用使用 JSL 進行編程的結構化方法,用於構建真實世界的可擴展應用程序 (2019-EU-30MP-098) 。 我認為這是從 22:00 開始的部分。
查看更多... 回复:需要有關編寫面板框腳本的幫助我說的是 X 方向的尺寸,我說的是 Y 方向的尺寸。
在您的示例中,面板框的高度正在變化。
這:

與這個:

我在這個面板下面還有其他面板框 - 他們開始跳躍。
不管怎樣,我暫時放棄了並將其實現為排隊盒。
回复:需要有關編寫面板框腳本的幫助這是一個使用的例子H型分線盒()和陣容框()去做這個。請注意,這還將所有內容限制在匿名名稱空間中,以防止從此腳本同時打開多個窗口時發生串擾。
Names Default to Here( 1 );
self = New Namespace();
self:notReadyTablesText = "Need to join tables";
self:readyTableText = "I have the table";
self:selectorOptions = Eval List( {self:notReadyTablesText, self:readyTableText} );
Eval( Eval Expr(
self:button generator = Function( {title, callback},
{Default Local},
self = Namespace( Expr( self << Get Name ) );
Eval( Parse( Eval Insert( JSL Quote(
box = Button Box( title, <<SET function=""></SET>回复:需要有關編寫面板框腳本的幫助手動設置可能有點困難按鈕盒()尺寸(我通常使用H型分線盒()和陣容框()讓 JMP 自動調整所有內容的大小),但我發現的最好方法是發送消息<<設置最小尺寸(寬度,25)<<設置最大尺寸(寬度,25) 。
notReadyTablesText = "Need to join tables";
readyTableText = "I have the table";
selectorOptions = Eval List( {notReadyTablesText, readyTableText} );
pb = Panel Box( "Select tables",
stVLB = V List Box(
readyTablesSelector = Combo Box(
selectorOptions,
selector = readyTablesSelector << Get Selected();
Show( selector );
If(
selector == notReadyTablesText,
notReadyTables << Set( 1 );
readyTables << Set( 0 );,
selector == readyTableText,
notReadyTables << Set( 0 );
readyTables << Set( 1 );
)
;
),
notReadyTables = If Box(
1,
V List Box(
bb1 = Button Box( "Table 1", t1Open ),
bb2 = Button Box( "Table 2", t2Open ),
join = Button Box( "Join Tables",
notImplemented;
)
)
),
readyTables = If Box( 1, bb3 = Button Box( "Load Tables (really long button name)", loadTable ) )
)
);
new window( "test",
pb
);
boxes = {bb1, bb2, bb3, join};
max size = Max( {readytables, notReadyTables} << Get Width );
boxes << Set Min Size( max size, 25 ) << set Max Size( max size, 25 );
readyTables << Set( 0 );