OpenDCL怎么让对话框自动关闭
RT,比如对话框出现延时5秒后自行关闭。谢谢各位。 (dcl_DelayedInvoke 5000 FunctionName )或(command "delay" 5000)
(dcl_Form_Close Test_Form1 {DialogStatus }) ;关闭对话框
;详看OpenDcl的Splash.lsp例子 自动关闭对话框这种有什么用呢?感觉没有地方比较需要这种 回复 jh1005 的帖子
非常感谢~~ 回复 jh1005 的帖子
还是不能自动关闭对话框,需要鼠标点击关闭才行。。 回复 jh1005 的帖子
;;;
;;; Miscellaneous Sample
;;;
;;; This sample demonstrates miscellaneous controls.
;;;
;; Main program
(defun c:Splash (/ cmdecho)
;; Ensure OpenDCL Runtime is (quietly) loaded
(setq cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_OPENDCL")
(setvar "CMDECHO" cmdecho)
;; Load the project
(dcl_Project_Load (*ODCL:Samples:FindFile "Splash.odcl"))
;; Show the main form
(dcl_Form_Show splash_Form1)
;; This is a modeless form, so (dcl_Form_Show) returns immediately,
;; leaving the event handlers to manage the form.
(setq *Count* 4)
(C:CloseSplash)
(princ)
)
(defun C:CloseSplash ()
(dcl_Control_SetCaption splash_Form1_Label1 (strcat "Loading..." (itoa *Count*)))
(setq *Count* (1- *Count*))
(if (/= *Count* -1)
(dcl_DelayedInvoke 1000 "C:CloseSplash")
(dcl_Form_close splash_Form1)
)
(princ)
)
;|<<OpenDCL Event Handlers>>|;
(princ)
;|<<OpenDCL Samples Epilog>>|;
;;;######################################################################
;;;######################################################################
;;; The following section of code is designed to locate OpenDCL Studio
;;; sample files in the samples folder by prefixing the filename with
;;; the path prefix that was saved in the registry by the installer.
;;; The global *ODCL:Prefix and function *ODCL:Samples:FindFile
;;; are used throughout the samples.
;;;
(or *ODCL:Samples:FindFile
(defun *ODCL:Samples:FindFile (file)
(setq *ODCL:Prefix
(cond
( *ODCL:Prefix
) ;_ already defined
( (vl-registry-read
"HKEY_CURRENT_USER\\SOFTWARE\\OpenDCL"
"SamplesFolder"
)
) ;_ 32-bit location
( (vl-registry-read
"HKEY_LOCAL_MACHINE\\SOFTWARE\\OpenDCL"
"SamplesFolder"
)
) ;_ 32-bit location
( (vl-registry-read
"HKEY_CURRENT_USER\\SOFTWARE\\Wow6432Node\\OpenDCL"
"SamplesFolder"
)
) ;_ 64-bit location
( (vl-registry-read
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\OpenDCL"
"SamplesFolder"
)
) ;_ 64-bit location
)
)
(cond
((findfile file)) ; check the support path first
(*ODCL:Prefix (findfile (strcat *ODCL:Prefix file)))
(file)
)
)
)
;; If master demo is active, run the main function immediately; otherwise
;; display a banner. The extra gymnastics allow the sample name to be
;; specified in only one place, thus making it easier to reuse this code.
( (lambda (demoname)
(if *ODCL:MasterDemo
(progn
(princ (strcat "'" demoname "\n"))
(apply (read (strcat "C:" demoname)) nil)
)
(progn
(princ (strcat "\n" demoname " OpenDCL sample loaded"))
(princ (strcat " (Enter " (strcase demoname) " command to run)\n"))
)
)
)
"Splash"
)
(princ)
;;;######################################################################
;;;######################################################################
;|玍isual LISP?Format Options?
(80 4 50 2 nil "end of " 80 50 0 0 2 nil nil nil T)
;*** DO NOT add text below the comment! ***|;
找到这个例子了,哈哈。可以了~非常感谢 6楼的是用EDITPLUS的吗?
页:
[1]