2013-09-13 16:38:21 +08:00
|
|
|
//
|
|
|
|
// NewEventDispatcherTest.h
|
|
|
|
// samples
|
|
|
|
//
|
|
|
|
// Created by James Chen on 9/13/13.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef __samples__NewEventDispatcherTest__
|
|
|
|
#define __samples__NewEventDispatcherTest__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
|
|
|
class EventDispatcherTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
class EventDispatcherTestDemo : public BaseTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
void backCallback(Object* sender);
|
|
|
|
void nextCallback(Object* sender);
|
|
|
|
void restartCallback(Object* sender);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class TouchableSpriteTest : public EventDispatcherTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2013-09-16 16:02:48 +08:00
|
|
|
class FixedPriorityTest : public EventDispatcherTestDemo
|
2013-09-16 15:43:48 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2013-09-18 22:23:02 +08:00
|
|
|
class RemoveListenerWhenDispatching : public EventDispatcherTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class CustomEventTest : public EventDispatcherTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() override;
|
|
|
|
virtual std::string subtitle() override;
|
|
|
|
private:
|
2013-09-19 09:14:51 +08:00
|
|
|
CustomEventListener* _listener;
|
2013-09-18 22:23:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class LabelKeyboardEventTest : public EventDispatcherTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() override;
|
|
|
|
virtual std::string subtitle() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteAccelerationEventTest : public EventDispatcherTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter() override;
|
2013-09-18 22:45:48 +08:00
|
|
|
virtual void onExit() override;
|
2013-09-18 22:23:02 +08:00
|
|
|
virtual std::string title() override;
|
|
|
|
virtual std::string subtitle() override;
|
|
|
|
};
|
2013-09-16 15:43:48 +08:00
|
|
|
|
2013-09-13 16:38:21 +08:00
|
|
|
#endif /* defined(__samples__NewEventDispatcherTest__) */
|