正在尝试实现(模式_)
大家好,我想知道如果在前面的对话框中选择了切换,如何在lisp中使用(mode\u tile)命令,允许用户在编辑框中输入数据。第一个对话框有一系列12个开关,每个开关都有唯一的键。每个切换用于确定用户是否能够将数据输入到位于第二个对话框中的一系列三个edit_框中。
例如:如果选择了第一个切换,那么用户将进入第二个对话框(单击下一步),一行中应该有三个编辑框,他/她可以在其中输入数据,同时还有十一行变灰。
我尝试过使用if语句“(if(=ln1 0)(mode\u tile“1acin”1)),其中ln1是切换,1acin是第二个对话框中的编辑框,我尝试过将其和其他形式放入lisp代码的不同部分,但它们都不起作用。
buckproj。lsp
buckproj。DCL 我想你在追求这样的东西
; starts with a screen layout and asks you to pick a lable/button
; now check each sq if picked then run sq_pick
(foreach pd0 wallszlst
(action_tilepd0"(sq_pick)")
)
(start_dialog)
; now (sq_pick) is a defun that asks which sqis picked and then you run another action
(defun sq_pick ()
(setq ans $key)
(cond
; ((= ans "sq1")(setq slays 1)(dumlays)(mode_tile "sq1" 1))
((= ans "sq2")(setq call_lst scalelst)(subdlg2)(scaleset)(mode_tile "sq2" 1))
; you can see lots of defuns calls rather than code much easier to handle coding
(defun subdlg2 ()
;(setq dcl_id (load_dialog"ca4nwlst"))
(if (not (new_dialog "ca4nwlst" dcl_id))
(exit))
(start_list "size_list")
; call_lst is a variable name giving name of list
(mapcar 'add_list call_lst)
(end_list)
(action_tile "size_list" "(setq newans (atoi $value))(done_dialog)")
(start_dialog)
)
在DCL代码中,对于第二个对话框定义,您应该禁用所有字段,因为这是它们的默认状态(仅在请求时启用):
: boxed_row { //LANE 5 ROW
label = "Lane 5";
: column {
: edit_box {
label = "AC Input Module(s):";
key = "5acin";
width = 2;
fixed_width = true;
is_enabled = false;
}
}
: column {
: edit_box {
label = "Meter Module(s):";
key = "5dcin";
width = 2;
fixed_width = true;
is_enabled = false;
}
}
: column {
: edit_box {
label = "AC Output Module(s):";
key = "5acout";
width = 2;
fixed_width = true;
is_enabled = false;
}
}
} //END LANE 5 ROW
然后在BUCK2函数中为每个车道组放置如下语句:
(if (eq ln5 "1")
(progn
(mode_tile "5acin"0)
(mode_tile "5dcin"0)
(mode_tile "5acout" 0)
)
)
这应该在调用START\u对话框之前进行。 谢谢,这正是我想要的!
页:
[1]