/*
Description : hogehoge
Support : scripted :
*/
(function(){
var lines = ["line 1","line 2","line 3","line 4"];
var window_title ="window title";
var head_text = "please select line.";
var group_text = "line name list";
var button_text = "push execute";
var start_x = 600;
var start_y = 480;
var width = 300;
var height = 160+Number(lines.length)*30;
var end_x = start_x + width;
var end_y = start_y + height;
var prompt_window = new Window('dialog',window_title,[start_x,start_y,end_x,end_y],{closeButton:false});
prompt_window.add('statictext',[15,15,width-15,45],head_text);
var radio_group = prompt_window.add('panel',[10,60,width-10,height-60],group_text);
for(var i=0;i<lines.length;i++){
radio_group.alignChildren = "left";
radio_group.add('radiobutton',[10,15+(i*35),width-30,35+(i*35)],lines[i]);
}
radio_group.children[0].value = true;
var e_Btn = prompt_window.add("button",[15,height-45,width-135,height-15],button_text);
var c_Btn = prompt_window.add("button",[width-125,height-45,width-15,height-15],"Cancel");
var selected = 0;
e_Btn.onClick = function(){
for (var i = 0; i < radio_group.children.length; i++){
var radio_button = radio_group.children[i];
if (radio_button.value == true){
selected = radio_button.text;
}
}
prompt_window.close();
}
c_Btn.onClick = function(){
alert("push cancel.");
prompt_window.close();
}
prompt_window.show();
alert(selected);
}());