Previous Next Up Title Contents General Index Functions Index Bookshelf

INITIALIZE CHOICE 3

PINCH3


CALL SEQUENCE

PINCH3 (WKID, CHDNR, ISTAT, ICHNR, PET, EVOL, LDR, DATREC)

INPUT PARAMETERS

INTEGER	WKID
INTEGER	CHDNR
INTEGER	ISTAT
INTEGER	ICHNR
INTEGER	PET
REAL	EVOL(6)
INTEGER	LDR
CHARACTER*80	DATREC(LDR)

ARGUMENTS

WKID
Workstation identifier.
CHDNR
CHOICE input device identifier.
ISTAT
Choice initial state:
ICHNR
Choice initial value.
PET
Echo type.
EVOL(6)
Echo volume in DC.
LDR
Number of data records.
DATREC(LDR)
Data record.

PHIGS STATE

(PHOP, WSOP, *, *).

EFFECT

This function initializes the CHOICE input device (input of an integer value,a selection) number CHDNR for workstation WKID.

The following devices are available:

1 : keyboard function keys. Returns the PFkey selected.

2 : mouse button number. Numbered from left to right.

40 to 49 : simulates a choice box on the screen. Selection is performed by clicking on items using the mouse

The following echo types are available for devices 40 to 49:

1 or -1: Display of a radio box widget with a title for each button.

2 or -2: Display of a radio box widget without button titles.

3 or -3: Display of a popup menu widget.

4 or -4: Display of a toggle box widget with a title for each button.

5 or -5: Display of a toggle box widget without button titles.

Echo volume is defined in Device Coordinates (DC) if echo type is positive or as a percentage of RootWindow size if echo type is negative.

Choice data record contains additional information depending on the echo type.

For echoes 1,-1,2,-2,4,-4,5 and -5 the PPREC function is called as follows:

Initialize IA array, LSTR and STR strings array:

IA: array of 32 integers indicating whether each button is visible (PON), invisible (POFF) or active (PACT for echo 4,-4,5 and -5).

LSTR: array of 33 integers describing the length of each character string.

STR: text of each field of the choice device. 33rd field must contain the title of the device and begin with a @ char.

	call PPREC(32,IA,0,0.,33,LSTR,STR,MLDR,IERR,LDR,DATREC)

For echoes 3 and -3 the PPREC function is called as follows:

Initialize LSTR and STR strings array:

LSTR: array of 33 integers describing the length of each character string.

STR: text of each field of the choice device. 33rd field must contain the title of the device and begin with a @ char.

	call PPREC(0,0,0,0.,33,LSTR,STR,MLDR,IERR,LDR,DATREC)


Example:

C Sample program for choice initialization 
	program choice

	include 'PHIGS.H'

	integer i,mldr,wkid,chdnr,ichnr,pet,istat,prompt(32),lstr(33)
	real evol(6)
	character*80 datrec(50)
	character*6 string(33) 
	data lstr/5*6,27*0,6/
	data string/'Choice1','Choice2','Choice3','Choice4','Choice5',
	+		28 * '      '/

C Open PHIGS session
	call POPPH(6,-1)

C Open workstation
	wkid = 1
	call POPWK(wkid,6,8887)

C Initialize choice device 41 with pet -4
	istat = PNCHOI
	ichnr = 0
	mldr = 50
	evol(1) = 0.0
	evol(2) = 0.1
	evol(3) = 0.5
	evol(4) = 1.0
	evol(5) = 0.
	evol(6) = 1.
	chdnr = 41
	pet = -4 
	do 3 i = 1,3
		prompt(i) = PON
3	continue
	do 4 i = 4,5
		prompt(i) = PACT
4	continue
	do 5 i = 6,32
		prompt(i) = POFF
5	continue
	string(33) = '@Echo4'
	call PPREC(32,prompt,0,0.,33,lstr,string,mldr,ierr,ldr,datrec)
	call PINCH3(wkid,chdnr,istat,ichnr,pet,evol,ldr,datrec)

C Close Workstation
	call PCLWK(wkid)

C Close PHIGS
	call PCLPH

	end

ERRORS

3
Ignoring function, function requires state (PHOP, WSOP,*,*)
54
Ignoring function, the specified workstation is not open
61
Ignoring function, specified workstation is neither of category INPUT nor of category OUTIN
250
Ignoring function, the specified device is not available on the specified workstation
251
Ignoring function, the function requires the input device to be in REQUEST mode
254
Ignoring function, invalid echo area volume: XMIN>=XMAX, YMIN>=YMAX or ZMIN>ZMAX
255
Ignoring function, one of the echo area volume boundary points is outside the range of the device
253
Ignoring function, the specified prompt echo type is not available on the specified workstation
260
Ignoring function, one of the fields within the input device data record is in error
261
Ignoring function, initial value is invalid

SEE ALSO

initialize choice, set choice mode, request choice 3, sample choice 3, get choice 3, inquire choice device state 3, inquire default choice device state 3, inquire number of available logical input devices


Previous Next Up Title Contents General Index Functions Index Bookshelf