- Added initial version of Hierarchical Menu
- Beautified the Message Box a bit
This commit is contained in:
70
Firmware/Hierarchical_Menu.h
Normal file
70
Firmware/Hierarchical_Menu.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* File: Hierarchical_Menu.h
|
||||
* Created: Created: Sunday September 2025 07:47:35
|
||||
* Author: Chris
|
||||
*/
|
||||
#ifndef HIERARCHICAL_MENU_H
|
||||
#define HIERARCHICAL_MENU_H
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "Display.h"
|
||||
#include "Display_Objects.h"
|
||||
#include "Display_Objects_Datatypes.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Forward declarations
|
||||
typedef struct Menu_Item_S Menu_Item;
|
||||
typedef struct Menu_List_S Menu_List;
|
||||
typedef struct Hierarchical_Menu_S Hierarchical_Menu;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Datatypes
|
||||
typedef enum {
|
||||
NONE,
|
||||
BOOL,
|
||||
RGB
|
||||
} Variable_Type;
|
||||
|
||||
typedef struct Menu_Item_S {
|
||||
const char* Text;
|
||||
const Menu_List* List;
|
||||
const bool Is_Back;
|
||||
const Menu_List* Containing_List;
|
||||
|
||||
const Variable_Type Type;
|
||||
const char* Variable_Title;
|
||||
const void* Variable;
|
||||
} Menu_Item;
|
||||
|
||||
typedef struct Menu_List_S {
|
||||
const char* Title;
|
||||
const Menu_Item* Items;
|
||||
const uint32_t Item_Count;
|
||||
const Menu_Item* Parent;
|
||||
const Hierarchical_Menu* Root;
|
||||
} Menu_List;
|
||||
|
||||
typedef struct Hierarchical_Menu_S {
|
||||
const Menu_List* List;
|
||||
const void (*Parent_Function)(Screen_Transition_Direction, Screen_Transition_Direction, Easing, uint32_t, int32_t);
|
||||
const int32_t Parent_Selected_Setting;
|
||||
} Hierarchical_Menu;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
|
||||
|
||||
|
||||
#endif // HIERARCHICAL_MENU_H
|
||||
Reference in New Issue
Block a user