(version 1.0 shown)
- Converts controls with absolute positioning and sizing to 'section' or 'previous' positioning and sizing, automatically doing the math and updating the controls
- Reorders script lines for the controls (with their associated font specifications) as necessary
- The Fontalyzer option removes redundant consecutive font definitions, reducing script size and improving readability
- The testing function allows for visually confirming that controls were grouped/converted as intended by moving (or resizing) the first control of a group and seeing which others automatically move (or change size) with it, as shown below:
Download: Version 1.1 - Requires AutoHotkey v1.1.31+. Tested on Windows 10. Wine/Linux users may require downloading imageres.dll (typically found in Windows installations).
v1.0 - 2020.02.03 - Initial release
v1.1 - 2020.02.12 - Added Align/Nudge feature
I have found AutoGUI's GUI designer to be an excellent tool for laying out and generating the initial code for my GUIs. The GUI script as output by AutoGUI uses absolute positioning for all controls. I find it to be very helpful while developing a script and modifying the initial GUI layout to have many of the controls use relative positioning so moving one control will automatically move those associated with it. But manually converting a large number of controls to relative controls can be a very laborious task, so I created a tool to make it a quick and easy process.
When a GUI script is loaded, the relevant controls will be displayed in a table. The user would first reorder the rows in the table as necessary, then indicate which controls are to be section anchors and which are to be positioned by a section or previous control. Width and height can also be based on that of the previous control. When "Update" is clicked, the tool will perform the math and update the options in the controls to reflect the relative positioning (shown in the first image above).
After updating, clicking "Test" will generate a visual demonstration to confirm the changes were made as intended. For each section control and for each control that begins a sequence of previous controls (called a "test point"), the position and/or size (as applicable) will be changed, and the associated relative controls will also change in position or size. If a problem is spotted, just make any changes necessary and update and test again.
The "Fontalyzer" option removes redundant font definition lines (including the lines that return the font to normal) from consecutive controls that have identical font definitions. See below for a before/after example. The "Group" option will take all controls that don't have to be in a particular order because they are not involved in relative positioning and group them together if they have identical font definitions before running Fontalyzer so that even more lines can be eliminated.