Msgbox2 - customizable msgbox - 2021/07/25 - beta.1

Post your working scripts, libraries and tools.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Msgbox2 - customizable msgbox - 2021/07/25 - beta.1

31 Jul 2020, 06:04

Thanks to @robodesign for LOTS of collaboration, testing, and feedback. This is definitely a joint project.
Thanks to @just me for making TaskDialog which gave me some ideas in a few places I got stuck.

This class enhances and combines the Msgbox and InputBox commands.

Highlights:
  • Add as many custom buttons as you want.
  • Add a help button and specify an optional callback function.
  • Change text font, size, and color.
  • Change dialog background color.
  • Msgbox2 does quite a bit of auto-sizing for ease-of-use.
  • Specify any combo of height and width of display message.
  • Msgbox2 centers on specified parent window (if specified).
  • Msgbox2 can emulate modal functionality.
  • Specify x, y options to place the dialog anywhere you want.
  • Add additional input controls:
    Edit, ListBox, ComboBox, DropListBox, Checkbox, Icon
  • Optionally make the display message an edit control for easy scrolling of long data.
  • Right click on display message for context menu option to copy message text.
After the user interacts with or closes the dialog, the following properties are populated:

Code: Select all

.list             row number selected in ListBox
.listText         text of row number selected in Listbox
.dropList         row number selected in DropDownList
.dropListText     text of row number selected in DropDownList
.combo            row number selected in ComboBox
.comboText        text of row number selected in ComboBox
.check            value of Checkbox (1 or 0 / true or false)
.button           text of the button clicked
.ClassNN          ClassNN of the button clicked
msgbox2 demo.png
msgbox2 demo.png (8.51 KiB) Viewed 2486 times
===========================================================================
Changes:
===========================================================================

:arrow: Download on GitHub
Last edited by TheArkive on 25 Jul 2021, 06:20, edited 4 times in total.
User avatar
Tigerlily
Posts: 377
Joined: 04 Oct 2018, 22:31

Re: Msgbox2 - customizable msgbox - 2020/07/31 - a121

19 Aug 2020, 16:52

@TheArkive

Very cool, I will definitely test these out and report back sometime! This should be built into AHK imo. Nice!
-TL
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Msgbox2 - customizable msgbox - 2020/07/31 - a121

20 Aug 2020, 02:12

@Tigerlily
Thanks :)
You can also change the font / font size with this class script. Forgot to mention that in the description (now updated).
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Msgbox2 - customizable msgbox - 2020/10/27 - a122

27 Oct 2020, 15:51

Update 2020/10/27:
  • optimized / condensed code (managed to cut over 250 lines / 5000+ chars)
  • added optional callback function for help button
  • changed auto-sizing up a bit to be more intuitive
  • added options: x, y, width, height, margin
  • updated docs
  • modified options syntax to be more consistent though all options (check docs)
  • updated OP

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: arcylix, GollyJer, jacek678 and 33 guests