rireqlib
This library opens the file and colour requesters of req.library, a
third-party requester library that is not part
of AmigaOS; the port is tested with
req.library 2.8 from Aminet.
The library opens req.library when the program starts and has it
free the file requester’s cached directory when the program ends.
Without req.library, no requester opens, and the commands return what they
return when the user cancels: ReqFileRequest an empty string,
ReqColour 65535. ReqFileLoc is 0 then.
ReqOutput chooses the window that both requesters appear on,
ReqFlags the flags of the file requester. The file requester can
only be used in Amiga mode. ReqFileRequest returns the path of the
file the user chose, and ReqColour starts on the colour it is given
and returns the colour the user chose.
The fixed bugs of the library are listed in Fixes in rireqlib.
Based on the RI Req Library guide by Steven Matty.
Library number 79.
Commands
ReqColour
Opens the colour requester of req.library on the window of ReqOutput, starting on the colour colour, and returns the colour the user chose, or 65535 if the user cancels.
Function, result .l. Help text: (colour)
Arguments: .l
Without req.library it returns 65535, as on cancel.
ReqFileLoc
The address of the library’s path buffer of 320 bytes, whose contents ReqFileRequest returns. 0 if req.library or the memory for the buffers was missing.
Function, result .l. No help text.
No arguments.
ReqFileRequest
Opens the file requester of req.library and returns the path of the file the user chose, or an empty string if the user cancels. title$ is the text of the title bar, flags the flags of the requester; without flags, the last setting is used.
Function, result $. Help text: ([title$][,flags])
3 forms:
- no arguments
$$, .l
Amiga mode only. The path is the one in the library’s path buffer at
ReqFileLoc. flags stay set for later calls, as with ReqFlags;
the title is for this call only. Without req.library the result is
an empty string.
ReqFlags
Sets the flags of the file requester for all later calls of ReqFileRequest.
Statement. Help text: flags
Arguments: .l
The flags are those of req.library, one bit each:
| Bit | Value | Effect |
|---|---|---|
| 0 | %1 | shows .info files |
| 1 | %10 | allows extended select |
| 2 | %100 | caches directories |
| 3 | %1000 | makes it a font requester |
| 4 | %10000 | adds the gadget that hides .info files |
| 5 | %100000 | hides the show and hide wildcard gadgets |
| 6 | %1000000 | uses absolute positions |
| 7 | %10000000 | purges the cache when a directory changes |
| 8 | %100000000 | caches only complete directories |
| 9 | %1000000000 | does not sort |
| 10 | %10000000000 | leaves out the drag bar and depth gadgets |
| 11 | %100000000000 | selects a file to save |
| 12 | %1000000000000 | selects files to load |
| 13 | %10000000000000 | lets the user select a directory |
The flags at the start are %10010100: directory caching, the gadget
that hides .info files, and the purge of the cache when a directory
changes.
ReqOutput
Makes the requesters of the library appear on the window with the number given.
Statement. Help text: windowptr
Arguments: .l
Without it, the requesters are given no window. Each run of the program starts without a window, also a second run from the editor.