Can has Answer/Ask -like progress bar?

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
tperry2x
Posts: 1559
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by tperry2x »

Anyway, getting back to the original point of this topic...
Link: https://mega.nz/folder/tXEi1JzK#YIdb511w5yuinee6KPULUw
standard.png
standard.png (12.03 KiB) Viewed 159 times
This is a stack you could choose to include as a substack in any project.

If you drag out the corners of the window, you can see what it uses to create the bars, and there's a few test buttons and suchlike...
expanded.png
expanded.png (18.75 KiB) Viewed 159 times
However, you can also invoke the progress bar setup as a function:
as-function.png
as-function.png (28.18 KiB) Viewed 159 times
Try running this in a message box, with the stack open:

Code: Select all

dispatch progbar(128974848,51914182,"A long wait...") to this stack
The first number is the total (any large number). The second number is the progress so far (a smaller number than the first). The string "A long wait..." is the message you want to be displayed.

Of course, this is non-blocking (unless you go and embed it in a cpu-hungry loop), so you can simply:

Code: Select all

close stack "progressbars" 
to hide the dialog (if you'd made it modal or something).

I should also mention, the colours aren't hard-coded or anything. So you can change the colours of the bars as you see fit, with the inspector. This way, it can fit into whatever project / implementation / os scheme you have in mind.
(Or you could colour them via script to match the platform the script is being run on).
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by OpenXTalkPaul »

Thanks for working on this, I did a version I'll have to post eventually.
So like Ask/Answer has options such as 'Answer Warning ...' my thinking was that 'Notify' stack would have options like 'Notify progressBar, ...' and 'Notify Spinner, ...' where param1 of 'the params' would indicate what type of activity indicator to use, so far the options are 'complete' to finish/close the window, 'progress' with a percentage param for horizontal progressbar, or 'busy' for the ambiguous spinner animation, and then you can mix/match them like so:

Code: Select all

Notify busy,"About to do the thing!"
repeat with x = 1 to 100
   Notify progress,"Doing the thing:" & x & "%",x
end repeat
Notify busy,"Almost done..."
--- do some cleanup stuff ---
Notify complete, "All Done!"
Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests