コンボボックスの選択に基づく動的ディスプレイボックスここでいくつかのヘルプを探していますが、「オプション1」を再度選択すると、表示ボックスが空白のウィンドウに戻り続けたため、正しく機能しません(参照用の写真がいくつかあります)。
本当に助けに感謝します!
names default to here(1);
Buttons = {"Button 1", "Button 2", "Button3"};
Boxes = {"Box 1", "Box 2", "Box 3"};
LB_Input_1 = lineupbox(ncol(2),spacing(5));
for(i=1,i<=nitems(Buttons),i++,
label1 = char(Buttons[i]);
bblabel1 = "clb_" || char(i);
eval(parse(evalinsert("\[LB_Input_1 << append(buttonbox("^label1^", ^bblabel1^ << append(clb2 << get selected)))]\")));
eval(parse(evalinsert("\[LB_Input_1 << append(^bblabel1^ = col list box("Numeric",minitems(1),maxitems(1),nlines(1)))]\")));
);
for(i=1,i<=nitems(Boxes),i++,
label1 = char(Boxes[i]);
neblabel1 = "neb_"||char(i);
eval(parse(evalinsert("\[LB_input_1 << append(Text box("^label1^"))]\")));
eval(parse(evalinsert("\[LB_input_1 << append(^neblabel1^ = Number edit box())]\")));
);
HB1 = hlistbox(
clb2 = filter col selector(dt1,all),
LB_input_1
);
LB_Input_2 = lineupbox(ncol(2),spacing(5));
for(i=1,i<=nitems(Buttons)-1,i++,
label1 = char(Buttons[i]);
bblabel1 = "clb_" || char(i);
eval(parse(evalinsert("\[LB_Input_2 << append(buttonbox("^label1^", ^bblabel1^ << append(clb2 << get selected)))]\")));
eval(parse(evalinsert("\[LB_Input_2 << append(^bblabel1^ = col list box("Numeric",minitems(1),maxitems(1),nlines(1)))]\")));
);
for(i=1,i<=nitems(Boxes)-1,i++,
label1 = char(Boxes[i]);
neblabel1 = "neb_"||char(i);
eval(parse(evalinsert("\[LB_input_2 << append(Text box("^label1^"))]\")));
eval(parse(evalinsert("\[LB_input_2 << append(^neblabel1^ = Number edit box())]\")));
);
HB2 = hlistbox(
clb2 = filter col selector(dt1,all),
LB_input_2
);
dt1 = current data table();
new window("Test",
vb1 = vlistbox(Text box(""),
Panel Box("Selection Option",H list box(text box("Select: "),
combo1 = combobox({"Option 1","Option 2"},
<< set function(function({this,index},
match(index,
1,
vb1 << append (try(view << delete);
view = HB1;
),
2,
vb1 << append (try(view << delete);
view = HB2;
)
)
))
)
)
),
text box (""),
view = HB1;
)
);



グラフィックススクリプティングRe:コンボボックスの選択に基づく動的ディスプレイボックス問題とデバッグ方法:
1.スクリプトを実行します
2. HB1およびHB2の内容を確認します(DisplayBox [ListBox])
3.オプション2に変更し、HB1の内容を確認します(DisplayBox [])
おそらく役立つかもしれない迅速な(そして汚い修正?)。 HB1とHB2の参照場所を変更し、それらを式にした方法をご覧ください。
names default to here(1);
Buttons = {"Button 1", "Button 2", "Button3"};
Boxes = {"Box 1", "Box 2", "Box 3"};
HB1 = Expr(
LB_Input_1 = lineupbox(ncol(2),spacing(5));
for(i=1,i<=nitems(Buttons),i++,
label1 = char(Buttons[i]);
bblabel1 = "clb_" || char(i);
eval(parse(evalinsert("\[LB_Input_1 << append(buttonbox("^label1^", ^bblabel1^ << append(clb2 << get selected)))]\")));
eval(parse(evalinsert("\[LB_Input_1 << append(^bblabel1^ = col list box("Numeric",minitems(1),maxitems(1),nlines(1)))]\")));
);
for(i=1,i<=nitems(Boxes),i++,
label1 = char(Boxes[i]);
neblabel1 = "neb_"||char(i);
eval(parse(evalinsert("\[LB_input_1 << append(Text box("^label1^"))]\")));
eval(parse(evalinsert("\[LB_input_1 << append(^neblabel1^ = Number edit box())]\")));
);
hlistbox(
clb2 = filter col selector(dt1,all),
LB_input_1
);
);
HB2 = Expr(
LB_Input_2 = lineupbox(ncol(2),spacing(5));
for(i=1,i<=nitems(Buttons)-1,i++,
label1 = char(Buttons[i]);
bblabel1 = "clb_" || char(i);
eval(parse(evalinsert("\[LB_Input_2 << append(buttonbox("^label1^", ^bblabel1^ << append(clb2 << get selected)))]\")));
eval(parse(evalinsert("\[LB_Input_2 << append(^bblabel1^ = col list box("Numeric",minitems(1),maxitems(1),nlines(1)))]\")));
);
for(i=1,i<=nitems(Boxes)-1,i++,
label1 = char(Boxes[i]);
neblabel1 = "neb_"||char(i);
eval(parse(evalinsert("\[LB_input_2 << append(Text box("^label1^"))]\")));
eval(parse(evalinsert("\[LB_input_2 << append(^neblabel1^ = Number edit box())]\")));
);
hlistbox(
clb2 = filter col selector(dt1,all),
LB_input_2
);
);
dt1 = current data table();
new window("Test",
vb1 = vlistbox(Text box(""),
Panel Box("Selection Option",H list box(text box("Select: "),
combo1 = combobox({"Option 1","Option 2"},
<< set function(function({this,index},
try(view << delete);
match(index,
1,
vb1 << append (
view = HB1;
),
2,
vb1 << append (
view = HB2;
)
)
))
)
)
),
text box (""),
view = HB1;
)
);Re:コンボボックスの選択に基づく動的ディスプレイボックスありがとう@jthi
解決策は機能します!
フォローアップとして、あなたが言及した3つのデバッグステップを明確にできますか? そのコメントはよくわかりません。
問題とデバッグ方法:
1.スクリプトを実行します
2. HB1およびHB2の内容を確認します(DisplayBox [ListBox])
3.オプション2に変更し、HB1の内容を確認します(DisplayBox [])
Re:コンボボックスの選択に基づく動的ディスプレイボックス承知しました。うまくいけば、これが役立つ:
1.ログウィンドウを開きます
2.スクリプトを実行します->正常に実行します
3.オプションをオプション1からオプション2に変更します->正常に動作します
4.オプションをオプション2からオプション1に変更->ディスプレイボックスが消える
5.オプションをオプション1からオプション2に戻します->ディスプレイボックスがまだありません
この時点で、HB1とHB2に問題があるのか、オプションを変更すると削除されるのか疑問に思い始めました。
6.スクリプトを再度実行します。 スクリプトウィンドウからHB1を強調表示し、スクリプトを実行して、変数に関する情報をログウィンドウ(DisplayBox [ListBox])に取得します。
7.オプションをオプション1からオプション2に変更します。スクリプトウィンドウからHB1を強調表示し、スクリプトを実行して、変数に関する情報をログウィンドウ(DisplayBox [])に取得します。
8.リストボックスが消えたことに注意してください

9.何がうまくいかず、それを修正する方法を理解し始めます
これは、何が起こっているのかを理解するのに役立つ場合があります。ある時点で、HB1およびHB2Hリストボックスが削除されます。
Re:コンボボックスの選択に基づく動的ディスプレイボックス@jthiデバッグアプローチを説明していただきありがとうございます。
ログに「Displaybox []」が頻繁に表示されますが、ログの意味が実際にはわかりませんでした。 ポインタをありがとう!