Shawndoe Posted December 9, 2010 Share Posted December 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
Guest kruuger Posted December 9, 2010 Share Posted December 9, 2010 do you want to save dialog position after close ? look at this code: http://www.cadtutor.net/forum/showthread.php?55038-Create-DCL-quot-on-the-fly-quot-problem-anyone-can-test-it and http://www.cadtutor.net/forum/showthread.php?54734-How-to-remember-DCL-window-position kruuger Quote Link to comment Share on other sites More sharing options...
Shawndoe Posted December 10, 2010 Author Share Posted December 10, 2010 Hi, That did it thanks alot. Have a good one. Shawndoe Quote Link to comment Share on other sites More sharing options...
Snownut Posted January 12, 2011 Share Posted January 12, 2011 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.... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 12, 2011 Share Posted January 12, 2011 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 12, 2011 Share Posted January 12, 2011 Ok, so I couldn't resist making an example (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) ) Save the following as 'test.dcl' in a Support Path: test : dialog { label = "Test Dialog"; spacer; : text { label = "Move me"; alignment = centered; } spacer; : button { key = "accept"; is_default = true; label = "I'm Done"; } } 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. Enjoy! Lee Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 12, 2011 Share Posted January 12, 2011 In fact, I have just decided to add this topic to my website: http://lee-mac.com/dialogposition.html Quote Link to comment Share on other sites More sharing options...
przem_saw Posted November 10, 2015 Share Posted November 10, 2015 is it possible to combine this to routine for *.dcl made in lisp. What I am trying to do is to adjust this code: http://www.lee-mac.com/filtlistbox.html to work with dialogposition. But no success unfortunately. Quote Link to comment Share on other sites More sharing options...
ymg3 Posted November 10, 2015 Share Posted November 10, 2015 Snownut, You would need to set *dlgpos* as a list of 2 integers, defining position of upper left corner of your DCL. So you would need to (getvar 'screensize) and know the pixel size of your dcl. (setq *dlgpos* '(0 0)) would place it at upper left corner of Autocad Screen, overlapping the ribbon. For that case no need to know thw size of the box. ymg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.