[Project] GUI helper classes - scrollbars, child windows etc

Discuss the future of the AutoHotkey language
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

[Project] GUI helper classes - scrollbars, child windows etc

13 Aug 2014, 06:20

After discussion with Lexikos, and having previewed Fincs' new v2 GUI, it seems that some GUI functionality is not planned for AHK v2, so users wishing to implement niceties such as scroll bars still have to brave DLL calls etc.

For an idea of the kinds of features I am talking about, you can see a screencast here.

Currently, this code resides in my UCR project here, but if other people in the community wish to collaborate, I would create a new project dedicated to these libraries.

Here is a proposed feature list:
  • Encapsulate GUIs (and Controls?) into classes.
    [GUIs Done]
  • Detect +Parent option passed to Gui.Create() and store child GUI object in an array on the parent.
    [Done]
  • Provide a Scrollable Window class that automatically creates scrollbars when client objects (GUIs, Controls) are clipped by the viewport.
    [Done for GUIs, Controls not handled yet but that is easy]
  • Provide a mechanism for child item positioning that adjust coordinates passed to Gui.Show() to account for current position of viewport (ie due to scrollbar position).
    [Routines to calculate offset done, implemented ShowRelative() alternative to Show()]
  • Provide a mechanism to route Windows Messages (eg Scroll) to the relevant GUI / Control. Ideally encapsulated within the class where possible.
    [Encapsulated proof of concept in, could do with some work]
  • Provide a way of moving multiple child windows together.
    [Implemented via DeferWindowPos Dll Call]
  • Miscellaneous wrappers for Dll calls (GetClientRect etc)
    [Lots already implemented]
  • Classes to implement a "TaskBar" to emulate a windowed environment within an AHK window.
    [Proof of conept done]
  • Additional events for GUIs such as OnMove(), ChildMoved(), ChildMinimized() etc
    [Many implemented]
As you can probably see, I have most of these problems licked, but due to me being an armchair coder at best, my classes probably are not as neat / elegant as they could be.
This is probably the area where I would need help in order to make it fit for release back into the community - it already works for the purposes I need it for, but I feel that with a bit of polish, it could make a very nice set of classes that would enable people to easily create full-featured applications in AHK.

I am also quite happy to do all the work myself, if anyone is willing to make suggestions as to how I could improve the quality of the code, that would be grand.

Comments / feedback welcomed...
User avatar
fischgeek
Posts: 435
Joined: 29 Jan 2014, 21:39

Re: [Project] GUI helper classes - scrollbars, child windows

13 Aug 2014, 12:00

I have actually never been able to (nor seen) a scrollable window. I'd be really interested in that one.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 33 guests