34 lines
839 B
C++
34 lines
839 B
C++
//
|
|
// Created by robtor on 04.01.23.
|
|
//
|
|
|
|
#include "Menu_Entry.h"
|
|
|
|
namespace floatpump {
|
|
namespace menu {
|
|
|
|
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();
|
|
}
|
|
} // floatpump
|
|
} // menu
|