Page 2 of 3

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 13 Oct 2015, 00:17
by HotKeyIt
Bruttosozialprodukt wrote:And here is another thing: http://i.snag.gy/8gM1f.jpg
This GUI does not resize or anything and chances are that I'll never change it again because changing one thing means changing everything.
I'd really to rewrite this whole thing to have the left side being able to resize in width and everything to resize in height when changing the window size.
And I'd also like to not worry about margins between any controls and have elements easily scaled to 100% (minus margins) inside a group box etc..
Do you mean like this?

Code: Select all

Gui,+Resize +Scroll
Gui, Add, Edit, w500 h400 aw ah
Gui, Add, ListView,x+10 w100 h200 axa ah1/3,Season
Gui, Add, ListView,x+10 w200 h200 axa aha,Episode
Gui, Add, Edit, xp-110 yp+210 w310 axa aha aya
Gui, Add, ListView, yp+30 w310 h160 aya axa aha,Hoster|Source|Language|Url
Gui, Show, x0
return
GuiClose:
ExitApp
EDIT:
You can even use negative values to make right part smaller:

Code: Select all

#SingleInstance force
Gui,+Resize +Scroll +MaxSize880x600
Gui, Add, Edit, w500 h400 aw5 ah
Gui, Add, ListView,x+10 w100 h200 axa aw-1 ah1/3,Season
Gui, Add, ListView,x+10 w200 h200 axa aw-3 aha,Episode
Gui, Add, Edit, xp-110 yp+210 w310 ax aw-4 aha aya
Gui, Add, ListView, yp+30 w310 h160 axp aya awa aha,Hoster|Source|Language|Url
Gui, Show, x0
return
GuiClose:
ExitApp

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 13 Oct 2015, 00:44
by Bruttosozialprodukt
I have to admit, this is pretty darn impressive. But I can't use column headers in every listview unfortunately. Would this be possible with the group boxes as well?

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 13 Oct 2015, 02:36
by HotKeyIt
Of course, all controls can be autosized and autopositioned.

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 13 Oct 2015, 06:43
by Bruttosozialprodukt
Cool. I'll play with it a bit and report back tomorrow or so. :)

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 14 Oct 2015, 14:40
by Soft
super awesome!! I always had this dream

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 14 Oct 2015, 15:42
by evilC
Zip updated with fix for mouse wheel.
When the focus is in a control with a scrollbar, but the mouse is outside it, the parent is scrolled.

Test Script:

Code: Select all

#SingleInstance force
Gui,+Resize +Scroll
Gui, Add, Edit, w120 w100 ah h200, Edit01`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n
 
Gui, Show, x0
return
GuiClose:
ExitApp

Re: [AHK Test Build - 11th Oct 2015] +Scroll option to enable ScrollBars for Guis / Auto-Positioning and Resizing system

Posted: 14 Oct 2015, 21:19
by joedf
cant wait to see this AHK_L ! :D

Re: [AHK Test Build - 15th Oct 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 15 Oct 2015, 15:13
by evilC
Added new Zip file with a prototype for Child Guis as GuiControls.

Re: [AHK Test Build - 17th Oct 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 17 Oct 2015, 09:26
by evilC
New build released, zip updated.

Improvements to the handling of mouse wheel scrolling - a control will only consume a scroll message if the cursor and focus is inside it and it has the relevant scrollbar showing (comple with a thumbtrack, not just an empty scrollbar).
Otherwise, the code keeps grabbing the parent HWND until it finds something with scrollbars.

Test script:

Code: Select all

#SingleInstance force
 
Gui, +Resize + Scroll
 
Gui, 2:+Scroll -Caption
Gui, 2:Color, Red
Gui, 2:Add, Edit, xm ym w100 h200 aw1/2,Test1`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n
Gui, 2:Add, Edit, ym w100 axa h200 aw1/2,Test2
Gui, Add, Gui,xm ym aw,2
Gui, Add, Edit,xm wp y+6 aya aw ah1,Test3
 
Gui, Show, x0 h100
return
GuiClose:
ExitApp
Place the cursor and/or focus in Test2 and notice that you can scroll the main gui with the wheel.
Focus in Test1, cursor in Test2 - main gui is scrolled.

Re: [AHK Test Build - 17th Oct 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 17 Oct 2015, 13:54
by evilC
New build, updated zip.

If the scrollbars of a control reach their limits, scrolling in that direction passes the scroll to the parent.

eg if scrollbar is at top and you scroll the wheel up, the parent gets scrolled.

Test script: Same as last post.
Place mouse + focus in Test1 - when the scrollbars reach the end, the parent is scrolled.

Re: [AHK Test Build - 17th Oct 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 05 Nov 2015, 17:20
by evilC
Switched to DropBox for the download, as I cannot seem to attach any more.
New version uploaded with some fixes.

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 29 Nov 2015, 13:52
by evilC
Updated download to build 44f439f.
Numerous enhancements and fixes to problems that we encountered while using the code in projects.

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 30 Nov 2015, 02:54
by toralf
great, thanks a lot.

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 01 Dec 2015, 08:58
by Heezea
Guys, amazing job. I'm holding out finishing a script until this makes it into the mainstream AHK version. Thanks so much for the effort, it's looking sweet.

Is it possible to use this so that when you are holding down the left mouse button (as if dragging an icon) and you move towards the edge of the GUI, that it would automatically scroll? Perhaps if you mouse over the "margin"? I'm envisioning this the same way windows explorer allows you to drag a file around in a directory.

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 01 Dec 2015, 14:20
by evilC
I wouldn't hold your breath for too long, we have not even approached lexikos yet about incorporating these additions, and we are still finding bugs and issues with it, so until we have a stable build that we are happy with, it's not gonna happen.
If you wish to keep up-to-date with the latest AHK_L changes whilst taking advantage of these new additions, then you can just use the AHK_H v1 executable. HotkeyIt pulls the changes in from AHK_L as they happen, so you get the best of both worlds. AHK_H is a superset of AHK_L, and should be 100% compatible.

Regarding the drag question - no, not at the moment. This is, however, something that I may want to be doing in my own project (It would be nice if you could drag reorder plugins), so there is hope for you yet :)

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 01 Dec 2015, 22:32
by lexikos
Off topic: No, AHK_H is not 100% compatible. There is at least one script which won't load because of a conflict with the new "null" constant. #NoEnv is the default behaviour, and I think any script containing the directive won't load (but I could be wrong). There are probably other minor issues.

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 01 Dec 2015, 23:06
by guest3456
yeah hotkeyit has documented some of the changes here (with some broken links):
http://hotkeyit.github.io/v2/docs/AHKH_Features.htm

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 16 Aug 2016, 15:50
by kinnex
I just stumbled onto this while trying to figure out if it is possible to increase the size of scroll bars for DropDownLists. This looks amazing. Have there been any updates since 12/2015?

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 16 Aug 2016, 17:05
by HotKeyIt
It is finalized so far and is included in AHK_H.
Documentation can be found here: Auto Positioning and Resizing of Controls.

Re: [AHK Test Build - 5th Nov 2015] Scrollbars, GuiControl Auto-Position+Size system, and more!

Posted: 09 Sep 2016, 02:06
by lmstearn
Looks very useful. :) Noticed that Anchor got nuked (?) as the last script on this page doesn't work on 112401. Time to port over to V2 at this stage?