2
* $Id: radio.h 136 2006-09-22 20:06:05Z hubert@u.washington.edu $
4
* ========================================================================
5
* Copyright 2006 University of Washington
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
11
* http://www.apache.org/licenses/LICENSE-2.0
13
* ========================================================================
16
#ifndef PINE_RADIO_INCLUDED
17
#define PINE_RADIO_INCLUDED
19
#include "../pith/helptext.h"
25
* For optionally_enter and radio_buttons, special meanings for keys.
27
typedef struct esckey {
28
long ch; /* holds all UCS values plus -1 and -2 */
29
int rval; /* return value */
30
char *name; /* short name */
31
char *label; /* long descriptive key name */
36
* Minimum space needed after the prompt for optionally_enter() to work well.
37
* If the available width after the prompt is smaller than this then the prompt will
38
* have the leading edge cut off by optionally_enter.
39
* (note: used to be 5)
41
#define MIN_OPT_ENT_WIDTH (7)
43
/* max length prompt for optionally_enter and want_to */
44
#define MAXPROMPT (ps_global->ttyo->screen_cols - MIN_OPT_ENT_WIDTH)
47
#define SEQ_EXCEPTION (-3) /* returned when seq # change and no
48
on_ctrl_C available. */
49
#define RB_NORM 0x00 /* flags modifying radio_buttons */
50
#define RB_ONE_TRY 0x01 /* one shot answer, else default */
51
#define RB_FLUSH_IN 0x02 /* discard pending input */
52
#define RB_NO_NEWMAIL 0x04 /* Quell new mail check */
53
#define RB_SEQ_SENSITIVE 0x08 /* Sensitive to seq # changes */
54
#define RB_RET_HELP 0x10 /* Return when help key pressed */
57
#define OE_NONE 0x00 /* optionally_enter flags */
58
#define OE_DISALLOW_CANCEL 0x01 /* Turn off Cancel menu item */
59
#define OE_DISALLOW_HELP 0x02 /* Turn off Help menu item */
60
#define OE_USER_MODIFIED 0x08 /* set on return if user input */
61
#define OE_KEEP_TRAILING_SPACE 0x10 /* Allow trailing white-space */
62
#define OE_SEQ_SENSITIVE 0x20 /* Sensitive to seq # changes */
63
#define OE_APPEND_CURRENT 0x40 /* append, don't truncate */
64
#define OE_PASSWD 0x80 /* Don't echo user input */
66
#define WT_NORM 0x00 /* flags modifying want_to */
67
#define WT_FLUSH_IN 0x01 /* discard pending input */
68
#define WT_SEQ_SENSITIVE 0x02 /* Sensitive to seq # changes */
71
/* exported protoypes */
72
int want_to(char *, int, int, HelpType, int);
73
int one_try_want_to(char *, int, int, HelpType, int);
74
int radio_buttons(char *, int, ESCKEY_S *, int, int, HelpType, int);
75
int double_radio_buttons(char *, int, ESCKEY_S *, int, int, HelpType, int);
79
#endif /* PINE_RADIO_INCLUDED */