Page 1 of 1

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

Posted: 31 Jul 2020, 06:04
by TheArkive
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 2484 times
===========================================================================
Changes:
===========================================================================

:arrow: Download on GitHub

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

Posted: 19 Aug 2020, 16:52
by Tigerlily
@TheArkive

Very cool, I will definitely test these out and report back sometime! This should be built into AHK imo. Nice!

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

Posted: 20 Aug 2020, 02:12
by TheArkive
@Tigerlily
Thanks :)
You can also change the font / font size with this class script. Forgot to mention that in the description (now updated).

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

Posted: 27 Oct 2020, 15:51
by TheArkive
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

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

Posted: 25 Jul 2021, 06:20
by TheArkive
2021/07/25:
  • updated for v2 beta.1