论坛帮助 |
社区圈子 |
日历事件 |
2017-04-19, 14:49 | #1 | ||
|
|||
正式会员
等级: 六袋长老
|
var dlg = new Window('dialog','test'); dlg.orientation = "column"; dlg.alignChildren = "top"; var GP0= dlg.add('group') GP0.orientation = 'row'; GP0.alignment = ['left','top']; var GP1 = dlg.add('group') GP1.orientation = 'row'; GP1.alignment = ['left','top']; var GP2 = dlg.add('group') GP2.orientation = 'row'; GP2.alignment = ['left','top']; var radio=GP0.add('statictext', undefined, "Settings "); var radio=GP0.add('edittext', undefined, ""); var list = GP1.add('panel',undefined,'Select Option'); list.orientation = 'row'; list.alignment = ['left','top']; var listdropDown =list.add ("dropdownlist", undefined, ["A","B", "C" ]); listdropDown.selection = 0; //=====================如果选择 A时 var radio_group = GP2.add('panel', undefined, "Settings A "); radio_group.orientation="row"; radio_group.alignChildren = "left"; radio_group.add("statictext", undefined, "Offset:"); radio_group.add("edittext", undefined, ""); radio_group.add("statictext", undefined, "px:"); radio_group.add("radiobutton", undefined, "Scale"); //====================如果选择B时 var radio_group = GP2.add('panel', undefined, "Settings B "); radio_group.orientation="row"; radio_group.alignChildren = "left"; radio_group.add("radiobutton", undefined, "Scale"); radio_grouporientation = 'row'; radio_group.alignChildren = ['left','top']; var check1 = radio_group.add('checkbox',undefined,'Save'); check1.value = true; check1.value = true; //=====================如果选择C时 var radio_group = GP2.add('panel', undefined, "Settings C "); radio_group.orientation="row"; radio_group.alignChildren = "left"; radio_group.add("statictext", undefined, "Offset:"); radio_group.add("edittext", undefined, ""); radio_group.add("statictext", undefined, "px"); radio_group.add("statictext", undefined, "Width:"); radio_group.add("edittext", undefined, ""); radio_group.add("statictext", undefined, "px"); var btnGroup = GP1.add("group"); btnGroup.orientation = "column"; btnGroup.alignment = ['left','top']; btnGroup.add ('button', {x:90, y:125, width:90, height:25}, 'Ok', {name:'ok'}); btnGroup.add ('button', {x:240, y:125, width:90, height:25}, 'Cancel', {name:'cancel'}); btnGroup.ok.onClick = function(){ dlg.close() switch(parseInt(listdropDown.selection)){ case 0: //code here alert("AA"); break; case 1: //code here alert("BB"); break; case 2: //code here alert("CC"); break; } } dlg.show();//add a show statement 修改后应该显示为附件的图 |
||
2017-04-19, 16:13 | 只看该作者 #2 | |||
|
||||
VIP会员
等级: 七袋长老
|
var dlg = new Window('dialog','test'); dlg.orientation = "column"; dlg.alignChildren = "top"; var GP0= dlg.add('group') GP0.orientation = 'row'; GP0.alignment = ['left','top']; var GP1 = dlg.add('group') GP1.orientation = 'row'; GP1.alignment = ['left','top']; var GP2 = dlg.add('group') GP2.orientation = 'row'; GP2.alignment = ['left','top']; var radio=GP0.add('statictext', undefined, "Settings "); var radio=GP0.add('edittext', undefined, ""); var list = GP1.add('panel',undefined,'Select Option'); list.orientation = 'row'; list.alignment = ['left','top']; var listdropDown =list.add ("dropdownlist", undefined, ["A","B", "C" ]); listdropDown.selection = 0; //=====================如果选择 A时 var g1=dlg.add('group') g1.orientation='stack' var radio_group1 = g1.add('panel', undefined, "Settings A "); radio_group1.orientation="row"; radio_group1.alignChildren = "left"; radio_group1.add("statictext", undefined, "Offset:"); radio_group1.add("edittext", undefined, ""); radio_group1.add("statictext", undefined, "px:"); radio_group1.add("radiobutton", undefined, "Scale"); radio_group1.visible=true //====================如果选择B时 var radio_group2 = g1.add('panel', undefined, "Settings B "); radio_group2.orientation="row"; radio_group2.alignChildren = "left"; radio_group2.add("radiobutton", undefined, "Scale"); radio_grouporientation = 'row'; radio_group2.alignChildren = ['left','top']; var check1 = radio_group2.add('checkbox',undefined,'Save'); check1.value = true; check1.value = true; radio_group2.visible=false //=====================如果选择C时 var radio_group3 = g1.add('panel', undefined, "Settings C "); radio_group3.orientation="row"; radio_group3.alignChildren = "left"; radio_group3.add("statictext", undefined, "Offset:"); radio_group3.add("edittext", undefined, ""); radio_group3.add("statictext", undefined, "px"); radio_group3.add("statictext", undefined, "Width:"); radio_group3.add("edittext", undefined, ""); radio_group3.add("statictext", undefined, "px"); radio_group3.visible=false var btnGroup = GP1.add("group"); btnGroup.orientation = "column"; btnGroup.alignment = ['left','top']; btnGroup.add ('button', {x:90, y:125, width:90, height:25}, 'Ok', {name:'ok'}); btnGroup.add ('button', {x:240, y:125, width:90, height:25}, 'Cancel', {name:'cancel'}); listdropDown.onChange = function(){ //~ dlg.close() switch(parseInt(listdropDown.selection)){ case 0: radio_group1.visible=true; radio_group2.visible=radio_group3.visible=false; alert("AA"); break; case 1: radio_group2.visible=true; radio_group1.visible=radio_group3.visible=false; alert("BB"); break; case 2: radio_group3.visible=true; radio_group2.visible=radio_group1.visible=false; alert("CC"); break; } } dlg.show();//add a show statement |
|||
右列会员因为此帖价值甚高向 calvin530126 表示感谢: |
roychen (2017-04-19)
|
2017-04-19, 18:22 | 只看该作者 #4 | ||
|
|||
正式会员
等级: 六袋长老
|
改为这样,按顺序,就没问题 switch(parseInt(listdropDown.selection)){ case 0: radio_group1.visible=true; radio_group2.visible=false; radio_group3.visible=false; alert("AA"); break; case 1: radio_group1.visible=false; radio_group2.visible=true; radio_group3.visible=false; alert("BB"); break; case 2: radio_group1.visible=false; radio_group2.visible=false; radio_group3.visible=true; |
||
2017-04-20, 09:07 | 只看该作者 #6 | |||
|
||||
VIP会员
等级: 七袋长老
|
引用:
其实是OK, 经过兄弟这么一说, 在Win7 PS CC 2017测试,确实有问题.... |
|||