diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp index 2c60aa56cc..b1faaae802 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp @@ -690,14 +690,16 @@ void EditBoxImplWin::openKeyboard() { _delegate->editBoxEditingDidBegin(_editBox); } - - EditBox* pEditBox = this->getEditBox(); - if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + +#if CC_ENABLE_SCRIPT_BINDING + 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); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); } +#endif std::string placeHolder = _labelPlaceHolder->getString(); if (placeHolder.length() == 0) diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp index 0086e7eab0..d30bb3c5a5 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp @@ -330,7 +330,7 @@ void UIEditBoxImplWinrt::openKeyboard() { _delegate->editBoxEditingDidBegin(_editBox); } - +#if CC_ENABLE_SCRIPT_BINDING EditBox* pEditBox = this->getEditBox(); if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) { @@ -338,7 +338,7 @@ void UIEditBoxImplWinrt::openKeyboard() ScriptEvent event(kCommonEvent,(void*)&data); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); } - +#endif std::string placeHolder = m_pLabelPlaceHolder->getString(); if (placeHolder.length() == 0) placeHolder = "Enter value"; diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-wp8.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-wp8.cpp index 892e53daf6..ceb918f2e0 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-wp8.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-wp8.cpp @@ -66,7 +66,7 @@ void UIEditBoxImplWp8::openKeyboard() { _delegate->editBoxEditingDidBegin(_editBox); } - +#if CC_ENABLE_SCRIPT_BINDING EditBox* pEditBox = this->getEditBox(); if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) { @@ -74,7 +74,7 @@ void UIEditBoxImplWp8::openKeyboard() ScriptEvent event(kCommonEvent,(void*)&data); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); } - +#endif std::string placeHolder = m_pLabelPlaceHolder->getString(); if (placeHolder.length() == 0) placeHolder = "Enter value";