Moved all the bobbycar gui code into this library
This commit is contained in:
1 parent
f4b568f055
commit
ad0d90339e
47 files changed
+1876
-1
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "actioninterface.h"
|
||||
|
||||
namespace espgui {
|
||||
class BackProxyAction : public virtual ActionInterface
|
||||
{
|
||||
public:
|
||||
BackProxyAction(BackInterface &backInterface) :
|
||||
m_backInterface{backInterface}
|
||||
{
|
||||
}
|
||||
|
||||
void triggered() override
|
||||
{
|
||||
m_backInterface.back();
|
||||
}
|
||||
|
||||
private:
|
||||
BackInterface &m_backInterface;
|
||||
};
|
||||
} // namespace espgui
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "actioninterface.h"
|
||||
|
||||
namespace espgui {
|
||||
class DummyAction : public virtual ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override {}
|
||||
};
|
||||
} // namespace espgui
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "actioninterface.h"
|
||||
#include "accessorinterface.h"
|
||||
|
||||
namespace espgui {
|
||||
template<typename T>
|
||||
class SetValueAction : public virtual ActionInterface
|
||||
{
|
||||
public:
|
||||
SetValueAction(T value, AccessorInterface<T> &accessorInterface, BackInterface &backInterface) :
|
||||
m_value{value},
|
||||
m_accessorInterface{accessorInterface},
|
||||
m_backInterface{backInterface}
|
||||
{
|
||||
}
|
||||
|
||||
void triggered() override
|
||||
{
|
||||
m_accessorInterface.setValue(m_value);
|
||||
}
|
||||
|
||||
T value() const { return m_value; }
|
||||
|
||||
private:
|
||||
const T m_value;
|
||||
AccessorInterface<T> &m_accessorInterface;
|
||||
BackInterface &m_backInterface;
|
||||
};
|
||||
} // namespace espgui
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "actioninterface.h"
|
||||
|
||||
namespace espgui {
|
||||
template<typename Tscreen, typename ...Targs>
|
||||
class SwitchScreenAction : public virtual ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override { switchScreen<Tscreen>(std::make_unique<Targs>()...); }
|
||||
};
|
||||
} // namespace espgui
|
||||
Reference in new issue
Block a user