Moved all the bobbycar gui code into this library

This commit is contained in:
2021-08-20 13:16:55 +02:00
parent f4b568f055
commit ad0d90339e
47 changed files with 1876 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
#include "changevaluedisplay_bool.h"
// local includes
#include "actions/setvalueaction.h"
#include "actions/backproxyaction.h"
#include "icons/back.h"
namespace espgui {
namespace {
constexpr char TEXT_TRUE[] = "true";
constexpr char TEXT_FALSE[] = "false";
constexpr char TEXT_BACK[] = "Back";
} // namespace
ChangeValueDisplay<bool>::ChangeValueDisplay()
{
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<bool>, StaticText<TEXT_TRUE>>>(true, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<bool>, StaticText<TEXT_FALSE>>>(false, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
}
void ChangeValueDisplay<bool>::start()
{
Base::start();
switch (getValue())
{
case true: setSelectedIndex(0); break;
case false: setSelectedIndex(1); break;
}
}
} // namespace espgui