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
AutoXYWH() - Move control automatically when GUI resized
-
- Posts: 58
- Joined: 18 Feb 2015, 15:06
Re: AutoXYWH() - Move control automatically when GUI resized
Actually I think it is simple.
What would you suggest should change?
What would you suggest should change?
ciao
toralf
toralf
-
- Posts: 58
- Joined: 18 Feb 2015, 15:06
Re: AutoXYWH() - Move control automatically when GUI resized
Sorry if I was not clear. You script is working perfectly. What should be changed is AHK documentation.toralf wrote:Actually I think it is simple.
What would you suggest should change?
Regards
Re: AutoXYWH() - Move control automatically when GUI resized
Only the first one works as expected.
Dont know if its my fault, but it drives me crazy.
Dont know if its my fault, but it drives me crazy.
Code: Select all
html:="fadfsf dfsdf dfssdf dfsd fsdf fsd fsdf fsdf df dfsd fd f sdf dsf asf fsdf f sdfsd f"
Gui, +Resize
document1 := ComObjCreate("InternetExplorer.Application")
Gui, Add, ActiveX, h100 w100 vdocument1 hwndhTest1, HTMLFile
document1.write(html)
Gui, Show, x800, test1
Gui, web:new
Gui, web:Default
Gui, +Resize
document2 := ComObjCreate("InternetExplorer.Application")
Gui, Add, ActiveX, h100 w100 vdocument2 hwndhTest2, HTMLFile
document2.write(html)
Gui, Show, x1000, test2
Gui, net:new
Gui, net: +Resize
document3 := ComObjCreate("InternetExplorer.Application")
Gui,net: Add, ActiveX, h100 w100 vdocument3 hwndhTest3, HTMLFile
document3.write(html)
Gui, net: Show, x1300, test3
return
GuiSize:
AutoXYWH("wh", htest1)
AutoXYWH("wh", htest2)
AutoXYWH("wh", htest3)
Return
Re: AutoXYWH() - Move control automatically when GUI resized
You will need to add WebGuiSize and NetGuiSize.
Each of the guisize subroutines will have only one AutoXYWH().
Each of the guisize subroutines will have only one AutoXYWH().
ciao
toralf
toralf
Re: AutoXYWH() - Move control automatically when GUI resized
Thank you very much.
I knew that, but i totally forget that fact. And i read it in the docs but dont mention it. Not my day.
I knew that, but i totally forget that fact. And i read it in the docs but dont mention it. Not my day.
-
- Posts: 58
- Joined: 18 Feb 2015, 15:06
Re: AutoXYWH() - Move control automatically when GUI resized
Hello Everyone.
This still not working for width of controls on the same "row". I tried with every kind of combination. Any Idea about what I'm doing wrong?
This still not working for width of controls on the same "row". I tried with every kind of combination. Any Idea about what I'm doing wrong?
Re: AutoXYWH() - Move control automatically when GUI resized
Note: Please use the modified version by toralf to test below examples.danielo515 wrote:Hello Everyone.
This still not working for width of controls on the same "row". I tried with every kind of combination. Any Idea about what I'm doing wrong?
Resize two controls's width at same row
Resize three controls's width at same row
-
- Posts: 58
- Joined: 18 Feb 2015, 15:06
Re: AutoXYWH() - Move control automatically when GUI resized
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.
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
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?
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?
Code: Select all
#include lib\autoxywh.ahk
Gui, +Resize
Gui, Add, Edit, HwndHEdit1,
Gui, Add, Edit, x+4 HwndHEdit2,
Gui, Add, Edit, x+4 HwndHEdit3,
Gui, Show
Return
GuiSize:
AutoXYWH("w", HEdit1)
AutoXYWH("xw", HEdit2)
AutoXYWH("xw", HEdit3)
Return
GuiClose:
ExitApp
My Stuff: mousey; volume; ahkinfo; instantbirder; npp highlighter; Dynamic File Menu; tv - a treeview library;
Re: AutoXYWH() - Move control automatically when GUI resized
@BGM
Code: Select all
AutoXYWH("w0.33", HEdit1)
AutoXYWH("x0.33 w0.33", HEdit2)
AutoXYWH("x0.66 w0.33", HEdit3)
Re: AutoXYWH() - Move control automatically when GUI resized
Thanks! That gives me some ideas. I actually had read about using percentages but I didn't get it. Now I get it.
My Stuff: mousey; volume; ahkinfo; instantbirder; npp highlighter; Dynamic File Menu; tv - a treeview library;
Re: AutoXYWH() - Move control automatically when GUI resized
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.
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.
My Stuff: mousey; volume; ahkinfo; instantbirder; npp highlighter; Dynamic File Menu; tv - a treeview library;
Re: AutoXYWH() - Move control automatically when GUI resized
Try to use the version which has the options as the first parameter and then a variadic list of controls.
ciao
toralf
toralf
Re: AutoXYWH() - Move control automatically when GUI resized
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.
; 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.
Code: Select all
isdown := getkeystate("shift","P")
if(isdown){
autoxywh("w", "edit2")
}else{
autoxywh("x*", "edit2")
autoxywh("w", "edit1")
}
My Stuff: mousey; volume; ahkinfo; instantbirder; npp highlighter; Dynamic File Menu; tv - a treeview library;
Re: AutoXYWH() - Move control automatically when GUI resized
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.
ciao
toralf
toralf
Re: AutoXYWH() - Move control automatically when GUI resized
tmplinshi added a setting for resetting the control info: http://ahkscript.org/boards/viewtopic.p ... 768#p45733
My Stuff: mousey; volume; ahkinfo; instantbirder; npp highlighter; Dynamic File Menu; tv - a treeview library;
Re: AutoXYWH() - Move control automatically when GUI resized
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().
Code: Select all
Gui, +Resize
Gui, Add, Edit, ve1 w150 h100
Gui, Add, Button, vb1 gResize, Resize
Gui, Show
return
Resize:
GuiControl, Move, e1, h50
AutoXYWH("update_ctrl_info")
return
GuiSize:
AutoXYWH("wh", "e1")
AutoXYWH("y", "b1")
return
Re: AutoXYWH() - Move control automatically when GUI resized
In case anyone has been following my plight - Just Me solved my resizing procedure with some basic math (doh!) rather than using a library.
My Stuff: mousey; volume; ahkinfo; instantbirder; npp highlighter; Dynamic File Menu; tv - a treeview library;
Re: AutoXYWH() - Move control automatically when GUI resized
Added the reset option, and changed the version info to:
Code: Select all
; Version: 2015-5-29 / Added 'reset' option (by tmplinshi)
; 2014-7-03 / toralf
; 2014-1-2 / tmplinshi
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 123 guests