乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 3|回复: 3

[编程交流] 正在尝试实现(模式_)

[复制链接]

2

主题

3

帖子

1

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:50:31 | 显示全部楼层 |阅读模式
大家好,我想知道如果在前面的对话框中选择了切换,如何在lisp中使用(mode\u tile)命令,允许用户在编辑框中输入数据。
 
第一个对话框有一系列12个开关,每个开关都有唯一的键。每个切换用于确定用户是否能够将数据输入到位于第二个对话框中的一系列三个edit_框中。
 
例如:如果选择了第一个切换,那么用户将进入第二个对话框(单击下一步),一行中应该有三个编辑框,他/她可以在其中输入数据,同时还有十一行变灰。
 
我尝试过使用if语句“(if(=ln1 0)(mode\u tile“1acin”1)),其中ln1是切换,1acin是第二个对话框中的编辑框,我尝试过将其和其他形式放入lisp代码的不同部分,但它们都不起作用。
 
buckproj。lsp
buckproj。DCL
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 07:26:24 | 显示全部楼层
我想你在追求这样的东西
 
075037iq0ww3ch84uqmmod.jpg
  1. ; starts with a screen layout and asks you to pick a lable/button
  2. ; now check each sq if picked then run sq_pick
  3. (foreach pd0 wallszlst
  4. (action_tile  pd0  "(sq_pick)")
  5. )
  6. (start_dialog)
  7. ; now (sq_pick) is a defun that asks which sq  is picked and then you run another action
  8. (defun sq_pick ()
  9.    (setq ans $key)
  10.    (cond      
  11. ;   ((= ans "sq1")(setq slays 1)(dumlays)(mode_tile "sq1" 1))
  12.    ((= ans "sq2")(setq call_lst scalelst)(subdlg2)(scaleset)(mode_tile "sq2" 1))
  13. ; you can see lots of defuns calls rather than code much easier to handle coding
  14. (defun subdlg2 ()
  15. ;  (setq dcl_id (load_dialog  "ca4nwlst"))
  16. (if (not (new_dialog "ca4nwlst" dcl_id))
  17. (exit))
  18.      (start_list "size_list")
  19. ; call_lst is a variable name giving name of list
  20.      (mapcar 'add_list call_lst)
  21.      (end_list)
  22. (action_tile "size_list" "(setq newans (atoi $value))(done_dialog)")
  23. (start_dialog)
  24. )
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 07:36:41 | 显示全部楼层
在DCL代码中,对于第二个对话框定义,您应该禁用所有字段,因为这是它们的默认状态(仅在请求时启用):
  1.    : boxed_row { //LANE 5 ROW
  2.    label = "Lane 5";
  3.    : column {
  4.     : edit_box {
  5.      label = "AC Input Module(s):";
  6.      key = "5acin";
  7.      width = 2;
  8.      fixed_width = true;
  9.      [color=red]is_enabled = false;[/color]
  10.      }
  11.     }
  12.    : column {
  13.     : edit_box {
  14.      label = "Meter Module(s):";
  15.      key = "5dcin";
  16.      width = 2;
  17.      fixed_width = true;
  18.      [color=red]is_enabled = false;[/color]
  19.      }
  20.     }
  21.    : column {
  22.     : edit_box {
  23.      label = "AC Output Module(s):";
  24.      key = "5acout";
  25.      width = 2;
  26.      fixed_width = true;
  27.      [color=red]is_enabled = false;[/color]
  28.      }
  29.     }
  30.   } //END LANE 5 ROW

然后在BUCK2函数中为每个车道组放置如下语句:
  1. (if (eq ln5 "1")
  2. (progn
  3.   (mode_tile "5acin"  0)
  4.   (mode_tile "5dcin"  0)
  5.   (mode_tile "5acout" 0)
  6. )
  7. )

这应该在调用START\u对话框之前进行。
回复

使用道具 举报

2

主题

3

帖子

1

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 08:05:48 | 显示全部楼层
谢谢,这正是我想要的!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 14:52 , Processed in 0.560108 second(s), 62 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表