GroupBox & relative control positioning Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
just me
Posts: 7240
Joined: 02 Oct 2013, 08:51
Location: Germany

GroupBox & relative control positioning

31 Dec 2016, 12:00

If I run the following code

Code: Select all

#NoEnv
Gui, Margin, 10, 10
Gui, Add, GroupBox, w400 r5, Group
Gui, Add, Text, xp+10 yp+20, Text 1
Gui, Add, Edit, xp y+2, Edit 1
Gui, Add, Text, xp, Text 2
Gui, Add, Edit, xp y+2, Edit 2
Gui, Show, , GroupBox
Return
GuiClose:
ExitApp
i get overlapping controls within the GroupBox. If you remove the xp from the options of the second Text control, everything is fine. I'm running AHK 1.1.24.02 U64 on Win 10 Pro (10.0.10240 x64).

Can somebody confirm the results?
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: GroupBox & relative control positioning

31 Dec 2016, 12:36

confirmed with
Win10 Pro x64 v10.0.14393
AHK x64 v1.1.24.04

Edit: I confirm also with AHK v1.0.48.03 on a Virtual WinXP x32.
Maybe this can help to track down the cause?
just me
Posts: 7240
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: GroupBox & relative control positioning

01 Jan 2017, 17:35

lexikos? (Happy new year!)
lexikos
Posts: 7067
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: GroupBox & relative control positioning

01 Jan 2017, 18:07

What are you trying to do?

I get the same results without the GroupBox. I see nothing in the documentation about GroupBox affecting the positioning of other controls.
hunter99
Posts: 128
Joined: 20 Jan 2014, 17:57

Re: GroupBox & relative control positioning

01 Jan 2017, 23:39

Hi and Happy New Year,
Don't know if this will help. As I'm running Win7 Pro. and get the same results.
But if I add y+2 to second Text like so:
"Gui, Add, Text, xp y+2, Text 2"
The problem is gone.

hunter99

Edit:
Here is what I get with all 4 combinations.

just xp gives overlap between Edit1 and Text2
no xp or y+2 gives space between Edit1 and Text2
just y+2 gives no space between Edit1 and Text2
xp and y+2 gives no space between Edit1 and Text2
User avatar
jNizM
Posts: 2661
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: GroupBox & relative control positioning  Topic is solved

02 Jan 2017, 02:32

xp without y(p)+(n) use the same spot like the control before...
can be used to position controls relative to the previous control's upper left corner
[AHK] 1.1.32.00 x64 Unicode | [WIN] 10 Pro (Version 2004) x64 | [GitHub] Profile
Donations are appreciated if I could help you
just me
Posts: 7240
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: GroupBox & relative control positioning

02 Jan 2017, 04:15

OK, my bad. RTFM is something you cannot do often enough! :?
The docs wrote:xp y+m positions a control below the previous control, whereas specifying an X coordinate on its own would normally imply yp by default.
Thanks to all contributors.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, devnullsp, Fayz, Google [Bot], MStavros, mystery, Xeo786 and 58 guests