乐筑天下

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

[编程交流] DCL问题

[复制链接]

23

主题

75

帖子

58

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
143
发表于 2022-7-6 00:30:13 | 显示全部楼层 |阅读模式
关于我写的对话框,我有两个问题。
1.下拉框不够宽,无法显示所有文本。我该如何解决这个问题?
2.目前,要在列表框中选择第二行,必须按住shift键。我如何更改它,使选择保持选中状态而不按下控制键?
 
扰乱dcl的命令
  1. (defun c:bprint ( / )
  2. (setq retlist1 nil)
  3. ;;;         lm:directorydialog
  4. ;;;  Author: Lee Mac, Copyright © 2013 - www.lee-mac.com       ;;;
  5. (setq thedirectory (lm:directorydialog "Select folder: " nil 0))
  6. (if (/= thedirectory nil)
  7.         (setq List1 (vl-directory-files thedirectory "*.dwg"))
  8.         end
  9. )
  10. (setq List2 (list ""))
  11. (batch thedirectory List1 List2)
  12. (if (/= retlist1 nil)
  13.         (progn
  14.                 (if (/= (findfile "BPlotData.txt") nil)
  15.                         (setq filedata
  16.                                 (readfile
  17.                                         (findfile "BPlotData.txt")
  18.                                 )
  19.                                 files (cdr filedata)
  20.                                 batchplotfiles (list )
  21.                         )
  22.                 )
  23.                 (foreach file files
  24.                         (setq batchplotfiles
  25.                                 (append batchplotfiles
  26.                                         (list
  27.                                                 (strcat "open "" thedirectory "\" file ""  (mybatchprint) ZOOM E close Y")
  28.                                         )
  29.                                 )
  30.                         )
  31.                 )
  32.                 (makefile
  33.                         (strcat
  34.                                 (strcat "C:\\Users\" (getvar "loginname") "\\Documents")
  35.                                 "\"
  36.                                 "BatchPlot.scr"
  37.                         )
  38.                         batchplotfiles
  39.                 )
  40.                 (command "_.script"
  41.                         (strcat "C:\\Users\" (getvar "loginname") "\\Documents\\BatchPlot.scr")
  42.                 )
  43.         )
  44. )       
  45. )

 
运行dcl的函数
  1. (defun batch ( mydir lista listb / prin )
  2. (setq dir mydir
  3.         poplist1 (list )
  4.         mylist1 lista
  5.         mylist2 listb
  6. )
  7. (setq poplist1 (getplotters)
  8.         poplist2 (getplotstyles)
  9. )
  10. (if (not (setq dcl_id (load_dialog "batch.dcl")))
  11.         (progn
  12.                 (alert "The DCL file could not be loaded!")
  13.                 (exit)
  14.         )
  15.         (progn
  16.                 (if (not (new_dialog "batch" dcl_id))
  17.                         (progn
  18.                                 (alert "The BATCH definition could not be loaded!")
  19.                                 (exit)
  20.                         )
  21.                         (progn
  22.                                
  23.                                 (start_list "poplist1" 3)
  24.                                 (mapcar 'add_list poplist1)
  25.                                 (end_list)
  26.                                 (start_list "poplist2" 3)
  27.                                 (mapcar 'add_list poplist2)
  28.                                 (end_list)
  29.                                
  30.                                 (start_list "mylist1" 3)
  31.                                 (mapcar 'add_list mylist1)
  32.                                 (end_list)
  33.                                
  34.                                 (action_tile "pickdir" " (setq pickdir "Yes")(done_dialog 1)")
  35.                                 (action_tile "accept" "(saveVars)(done_dialog 2)")
  36.                                 (action_tile "cancel" "(done_dialog 3)")
  37.                                
  38.                                 (setq ddiag (start_dialog))
  39.                                
  40.                                 (unload_dialog dcl_id)
  41.                                
  42.                                
  43.                                 (if (= ddiag 1)
  44.                                         (princ "\nSelect directory . . . ")
  45.                                 )
  46.                                
  47.                                 (if (= ddiag 2)
  48.                                         (princ "\nPlease wait. . . ")
  49.                                 )
  50.                                
  51.                                 (if (= ddiag 3)
  52.                                         (princ "\nBatch print has been cancelled! ")
  53.                                 )
  54.                         )
  55.                 )
  56.         )
  57. )
  58. (princ)
  59. )

 
 
数据链路连接器代码
  1. batch
  2. : dialog
  3. {
  4. :        boxed_column
  5. {
  6.         : row
  7.         {
  8.                 : popup_list
  9.                 {
  10.                         label ="Choose printer";
  11.                         key = "poplist1";
  12.                         height = 15;
  13.                         width = 30;
  14.                         multiple_select = true;
  15.                         fixed_width_font = true;
  16.                         value = "0";
  17.                 }
  18.         }
  19.         : row
  20.         {
  21.                 : popup_list
  22.                 {
  23.                         label ="Choose plot style table";
  24.                         key = "poplist2";
  25.                         height = 15;
  26.                         width = 30;
  27.                         multiple_select = true;
  28.                         fixed_width_font = true;
  29.                         value = "0";
  30.                 }
  31.         }
  32.         : list_box
  33.         {
  34.                 label ="Choose Item";
  35.                 key = "mylist1";
  36.                 height = 15;
  37.                 width = 25;
  38.                 multiple_select = true;
  39.                 fixed_width_font = true;
  40.                 value = "";
  41.         }
  42.         : row
  43.         {
  44.                 : button
  45.                 {
  46.                         key = "accept";
  47.                         label = " Print ";
  48.                         is_default = true;
  49.                 }  
  50.                 : button
  51.                 {
  52.                         key = "cancel";
  53.                         label = " Cancel ";
  54.                         is_default = false;
  55.                         is_cancel = true;
  56.                 }
  57.         }
  58. }
  59. }
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:43:42 | 显示全部楼层
问题1
这就是答案
回复

使用道具 举报

0

主题

301

帖子

301

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 00:48:43 | 显示全部楼层
关于问题2,
 
这种行为是在列表框中进行选择的标准方式。
 
它是硬编码到列表框中的,没有写自己的
这很难改变,当然也不可取。
 
ymg公司
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 00:54:27 | 显示全部楼层
要增加DCL文件的宽度,只需添加属性width=66;你喜欢在文件顶部和第一个括号之后的任何数字,但不要超过100左右。
为了避免使用控制按钮进行多次选择,只需删除属性multiple\u select=true;从列表框中。
 
注意:同时从popup\u列表中删除multiple\u select属性,因为popup\u列表中不支持以前的属性。
回复

使用道具 举报

0

主题

301

帖子

301

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 01:03:15 | 显示全部楼层
 
塔尔瓦特,
 
我不知道我是否误解了,但我相信WPerciful想要的是能够选择多个,但不需要按Control或Shift。
 
ymg公司
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 01:09:37 | 显示全部楼层
 
让我们等待OP的回应
回复

使用道具 举报

23

主题

75

帖子

58

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
143
发表于 2022-7-6 01:15:49 | 显示全部楼层
 

 
 
我不知道该在哪里改变。
回复

使用道具 举报

0

主题

301

帖子

301

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 01:25:03 | 显示全部楼层
 
正如Tharwat告诉您的那样,文件顶部的宽度(参见下面代码窗口中的示例)
 
对于多个选择,最好忘记这一个。反对总是一个坏主意
标准接口。
 
ymg公司
 
  1. batch
  2. : dialog{
  3.        width = 66;
  4. :        boxed_column
  5. {
  6.         : row
  7.         {
  8.                 : popup_list
  9.                 {
  10.                         label ="Choose printer         ";
  11.                         key = "poplist1";
  12.                         height = 15;
  13.                         width = 30;
  14.                         multiple_select = true;
  15.                         fixed_width_font = true;
  16.                         value = "0";
  17.                 }
  18.         }
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 01:35:17 | 显示全部楼层
 
这是可能的,但你必须自己滚。。。
 
[code][颜色=绿色];;多个列表框选择,不使用CTRL/SHIFT-Lee-Mac;;仅用于学术目的;不用于商业应用。defunc:示例(/*错误*cnt dch dcl des sel)(defun*错误*(msg)(if='文件(类型des))(关闭des))(
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 21:18 , Processed in 0.390515 second(s), 70 queries .

© 2020-2025 乐筑天下

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