diff --git a/cocos2dx/extensions/CCBReader/CCBFileLoader.h b/cocos2dx/extensions/CCBReader/CCBFileLoader.h index 5e644d65d6..0870451dd9 100644 --- a/cocos2dx/extensions/CCBReader/CCBFileLoader.h +++ b/cocos2dx/extensions/CCBReader/CCBFileLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCBFileLoader : public CCNodeLoader { +class CC_DLL CCBFileLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCBFileLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCBMemberVariableAssigner.h b/cocos2dx/extensions/CCBReader/CCBMemberVariableAssigner.h index 0ddc70f0bf..78658e5582 100644 --- a/cocos2dx/extensions/CCBReader/CCBMemberVariableAssigner.h +++ b/cocos2dx/extensions/CCBReader/CCBMemberVariableAssigner.h @@ -5,7 +5,7 @@ NS_CC_EXT_BEGIN -class CCBMemberVariableAssigner { +class CC_DLL CCBMemberVariableAssigner { public: virtual bool onAssignCCBMemberVariable(CCObject * pTarget, const char * pMemberVariableName, CCNode * pNode) = 0; }; diff --git a/cocos2dx/extensions/CCBReader/CCBReader.cpp b/cocos2dx/extensions/CCBReader/CCBReader.cpp index 7f8ce3a891..bb9300a668 100644 --- a/cocos2dx/extensions/CCBReader/CCBReader.cpp +++ b/cocos2dx/extensions/CCBReader/CCBReader.cpp @@ -92,12 +92,15 @@ CCNode * CCBReader::readNodeGraphFromFile(const char * pCCBRootPath, const char CCNode * CCBReader::readNodeGraphFromFile(const char * pCCBRootPath, const char * pCCBFileName, CCObject * pOwner, CCSize pRootContainerSize) { this->mCCBRootPath = pCCBRootPath; - char ccbFullFilePath[strlen(pCCBRootPath) + strlen(pCCBFileName) + 1]; + char* ccbFullFilePath = (char*)malloc(strlen(pCCBRootPath) + strlen(pCCBFileName) + 1); + strcpy(ccbFullFilePath, pCCBRootPath); strcat(ccbFullFilePath, pCCBFileName); const char * path = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(ccbFullFilePath); + CC_SAFE_FREE(ccbFullFilePath); + unsigned long size = 0; this->mBytes = CCFileUtils::sharedFileUtils()->getFileData(path, "rb", &size); diff --git a/cocos2dx/extensions/CCBReader/CCBSelectorResolver.h b/cocos2dx/extensions/CCBReader/CCBSelectorResolver.h index a29faec091..ff67a84054 100644 --- a/cocos2dx/extensions/CCBReader/CCBSelectorResolver.h +++ b/cocos2dx/extensions/CCBReader/CCBSelectorResolver.h @@ -5,7 +5,7 @@ NS_CC_EXT_BEGIN -class CCBSelectorResolver { +class CC_DLL CCBSelectorResolver { public: virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuSelector(CCObject * pTarget, const char * pSelectorName) = 0; virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, const char * pSelectorName) = 0; diff --git a/cocos2dx/extensions/CCBReader/CCControlButtonLoader.h b/cocos2dx/extensions/CCBReader/CCControlButtonLoader.h index 91ca8c00d3..7baea69fb7 100644 --- a/cocos2dx/extensions/CCBReader/CCControlButtonLoader.h +++ b/cocos2dx/extensions/CCBReader/CCControlButtonLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCControlButtonLoader : public CCControlLoader { +class CC_DLL CCControlButtonLoader : public CCControlLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCControlButtonLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCControlLoader.h b/cocos2dx/extensions/CCBReader/CCControlLoader.h index 4638cf5ac4..07bb23c23e 100644 --- a/cocos2dx/extensions/CCBReader/CCControlLoader.h +++ b/cocos2dx/extensions/CCBReader/CCControlLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCControlLoader : public CCNodeLoader { +class CC_DLL CCControlLoader : public CCNodeLoader { protected: virtual CCControl * createCCNode(CCNode *, CCBReader *) = 0; diff --git a/cocos2dx/extensions/CCBReader/CCLabelBMFontLoader.h b/cocos2dx/extensions/CCBReader/CCLabelBMFontLoader.h index 582b11beb5..659ff28ca9 100644 --- a/cocos2dx/extensions/CCBReader/CCLabelBMFontLoader.h +++ b/cocos2dx/extensions/CCBReader/CCLabelBMFontLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCLabelBMFontLoader : public CCNodeLoader { +class CC_DLL CCLabelBMFontLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLabelBMFontLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCLabelTTFLoader.h b/cocos2dx/extensions/CCBReader/CCLabelTTFLoader.h index 04ee0bc641..aa406d7cb4 100644 --- a/cocos2dx/extensions/CCBReader/CCLabelTTFLoader.h +++ b/cocos2dx/extensions/CCBReader/CCLabelTTFLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCLabelTTFLoader : public CCNodeLoader { +class CC_DLL CCLabelTTFLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLabelTTFLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCLayerColorLoader.h b/cocos2dx/extensions/CCBReader/CCLayerColorLoader.h index 8efd9d872a..ce5d36ae4f 100644 --- a/cocos2dx/extensions/CCBReader/CCLayerColorLoader.h +++ b/cocos2dx/extensions/CCBReader/CCLayerColorLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCLayerColorLoader : public CCLayerLoader { +class CC_DLL CCLayerColorLoader : public CCLayerLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerColorLoader, loader); protected: diff --git a/cocos2dx/extensions/CCBReader/CCLayerGradientLoader.h b/cocos2dx/extensions/CCBReader/CCLayerGradientLoader.h index f515a312dc..78d2033e2c 100644 --- a/cocos2dx/extensions/CCBReader/CCLayerGradientLoader.h +++ b/cocos2dx/extensions/CCBReader/CCLayerGradientLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCLayerGradientLoader : public CCLayerLoader { +class CC_DLL CCLayerGradientLoader : public CCLayerLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerGradientLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCLayerLoader.h b/cocos2dx/extensions/CCBReader/CCLayerLoader.h index b0277fa95b..49ffa9b095 100644 --- a/cocos2dx/extensions/CCBReader/CCLayerLoader.h +++ b/cocos2dx/extensions/CCBReader/CCLayerLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCLayerLoader : public CCNodeLoader { +class CC_DLL CCLayerLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCMenuItemImageLoader.h b/cocos2dx/extensions/CCBReader/CCMenuItemImageLoader.h index 756474d880..e452726302 100644 --- a/cocos2dx/extensions/CCBReader/CCMenuItemImageLoader.h +++ b/cocos2dx/extensions/CCBReader/CCMenuItemImageLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCMenuItemImageLoader : public CCMenuItemLoader { +class CC_DLL CCMenuItemImageLoader : public CCMenuItemLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCMenuItemImageLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCMenuItemLoader.h b/cocos2dx/extensions/CCBReader/CCMenuItemLoader.h index e7ff8ff9a5..16030aeba7 100644 --- a/cocos2dx/extensions/CCBReader/CCMenuItemLoader.h +++ b/cocos2dx/extensions/CCBReader/CCMenuItemLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCMenuItemLoader : public CCNodeLoader { +class CC_DLL CCMenuItemLoader : public CCNodeLoader { protected: virtual CCMenuItem * createCCNode(CCNode *, CCBReader *) = 0; diff --git a/cocos2dx/extensions/CCBReader/CCMenuLoader.h b/cocos2dx/extensions/CCBReader/CCMenuLoader.h index 333c781993..c98b43ca35 100644 --- a/cocos2dx/extensions/CCBReader/CCMenuLoader.h +++ b/cocos2dx/extensions/CCBReader/CCMenuLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCMenuLoader : public CCLayerLoader { +class CC_DLL CCMenuLoader : public CCLayerLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCMenuLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCNodeLoaderListener.h b/cocos2dx/extensions/CCBReader/CCNodeLoaderListener.h index 16e1c216f6..a7730c581b 100644 --- a/cocos2dx/extensions/CCBReader/CCNodeLoaderListener.h +++ b/cocos2dx/extensions/CCBReader/CCNodeLoaderListener.h @@ -5,7 +5,7 @@ NS_CC_EXT_BEGIN -class CCNodeLoaderListener { +class CC_DLL CCNodeLoaderListener { public: virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader) = 0; }; diff --git a/cocos2dx/extensions/CCBReader/CCParticleSystemQuadLoader.h b/cocos2dx/extensions/CCBReader/CCParticleSystemQuadLoader.h index c2687b3865..e2c6fdfe68 100644 --- a/cocos2dx/extensions/CCBReader/CCParticleSystemQuadLoader.h +++ b/cocos2dx/extensions/CCBReader/CCParticleSystemQuadLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCParticleSystemQuadLoader : public CCNodeLoader { +class CC_DLL CCParticleSystemQuadLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCParticleSystemQuadLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCScale9SpriteLoader.h b/cocos2dx/extensions/CCBReader/CCScale9SpriteLoader.h index 4dd747f622..0a2bc8a667 100644 --- a/cocos2dx/extensions/CCBReader/CCScale9SpriteLoader.h +++ b/cocos2dx/extensions/CCBReader/CCScale9SpriteLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCScale9SpriteLoader : public CCNodeLoader { +class CC_DLL CCScale9SpriteLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCScale9SpriteLoader, loader); diff --git a/cocos2dx/extensions/CCBReader/CCSpriteLoader.h b/cocos2dx/extensions/CCBReader/CCSpriteLoader.h index 65caa1a007..2e54247a67 100644 --- a/cocos2dx/extensions/CCBReader/CCSpriteLoader.h +++ b/cocos2dx/extensions/CCBReader/CCSpriteLoader.h @@ -8,7 +8,7 @@ NS_CC_EXT_BEGIN /* Forward declaration. */ class CCBReader; -class CCSpriteLoader : public CCNodeLoader { +class CC_DLL CCSpriteLoader : public CCNodeLoader { public: STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCSpriteLoader, loader); diff --git a/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.cpp b/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.cpp index 081c34b551..c0192c43dd 100644 --- a/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.cpp +++ b/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.cpp @@ -130,7 +130,7 @@ void CCControlColourPicker::updateHueAndControlPicker() } -void CCControlColourPicker::hueSliderValueChanged(CCObject * sender) +void CCControlColourPicker::hueSliderValueChanged(CCObject * sender, CCControlEvent controlEvent) { m_hsv.h = ((CCControlHuePicker*)sender)->getHue(); @@ -143,7 +143,7 @@ void CCControlColourPicker::hueSliderValueChanged(CCObject * sender) updateControlPicker(); } -void CCControlColourPicker::colourSliderValueChanged(CCObject * sender) +void CCControlColourPicker::colourSliderValueChanged(CCObject * sender, CCControlEvent controlEvent) { m_hsv.s=((CCControlSaturationBrightnessPicker*)sender)->getSaturation(); m_hsv.v=((CCControlSaturationBrightnessPicker*)sender)->getBrightness(); diff --git a/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.h b/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.h index 66b3cb0eec..60fe18d5ee 100644 --- a/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.h +++ b/cocos2dx/extensions/CCControlExtension/CCControlColourPicker.h @@ -59,8 +59,8 @@ public: virtual bool init(); //virtual ~CCControlColourPicker(); - void hueSliderValueChanged(CCObject * sender); - void colourSliderValueChanged(CCObject * sender); + void hueSliderValueChanged(CCObject * sender, CCControlEvent controlEvent); + void colourSliderValueChanged(CCObject * sender, CCControlEvent controlEvent); protected: void updateControlPicker(); diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos2dx/label_nodes/CCLabelBMFont.cpp index 1f7c681b1e..adc0c48eaf 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.cpp +++ b/cocos2dx/label_nodes/CCLabelBMFont.cpp @@ -718,6 +718,10 @@ void CCLabelBMFont::purgeCachedData() FNTConfigRemoveCache(); } +CCLabelBMFont * CCLabelBMFont::node() { return CCLabelBMFont::create(); } + +CCLabelBMFont * CCLabelBMFont::create() { CCLabelBMFont * pRet = new CCLabelBMFont(); if (pRet && pRet->init()) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; } + CCLabelBMFont *CCLabelBMFont::labelWithString(const char *str, const char *fntFile, float width/* = kCCLabelAutomaticWidth*/, CCTextAlignment alignment/* = kCCTextAlignmentLeft*/, CCPoint imageOffset/* = CCPointZero*/) { return CCLabelBMFont::create(str, fntFile, width, alignment, imageOffset); diff --git a/cocos2dx/label_nodes/CCLabelBMFont.h b/cocos2dx/label_nodes/CCLabelBMFont.h index 0c28322645..b0e0f5eb1d 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.h +++ b/cocos2dx/label_nodes/CCLabelBMFont.h @@ -201,9 +201,14 @@ public: static CCLabelBMFont * create(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointZero); /** Creates an label. + @warning: This interface will be deprecated in future. */ static CCLabelBMFont * node(); + /** Creates an label. + */ + static CCLabelBMFont * create(); + bool init(); /** init a bitmap font altas with an initial string and the FNT file */ bool initWithString(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointZero); diff --git a/cocos2dx/label_nodes/CCLabelTTF.cpp b/cocos2dx/label_nodes/CCLabelTTF.cpp index 3ea6555b0e..0fa03771bd 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.cpp +++ b/cocos2dx/label_nodes/CCLabelTTF.cpp @@ -54,6 +54,11 @@ CCLabelTTF::~CCLabelTTF() } CCLabelTTF * CCLabelTTF::node() +{ + return CCLabelTTF::create(); +} + +CCLabelTTF * CCLabelTTF::create() { CCLabelTTF * pRet = new CCLabelTTF(); if (pRet && pRet->init()) diff --git a/cocos2dx/label_nodes/CCLabelTTF.h b/cocos2dx/label_nodes/CCLabelTTF.h index f5fe5fdd29..27427e1d11 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.h +++ b/cocos2dx/label_nodes/CCLabelTTF.h @@ -90,6 +90,10 @@ public: */ static CCLabelTTF * node(); + /** Creates an label. + */ + static CCLabelTTF * create(); + /** changes the string to render * @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas */ diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 0181b1799a..645d01eaf7 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -252,8 +252,9 @@ public: virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);} virtual bool getIsOpacityModifyRGB(void) { return false;} - LAYER_CREATE_FUNC(CCLayerColor); - + //@warning: This interface will be deprecated in future. + LAYER_CREATE_FUNC(CCLayerColor) + LAYER_NODE_FUNC(CCLayerColor) protected: virtual void updateColor(); }; @@ -317,7 +318,9 @@ public: */ CC_PROPERTY(bool, m_bCompressedInterpolation, IsCompressedInterpolation) - LAYER_CREATE_FUNC(CCLayerGradient); + // @warning: This interface will be deprecated in future. + LAYER_NODE_FUNC(CCLayerGradient) + LAYER_CREATE_FUNC(CCLayerGradient) protected: virtual void updateColor(); }; @@ -372,7 +375,10 @@ public: */ void switchToAndReleaseMe(unsigned int n); - LAYER_CREATE_FUNC(CCLayerMultiplex); + //@warning: This interface will be deprecated in future. + LAYER_NODE_FUNC(CCLayerMultiplex) + + LAYER_CREATE_FUNC(CCLayerMultiplex) }; NS_CC_END diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos2dx/menu_nodes/CCMenuItem.cpp index ce3feec0be..5765cf5bc7 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.cpp +++ b/cocos2dx/menu_nodes/CCMenuItem.cpp @@ -693,8 +693,12 @@ void CCMenuItemSprite::updateImagesVisibility() } } - CCMenuItemImage* CCMenuItemImage::node() +{ + return CCMenuItemImage::create(); +} + +CCMenuItemImage* CCMenuItemImage::create() { CCMenuItemImage *pRet = new CCMenuItemImage(); if (pRet && pRet->init()) diff --git a/cocos2dx/menu_nodes/CCMenuItem.h b/cocos2dx/menu_nodes/CCMenuItem.h index 409d5b0a5f..726e012095 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.h +++ b/cocos2dx/menu_nodes/CCMenuItem.h @@ -339,8 +339,13 @@ public: /** sets the sprite frame for the disabled image */ void setDisabledSpriteFrame(CCSpriteFrame* frame); /** Creates an CCMenuItemImage. + @warning: This interface will be deprecated in future. */ static CCMenuItemImage* node(); + + /** Creates an CCMenuItemImage. + */ + static CCMenuItemImage* create(); }; /** @brief A CCMenuItemToggle diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp index bdbeea51ab..07cab0b9a7 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp @@ -569,7 +569,12 @@ void CCParticleSystemQuad::setBatchNode(CCParticleBatchNode * batchNode) } } -CCParticleSystemQuad * CCParticleSystemQuad::node() { +CCParticleSystemQuad * CCParticleSystemQuad::node() +{ + return CCParticleSystemQuad::create(); +} + +CCParticleSystemQuad * CCParticleSystemQuad::create() { CCParticleSystemQuad *pParticleSystemQuad = new CCParticleSystemQuad(); if (pParticleSystemQuad && pParticleSystemQuad->init()) { diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.h b/cocos2dx/particle_nodes/CCParticleSystemQuad.h index a358f3ae34..cbe8d42fd6 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.h +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.h @@ -101,7 +101,10 @@ public: */ void listenBackToForeground(CCObject *obj); + //@warning: This interface will be deprecated in future. static CCParticleSystemQuad * node(); + + static CCParticleSystemQuad * create(); private: #if CC_TEXTURE_ATLAS_USE_VAO void setupVBOandVAO(); diff --git a/cocos2dx/proj.win32/cocos2d-win32.vcproj b/cocos2dx/proj.win32/cocos2d-win32.vcproj index 96cc4a5e72..7611402e1f 100755 --- a/cocos2dx/proj.win32/cocos2d-win32.vcproj +++ b/cocos2dx/proj.win32/cocos2d-win32.vcproj @@ -1239,11 +1239,19 @@ Name="CCBReader" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/proj.win32/test.win32.vcproj b/tests/proj.win32/test.win32.vcproj index 8bd845e672..3a0a332e6f 100644 --- a/tests/proj.win32/test.win32.vcproj +++ b/tests/proj.win32/test.win32.vcproj @@ -893,6 +893,22 @@ + + + + + + + + @@ -902,11 +918,35 @@ > + + + + + + + + + + + + diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp index 5d72ec032d..9c14505f42 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp @@ -149,42 +149,42 @@ bool CCControlButtonTest_Event::init() return false; } -void CCControlButtonTest_Event::touchDownAction(CCObject *sender) +void CCControlButtonTest_Event::touchDownAction(CCObject *senderz, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Touch Down")->getCString()); } -void CCControlButtonTest_Event::touchDragInsideAction(CCObject *sender) +void CCControlButtonTest_Event::touchDragInsideAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Drag Inside")->getCString()); } -void CCControlButtonTest_Event::touchDragOutsideAction(CCObject *sender) +void CCControlButtonTest_Event::touchDragOutsideAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Drag Outside")->getCString()); } -void CCControlButtonTest_Event::touchDragEnterAction(CCObject *sender) +void CCControlButtonTest_Event::touchDragEnterAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Drag Enter")->getCString()); } -void CCControlButtonTest_Event::touchDragExitAction(CCObject *sender) +void CCControlButtonTest_Event::touchDragExitAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Drag Exit")->getCString()); } -void CCControlButtonTest_Event::touchUpInsideAction(CCObject *sender) +void CCControlButtonTest_Event::touchUpInsideAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Touch Up Inside.")->getCString()); } -void CCControlButtonTest_Event::touchUpOutsideAction(CCObject *sender) +void CCControlButtonTest_Event::touchUpOutsideAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Touch Up Outside.")->getCString()); } -void CCControlButtonTest_Event::touchCancelAction(CCObject *sender) +void CCControlButtonTest_Event::touchCancelAction(CCObject *sender, CCControlEvent controlEvent) { m_pDisplayValueLabel->setString(CCString::createWithFormat("Touch Cancel")->getCString()); } diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h index a9089a1fb4..1b885ecde8 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h @@ -44,14 +44,14 @@ public: CCControlButtonTest_Event(); ~CCControlButtonTest_Event(); bool init(); - void touchDownAction(CCObject *sender); - void touchDragInsideAction(CCObject *sender); - void touchDragOutsideAction(CCObject *sender); - void touchDragEnterAction(CCObject *sender); - void touchDragExitAction(CCObject *sender); - void touchUpInsideAction(CCObject *sender); - void touchUpOutsideAction(CCObject *sender); - void touchCancelAction(CCObject *sender); + void touchDownAction(CCObject *sender, CCControlEvent controlEvent); + void touchDragInsideAction(CCObject *sender, CCControlEvent controlEvent); + void touchDragOutsideAction(CCObject *sender, CCControlEvent controlEvent); + void touchDragEnterAction(CCObject *sender, CCControlEvent controlEvent); + void touchDragExitAction(CCObject *sender, CCControlEvent controlEvent); + void touchUpInsideAction(CCObject *sender, CCControlEvent controlEvent); + void touchUpOutsideAction(CCObject *sender, CCControlEvent controlEvent); + void touchCancelAction(CCObject *sender, CCControlEvent controlEvent); protected: CC_SYNTHESIZE_RETAIN(CCLabelTTF *, m_pDisplayValueLabel, DisplayValueLabel) CONTROL_SCENE_CREATE_FUNC(CCControlButtonTest_Event) diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp index e18e39bd11..3e7f9040c2 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp @@ -75,7 +75,7 @@ bool CCControlColourPickerTest::init() layer->setAnchorPoint(ccp (0.5f, 0.5f)); // Update the color text - colourValueChanged(colourPicker); + colourValueChanged(colourPicker, CCControlEventValueChanged); return true; } return false; @@ -87,7 +87,7 @@ CCControlColourPickerTest::~CCControlColourPickerTest() CC_SAFE_RELEASE(m_pColorLabel); } -void CCControlColourPickerTest::colourValueChanged(CCObject *sender) +void CCControlColourPickerTest::colourValueChanged(CCObject *sender, CCControlEvent controlEvent) { CCControlColourPicker* pPicker = (CCControlColourPicker*)sender; m_pColorLabel->setString(CCString::createWithFormat("#%02X%02X%02X",pPicker->getColorValue().r, pPicker->getColorValue().g, pPicker->getColorValue().b)->getCString()); diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h index 7d60c50343..7e3660d4d8 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h @@ -32,7 +32,7 @@ public: virtual ~CCControlColourPickerTest(); bool init(); /** Callback for the change value. */ - void colourValueChanged(CCObject *sender); + void colourValueChanged(CCObject *sender, CCControlEvent controlEvent); CC_SYNTHESIZE_RETAIN(CCLabelTTF*, m_pColorLabel, ColorLabel) diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp index d7fefb973b..6dd4ff2bef 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp @@ -65,7 +65,7 @@ bool CCControlSliderTest::init() return false; } -void CCControlSliderTest::valueChanged(CCObject *sender) +void CCControlSliderTest::valueChanged(CCObject *sender, CCControlEvent controlEvent) { CCControlSlider* pSlider = (CCControlSlider*)sender; // Change value of label. diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h index 5e7fd7c536..de5242ab47 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h @@ -31,7 +31,7 @@ public: CCControlSliderTest(); virtual ~CCControlSliderTest(); bool init(); - void valueChanged(CCObject *sender); + void valueChanged(CCObject *sender, CCControlEvent controlEvent); protected: CCLabelTTF* m_pDisplayValueLabel; CONTROL_SCENE_CREATE_FUNC(CCControlSliderTest) diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp index 9ebff11d66..d89a88a46d 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp @@ -78,13 +78,13 @@ bool CCControlSwitchTest::init() layer->setAnchorPoint(ccp (0.5f, 0.5f)); // Update the value label - valueChanged(switchControl); + valueChanged(switchControl, CCControlEventValueChanged); return true; } return false; } -void CCControlSwitchTest::valueChanged(CCObject* sender) +void CCControlSwitchTest::valueChanged(CCObject* sender, CCControlEvent controlEvent) { CCControlSwitch* pSwitch = (CCControlSwitch*)sender; if (pSwitch->getIsOn()) diff --git a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h index 6efbc50294..b62a8a0bd7 100644 --- a/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h +++ b/tests/tests/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h @@ -32,7 +32,7 @@ public: virtual ~CCControlSwitchTest(); bool init(); /** Callback for the change value. */ - void valueChanged(CCObject* sender); + void valueChanged(CCObject* sender, CCControlEvent controlEvent); CCLabelTTF *m_pDisplayValueLabel; CONTROL_SCENE_CREATE_FUNC(CCControlSwitchTest) }; diff --git a/tests/tests/SchedulerTest/SchedulerTest.cpp b/tests/tests/SchedulerTest/SchedulerTest.cpp index 8ffc63257c..4e5f4daa66 100644 --- a/tests/tests/SchedulerTest/SchedulerTest.cpp +++ b/tests/tests/SchedulerTest/SchedulerTest.cpp @@ -874,7 +874,7 @@ CCControlSlider* SchedulerTimeScale::sliderCtl() return slider; } -void SchedulerTimeScale::sliderAction(CCObject* pSender) +void SchedulerTimeScale::sliderAction(CCObject* pSender, CCControlEvent controlEvent) { CCControlSlider* pSliderCtl = (CCControlSlider*)pSender; float scale; @@ -966,7 +966,7 @@ CCControlSlider *TwoSchedulers::sliderCtl() return slider; } -void TwoSchedulers::sliderAction(CCObject* sender) +void TwoSchedulers::sliderAction(CCObject* sender, CCControlEvent controlEvent) { float scale; diff --git a/tests/tests/SchedulerTest/SchedulerTest.h b/tests/tests/SchedulerTest/SchedulerTest.h index 0dc4eec257..c18d67f6e0 100644 --- a/tests/tests/SchedulerTest/SchedulerTest.h +++ b/tests/tests/SchedulerTest/SchedulerTest.h @@ -223,7 +223,7 @@ public: virtual std::string title(); virtual std::string subtitle(); CCControlSlider* sliderCtl(); - void sliderAction(CCObject* pSender); + void sliderAction(CCObject* pSender, CCControlEvent controlEvent); CCControlSlider* m_pSliderCtl; }; @@ -236,7 +236,7 @@ public: virtual std::string subtitle(); void onEnter(); CCControlSlider* sliderCtl(); - void sliderAction(CCObject* sender); + void sliderAction(CCObject* sender, CCControlEvent controlEvent); CCScheduler *sched1; CCScheduler *sched2; CCActionManager *actionManager1; diff --git a/tests/tests/ShaderTest/ShaderTest.cpp b/tests/tests/ShaderTest/ShaderTest.cpp index e62db14f94..eb0e8c222b 100644 --- a/tests/tests/ShaderTest/ShaderTest.cpp +++ b/tests/tests/ShaderTest/ShaderTest.cpp @@ -611,7 +611,7 @@ bool ShaderBlur::init() return false; } -void ShaderBlur::sliderAction(CCObject* sender) +void ShaderBlur::sliderAction(CCObject* sender, CCControlEvent controlEvent) { CCControlSlider* pSlider = (CCControlSlider*)sender; m_pBlurSprite->setBlurSize(pSlider->getValue()); diff --git a/tests/tests/ShaderTest/ShaderTest.h b/tests/tests/ShaderTest/ShaderTest.h index f83c03c9db..47bb3a631c 100644 --- a/tests/tests/ShaderTest/ShaderTest.h +++ b/tests/tests/ShaderTest/ShaderTest.h @@ -89,7 +89,7 @@ public: virtual std::string subtitle(); virtual bool init(); CCControlSlider* createSliderCtl(); - void sliderAction(CCObject* sender); + void sliderAction(CCObject* sender, CCControlEvent controlEvent); protected: SpriteBlur* m_pBlurSprite; CCControlSlider* m_pSliderCtl;