可編程多個圖形框在新窗口中的數量如果這回答了我無法找到的其他地方,請道歉。
我想在一個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並追加,然後只是覆蓋引用,因為我不再需要它了。
我希望這會使事情變得更清晰,而不是更少。