Jump to content

Recommended Posts

Posted

I have a very simple routine that uses a dialogue box for the user input (see below). There is a slight problem which i am sure has been covered elsewhere but i cant find the answer. Here is the problem when completing the box:

  • The user completes the input boxes (default values are already there).
  • Under 'Schedule Insertion Point' the user picks a point and is taken to the main screen
  • Once the point is picked, the X: Y: Z: values are completed, however, the previously completed boxes have reverted back to the default values.

The dialogue box does work but only if completed from top to bottom. Should this be the case? :?

 

Capture.JPG

Posted

Prior to temporary close the dialog box for point input, you need to create a list of current inputs from fields and restore those instead of default values when re-display the dialog.

 

The dialogue box does work but only if completed from top to bottom.

Not sure what you mean by this - are you talking about tab order?

Posted
Prior to temporary close the dialog box for point input, you need to create a list of current inputs from fields and restore those instead of default values when re-display the dialog.

 

 

Not sure what you mean by this - are you talking about tab order?

 

No. Basically, so the input box data is not forgotten, i have been working down the dialogue box from top to bottom.

 

Can you elaborate on your point about a list of current inputs? whereabouts would add this?

 

(defun selch ()
 (setq dcl_id (load_dialog "schdialog.dcl"))
 (while (> flag 2)
 (if (not (new_dialog "schdialog" dcl_id))

   (exit)
 )
 (set_tile "eb1" ptx)
 ;display x value
 (set_tile "eb2" pty)
 ;display y value
 (set_tile "eb3" ptz)
 ;display z value

 (action_tile
   "cancel"      ;if cancel button pressed
   "(done_dialog) (setq flag 0)"  ;close dialog, set flag
   );action_tile

 (action_tile
   "accept" ;if O.K. pressed

   (strcat
     "(progn         
      (setq chtp (get_tile \"gp_prefix\"))"
     "(setq chn (get_tile \"gp_start\"))"
     "(setq col (get_tile \"gp_col\"))"
     "(setq seqy (atof (get_tile \"gp_freq\")))"
     "(setq ans (get_tile \"tfile\"))"
     "(setq fnam (get_tile \"tfilen\"))"
     "(setq sel (atof (get_tile \"selc\")))"
     "(done_dialog) (setq userclick T))"
    ); strcat
 ); action
  (action_tile
   "picker"
   "(done_dialog 4)"
 )
 ;if pick button selected, hide the dialogue
 ;and set the flag to 4
 (setq flag (start_dialog))
 ;start the dialogue and set flag
 ;to value of start dialogue
 (if (and (= ptx "0")(/= flag 0)) ;(= flag 4)
 ;if the pick button was selected
   (progn
   ;do the following

     (setq selpoint (getpoint "\nSchedule Insertion Point: "))
     ;get the insertion point
     (setq ptx (rtos (car selpoint) 2 4))
     ;get the x value
     (setq pty (rtos (cadr selpoint) 2 4))
     ;get the y value
     (setq ptz (rtos (caddr selpoint) 2 4))
     ;get the z value
     (setq pnt selpoint)
(command "text" "tl" pnt "" "" "Reference")
 (setq ts (getvar "textsize"))
 (setq xc (* ts 5))
 (setq chp (car pnt))
 (setq xcc (* xc 2))
 (setq cha (+ xcc chp))
 (setq chb (cadr pnt))
 (setq chp (list cha chb))
 (command "text" "tl" chp "" "" "Easting")
 (setq xc (* ts 4.5))
 (setq cht (car chp))
 (setq xcc (* xc 2))
 (setq chx (+ xcc cht))
 (setq chy (cadr pnt))
 (setq cht (list chx chy))
 (command "text" "tl" cht "" "" "Northing")
   );progn
   );if
     );while
 (start_dialog)
 (unload_dialog dcl_id)  ;unload
 (princ)

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...