do you want to save dialog position after close ?
look at this code:
http://www.cadtutor.net/forum/showth...ne-can-test-it
and
http://www.cadtutor.net/forum/showth...indow-position
kruuger

Registered forum members do not see this ad.
Hi,
I need to move a DCL box out of the middle of the screen, is there a way to do that?
Thanks for your help.
Shawndoe
do you want to save dialog position after close ?
look at this code:
http://www.cadtutor.net/forum/showth...ne-can-test-it
and
http://www.cadtutor.net/forum/showth...indow-position
kruuger

Hi,
That did it thanks alot.
Have a good one.
Shawndoe
I have looked at this thread, and the file from kruuger, however I am still lost on dcl box placement. Is there a way to direct the where the dialog box is placed on the screen when it opens ? Anyone willing to share....
You can specify an initial position in screen coordinates, then the position of the dialog will be returned bythe done_dialog function, which you can store for the next time.
I'll post an example if you wish![]()
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Ok, so I couldn't resist making an example
Save the following as 'test.dcl' in a Support Path:Code:(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) )
Position is stored as a global variable in this case, but the code could be altered to convert the screen position into a string and store it in the registry between drawing sessions.Code:test : dialog { label = "Test Dialog"; spacer; : text { label = "Move me"; alignment = centered; } spacer; : button { key = "accept"; is_default = true; label = "I'm Done"; } }
Enjoy!
Lee
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Registered forum members do not see this ad.
In fact, I have just decided to add this topic to my website:
http://lee-mac.com/dialogposition.html
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Bookmarks