OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Hypersonic on January 01, 2008, 12:12:39 PM

Title: Is there a way to set position of a dialog after it is opened?
Post by: Hypersonic on January 01, 2008, 12:12:39 PM

i.e. to enable automatically "sliding" the dialog out of the way?

Thanks!
Title: Re: Is there a way to set position of a dialog after it is opened?
Post by: BazzaCAD on January 01, 2008, 07:13:38 PM
You can move it on SHOW:

(Setq rValue (dcl_Form_Show Project1_Form1
     [Optional]  UpperLeftXCoordinate [as Integer]
     [Optional]  UpperLeftYCoordinate [as Integer]))

Owen can you clarify something for me? You mention before you could move a form on OnInitialize:
https://sourceforge.net/tracker/index.php?func=detail&aid=1810592&group_id=187950&atid=923363 (https://sourceforge.net/tracker/index.php?func=detail&aid=1810592&group_id=187950&atid=923363)

How do we do this? With (dcl_form_resize) or (dcl_control_setpos) or something else?
Title: Re: Is there a way to set position of a dialog after it is opened?
Post by: BazzaCAD on January 01, 2008, 08:37:02 PM
Owen, Also what's the best way to get the Height & Width of a form?
I've learned from you that we can use:
(dcl_Control_GetHeight (car (dcl_Form_GetControls Proj_Form)))
But that includes the Titlebar & borders.
I'm assuming this will be different for each version of windows & VisualStyles, it makes things difficult to figure out what's on the users end.
Since we changed the Forms properties (Height & Width) to no longer include the TitleBar & borders for functions like (dcl_Form_Resize),
It would be nice if there was an opposing function to get the Height & Width without the TitleBar & borders included.
Maybe something like: (dcl_Form_GetSize)
Title: Re: Is there a way to set position of a dialog after it is opened?
Post by: owenwengerd on January 02, 2008, 12:57:42 AM
Barry, you should be able to call either (dcl_form_resize) or (dcl_form_setpos) during OnInitialize. Also, (dcl_Control_GetHeight (car (dcl_Form_GetControls Proj_Form))) returns the client height (i.e. not including the title bar or border) *unless* it's an older form that was created before sizes used the client area. With newly created forms, all sizes should be client sizes, and should be correct and consistent on all platforms.
Title: Re: Is there a way to set position of a dialog after it is opened?
Post by: BazzaCAD on January 02, 2008, 12:43:59 PM
Is there a way to tell/check what version a for was created in?
If you have a look at JTHWAMAN sample form here:
http://www.opendcl.com/forum/index.php?topic=127.msg507#msg507 (http://www.opendcl.com/forum/index.php?topic=127.msg507#msg507)
It returns the forms Height/Width with the TitleBar & borders dimensions (so I guess it's an older form).
Is there a way to convert\upgrade the form to use the new client area code?