Constrain movement of controls?

Started by roy_043 · 2011-05-20 12:04 UTC · 6 replies · SMF topic #1627

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?
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.
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.
author=roy_043 link=topic=1627.msg8015#msg8015 date=1306308582 wrote:
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 ?
author=owenwengerd link=topic=1627.msg8017#msg8017 date=1306324002 wrote:
Have you tried just setting the grid spacing to ?
Yes I have. But constraining your hand movement to the X or Y direction is not that easy.
Hi,

author=roy_043 link=topic=1627.msg8015#msg8015 date=1306308582 wrote:
[...] a 50 pixel shift requires 50 arrow key clicks.


A techno song with 120 bpm will help you :)

Fred
author=Fred Tomke link=topic=1627.msg8020#msg8020 date=1306395086 wrote:
A techno song with 120 bpm will help you :)

This {2} 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