17 January 2022, 17:01 | #1 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Using system requesters for info dialog and progress bar? (OS 3.2)
I'm getting to the point where I need to actually let the user know about status of in-progress copy actions, and failures, errors, that sort of thing. Before I roll my own status/progress window, and my own info dialog box, I wanted to see if I can use the ones built into 3.2.
I scanned through the auto docs, and didn't see anything about progress bar used in 3.2 (see screenshot). Safe to assume I need to make my own there? (fuel gauge example is enough to go on). (I did find some references on the web to a progress bar class in non-3.2 land, as part of an Enhancer pack I don't have). For the general info dialog box (see screenshot), is that this: requester.class/RM_OPENREQ. I'm assuming so, it looks like it has all the right stuff. Last edited by Warty; 17 January 2022 at 17:37. Reason: Add screenshot of system progress bar |
17 January 2022, 18:43 | #2 | |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Spelunking in the header files, I noticed all this beautiful stuff, going all the way back to 2.1 NDK:
Code:
/********************************** * progress window type attributes * **********************************/ #define REQP_Total (REQP_Dummy+1) /* (ULONG) Total number of levels for the progressbar. (default: 100) (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_Current (REQP_Dummy+2) /* (ULONG) The current level of the progressbar. (default: 0) (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_AbortText REQ_GadgetText /* (UBYTE *) Text to be put into the gadget that will abort the progressbar. If not present, no gadget will be created. (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_ProgressText REQ_BodyText /* (UBYTE *) Text to be shown over the progressbar. (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_OpenInactive (REQP_Dummy+3) /* (BOOL) Open window inactive if ta_Data is TRUE. (OM_NEW, RM_OPENREQ) */ #define REQP_NoText (REQP_Dummy+4) /* (BOOL) No text-gadget in progressbar if ti_Data is TRUE (OM_NEW, RM_OPENREQ) */ #define REQP_Dynamic (REQP_Dummy+5) /* (BOOL) TRUE if the pb should size automatically when a too long progresstext is set. Default is TRUE. (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_CenterWindow (REQP_Dummy+6) /* (struct Window *) The progressbar is centered over this window. (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_LastPosition (REQP_Dummy+7) /* (BOOL) Open progressbar on the same place the last was. Default is TRUE. (OM_NEW, OM_SET, RM_OPENREQ) */ #define REQP_Percent (REQP_Dummy+8) /* (BOOL) Render numeric percentage display. (OM_NEW, RM_OPENREQ) */ #define REQP_Ticks (REQP_Dummy+9) /* (WORD) If present, how many tick marks (OM_NEW, RM_OPENREQ) */ #define REQP_ShortTicks (REQP_Dummy+10) /* (BOOL) Enable small intermediate tick marks. (OM_NEW, RM_OPENREQ) */ But then this (still) in the 3.2 NDK header: Quote:
http://amigadev.elowar.com/read/ADCD.../node0637.html So I guess that's the answer. |
|
17 January 2022, 19:57 | #3 |
Registered User
Join Date: Oct 2008
Location: EU
Posts: 163
|
Amiga Installer has a progress bar, is there maybe a source available somewhere to adopt things from?
Or can REQ_Image be used with a pointer to a custom image which gets changed in background? |
17 January 2022, 20:12 | #4 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
The system definitely has progress bars in use, at least in 3.2, but I don't know HOW it's doing it.
I did play around with the REQTYPE_PROGRESS type, and it opens a window with a progress bar. The problem, as I see it, is that the window is essential model: it needs the user to hit enter before code execution continues. What you want for a progress bar is a window that stays open without user input, and takes updated values for the bar's progress. I'm sure 3.2 knows how to do that, but I haven't stumbled on how they do it. It might be they are using a totally different thing to do it, and not a system requester at all. It's not a huge deal to make my own window to do it, but always better to do things the "system way" whenever possible... |
17 January 2022, 20:43 | #5 |
Coder/webmaster/gamer
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,630
|
The way that AsyncWB etc. do it is that they just make a small window (eg. with window.class) and put a fuelgauge.gadget in it. fuelgauge_gc.doc in the NDK has the documentation you will need.
|
18 January 2022, 06:56 | #6 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Yep, that's what I ended up doing. It's fine. I needed to do some magic in there anyway, as I wanted a callback function in case people want to cancel an operation part way through.
I have to say I'm impressed by the team keeping all those auto docs up to date and accurate. I mean, just the fact they are typo free as far as I have seen so far, is rather amazing. Some serious discipline going on there! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Double Menu Requesters | tygre | Coders. General | 7 | 09 September 2021 19:05 |
Xenon 2 - Weapon System & Shop info | ransom1122 | Retrogaming General Discussion | 4 | 16 September 2020 22:42 |
Copying files - progress bar | trixster | support.Apps | 24 | 06 June 2016 14:54 |
ASMPro info bar thingy | bodhi | Coders. Asm / Hardware | 3 | 29 July 2013 10:43 |
Workbench 3.1 Where is the System Info? | clitosa | New to Emulation or Amiga scene | 5 | 15 November 2012 21:18 |
|
|