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
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(MouseTests);
|
2015-03-04 06:52:55 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class BaseMouseTest : public TestCase
|
2015-03-04 06:52:55 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
|
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
|
|
|
|
2015-04-09 08:37:30 +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:
|
2015-04-09 08:37:30 +08:00
|
|
|
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:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::EventListenerMouse* _lis;
|
2013-10-12 05:35:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|