2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _MENU_TEST_H_
|
|
|
|
#define _MENU_TEST_H_
|
|
|
|
|
|
|
|
////----#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
|
|
|
|
|
|
|
class MenuLayerMainMenu : public CCLayer
|
|
|
|
{
|
|
|
|
protected:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCMenuItem* _disabledItem;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
MenuLayerMainMenu(void);
|
|
|
|
~MenuLayerMainMenu();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool ccTouchBegan(CCTouch *touch, CCEvent * pEvent);
|
|
|
|
virtual void ccTouchEnded(CCTouch *touch, CCEvent * pEvent);
|
|
|
|
virtual void ccTouchCancelled(CCTouch *touch, CCEvent * pEvent);
|
|
|
|
virtual void ccTouchMoved(CCTouch *touch, CCEvent * pEvent);
|
|
|
|
|
2012-06-08 13:55:28 +08:00
|
|
|
void allowTouches(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
void menuCallback(CCObject* pSender);
|
|
|
|
void menuCallbackConfig(CCObject* pSender);
|
|
|
|
void menuCallbackDisabled(CCObject* pSender);
|
|
|
|
void menuCallback2(CCObject* pSender);
|
|
|
|
void menuCallbackPriorityTest(CCObject* pSender);
|
2012-11-19 13:57:54 +08:00
|
|
|
void menuCallbackBugsTest(CCObject *pSender);
|
2012-04-19 14:35:52 +08:00
|
|
|
void onQuit(CCObject* pSender);
|
2013-01-17 15:04:48 +08:00
|
|
|
void menuMovingCallback(CCObject *pSender);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
//CREATE_NODE(MenuLayer1);
|
|
|
|
};
|
|
|
|
|
|
|
|
class MenuLayer2 : public CCLayer
|
|
|
|
{
|
|
|
|
protected:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCPoint _centeredMenu;
|
|
|
|
bool _alignedH;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
void alignMenusH();
|
|
|
|
void alignMenusV();
|
|
|
|
|
|
|
|
public:
|
|
|
|
MenuLayer2(void);
|
|
|
|
~MenuLayer2();
|
|
|
|
|
|
|
|
public:
|
|
|
|
void menuCallback(CCObject* pSender);
|
|
|
|
void menuCallbackOpacity(CCObject* pSender);
|
|
|
|
void menuCallbackAlign(CCObject* pSender);
|
|
|
|
|
|
|
|
//CREATE_NODE(MenuLayer2);
|
|
|
|
};
|
|
|
|
|
|
|
|
class MenuLayer3 : public CCLayer
|
|
|
|
{
|
|
|
|
protected:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCMenuItem* _disabledItem;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
MenuLayer3(void);
|
|
|
|
~MenuLayer3();
|
|
|
|
|
|
|
|
//CREATE_NODE(MenuLayer3);
|
|
|
|
};
|
|
|
|
|
|
|
|
class MenuLayer4 : public CCLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MenuLayer4(void);
|
|
|
|
~MenuLayer4();
|
|
|
|
|
|
|
|
public:
|
|
|
|
void menuCallback(CCObject* pSender);
|
|
|
|
void backCallback(CCObject* pSender);
|
|
|
|
|
|
|
|
//CREATE_NODE(MenuLayer4);
|
|
|
|
};
|
|
|
|
|
|
|
|
class MenuLayerPriorityTest : public CCLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MenuLayerPriorityTest();
|
|
|
|
~MenuLayerPriorityTest();
|
|
|
|
|
|
|
|
void menuCallback(CCObject* pSender);
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCMenu* _menu1;
|
|
|
|
CCMenu* _menu2;
|
|
|
|
bool _priority;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2012-11-19 13:57:54 +08:00
|
|
|
class BugsTest : public CCLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BugsTest();
|
|
|
|
|
|
|
|
void issue1410MenuCallback(CCObject *pSender);
|
|
|
|
void issue1410v2MenuCallback(CCObject *pSender);
|
|
|
|
void backMenuCallback(CCObject *pSender);
|
|
|
|
};
|
|
|
|
|
2013-01-17 15:04:48 +08:00
|
|
|
class RemoveMenuItemWhenMove : public CCLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RemoveMenuItemWhenMove();
|
|
|
|
~RemoveMenuItemWhenMove();
|
|
|
|
|
|
|
|
virtual void registerWithTouchDispatcher(void);
|
|
|
|
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
|
|
|
|
virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);
|
|
|
|
|
|
|
|
void goBack(CCObject *pSender);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CCMenuItemFont *item;
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
class MenuTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|