Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 26 Apr 2015, 07:47
by danielo515
Hello toralf,
It's not a problem with your script, it's a problem with AHK documentation. It's very hard to figure out that each window has it's ow guisize label. Once I added the name of the gui as a prefix of the guisize label you script started to work again. Not very intuitive in my opinion
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 26 Apr 2015, 12:10
by toralf
Actually I think it is simple.
What would you suggest should change?
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 27 Apr 2015, 03:51
by danielo515
toralf wrote:Actually I think it is simple.
What would you suggest should change?
Sorry if I was not clear. You script is working perfectly. What should be changed is AHK documentation.
Regards
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 27 Apr 2015, 06:21
by Guest
Only the first one works as expected.
Dont know if its my fault, but it drives me crazy.
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 30 Apr 2015, 10:42
by danielo515
Hello tmplinshi
Wow, I can't believe I have been so stupid! I have been using 0.5w and 0.5x as options instead of w0.5 and x0.5!!
Now I have others problems to face. Thank you.
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 12 May 2015, 23:43
by BGM
In my case, I need three controls in a row to size proportionally, but I need the last control to be anchored to the previous control instead of anchored to "x".
In other words, in this case, Edit3's leftmost position should be 4 pixels from the rightmost edge of Edit2.
Is it possible to add a feature to anchor to another control's border?
Or maybe it could be made to anchor to the right side of the window?
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 13 May 2015, 09:56
by BGM
Thanks! That gives me some ideas. I actually had read about using percentages but I didn't get it. Now I get it.
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 16 May 2015, 10:43
by BGM
Hmmm... I was hoping to do some tricks with two edit controls.
Take a look at my example here: http://ahkscript.org/boards/viewtopic.p ... 635#p45635
where I try to use GuiSize to size one edit control but not the other and vice versa.
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 16 May 2015, 11:25
by toralf
Try to use the version which has the options as the first parameter and then a variadic list of controls.
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 16 May 2015, 11:37
by BGM
toralf - that's the autoxywh.ahk (not anchor)
; Release date: 2014-7-03
; Author : tmplinshi (mod by toralf)
; requires AHK version : 1.1.13.01+
I've played around with this for some time now (I've tried both versions of AutoXYWH). It looks like I'm going to have to do all the math myself.
AutoXYWH, for some reason, just doesn't seem to respect the settings - it's as if it conflicts with itself.
So I tried reversing things. In the following configuration, when you hold shift, none of the boxes resize at all.
It seems like autoxywh is ignoring the second declaration.
Further, if you shift+resize and then try to resize without shift, autoxywh doesn't respect the new size of the box.
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 16 May 2015, 22:46
by toralf
It stores the initial control size and position relative to the GUI size. All further movements are depending on the new GUI size. You are right you can not switch between different options nor can you reset the initial size/position.
Re: AutoXYWH() - Move control automatically when GUI resized
Re: AutoXYWH() - Move control automatically when GUI resized
Posted: 21 May 2015, 05:12
by m3user
Thank you very much tmplinshi for adding a reset option. I tried it with my basic example (below) and it works well. You should update the function on the first page, maybe you could consider using a simpler parameter like AutoXYWH("r")or even AutoXYWH().