From ac0fb689896e1f114918208e1f3b9604b5604536 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 14 Nov 2014 15:04:32 +0800 Subject: [PATCH] fix compiling error caused by disable CC_ENABLE_SCRIPT_BINDING --- cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp | 10 ++++++---- cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp | 4 ++-- cocos/ui/UIEditBox/UIEditBoxImpl-wp8.cpp | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) 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";