Question
GEsture Event not works
My HPP
#ifndef PRINT_PROGRESS_SCREENVIEW_HPP
#define PRINT_PROGRESS_SCREENVIEW_HPP
#include <gui_generated/print_progress_screen_screen/PRINT_PROGRESS_ScreenViewBase.hpp>
#include <gui/print_progress_screen_screen/PRINT_PROGRESS_ScreenPresenter.hpp>
class PRINT_PROGRESS_ScreenView : public PRINT_PROGRESS_ScreenViewBase
{
public:
PRINT_PROGRESS_ScreenView();
virtual ~PRINT_PROGRESS_ScreenView() {}
virtual void setupScreen();
virtual void tearDownScreen();
void handleTickEvent();
virtual void handleClickEvent(const ClickEvent& evt);
virtual void handleGestureEvent(const GestureEvent& evt);
virtual void DRAW_function();
virtual void ScreenEntered_function();
protected:
Callback<PRINT_PROGRESS_ScreenView, const BoxWithBorder&, const ClickEvent&> Box3DClickedCallback;
Callback<PRINT_PROGRESS_ScreenView, const BoxWithBorder&, const GestureEvent&> Box3DGestureCallback;
void Box3DClickHandler(const BoxWithBorder& b, const ClickEvent& e);
void Box3DGestureHandler(const BoxWithBorder& b, const GestureEvent& g);
};
#endif // PRINT_PROGRESS_SCREENVIEW_HPPMy CPP
PRINT_PROGRESS_ScreenView::PRINT_PROGRESS_ScreenView():
Box3DClickedCallback(this, &PRINT_PROGRESS_ScreenView::Box3DClickHandler),
Box3DGestureCallback(this, &PRINT_PROGRESS_ScreenView::Box3DGestureHandler)
{
}
void PRINT_PROGRESS_ScreenView::setupScreen()
{
PRINT_PROGRESS_ScreenViewBase::setupScreen();
Box3D.setClickAction(Box3DClickedCallback);
}
void PRINT_PROGRESS_ScreenView::tearDownScreen()
{
PRINT_PROGRESS_ScreenViewBase::tearDownScreen();
}
.....................................
void PRINT_PROGRESS_ScreenView::Box3DGestureHandler(const BoxWithBorder& b, const GestureEvent& g_evt)
{
if (&b == &Box3D)
{
//Implement what should happen when 'box' is touched/clicked here.
if(g_evt.getType() == GestureEvent::SWIPE_VERTICAL)
{
// Do something with x and y, such as...
// presenter->touchRegistered(x, y); // you write this function in the presenter
}
}
}I try to swipe on Box3D (clickListener is on)
But Box3DGestureHandler - never called....
How to do?
