Skip to content

Improved Layout Position Locking

Among the many IDE improvements in 2019r2 we’ve made some improvements in how the Control Layout Locks work so even if a control is locked, it’ll still obey the left/top/right/bottom alignment locks. We are taking some hints from the way many graphic design programs approach this and we think it’ll be a big improvement to the way controls are organized on Windows and Containers. 


First of all, the primary function of Position Locking in the IDE is to prevent accidentally moving controls that you’ve already placed on a Window or Container. For users with very complex layouts and layers of overlapping controls, this feature is a must.

In previous versions of the IDE when you lock a control’s layout position, it stays in that position no matter what, and while that sounds like the desired result, it does have some not-so-desirable side effects, the least of which is that the control no longer obeys runtime control locking. If you follow these steps in 2019r1.1, you get a very strange result:

  1. Create a new Desktop Project.
  2. In Window1, drag a Canvas control to the lower-right corner of the window.
  3. Set the control locking in the inspector so that only the right and bottom sides are locked.
  4. Right-click the control and select “Lock Position”
  5. Resize the Window by dragging the lower-right handle

In 2019r1.1 and below, the Canvas acts like it’s locked on the top-left corner and stays at the same x and y position as when you locked it. If you do these same steps in 2019r2, the control now follows it’s runtime locking rules and stays with the lower-right corner of the Window. 


The second issue we had was that Position Locking did not affect the alignment tools. Previously, if you selected one or more controls whose positions were locked, the alignment toolbar buttons were always enabled, but clicking them didn’t affect all locked controls. Instead, the IDE would figure out the outer bounds of all selected controls and move the unlocked controls to align with this boundary. This leads to unexpected results if one or more locked controls are selected because they don’t move. 

Starting in 2019r2, the rules for alignment have changed somewhat.

  • The alignment controls are now only enabled if you have at most one locked control selected. 
  • If no locked controls are selected, the IDE will align controls using the outer boundary of all selected controls as a guide, just like it did before.
  • If a locked control is selected, the controls will be aligned to that control.