转自微雪课堂:微雪课堂
Screen1View.hpp
#ifndef SCREEN1VIEW_HPP
#define SCREEN1VIEW_HPP
#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>
#include <gui/screen1_screen/Screen1Presenter.hpp>
class Screen1View : public Screen1ViewBase
{
public:
Screen1View();
virtual ~Screen1View() {}
virtual void setupScreen();
virtual void tearDownScreen();
virtual void Down_function();
virtual void Up_function();
int count=0;
protected:
};
#endif // SCREEN1VIEW_HPP
Screen1View.cpp
#include <gui/screen1_screen/Screen1View.hpp>
Screen1View::Screen1View()
{
}
void Screen1View::setupScreen()
{
Screen1ViewBase::setupScreen();
}
void Screen1View::tearDownScreen()
{
Screen1ViewBase::tearDownScreen();
}
void Screen1View::Down_function()
{
count--;
if (count < 0)
{
count = 100;
}
touchgfx_printf("Count %d
",count);
PWM.setValue(count);//PWM是给那个圆圆的控件起的名字
PWM.invalidate();
}
void Screen1View::Up_function()
{
count++;
if (count > 100)
{
count = 0;
}
touchgfx_printf("Count %d
",count);
PWM.setValue(count);
PWM.invalidate();
}