- Added initial version of Hierarchical Menu

- Beautified the Message Box a bit
This commit is contained in:
2025-09-19 15:21:15 +02:00
parent 097a50f073
commit c8f14373d3
36 changed files with 2998 additions and 1973 deletions

View File

@@ -9,10 +9,10 @@
// Includes
#include "../Screens.h"
#include "../UI_Control.h"
#include "../Display_Default_Configurations.h"
#include "../Display.h"
#include "../Display_Objects.h"
#include "../Display_Default_Configurations.h"
// ============================================================================================
@@ -58,11 +58,14 @@ static Configuration_Menu_Icon_Row _Configuration_Menu_Icon_Row = {
static int32_t _Selected_Item;
extern const Hierarchical_Menu _Hierarchical_Menu_MIDI;
// ============================================================================================
// Function Declarations
void Screen_Setup_Settings(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, int32_t selected_item);
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
static void Screen_Tick (void);
static void Screen_Click (uint button_return_value);
static void Screen_Touch_Event (int16_t x, int16_t y);
@@ -80,7 +83,15 @@ static void Screen_On_Object_Deselect (Object_ID object_id);
*******************************************************************/
void Screen_Setup_Settings(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, int32_t selected_item)
{
_Screen_Tick = Screen_Tick;
Screen_Init(direction_out, direction_in, type, frame_duration);
_Selected_Item = selected_item;
}
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
{
_Screen_Last = Screen_Init;
_Screen_Tick = Screen_Tick;
_Screen_Click = Screen_Click;
_Screen_Touch_Event = Screen_Touch_Event;
_Screen_Action_CW = Screen_Action_CW;
@@ -94,9 +105,7 @@ void Screen_Setup_Settings(Screen_Transition_Direction direction_out, Screen_Tra
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
//////////////////////////////
//////////////////////////////
// Add Display Objects here //
//////////////////////////////
@@ -107,11 +116,8 @@ void Screen_Setup_Settings(Screen_Transition_Direction direction_out, Screen_Tra
Display_Objects_Add_Text(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, 45, NOT_SELECTABLE, "Settings", Font_Title, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
Display_Objects_Add_Rectangle_Filled(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_FROM_RGB888(32, 32, 32), DISPLAY_WIDTH, 85, NO_STYLE, NO_ANIMATION);
_Object_Menu = Display_Objects_Add_Menu_Icon_Row(_Icon_Row_Items, MENU_ENTRY_COUNT, &_Selected_Item, &_Configuration_Menu_Icon_Row);
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_FROM_RGB888(255, 223, 0), 70, 70, 21, 4, NO_STYLE, NO_ANIMATION);
_Selected_Item = selected_item;
Display_Select_First_Object();
Display_Select_First_Object();
Display_Select_Object();
}
@@ -159,7 +165,8 @@ void Screen_On_Object_Deselect(Object_ID object_id)
{
switch (_Selected_Item)
{
case 0: Screen_Setup_Settings_MIDI(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, 0); break;
// case 0: Screen_Setup_Settings_MIDI(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, 0); break;
case 0: Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, &_Hierarchical_Menu_MIDI, _Hierarchical_Menu_MIDI.List, 0); break;
case 1: break;
case 2: break;
case 3: break;