Jump to content

The new Mad Max trailer looks cool... Done dialog question...


LosGirk

Recommended Posts

Greetings all,

Hopefully someone can help with a question I have. What is the difference between these sections of code? Is done dialog 1 and set userclick T saying the same thing?

 

(action_tile "accept" "(done_dialog 1)")
(setq Return# (start_dialog))

 

and

 

(done_dialog)(setq userclick T)

 

I know the Return# has to do with having multiple dialog boxes with next and back buttons, but the ddiag1 and userclick T I'm having trouble with.

 

 

Thanks your time, and have an extraordinary Sunday! 8)

Link to comment
Share on other sites

No difference at all , and it is all about the programmer which way to go through .

 

After unloading the dialog there must be the following .

 

e.g No: (1)


(if (and Return# (eq Return# 1))
 (progn
   .....
   )
 )

e.g No: (2)

 

(if userclick1
 (progn
   .....
   )
 )

Link to comment
Share on other sites

What is the difference between these sections of code? Is done dialog 1 and set userclick T saying the same thing?

(action_tile "accept" "(done_dialog 1)")
(setq Return# (start_dialog))

and

(done_dialog)(setq userclick T)

 

They essentially result in the same dialog behaviour; though note that neither expressions are required as the action statements for the accept & cancel tiles are predefined with done_dialog returns of 1 & 0 respectively.

 

Consider the following quick example to verify this:

(defun c:dcltest ( / *error* dch dcl des )

   (defun *error* ( msg )
       (if (< 0 dch) (unload_dialog dch))
       (if (= 'file (type des)) (close des))
       (if (and (= 'str (type dcl)) (setq dcl (findfile dcl))) (vl-file-delete dcl))
       (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
           (princ (strcat "\nError: " msg))
       )
       (princ)
   )

   (if (and (setq dcl (vl-filename-mktemp nil nil ".dcl"))
            (setq des (open dcl "w"))
            (write-line "test:dialog{label=\"DCL Test\";spacer;ok_cancel;}" des)
            (not (setq des (close des)))
            (< 0 (setq dch (load_dialog dcl)))
            (new_dialog "test" dch)
       )
       (if (= 1 (start_dialog))
           (princ "\nUser pressed OK.")
           (princ "\nUser pressed Cancel.")
       )
   )
   (*error* nil)
   (princ)
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...