Shawndoe 发表于 2022-7-5 18:24:27

DCL盒放置

你好
 
我需要把DCL盒从屏幕中间移开,有什么办法吗?
 
谢谢你的帮助。
肖恩多

Guest kruuger 发表于 2022-7-5 18:39:10

关闭后是否保存对话框位置?
看看这个代码:
http://www.cadtutor.net/forum/showthread.php?55038-创建动态DCL quot问题任何人都可以测试它

http://www.cadtutor.net/forum/showthread.php?54734-如何记住DCL窗口位置
 
克鲁格

Shawndoe 发表于 2022-7-5 18:45:13

你好
 
真的很感谢你。
 
祝你过得愉快。
肖恩多

Snownut 发表于 2022-7-5 18:52:28

我已经看了这个线程和来自kruuger的文件,但是我仍然在dcl盒放置上迷失了方向。当对话框打开时,是否有方法指示对话框在屏幕上的位置?任何愿意分享的人。。。。

Lee Mac 发表于 2022-7-5 18:58:55

您可以在屏幕坐标中指定初始位置,然后对话框的位置将由done\u dialog函数返回,您可以将其存储到下一次。
 
如果你愿意,我会贴一个例子

Lee Mac 发表于 2022-7-5 19:06:48

好吧,我忍不住举个例子
 

(defun c:test ( / *error* dcl dch )

;; Example by Lee Mac 2011-www.lee-mac.com

;; Demonstrates how to remember a dialog screen
;; position for next use.

;; Requires accompanying file: test.dcl to be
;; in AutoCAD Support Path.

(defun *error* ( msg )
   (if dch (unload_dialog dch))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
)

(cond
   (
   (not
       (and
         (setq dcl (findfile "test.dcl"))
         (< 0 (setq dch (load_dialog dcl)))
       )
   )

   (princ "\n** DCL File not found **")
   )
   (
   (not (new_dialog "test" dch "" (cond ( *screenpoint* ) ( '(-1 -1) ))))
                                          
   (setq dch (unload_dialog dch))
   (princ "\n** Dialog could not be Loaded **")
   )
   (t
   (action_tile "accept" "(setq *screenpoint* (done_dialog 1))")
   (start_dialog)

   (setq dch (unload_dialog dch))
   )
)

(princ)
)

 
将以下内容另存为“测试”。支持路径中的dcl:
 

test : dialog { label = "Test Dialog";
spacer;
: text { label = "Move me"; alignment = centered; }
spacer;
: button { key = "accept"; is_default = true; label = "I'm Done"; }
}
 
在这种情况下,位置存储为全局变量,但可以更改代码以将屏幕位置转换为字符串,并在绘图会话之间将其存储在注册表中。
 
享受
 

Lee Mac 发表于 2022-7-5 19:12:24

事实上,我刚刚决定在我的网站上添加这个主题:
 
http://lee-mac.com/dialogposition.html

przem_saw 发表于 2022-7-5 19:23:31

是否可以将此合并到*的例程中。dcl采用lisp语言。
 
我试图做的是调整此代码:http://www.lee-mac.com/filtlistbox.html使用dialogposition。
但不幸的是没有成功。

ymg3 发表于 2022-7-5 19:31:33

雪果,
 
您需要将*dlgpos*设置为2个整数的列表,定义DCL左上角的位置。
 
因此,您需要(getvar的屏幕大小)并了解dcl的像素大小。
 
(setq*dlgpos*'(0 0))将其放置在Autocad屏幕的左上角,
重叠功能区。在这种情况下,不需要知道盒子的尺寸。
 
ymg公司
页: [1]
查看完整版本: DCL盒放置