需要有关编写面板框脚本的帮助我有一个带有 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 );