Difference between revisions of "RequestChooser"

From wiki.amiga.org
Jump to navigation Jump to search
 
Line 99: Line 99:
  
 
<pre style="color: black; background:lightgray; font-family:courier; width:60%">
 
<pre style="color: black; background:lightgray; font-family:courier; width:60%">
RequestEULA "User Agreement" "Licence.txt" "I Agree|Cancel"  
+
RequestChooser "User Agreement" "Licence.txt" "I Agree|Cancel"  
 
         HEADER "Please Read the licence below*N
 
         HEADER "Please Read the licence below*N
 
           and click on 'I Agree'*Nif you accept the terms"  
 
           and click on 'I Agree'*Nif you accept the terms"  
 
           IMAGE "logo.iff" FILE
 
           IMAGE "logo.iff" FILE
 
</pre>
 
</pre>

Latest revision as of 20:01, 16 April 2016

commands/RequestChooser


NAME

RequestChooser - Allows a script to display a requester displaying a license document or other similar text in a scrollable window and obtain a response via standard requester buttons.


FORMAT

RequestChooser <TITLE> <BODY> {gadgets} [HEADER <instructions text>] [IMAGE <image file>] [FOOTER <instructions text>] [TO <file>] [PUBSCREEN <public screenname>] [WIDTH <window width>] [HEIGHT <window height>] [FILE] [TIMEOUTSECS <seconds>] [INACTIVE]


TEMPLATE

"TITLE/A,BODY/A,GADGETS/M,HEADER/K,IMAGE/K,FOOTER/K,TO/K,PUBSCREEN/K,WIDTH/K/N, HEIGHT/K/N,FILE/S,TIMEOUTSECS/K/N,INACTIVE/S"


FUNCTION

The command is very similar to the system command RequestChoice. It will obey the user preferences for system requester positioning (Top Left, Centre Screen etc etc) and for the sizes of the requester gadgets (even sized etc).

The number of the gadget selected will be returned, Gadgets being numbered 1,2, ..., 0. -1 is returned on timeout.


OPTIONS

TITLE/A

The title of the requester window.

BODY/A

Text to display in the scrollable section of the requester, newlines etc should be DOS escaped, ie *N. If the FILE switch is set, then this is interpreted the name of a file load.

GADGETS/M

A list of texts to display in the gadget section of the requester either as a space separate of '|' separated list.

HEADER/K

Text to display is the upper section of the gadgets, typicaly instructions on how to respond having read the body text.

IMAGE/K

Filename of an image to display to the left of the header area. Typically a small logo. The image will not be scaled, so choose a sensibly sized one.

FOOTER/K

Text to display is the lower section of the gadgets, typicaly instructions on how to respond having read the body text.

TO/K

Write the result to the file specified instead of STDOUT

PUBSCREEN

Name of a public screen to open the requester on.

WIDTH

HEIGHT

Size to open the window. The window may be resized by the user after opening.

FILE/S

AS noted above the FILE switch is used to pass a filename in the BODY argument.

TIMEOUTSECS

Time in seconds after which the requester will automaticaly close. In case of timeout the returned result will be -1

INACTIVE

Open the requester window in inactive state.


EXAMPLES

	RequestChooser "User Agreement" "Licence.txt" "I Agree|Cancel" 
         HEADER "Please Read the licence below*N
          and click on 'I Agree'*Nif you accept the terms" 
          IMAGE "logo.iff" FILE