void pinit_choice3 (ws_id, choice_dev, init_status, init_choice, pet, echo_volume, choice_data_rec)
Pint ws_id, Pint choice_dev, Pin_status init_status, Pint init_choice, Pint pet, const Plimit3 *echo_volume, const Pchoice_data3 *choice_data_rec
typedef enum {
PIN_STATUS_NONE,
PIN_STATUS_OK,
PIN_STATUS_NO_IN
} Pin_status;
typedef struct {
Pfloat x_min; /* minimum x */
Pfloat x_max; /* maximum x */
Pfloat y_min; /* minimum y */
Pfloat y_max; /* maximum y */
Pfloat z_min; /* minimum z */
Pfloat z_max; /* maximum z */
} Plimit3;
typedef struct {
union Pchoice3_pets {
struct Pchoice3_pet_r1 {
Pint num_prompts; /* number of prompts */
Ppr_switch prompts[P_NBCHOICE-1];
char *strings[P_NBCHOICE];
} pet_r1;
struct Pchoice3_pet_r2 {
Pint num_prompts; /* number of prompts */
char *prompts; /* array of prompts */
} pet_r2;
struct Pchoice3_pet_r3 {
Pint num_strings; /* number of choice strings */
char **strings; /* array of choice strings */
} pet_r3;
struct Pchoice3_pet_r4 {
Pint num_strings; /* number of choice strings */
char **strings; /* array of choice strings */
} pet_r4;
struct Pchoice3_pet_r5 {
Pint struct_id; /* structure identifier */
Pint struct_id; /* number of pick identifiers */
Pint *pick_ids; /* array of pick identifiers */
} pet_r5;
} pets;
} Pchoice_data3;
typedef enum {
PPR_OFF,
PPR_ON
} Ppr_switch;
The following devices are available:
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 echo type 1, -1, 4 and -4 the following fields of Pchoice_data structure are to be initialized:
/* Sample program for choice initialization */
#include <phigs.h>
main()
{
int i;
Pint ws_id,choice_dev,init_choice,pet;
Pin_status init_status;
Plimit echo_area;
Pchoice_data choice_data_rec;
static char *strings[5] =
{"Choice1","Choice2","Choice3","Choice4","Choice5"};
/* Open PHIGS session */
popen_phigs(PDEF_ERR_FILE,PDEF_MEM_SIZE);
/* Open workstation */
ws_id = 1;
popen_ws(ws_id,"/dev/tty",8887);
/* Initialize choice device number 41 with pet -4 */
init_status = PIN_STATUS_NONE;
init_choice = 0;
echo_area.y_min = 0.5;
echo_area.y_max = 1.0;
echo_area.x_min = 0.0;
echo_area.x_max = 0.1;
choice_dev = 41;
pet = -4;
choice_data_rec.pets.pet_r1.num_prompts = 32;
for (i = 0;i < 3;i++) {
choice_data_rec.pets.pet_r1.prompts[i] = PPR_ON;
choice_data_rec.pets.pet_r1.strings[i] = strings[i];
}
for (i = 3;i < 5;i++) {
choice_data_rec.pets.pet_r1.prompts[i] = PPR_ACT;
choice_data_rec.pets.pet_r1.strings[i] = strings[i];
for (i = 5;i < 32;i++) {
choice_data_rec.pets.pet_r1.prompts[i] = PPR_OFF;
}
choice_data_rec.pets.pet_r1.strings[32] = "@Echo4";
pinit_choice(ws_id,choice_dev,init_status,init_choice,
pet,&echo_area,&choice_data_rec);
/* Close workstation */
pclose_ws(ws_id);
/* Close PHIGS */
pclose_phigs();
}