mirror of https://github.com/axmolengine/axmol.git
Remove hard codes
This commit is contained in:
parent
4c9fb311da
commit
a9a1e7cb2f
|
@ -264,12 +264,12 @@ static void editBoxCallbackFunc(const char* pText, void* ctx)
|
||||||
CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox);
|
CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox);
|
||||||
ScriptEvent event(kCommonEvent,(void*)&data);
|
ScriptEvent event(kCommonEvent,(void*)&data);
|
||||||
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
memset(data.eventName,0,64*sizeof(char));
|
memset(data.eventName, 0, sizeof(data.eventName));
|
||||||
strncpy(data.eventName,"ended",64);
|
strncpy(data.eventName, "ended", sizeof(data.eventName));
|
||||||
event.data = (void*)&data;
|
event.data = (void*)&data;
|
||||||
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
memset(data.eventName,0,64*sizeof(char));
|
memset(data.eventName, 0, sizeof(data.eventName));
|
||||||
strncpy(data.eventName,"return",64);
|
strncpy(data.eventName, "return", sizeof(data.eventName));
|
||||||
event.data = (void*)&data;
|
event.data = (void*)&data;
|
||||||
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,8 +196,8 @@ static const int CC_EDIT_BOX_PADDING = 5;
|
||||||
cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox);
|
cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox);
|
||||||
cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);
|
cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);
|
||||||
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
memset(data.eventName,0,64*sizeof(char));
|
memset(data.eventName, 0, sizeof(data.eventName));
|
||||||
strncpy(data.eventName,"return",64);
|
strncpy(data.eventName, "return", sizeof(data.eventName));
|
||||||
event.data = (void*)&data;
|
event.data = (void*)&data;
|
||||||
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,8 +187,8 @@
|
||||||
cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox);
|
cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox);
|
||||||
cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);
|
cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);
|
||||||
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
memset(data.eventName,0,64*sizeof(char));
|
memset(data.eventName, 0, sizeof(data.eventName));
|
||||||
strncpy(data.eventName,"return",64);
|
strncpy(data.eventName, "return", sizeof(data.eventName));
|
||||||
event.data = (void*)&data;
|
event.data = (void*)&data;
|
||||||
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue