[Menu] Add captions and seperators
Additionally, skip selection of them to retain flow and maintain auto scroll.
This commit is contained in:
19
ipl/tui.h
19
ipl/tui.h
@@ -20,16 +20,19 @@
|
||||
#include "types.h"
|
||||
#include "gfx.h"
|
||||
|
||||
#define MENT_END 0
|
||||
#define MENT_END 0
|
||||
#define MENT_HANDLER 1
|
||||
#define MENT_MENU 2
|
||||
#define MENT_CHOICE 3
|
||||
#define MENT_BACK 4
|
||||
#define MENT_MENU 2
|
||||
#define MENT_CHOICE 3
|
||||
#define MENT_BACK 4
|
||||
#define MENT_CAPTION 5
|
||||
#define MENT_CHGLINE 6
|
||||
|
||||
typedef struct _ment_t
|
||||
{
|
||||
u32 type;
|
||||
const char *caption;
|
||||
u32 color;
|
||||
void *data;
|
||||
union
|
||||
{
|
||||
@@ -47,10 +50,12 @@ typedef struct _menu_t
|
||||
} menu_t;
|
||||
|
||||
#define MDEF_END() {MENT_END}
|
||||
#define MDEF_HANDLER(caption, _handler) { MENT_HANDLER, caption, NULL, { .handler = _handler } }
|
||||
#define MDEF_HANDLER_EX(caption, data, _handler) { MENT_HANDLER, caption, data, { .handler = _handler } }
|
||||
#define MDEF_MENU(caption, _menu) { MENT_MENU, caption, NULL, { .menu = _menu } }
|
||||
#define MDEF_HANDLER(caption, _handler) { MENT_HANDLER, caption, 0, NULL, { .handler = _handler } }
|
||||
#define MDEF_HANDLER_EX(caption, data, _handler) { MENT_HANDLER, caption, 0, data, { .handler = _handler } }
|
||||
#define MDEF_MENU(caption, _menu) { MENT_MENU, caption, 0, NULL, { .menu = _menu } }
|
||||
#define MDEF_BACK() { MENT_BACK, "Back" }
|
||||
#define MDEF_CAPTION(caption, color) { MENT_CAPTION, caption, color }
|
||||
#define MDEF_CHGLINE() {MENT_CHGLINE}
|
||||
|
||||
void tui_pbar(gfx_con_t *con, int x, int y, u32 val);
|
||||
void *tui_do_menu(gfx_con_t *con, menu_t *menu);
|
||||
|
||||
Reference in New Issue
Block a user