列表框选择更改rad
大家好,列表框中的选择是否会改变radio\u行的选择?我有一个列表框,下面有一行radio\u。(如图所示)
如果选择了Box1,radio\u row选项可能会变为左,如果选择了Box2,radio\u row选项会变为右,Box3选择radio\u row会变为左,依此类推?
据我所知,我应该使用mode\u tile来实现这一点,但我还没有弄明白?有人能帮我做这个吗?
提前谢谢你。
使用列表框上的函数action\u tile和set\u tile函数在单选按钮之间切换 这里可以找到一个很接近的例子,其相关代码可以在这里找到 谢谢,我会调查的。 动态示例
你的例子正是我想要做的。
我不知道这是否正确,它可以工作,但当选择列表框时,它并不是动态正确的,只有当我点击Ok然后重新打开对话框时,按钮才被更改。我把我的代码放在action\u互动程序之后。这是因为我把代码放在哪里,还是完全错了?
您介意为您在示例中所做的事情发布代码吗?
谢谢你的帮助。
(progn
(if (= arm "ARM01")
(progn
(set_tile "G" "1")
(set_tile "W" "0")
)))
(progn
(if (= arm "ARM02")
(progn
(set_tile "G" "0")
(set_tile "W" "1")
))) 当然我不介意,仔细看看,如果你对代码有任何疑问或问题,请告诉我
(defun c:Test (/ f dlg lst id)
;;; Tharwat 08.01.2014 ;;
(cond
((not
(and
(setq dlg (vl-filename-mktemp nil nil ".dcl"))
(setq f (open dlg "w"))
(write-line
"options : dialog {label = \"Sample\";
spacer_1 ;
: popup_list { label = \"Select Box\"; key = \"bx\";}
: boxed_radio_row {
: radio_button { label = \"Left\"; key = \"l\";}
: radio_button { label = \"Right\"; key = \"r\";}}
: button { label = \"Okay\"; key = \"oki\"; is_default = true;}
: button { label = \"Exit\"; key = \"esc\"; is_cancel = true; }} "
f
)
(not (close f))
)
)
(alert "Can't load the temporary file <!>")
)
((or (not dlg)
(not (> (setq id (load_dialog dlg)) 0))
(not (new_dialog
"options"
id
)
)
)
(princ "\n Can not load Dialog !")
)
(t
(set_tile "l" "1")
(setq lst '("BOX1" "BOX2" "BOX3" "BOX4" "BOX5"))
(start_list "bx")
(mapcar 'add_list lst)
(end_list)
(action_tile "bx" "(if (eq (rem (atoi (get_tile \"l\")) 2) 1) (set_tile \"r\" \"1\")(set_tile \"l\" \"1\"))")
(action_tile "oki" "(done_dialog)")
(action_tile "esc" "(done_dialog)")
(start_dialog)
(unload_dialog id)
(vl-file-delete dlg)
)
)
(princ)
)
非常感谢你。我今晚会调查一下,明天再告诉你。
祝你好运和快乐
页:
[1]