The default size is relatively small, only 290 x 100, which is sufficient for it's usage. The other default values are 14 for the font size, Arial for the font, the GUI background is Blue, and the label text is yellow.
I created this function when I discovered that I needed a way to display something on the screen while my program was performing a lengthy operation that didn't require any screen output. I was using it to read ID3 tag information for about 4000 songs and it took some time to do that. Having a small gui with a configurable label and parameters allowed me to hide the program while informing the user that something was still going on.
I've gotten rid of most of the "magic numbers" in the script so that it's using constants for everything, and you'll have a better idea of what the code is doing.
I've added the ability to set the background and label colors using the Default keyword, and -1. If you wish this GUI to use the color scheme of your Windows theme, or your skin theme, use "" as this will not set a color for the label text or the GUI background.
I've limited the Y dimension of the GUI to no less than 100 pixels tall, as this would cause several issues with displaying things properly.
I've updated the UDF header information so that things are a bit clearer as to how to use this.
None of these changes should be script breaking, just added functionality and usage.
Removed the need for any external includes, doesn't change the functionality in any way though so it will work as it did previously
Updated the return values, it now returns an array on success. The array contains the handles to the GUI(array), Progress Bar (array), and the label (array). So now you will be able to update the controls on the fly now. This version is incompatible with the previous versions because of the change.
I have updated the example code below to match the newest version.
Here is a short demo program showing how the 2 different progress bars would show up, and showing some of the custom features of the function.
#include "_ProgressGUI.au3" $Return = _ProgressGUI("This is a test message xxxxxxxxxxxxxxx xxxxxxxxxxxxx", 1, 30, "", 400, 300);, 4, 6) For $I = 1 To 100 GUICtrlSetData($Return, $I) Sleep(100) If Mod($I, 2) Then GUISetBkColor(Random(0, 32767, 1), $Return) Next Sleep(2000) GUIDelete($Return) $Return = _ProgressGUI() Sleep(4000)
And here's a link to the actual UDF
Please let me know if you find it useful or have suggestions. Thanks for reading.
Edited by BrewManNH, 30 March 2012 - 03:56 PM.