More button improvements
This commit is contained in:
+26
-4
@@ -1,11 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "display.h"
|
||||
#include "textinterface.h"
|
||||
#include "widgets/label.h"
|
||||
#include "widgets/graph.h"
|
||||
#include "confirminterface.h"
|
||||
#include "backinterface.h"
|
||||
|
||||
namespace espgui {
|
||||
|
||||
template<std::size_t COUNT>
|
||||
class TopGraphAccessorInterface
|
||||
{
|
||||
@@ -42,15 +46,19 @@ public:
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
class SplitGraphDisplay :
|
||||
public Display,
|
||||
public virtual TextInterface,
|
||||
public virtual TopGraphAccessorInterface<COUNT0>,
|
||||
public virtual BottomGraphAccessorInterface<COUNT1>
|
||||
public Display,
|
||||
public virtual TextInterface,
|
||||
public virtual TopGraphAccessorInterface<COUNT0>,
|
||||
public virtual BottomGraphAccessorInterface<COUNT1>,
|
||||
public virtual ConfirmInterface,
|
||||
public virtual BackInterface
|
||||
{
|
||||
public:
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(Button button) override;
|
||||
|
||||
private:
|
||||
Label m_titleLabel{5, 5}; // 230, 25
|
||||
|
||||
@@ -80,4 +88,18 @@ void SplitGraphDisplay<COUNT0, COUNT1>::redraw()
|
||||
m_graph0.redraw(static_cast<const TopGraphAccessorInterface<COUNT0>&>(*this).getTopBuffers());
|
||||
m_graph1.redraw(static_cast<const BottomGraphAccessorInterface<COUNT1>&>(*this).getBottomBuffers());
|
||||
}
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
void SplitGraphDisplay<COUNT0, COUNT1>::buttonPressed(Button button)
|
||||
{
|
||||
//Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
case Button::Left: back(); break;
|
||||
case Button::Right: confirm(); break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace espgui
|
||||
|
||||
Reference in New Issue
Block a user