VG3_input_select()
Show an menu-box for selecting an element.SYNTAX
int
VG3_input_select(struct vg3_window *wstruct,
int fcolor,
int bcolor,
const char *text,
char **felem,
int onleft)
FUNCTION PARAMETERS
wstruct | Window-struct |
fcolor | Foreground color (from VGAG3_COLORS or VGAG3_COLOR_CUSTOM) |
bcolor | Background color (from VGAG3_COLORS or VGAG3_COLOR_CUSTOM) |
text | Title text |
felem | A null-terminates field of strings for selection |
onleft | Left orientated instead of centered elements |
RETURN VALUE
Returns integer:
- >=1: OK - number of selected element
- 0: No selection because of pressing escape-key
- -1: failure
- -2: Got request for closing the window and exiting the game
ERRORS
On error VG3_errmsg() returns:
EINVAL - error in argument
ENOSYS - cannot create image
ENOMEM - cannot get memory
DESCRIPTION
Show an menu-box on top of the actual window,
in which the passed elements of strings are shown for selection.
Pressing the return-key selects the current highlighted element
returning the element-number,
pressing the escape-key discards selecting and returns 0.
Navigate with the cursor-keys cursor-up and cursor-down.
The current background image will be dimmed out and used as background for the box.
The background color bcolor may be VGAG3_COLOR_TRANSPARENT.
A deactivated element may be passed by prepending an exklamation mark (!),
e.g. "!Not selectable".
This element will be shown in a grey color, but cannot be selected.
SEE ALSO