Unit 'intuition' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#amunits]

AutoRequest

Automatically build and get response from a requester.

Declaration

Source position: intuition.pas line 4077

function AutoRequest(

  window: pWindow;

  const body: pIntuiText;

  const posText: pIntuiText;

  const negText: pIntuiText;

  pFlag: LongWord;

  nFlag: LongWord;

  width: LongWord;

  height: LongWord

):LongBool;

Arguments

window

  

A pointer to a Window structure. See BuildSysRequest() for a full discussion.

body

  

A pointer to an TIntuiText structure

posText

  

A pointer to an TIntuiText structure, may by nil.

negText

  

A pointer to an TIntuiText structure, must be valid!

pFlag

  

Flags for the IDCMP

nFlag

  

Flags for the IDCMP

width

  

The width to be used for the rendering of the requester

height

  

The height to be used for the rendering of the requester

Function result

The return value is either True or False. See the text above for a complete description of the chain of events that might lead to either of these values being returned.

Description

This procedure automatically builds a requester for you and then waits for a response from the user, or for the system to satisfy your request. If the response is positive, this procedure returns TRUE. If the response is negative, this procedure returns FALSE.

An IDCMPFlag specification is created by bitwise "or'ing" your PosFlags, NegFlags, and the IDCMP classes IDCMP_GADGETUP and IDCMP_RAWKEY. You may specify zero flags for either the PosFlags or NegFlags arguments.

The IntuiText arguments, and the width and height values, are passed directly to the BuildSysRequest() procedure along with your window pointer and the IDCMP flags. Please refer to BuildSysRequest() for a description of the IntuiText that you are expected to supply when calling this routine. It's an important but long-winded description that need not be duplicated here.

If the BuildSysRequest() procedure does not return a pointer to a window, it will return TRUE or FALSE (not valid structure pointers) instead, and these BOOL values will be returned to you immediately.

On the other hand, if a valid window pointer is returned, that window will have had its IDCMP ports and flags initialized according to your specifications. AutoRequest() then waits for IDCMP messages on the UserPort, which satisfies one of four requirements:

When the dust has settled, this routine calls FreeSysRequest() if necessary to clean up the requester and any other allocated memory.

When DOS brings up AutoRequests() on your process (eg. "Please insert volume XXX in any drive", they normally come up on the Workbench screen. If you set your Process pr_WindowPtr field to point to one of your windows, then DOS will bring its requesters up on the same screen as that window. A pr_WindowPtr of -1 prevents requesters from coming up at all. (Some FileSystem requesters cannot be redirected or supressed).

See also

EasyRequestArgs

  

Easy alternative to AutoRequest()

BuildSysRequest

  

Build and display a system requester.

SysReqHandler

  

Handle system requester input.


Documentation generated on: 2021-07-30