OMOTE/Platformio/OmoteUI/core/UIElementIds.hpp
Matthew Colvin 1cc65594a9 Added concept of Background Screen that allows for construction of pages before knowing the final parent.
This will allow for easy creation of "pages" that can be layed out internally and passed to different screens and cleaned up when screens are cleaned up by the screen manager

add set width and height to base elements that allow for easy resizing

Create a settings page and make it red.
Test adding 2 tabs with the Page

this currently does not do anything fantastic on simulator but it sets a strong foundation for managing multiple pages
2023-09-22 19:59:24 -05:00

34 lines
No EOL
687 B
C++

#pragma once
namespace UI {
class ID {
public:
static constexpr auto INVALID = 0;
enum class Screens {
Background = static_cast<int>(INVALID) + 1,
Home,
INVALID_SCREEN_ID
};
enum class Widgets {
Slider = static_cast<int>(Screens::INVALID_SCREEN_ID) + 1,
INVALID_WIDGET_ID
};
enum class Pages {
Settings = static_cast<int>(Widgets::INVALID_WIDGET_ID) + 1,
INVALID_PAGE_ID
};
ID() : mId(INVALID){};
ID(ID::Screens aScreenId) : mId(static_cast<int>(aScreenId)){};
ID(ID::Widgets aWidgetId) : mId(static_cast<int>(aWidgetId)){};
ID(ID::Pages aPageId) : mId(static_cast<int>(aPageId)){};
private:
const int mId;
};
} // namespace UI