fix compiling error caused by disable CC_ENABLE_SCRIPT_BINDING

This commit is contained in:
Dhilan007 2014-11-14 15:04:32 +08:00
parent 3bd466ce49
commit ac0fb68989
3 changed files with 10 additions and 8 deletions

View File

@ -690,14 +690,16 @@ void EditBoxImplWin::openKeyboard()
{ {
_delegate->editBoxEditingDidBegin(_editBox); _delegate->editBoxEditingDidBegin(_editBox);
} }
EditBox* pEditBox = this->getEditBox(); #if CC_ENABLE_SCRIPT_BINDING
if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) auto editBox = this->getEditBox();
if (editBox && editBox->getScriptEditBoxHandler())
{ {
CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); CommonScriptData data(editBox->getScriptEditBoxHandler(), "began",editBox);
ScriptEvent event(kCommonEvent,(void*)&data); ScriptEvent event(kCommonEvent,(void*)&data);
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
} }
#endif
std::string placeHolder = _labelPlaceHolder->getString(); std::string placeHolder = _labelPlaceHolder->getString();
if (placeHolder.length() == 0) if (placeHolder.length() == 0)

View File

@ -330,7 +330,7 @@ void UIEditBoxImplWinrt::openKeyboard()
{ {
_delegate->editBoxEditingDidBegin(_editBox); _delegate->editBoxEditingDidBegin(_editBox);
} }
#if CC_ENABLE_SCRIPT_BINDING
EditBox* pEditBox = this->getEditBox(); EditBox* pEditBox = this->getEditBox();
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
{ {
@ -338,7 +338,7 @@ void UIEditBoxImplWinrt::openKeyboard()
ScriptEvent event(kCommonEvent,(void*)&data); ScriptEvent event(kCommonEvent,(void*)&data);
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
} }
#endif
std::string placeHolder = m_pLabelPlaceHolder->getString(); std::string placeHolder = m_pLabelPlaceHolder->getString();
if (placeHolder.length() == 0) if (placeHolder.length() == 0)
placeHolder = "Enter value"; placeHolder = "Enter value";

View File

@ -66,7 +66,7 @@ void UIEditBoxImplWp8::openKeyboard()
{ {
_delegate->editBoxEditingDidBegin(_editBox); _delegate->editBoxEditingDidBegin(_editBox);
} }
#if CC_ENABLE_SCRIPT_BINDING
EditBox* pEditBox = this->getEditBox(); EditBox* pEditBox = this->getEditBox();
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
{ {
@ -74,7 +74,7 @@ void UIEditBoxImplWp8::openKeyboard()
ScriptEvent event(kCommonEvent,(void*)&data); ScriptEvent event(kCommonEvent,(void*)&data);
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
} }
#endif
std::string placeHolder = m_pLabelPlaceHolder->getString(); std::string placeHolder = m_pLabelPlaceHolder->getString();
if (placeHolder.length() == 0) if (placeHolder.length() == 0)
placeHolder = "Enter value"; placeHolder = "Enter value";