Prior to Delphi 2007, the “Align” and “Spacing” toolbars were not entirely supported by the VCL designer. Now, operations like “Align left edges” or “Increment horizontal spacing” can be performed by clicking a toolbar button. Delphi 2007 also makes it easier to identify and change the anchor component for these commands.
The Align toolbar is an alternative to using the Edit|Align… and Edit|Size… commands. To show the Align toolbar, check “Align” on the toolbar popup menu.
The Align toolbar contains alignment commands as well as sizing commands like “Make same width”. Note that most of these commands are grayed unless multiple components are selected.
The Align commands are: Align left, align right, align vert centers, align tops, align bottoms, align horz centers, align to grid, Snap to grid, make same height, make same width, make same size, size to grid
The Edit|Align… and…
Edit|Size… commands continue to work as in Delphi 2006.
Spacing commands are new to the Delphi 2007 VCL designer (with the exception of “space equally”). These commands change the spacing between components. “Increment horizontal spacing” is an example of a spacing command.
To show the spacing toolbar, check “Spacing” on the toolbar popup menu. Spacing commands are grayed unless multiple components are selected.
The Spacing commands are: space equally horz, increment horz spacing, decrement horz spacing, remove horz spacing, space equal vert, increment vert spacing, decrement vert spacing, remove vert spacing
When multiple components are selected, one component is the anchor. When aligning, sizing, or spacing, the anchor component stays in place and the other component(s) are moved or sized in relation to the anchor.
There are two changes to anchor support in Delphi 2007.
- Clicking on a selected component makes that component the anchor.
- The handles of the anchor component are painted black. Other handles are gray.
In summary, these minor enhancements to the VCL form designer provide new and improved ways to position and size components.