axmol/tests/cpp-tests/Classes/InputTest/MouseTest.h

51 lines
1.0 KiB
C
Raw Normal View History

2013-10-12 05:35:38 +08:00
#ifndef __MOUSE_TEST_H_
#define __MOUSE_TEST_H_
#include "cocos2d.h"
2015-03-04 06:52:55 +08:00
#include "../BaseTest.h"
2013-10-12 05:35:38 +08:00
DEFINE_TEST_SUITE(MouseTests);
2015-03-04 06:52:55 +08:00
class BaseMouseTest : public TestCase
2015-03-04 06:52:55 +08:00
{
public:
2015-03-04 06:52:55 +08:00
};
class MouseEventTest : public BaseMouseTest
{
public:
CREATE_FUNC(MouseEventTest);
MouseEventTest();
~MouseEventTest();
2013-10-12 05:35:38 +08:00
void onMouseDown(cocos2d::Event* event);
void onMouseUp(cocos2d::Event* event);
void onMouseMove(cocos2d::Event* event);
void onMouseScroll(cocos2d::Event* event);
2015-03-04 06:52:55 +08:00
virtual std::string title() const override;
virtual std::string subtitle() const override;
2013-10-12 05:35:38 +08:00
private:
cocos2d::Label* _labelAction;
cocos2d::Label* _labelPosition;
cocos2d::EventListenerMouse* _mouseListener;
2013-10-12 05:35:38 +08:00
};
2015-03-04 06:52:55 +08:00
class HideMouseTest : public BaseMouseTest
2013-10-12 05:35:38 +08:00
{
public:
2015-03-04 06:52:55 +08:00
CREATE_FUNC(HideMouseTest);
HideMouseTest();
~HideMouseTest();
virtual std::string title() const override;
virtual std::string subtitle() const override;
private:
cocos2d::EventListenerMouse* _lis;
2013-10-12 05:35:38 +08:00
};
#endif