Files
RP2350_MIDI_Lighter/Firmware/Screens_Display/Screen_Mode.c
Chris c8f14373d3 - Added initial version of Hierarchical Menu
- Beautified the Message Box a bit
2025-09-19 15:21:15 +02:00

134 lines
4.9 KiB
C

/*
* File: Screen_Mode.c
*
* Created: Created: Tuesday September 2025 19:44:30
* Author: Chris
*/
// ============================================================================================
// Includes
#include "../Screens.h"
#include "../UI_Control.h"
#include "../Display_Default_Configurations.h"
#include "../Display.h"
#include "../Display_Objects.h"
// ============================================================================================
// Defines
// ============================================================================================
// Variables
// ============================================================================================
// Function Declarations
void Screen_Setup_Mode(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
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);
static void Screen_Action_CW (Object_ID object_id);
static void Screen_Action_CCW (Object_ID object_id);
static void Screen_On_Object_Focused (Object_ID object_id);
static void Screen_On_Object_Defocused (Object_ID object_id);
static void Screen_On_Object_Select (Object_ID object_id);
static void Screen_On_Object_Deselect (Object_ID object_id);
/*******************************************************************
Functions
*******************************************************************/
void Screen_Setup_Mode(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
{
Screen_Init(direction_out, direction_in, type, frame_duration);
}
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;
_Screen_Action_CCW = Screen_Action_CCW;
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
_Screen_On_Object_Select = Screen_On_Object_Select;
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
Display_Objects_Clear();
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
//////////////////////////////
// Add Display Objects here //
//////////////////////////////
Display_Objects_Add_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_RED, 80, 80, 1, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN, 80, 80, 10, 4, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN, 100, 100, 15, 1, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN, 80, 80, 5, 1, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN , 80, 80, 10, 1, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_BLUE , 60, 60, 5, 1, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Circle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_BLUE, 40, 5, NO_STYLE, NO_ANIMATION);
Display_Objects_Add_Circle_Filled(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_BLUE, 40, NO_STYLE, NO_ANIMATION);
// Display_Objects_Add_Circle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_ORANGE, 40, 1, NO_STYLE, NO_ANIMATION);
Display_Select_Object();
}
void Screen_Tick(void)
{
}
void Screen_Click(uint button_return_value)
{
}
void Screen_Touch_Event(int16_t x, int16_t y)
{
}
void Screen_Action_CW(Object_ID object_id)
{
}
void Screen_Action_CCW(Object_ID object_id)
{
}
void Screen_On_Object_Focused(Object_ID object_id)
{
}
void Screen_On_Object_Defocused(Object_ID object_id)
{
}
void Screen_On_Object_Select(Object_ID object_id)
{
}
void Screen_On_Object_Deselect(Object_ID object_id)
{
Screen_Setup_Menu_Main(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, false, 3);
}
/*******************************************************************
Internal Functions
*******************************************************************/