floatpump-firmware/Middlewares/floatpump/Src/Menu_Entry.cpp

34 lines
845 B
C++
Raw Normal View History

2023-01-04 12:22:45 +00:00
//
// Created by robtor on 04.01.23.
//
#include "Menu_Entry.h"
namespace floatpump {
namespace menu {
2023-01-06 12:51:07 +00:00
std::string Menu_Entry::printLine() {
//We have 19 characters width for displaying the entry -> fill with spaces
int spaces = 19 - (m_name.length() + m_type->toString().length());
std::string spacer;
spacer.append(spaces, ' ');
return m_name + spacer + m_type->toString();
}
void Menu_Entry::action_press() {
m_type->u_press();
}
void Menu_Entry::action_increase() {
m_type->u_increase(1);
}
void Menu_Entry::action_decrease() {
m_type->u_decrease(1);
}
bool Menu_Entry::isEntered() {
return m_type->isEntered();
}
2023-01-04 12:22:45 +00:00
} // floatpump
} // menu