#include <menu_input.h>
Public Member Functions | |
| void | setup (const char *keys, const char *const *words, int count, int col, int row) |
| void | reset () |
| bool | hasChoice () const |
| const char * | word () const |
| int | index () const |
| char | key () const |
| bool | handleKey (const KeypressMessage &msg) |
| void | draw (GfxSurface &s, bool active) const |
A menu prompt. Pressing one of the option keys only echoes the matching word; it then has to be confirmed with Enter, or taken back with Backspace or Left. Anything else is rejected with a beep.
| void Ultima::Ultima3::Views::MenuChoice::setup | ( | const char * | keys, |
| const char *const * | words, | ||
| int | count, | ||
| int | col, | ||
| int | row | ||
| ) |
Sets up the prompt. The word at each index is echoed for the key at the same index; the Escape key is represented in the keys by 0x1B
|
inline |
Returns true if a choice has been echoed and is awaiting confirmation
|
inline |
Returns the word of the option currently echoed
|
inline |
Returns the number of the option currently echoed
|
inline |
Returns the key of the choice made
| bool Ultima::Ultima3::Views::MenuChoice::handleKey | ( | const KeypressMessage & | msg | ) |
Handles a keypress, returning true once a choice has been confirmed
| void Ultima::Ultima3::Views::MenuChoice::draw | ( | GfxSurface & | s, |
| bool | active | ||
| ) | const |
Draws the echoed word, and the cursor if the prompt is still active