Moving forms around in CAD

Started by AutoKAD, July 12, 2009, 03:50:35 PM

Previous topic - Next topic

AutoKAD

Does anyone know of a way (or if it is even possible) to make one modeless form a child to a parent modeless form, so as the result of moving the parent around on the screen will move the child at the same time?

Thanks.

Fred Tomke

Hi AutoKAD, I see no solution yet. It would work of course if you resize the parent. Then you could resize the child modeless form programmatically within the OnSize-event of the parent modeless form. But since the form object has no Move-method (like in FoxPro, I'm just working with FoxPro), I see no solution yet. But maybe you could add a feature request for adding a OnMove event.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

AutoKAD

#2
Thanks for the information Fred.  I figured out a roundabout way of doing this, but I need the screen position of the parent control.  I tried to retrieve the screen position using getcontrols, but all i get is a list of entity names.

Anyway, It's basically using the mousemovedoff event and closing the child form and then calling to show it again with the X Y position set.

Any idea how to get the screen position of controls?

Thanks.

Edit: Nevermind.  Found it.  (dcl_Control_GetPos <control>)  Some of the functions for forms and controls don't show up in the help file included with studio editor.  Guess I should just start using the online help instead.  Anyways, got this working using this roundabout way.  Not perfect, but it'll do for now.  Time to put in a feature request.

Fred Tomke

Hi, try GetRectangle for the form position. To get the screen position add the results of GetControlArea from the form with the values of Top and Left of each control you want.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Quote from: AutoKAD on July 12, 2009, 04:47:22 PM
Any idea how to get the screen position of controls?

(dcl_Control_GetPos) works on forms and controls. Likewise, (dcl_Control_SetPos) can move them. Which functions were not listed in the Control Browser? All except the deprecated ones should be listed, and there should be no need to use deprecated functions as those all have suitable replacements.
Owen Wengerd (Outside The Box) / ManuSoft

AutoKAD

Opps.  Sorry Owen, I must be blind as a bat.  Nothing wrong with the help menu.  When you right click on a form in the studio editor and select Control Browser all the functions are shown in the right panel.  I should have looked there before looking at the left panel.  I'm sure there is a reason for the different listings.  Anyway, yea, my bad.