Merge pull request #7645 from andyque/testPR7549

fix EditBox began/end events not work issue
This commit is contained in:
minggo 2014-08-04 15:36:07 +08:00
commit 358d637e75
1 changed files with 2 additions and 4 deletions

View File

@ -159,7 +159,7 @@
{ {
} }
- (BOOL)textFieldShouldBeginEditing:(NSTextField *)sender // return NO to disallow editing. - (void)controlTextDidBeginEditing:(NSNotification *)notification
{ {
editState_ = YES; editState_ = YES;
cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();
@ -177,10 +177,9 @@
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
} }
#endif #endif
return YES;
} }
- (BOOL)textFieldShouldEndEditing:(NSTextField *)sender - (void)controlTextDidEndEditing:(NSNotification *)notification
{ {
editState_ = NO; editState_ = NO;
cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();
@ -203,7 +202,6 @@
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
} }
#endif #endif
return YES;
} }
/** /**