Constrain movement of controls?

Started by roy_043, May 20, 2011, 05:04:19 AM

Previous topic - Next topic

roy_043

Grid spacing 6
control1 top = 5
control2 top = 7

If you select both controls and move them horizontally both will have a new top of 6. Is there a way to constrain the movement to the X direction so that the top values do not change?

owenwengerd

I think there is a feature request for something like this. I think the best solution is to always keep the controls' relative spacing the same when dragging multiple controls, and snap the entire set to the upper-left corner of the selection bounding box.
Owen Wengerd (Outside The Box) / ManuSoft

roy_043

Thank you Owen for your reply. I am not sure I correctly understand the terms you use:

keep the controls' relative spacing the same
Upper-left point of each control matches a grid point?

snap the entire set to the upper-left corner of the selection bounding box
Each control is a aligned top from top edge of parent and left from left edge of parent?

A simple way to constrain the movement of controls is to use the arrow keys instead of dragging them. It is not a very convenient method though: a 50 pixel shift requires 50 arrow key clicks.

owenwengerd

Quote from: roy_043 on May 25, 2011, 12:29:42 AM
A simple way to constrain the movement of controls is to use the arrow keys instead of dragging them. It is not a very convenient method though: a 50 pixel shift requires 50 arrow key clicks.

Have you tried just setting the grid spacing to <None>?
Owen Wengerd (Outside The Box) / ManuSoft

roy_043

Quote from: owenwengerd on May 25, 2011, 04:46:42 AM
Have you tried just setting the grid spacing to <None>?
Yes I have. But constraining your hand movement to the X or Y direction is not that easy.

Fred Tomke

Hi,

Quote from: roy_043 on May 25, 2011, 12:29:42 AM
[...] a 50 pixel shift requires 50 arrow key clicks.

A techno song with 120 bpm will help you :)

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

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

roy_043

#6
Quote from: Fred Tomke on May 26, 2011, 12:31:26 AM
A techno song with 120 bpm will help you :)
This AHK script is a little easier on the eardrums (and blood pressure):


#Persistent
#SingleInstance, Force
Menu, Tray, Icon, C:\Program Files\OpenDCL Studio\ENU\Studio.Res.dll
Menu, Tray, NoStandard
Menu, Tray, Add, Exit, Exit
Menu, Tray, Add, ODCL AHK Move, ODCL_AHK_Move
Menu, Tray, Default, ODCL AHK Move
Menu, Tray, Click, 1
Return

ODCL_AHK_Move:
InputBox, UserInput, ODCL AHK Move, Please enter e.g.: X-30 or Y+10, , 220, 115
action := SubStr(UserInput, 1, 2)
repeat := SubStr(UserInput, 3)
if (action = "x+")
  key = {RIGHT}
else if (action = "x-")
  key = {LEFT}
else if (action = "y+")
  key = {DOWN}
else if (action = "y-")
  key = {UP}
IfWinNotActive, OpenDCL Studio, , WinActivate, OpenDCL Studio,
WinWaitActive, OpenDCL Studio,
Loop, %repeat%
  Send, %key%
Return

Exit:
ExitApp


EDIT: Improved code