可编程多个图形框在新窗口中的数量如果这回答了我无法找到的其他地方,请道歉。
我想在一个Window中生成许多单独的图形框,然后我可以在其中绘制自定义形状。应该有X列和Y行 - 即数量和格式必须是可编程的。
我希望它看起来有点像附加的图像。这是在每个Graph Box完整写出的情况下创建的,这显然不是理想的。
作为一个简单的起点,我尝试了这个:
win01 = New Window( "test",
Outline Box( "test",
V List Box(
For( yy = 1, yy <= 5, yy++,
H List Box(
For( xx = 1, xx <= 5, xx++,
aa = xx + 5 * ( yy - 1 );
Graph Box(
framesize( 200, 200 ),
X Scale( 0, 10 ),
Y Scale( 0, 10 ),
X Axis( Inc( 2 ), Minor Ticks( 1 ), Show Major Grid( 1 ), Show Minor Grid( 1 ) ),
Y Axis( Inc( 2 ), Minor Ticks( 1 ), Show Major Grid( 1 ), Show Minor Grid( 1 ) ),
XName( "Die X" ),
YName( "Die Y" ),
Text({1,5}, char(aa) )
)
)
)
)
)
)
);
但当然这不起作用。我可能需要在某种eval(substitute(expr()))类型表达式中包含它,但我的JSL非常生疏,我不知道从哪里开始!
我们将非常感激地收到任何建议。
非常感谢,
马修。

Re:在新窗口中可编程多个图形框的数量会这样的吗?
Names default to here(1);
vlb = V List Box();
For( yy = 1, yy <= 5, yy++,
vlb << Append(hlb = H List Box());
For( xx = 1, xx <= 5, xx++,
aa = xx + 5 * ( yy - 1 );
Eval(EvalExpr(
hlb << Append(
Graph Box(
framesize( 200, 200 ),
X Scale( 0, 10 ),
Y Scale( 0, 10 ),
X Axis( Inc( 2 ), Minor Ticks( 1 ), Show Major Grid( 1 ), Show Minor Grid( 1 ) ),
Y Axis( Inc( 2 ), Minor Ticks( 1 ), Show Major Grid( 1 ), Show Minor Grid( 1 ) ),
XName( "Die X" ),
YName( "Die Y" ),
Text({1,5}, Expr(char(aa)) )
)
);
));
);
);
win01 = New Window( "test",
Outline Box( "test",
vlb
)
);
Re:在新窗口中可编程多个图形框的数量太棒了,效果很好!现在我将尝试找出它的工作原理。
非常感谢,
马修。
Re:在新窗口中可编程多个图形框的数量对不起我迟到的懒惰。 应该把它放在那里。 这是我的一般事情,为什么你的工作不起作用。
JMP使表达式返回粘合语句中的最后一个表达式(这是;运算符所做的)
x = 1;
y = 2;
// is the same as
glue(x=1, y=2);
//that's why it returns 2 if you run it.
但是对于循环,不要返回最后一件事。 那就跑了。 但即使他们这样做,在像HListbox这样的显示器中,它只会显示最后一件事(一个图表框)。 在处理显示箱时,在其构造中。 您可以在其中放置常规粘合语句以返回每个显示框。
new window("Test",
x = 2;
textbox("This won't show up");
textbox("This will show up"), //notice this is a comma. The whole glue will return just this last textbox
hlb = hlistbox(); // this will also show up because nothing is after it even though it's a semicolon
);
// to add to the hlistbox dynamically, append is often used.
wait(2);
hlb << Append(Textbox("Some other box"));
基本上,不是for()在你的hlistbox构造函数内部,而是使用引用创建它,然后在for循环中追加它们(它们)。
使用你的hlb,我会在行的每次迭代中创建hlb并追加,然后只是覆盖引用,因为我不再需要它了。
我希望这会使事情变得更清晰,而不是更少。