mirror of
https://github.com/AquaMorph/Droplets.git
synced 2025-04-30 01:35:34 +00:00
Menu item
This commit is contained in:
parent
60945dcfd4
commit
f885af87a1
18
src/main.cpp
18
src/main.cpp
@ -52,14 +52,22 @@ void ProcessControls() {
|
|||||||
|
|
||||||
void ProcessOutputs() {}
|
void ProcessOutputs() {}
|
||||||
|
|
||||||
|
void CreateMenuItem(std::string text, int position, bool highlighted) {
|
||||||
|
char* cstr = &text[0];
|
||||||
|
patch.display.SetCursor(0, (position-1)*10);
|
||||||
|
patch.display.WriteString(cstr, Font_7x10, !highlighted);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessOled() {
|
void ProcessOled() {
|
||||||
patch.display.Fill(false);
|
patch.display.Fill(false);
|
||||||
|
|
||||||
std::string str;
|
CreateMenuItem(std::to_string(selectedMenuItem) + " " +
|
||||||
char* cstr = &str[0];
|
menuItems[selectedMenuItem], 1, false);
|
||||||
patch.display.SetCursor(0,0);
|
CreateMenuItem("Item 2", 2, false);
|
||||||
str = std::to_string(selectedMenuItem) + " " + menuItems[selectedMenuItem];
|
CreateMenuItem("Item 3", 3, false);
|
||||||
patch.display.WriteString(cstr, Font_7x10, true);
|
CreateMenuItem("Item 4", 4, false);
|
||||||
|
CreateMenuItem("Item 5", 5, false);
|
||||||
|
CreateMenuItem("Item 6", 6, false);
|
||||||
|
|
||||||
patch.display.Update();
|
patch.display.Update();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user