TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CAB on July 04, 2004, 04:01:39 PM

Title: DCL Dialog Box Screen Location
Post by: CAB on July 04, 2004, 04:01:39 PM
I think I may have asked this before but if so I forgot the answer.

It seems that you can pre set the location of the dialog box using

Code: [Select]
(new_dialog "InsertDlg" dcl_id "" *DiaLoc*)
But if any of the dialog box is off the screen, it resets to centered.
My desire was to slide the dialog box partially off the screen exit
the dialog and when you return, restore it to the last position.
It seem to reject the last position because part of the box was
off the screen.
Has anyone overcome this problem? How?

CAB
Title: DCL Dialog Box Screen Location
Post by: Serge J. Gianolla on July 05, 2004, 01:22:01 AM
Unless they are floating dialogue boxes, they; by default center themselves. Add a couple of lines to your code writing a file storing x & y locations. And when lauching the routine, make it read the values to restore position. About 6 months ago I posted some code on the "forum that recently disappeared"! :oops:
As an aside, if using ObjectDCL, 't'is done au-to-ma-ti-ca-ll-y!
Title: DCL Dialog Box Screen Location
Post by: Keith™ on July 05, 2004, 09:00:07 AM
Use this scenario on your dcl dialogs .....

To specify a screen position ....
Code: [Select]

(new_dialog dlgname dcl_id "" 2d-screen-pt)


To grab the return value specified by done_dialog
Code: [Select]

(setq return_value (start_dialog))


To grab the closing position of the dialog
Code: [Select]

(setq 2d-screen-pt (done_dialog))


To specify a return value for start_dialog
Code: [Select]

(setq 2d-screen-pt (done-dialog return_value))


Any more questions?
Title: DCL Dialog Box Screen Location
Post by: CAB on July 05, 2004, 09:11:32 AM
Quote from: Serge J. Gianolla
Unless they are floating dialogue boxes, they; by default center themselves. Add a couple of lines to your code writing a file storing x & y locations. And when lauching the routine, make it read the values to restore position. About 6 months ago I posted some code on the "forum that recently disappeared"! :oops:
As an aside, if using ObjectDCL, 't'is done au-to-ma-ti-ca-ll-y!

Hello Serge.
Good to hear from you.
Not sure what a "Floating" dialog box is. Nor how you accomplish the x,y other than what I have done already.
When i launch i set the dialog location via the code line posted above. But because part off the dialog
box is off the screen, ACAD i guess, resets it to center as some sort of error check I guess. If the
box is fully on the screen it will remain in the new location.

To bad about Cadalog, lots of resource material lost. I was wondering if the forum database could be
acquired and archived somewhere for research material. Oh well, we move on to bigger and better things.

CAB

PS
Did you ever solve the Roof Skeleton riddle?
Title: DCL Dialog Box Screen Location
Post by: CAB on July 05, 2004, 09:16:27 AM
Quote from: Keith
Any more questions?


You type too fast!

I have used that in my routine but if the dialog box has any part off the screen
it is reset to center.
Title: DCL Dialog Box Screen Location
Post by: Keith™ on July 05, 2004, 10:05:38 AM
You may be able to fix that by turning off audit in the dcl code. I cannot say for sure because the audit features of DCL are so poorly documented.
Title: DCL Dialog Box Screen Location
Post by: CAB on July 05, 2004, 04:46:28 PM
Thanks Keith, but no go.
Title: DCL Dialog Box Screen Location
Post by: Keith™ on July 05, 2004, 04:51:08 PM
I'll check around a bit more and let you know if I find anything...
Title: DCL Dialog Box Screen Location
Post by: CAB on July 05, 2004, 05:02:21 PM
Thanks I appreciate that.
Title: DCL Dialog Box Screen Location
Post by: Serge J. Gianolla on July 05, 2004, 07:25:39 PM
Ciao CAB,
Instead of Floating, I should have used modeless dialogue box [Properties] always floating or displayed unless turned off, as opposed to DCL which are modal, - you have to exit them to carry on the task - [Units, Color...]

See if this 'd come close to helpin'?
Code: [Select]
(if
      (setq file (open (strcat sPath "ARray.loc") "r")) ;_ EndOf setq
       (progn
(setq ARrayloc (list (atoi (read-line file))
      (atoi (read-line file))
) ;_ EndOf list
) ;_ EndOf setq
(close file)
       ) ;_ EndOf progn
    ) ;_ EndOf if

     (setq dcl_id (load_dialog (strcat sPath "Blah.dcl")))
     (while (< 1 what_next)
      (new_dialog "BLAHBLIH" dcl_id "" ARrayloc)


Then further down:
     
Code: [Select]
((= what_next 1)
  (setq file (open (strcat sPath "ARray.loc") "w"))
  (write-line (itoa (car ARrayloc)) file)
  (write-line (itoa (cadr ARrayloc)) file)
  (close file)

With this you could add conditional test, if out of dwg area then send to top left corner...

Quote
Did you ever solve the Roof Skeleton riddle?
Gone to the too hard basket for time being! :lol:
Title: DCL Dialog Box Screen Location
Post by: Guest on July 10, 2004, 09:24:48 PM
i am interesrted in this for long time, so i add lines to my lisp and no working. Mensaje says does not find the file! Serge do you know what is wrong!
Title: DCL Dialog Box Screen Location
Post by: Serge J. Gianolla on July 12, 2004, 01:30:28 AM
Create a dummy file first with preferred x & y values, and this file has to be in path AutoCAD searches. See if it makes any difference!