-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.47 resizing of Configure Editors GUI; some code cleanup
- Loading branch information
Showing
9 changed files
with
133 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
; ================================================================================= | ||
; Function: AutoXYWH | ||
; Move and resize control automatically when GUI resizes. | ||
; Parameters: | ||
; DimSize - Can be one or more of x/y/w/h optional followed by a fraction | ||
; add a '*' to DimSize to 'MoveDraw' the controls rather then just 'Move', this is recommended for Groupboxes | ||
; cList - variadic list of ControlIDs | ||
; ControlID can be a control HWND, associated variable name, ClassNN or displayed text. | ||
; The later (displayed text) is possible but not recommend since not very reliable | ||
; Examples: | ||
; AutoXYWH("xy", "Btn1", "Btn2") | ||
; AutoXYWH("w0.5 h 0.75", hEdit, "displayed text", "vLabel", "Button1") | ||
; AutoXYWH("*w0.5 h 0.75", hGroupbox1, "GrbChoices") | ||
; --------------------------------------------------------------------------------- | ||
; Version: 2015-5-29 / Added 'reset' option (by tmplinshi) | ||
; 2014-7-03 / toralf | ||
; 2014-1-2 / tmplinshi | ||
; requires AHK version : 1.1.13.01+ | ||
; ================================================================================= | ||
AutoXYWH(DimSize, cList*){ ; http://ahkscript.org/boards/viewtopic.php?t=1079 | ||
static cInfo := {} | ||
|
||
If (DimSize = "reset") | ||
Return cInfo := {} | ||
|
||
For i, ctrl in cList { | ||
ctrlID := A_Gui ":" ctrl | ||
If ( cInfo[ctrlID].x = "" ){ | ||
GuiControlGet, i, %A_Gui%:Pos, %ctrl% | ||
MMD := InStr(DimSize, "*") ? "MoveDraw" : "Move" | ||
fx := fy := fw := fh := 0 | ||
For i, dim in (a := StrSplit(RegExReplace(DimSize, "i)[^xywh]"))) | ||
If !RegExMatch(DimSize, "i)" dim "\s*\K[\d.-]+", f%dim%) | ||
f%dim% := 1 | ||
cInfo[ctrlID] := { x:ix, fx:fx, y:iy, fy:fy, w:iw, fw:fw, h:ih, fh:fh, gw:A_GuiWidth, gh:A_GuiHeight, a:a , m:MMD} | ||
}Else If ( cInfo[ctrlID].a.1) { | ||
dgx := dgw := A_GuiWidth - cInfo[ctrlID].gw , dgy := dgh := A_GuiHeight - cInfo[ctrlID].gh | ||
For i, dim in cInfo[ctrlID]["a"] | ||
Options .= dim (dg%dim% * cInfo[ctrlID]["f" dim] + cInfo[ctrlID][dim]) A_Space | ||
GuiControl, % A_Gui ":" cInfo[ctrlID].m , % ctrl, % Options | ||
} } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.