askm_radio()

Purpose

Generates radio buttons on a map. Obsolete from v 4.603 onwards

Syntax

askm_radio(int mapnr, int fieldnr, short *selected,
int low_field, int high_field, int flags);

Parameters

int mapnr

The number of the map to display the radio buttons

 

int fieldnr

The number of the current field

 

short *selected

Pointer to the number of the default selected radio button in the set; the first in the set is 0

 

int low_field

The lowest field number displayed as a radio button

 

int high_field

The highest field number displayed as a radio button

 

int flags

Specifies the display format, acting like the global variable scrn_flags

Description

The function askm_radio() creates a set of radio buttons in a DP4 map.

Each button in the set constitutes a field in the map. The low_field and high_field parameters determine the range of field numbers of the set.

One button must be specified as the default selection using the selected parameter. This is 0 if the lowest field is the default, 1 if the second and so on.

From v 4.603 the askm_radio() function has been discontinued. The terminal manager supports the use of radio-type buttons through its regular input routines, in which each button is assigned a field number.

Return values

None

Example

/*
C Functions Reference Manual
----------------------------
Filename: ASKM_RAD.C
Example: askm_radio
Purpose: Simple data entry using radio buttons
*/

/*
#mapname blob
#db system
#map 1 4 1 map_flags=19
________

| Radio One

| Radio Two

| Radio Three

Enter a name |_
________
#fields 1:select=0,2:select=t,3:select=h;
#end
*/

#include "dp4.h"

short radio = 0; /* Default activated radio button
is first in set */
char name[2];

void process_inner(int m,int *f);
int ask_mradio(int mapnr,int DP4P fieldnr,
short DP4P data,int first,int last,
int scrn_flags);

/**/

void process()
{
libtype = 1;
loadmaps("blob");
while (!get_inputs(1,1,process_inner,
CLEAR|PREDISPLAY))
jump = FALSE;
}

/**/

void process_inner(m,f)
int *f;
{
switch (*f)
{
/* First three fields on map are the radio
button set */
case 1:
case 2:
case 3:
/* Solicit input in radio button set */
askm_radio(m,f,&radio,1,3,0);
break;
case 4:
/* Non-radio button field */
inpm_cnp(name);
break;
default:
skip();
break;
}
}