Lots of refactoring
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
#define MENU_SEL_RECT_RADIUS 5
|
||||
|
||||
#define MENU_STACK_SIZE 4
|
||||
#define MENU_ITEM_SIZE 10
|
||||
//#define MENU_ITEM_SIZE 10
|
||||
|
||||
typedef struct Menu_s Menu_t;
|
||||
typedef int (*MenuHandler_t)(Menu_t *menu);
|
||||
@@ -73,6 +73,7 @@ typedef enum
|
||||
MENU_ID_FREQUENCIES,
|
||||
MENU_ID_SYSINFO,
|
||||
MENU_ID_LANGUAGE,
|
||||
MENU_ID_FREQUENCY,
|
||||
|
||||
} MenuItemId_t;
|
||||
|
||||
@@ -82,6 +83,7 @@ typedef struct MENU_ITEM_s
|
||||
char text[MENU_MAX_STRING_LENGTH];
|
||||
MenuItemId_t id;
|
||||
int (*handler)(Menu_t *menu);
|
||||
void *data;
|
||||
|
||||
} MenuItem_t;
|
||||
|
||||
@@ -98,7 +100,7 @@ struct Menu_s
|
||||
bool init;
|
||||
bool draw;
|
||||
int selected;
|
||||
MenuItem_t items[MENU_ITEM_SIZE];
|
||||
MenuItem_t *items;
|
||||
int itemCount;
|
||||
int displayIndex;
|
||||
int exitCode;
|
||||
|
||||
Reference in New Issue
Block a user