|
我设计了一个两级嵌套对话框, 在第一层上有一个Toggle, 如果tick 它便激活第二层.
现在的问题是:如果clear tick 这个Toggle, 仍激活第二层.这是为什么?
程序如下:
第一层:
dstr : dialog {label = "arents-Straight";
: row {
: image { key ="i"; width=36; aspect_ratio=0.55; color=0;}
: column {
: edit_box { label = "L:"; key = "tl1"; value= "2.71"; edit_width = 4;}
: edit_box { label = "Hex:"; key = "thex"; value= "27"; edit_width = 4;}
: edit_box { label = "DAng:"; key = "da"; value= "59"; edit_width = 4;}
: toggle { label = "Id.Collar"; key = "idc";}
: toggle { label = "Id.Notch"; key = "idn";}
}
ok_cancel;
}
}
第二层
dnotch : dialog {
label = "Add Id.Notch:";
: edit_box {label= "Dis:"; key= "dis"; edit_width = 4; value = "0.100";}
: edit_box {label= "Gap:"; key ="gap"; edit_width = 4; value = "";}
: edit_box {label= "Dep:"; key= "dep";edit_width = 4; value = "0.031";}
: edit_box {label= "Ang:"; key= "ang";edit_width = 4; value = "60";}
spacer;
ok_only;
}
主程序调用对话框片断
(if (not (new_dialog (strcat "d" pstyle) index))(exit))
(action_tile "idn" "(notchd)")
(start_dialog)
(unload_dialog index)
调第二层对话框程序
(defun notchd ()
(if (not (new_dialog "dnotch" index))(exit))
;(imagep)
(action_tile "accept"
"(setq dis (atof (get_tile \"dis\"))
gap (atof (get_tile \"gap\"))
dep (atof (get_tile \"dep\"))
ang (angtof (get_tile \"ang\")))
(done_dialog)")
(action_tile "cancel" "(exit)")
(start_dialog)
;(unload_dialog index)
);
;; |
|