mirror of https://github.com/axmolengine/axmol.git
26 lines
1.2 KiB
C++
26 lines
1.2 KiB
C++
#include "CCControlLoader.h"
|
|
|
|
USING_NS_CC;
|
|
USING_NS_CC_EXT;
|
|
|
|
#define PROPERTY_ENABLED "enabled"
|
|
#define PROPERTY_SELECTED "selected"
|
|
#define PROPERTY_CCCONTROL "ccControl"
|
|
|
|
void CCControlLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
|
|
if(strcmp(pPropertyName, PROPERTY_ENABLED) == 0) {
|
|
((CCControl *)pNode)->setIsEnabled(pCheck);
|
|
} else if(strcmp(pPropertyName, PROPERTY_SELECTED) == 0) {
|
|
((CCControl *)pNode)->setIsSelected(pCheck);
|
|
} else {
|
|
CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
|
|
}
|
|
}
|
|
|
|
void CCControlLoader::onHandlePropTypeBlockCCControl(CCNode * pNode, CCNode * pParent, const char * pPropertyName, BlockCCControlData * pBlockCCControlData, CCBReader * pCCBReader) {
|
|
if(strcmp(pPropertyName, PROPERTY_CCCONTROL) == 0) {
|
|
((CCControl *)pNode)->addTargetWithActionForControlEvents(pBlockCCControlData->mTarget, pBlockCCControlData->mSELCCControlHandler, pBlockCCControlData->mControlEvents);
|
|
} else {
|
|
CCNodeLoader::onHandlePropTypeBlockCCControl(pNode, pParent, pPropertyName, pBlockCCControlData, pCCBReader);
|
|
}
|
|
} |