slightly-improved dialogs

Discuss the future of the AutoHotkey language
User avatar
Posts: 3787
Joined: 19 Dec 2016, 01:58
Location: UK

slightly-improved dialogs

06 Mar 2018, 19:00

- The idea here is to create slightly-improved versions of the AutoHotkey dialogs (MsgBox/InputBox/ToolTip) that support a custom font and various simple commonly-asked for features, and to also recreate Progress and SplashImage. The Borders function simply puts coloured borders around a square/rectangle (e.g. a window/control/GUI element).
2 InputBox (+ InputBox multi)
3 Progress (+ SplashText) (no additional features) [NOT IMPLEMENTED]
7 Find dialog [NOT IMPLEMENTED]

- I'm implementing the functions here in AutoHotkey v2, although I had intended ultimately to create them using my own custom GUI functions, because that way you can specify the class name (needed for all of them), no icon (e.g. MsgBox, Find dialog), and you don't cause #Persistent, and they can be used in AutoHotkey v1/v2.
- I mentioned some of my plans here:
GUI COMMANDS: COMPLETE RETHINK - Page 2 - AutoHotkey Community

- Some points on functionality.
- I have various queries relating to the GUI functionality, in the script's to-do list.
- One idea for #Persistent could be something like object reference counts, the user can choose to increment the 'GUI count' by 1, and decrement it when finished, as a way to ensure the script remains open at least while the GUI is displaying. If the 'GUI count' ever reaches 0, the script can then close at the next appropriate point.
- Some properties that could be useful: HwndParent (or ParentHwnd), .B/.R for bottom/right, being able to set the control colours as built-in (the one 'complex' feature I would recommend adding in), specific menu item IDs.
- Having used AutoHotkey v2 GUIs for the first time in this project (apart from in my control zoo), I repeatedly noticed the benefits of this idea:
For convenience, it should be possible to pass a Gui object to a WinTitle parameter instead of "ahk_id " Gui.Hwnd.
I would suggest that it work in general for all WinXXX functions, if you pass any object which has a key 'hWnd'.

Code: [Select all] [Download] GeSHi © Codebox Plus

oWin := {hWnd:hWnd}
vWinTitle := WinGetTitle(oWin)
vWinTitle := WinGetTitle("ahk_id " oWin.hWnd)
vWinTitle := WinGetTitle("ahk_id " hWnd)

- I'm looking for any similar/related scripts for comparison. Although the focus here is strictly very minor oft-asked-for features.
InputBox() - easy & powerful InputBox implementation - Scripts and Functions - AutoHotkey Community
ToolTipEx - custom fonts and colors in ToolTips - AutoHotkey Community
EntryForm() - easy, custom InputBox, data entry forms - AutoHotkey Community
ToolTipFont / ToolTipColor - options for the ToolTip command - AutoHotkey Community
AHKv2: Diálogos para seleccionar Icono, Fuente, Color y Más! [23/07/17] - AutoHotkey Community
MagicBox - Message Box Generator - AutoHotkey Community
ToolTips: set border colour (custom font/colour ToolTips) (borders around windows/controls) - AutoHotkey Community
Last edited by jeeswg on 07 Mar 2018, 09:04, edited 1 time in total.
User avatar
Posts: 3787
Joined: 19 Dec 2016, 01:58
Location: UK

Re: slightly-improved dialogs

06 Mar 2018, 19:47

First attempt which currently only covers InputBox.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

[EDIT:] Added to 'NOTES' re. 'Close' event.
Last edited by jeeswg on 07 Mar 2018, 05:56, edited 1 time in total.
User avatar
Posts: 2547
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: slightly-improved dialogs

07 Mar 2018, 02:42

I think this would be better off in the Scripts forum.
Recommends AHK Studio

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 2 guests