2013-01-04 20:16:03 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
|
|
|
Copyright (c) 2012 Jozef Pridavok
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "CCEditBoxImplMac.h"
|
2013-01-15 15:11:20 +08:00
|
|
|
|
|
|
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
|
|
|
|
2013-01-04 20:16:03 +08:00
|
|
|
#include "CCEditBox.h"
|
|
|
|
#import "EAGLView.h"
|
2013-01-09 22:34:53 +08:00
|
|
|
|
|
|
|
#define getEditBoxImplMac() ((cocos2d::extension::CCEditBoxImplMac*)editBox_)
|
|
|
|
|
|
|
|
@implementation CustomNSTextField
|
|
|
|
|
|
|
|
- (CGRect)textRectForBounds:(CGRect)bounds {
|
|
|
|
float padding = 5.0f;
|
|
|
|
return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding,
|
|
|
|
bounds.size.width - padding*2, bounds.size.height - padding*2);
|
|
|
|
}
|
|
|
|
- (CGRect)editingRectForBounds:(CGRect)bounds {
|
|
|
|
return [self textRectForBounds:bounds];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setup {
|
|
|
|
[self setBordered:NO];
|
|
|
|
[self setHidden:NO];
|
|
|
|
[self setWantsLayer:YES];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@implementation EditBoxImplMac
|
|
|
|
|
|
|
|
@synthesize textField = textField_;
|
|
|
|
@synthesize editState = editState_;
|
|
|
|
@synthesize editBox = editBox_;
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
|
|
|
[textField_ resignFirstResponder];
|
|
|
|
[textField_ removeFromSuperview];
|
|
|
|
self.textField = NULL;
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox
|
|
|
|
{
|
|
|
|
self = [super init];
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (self == nil) break;
|
|
|
|
editState_ = NO;
|
|
|
|
self.textField = [[[CustomNSTextField alloc] initWithFrame: frameRect] autorelease];
|
|
|
|
if (!textField_) break;
|
|
|
|
[textField_ setTextColor:[NSColor whiteColor]];
|
|
|
|
textField_.font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.
|
|
|
|
textField_.backgroundColor = [NSColor clearColor];
|
|
|
|
[textField_ setup];
|
|
|
|
textField_.delegate = self;
|
|
|
|
[textField_ setDelegate:self];
|
|
|
|
self.editBox = editBox;
|
|
|
|
|
|
|
|
[[EAGLView sharedEGLView] addSubview:textField_];
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}while(0);
|
|
|
|
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance
|
|
|
|
{
|
|
|
|
id eglView = [EAGLView sharedEGLView];
|
|
|
|
[eglView doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) setPosition:(NSPoint) pos
|
|
|
|
{
|
|
|
|
NSRect frame = [textField_ frame];
|
|
|
|
frame.origin = pos;
|
|
|
|
[textField_ setFrame:frame];
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) setContentSize:(NSSize) size
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) visit
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) openKeyboard
|
|
|
|
{
|
|
|
|
[textField_ becomeFirstResponder];
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) closeKeyboard
|
|
|
|
{
|
|
|
|
[textField_ resignFirstResponder];
|
|
|
|
[textField_ removeFromSuperview];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)textFieldShouldReturn:(NSTextField *)sender
|
|
|
|
{
|
|
|
|
if (sender == textField_) {
|
|
|
|
[sender resignFirstResponder];
|
|
|
|
}
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void)animationSelector
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)textFieldShouldBeginEditing:(NSTextField *)sender // return NO to disallow editing.
|
|
|
|
{
|
|
|
|
editState_ = YES;
|
|
|
|
cocos2d::extension::CCEditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();
|
|
|
|
if (pDelegate != NULL)
|
|
|
|
{
|
|
|
|
pDelegate->editBoxEditingDidBegin(getEditBoxImplMac()->getCCEditBox());
|
|
|
|
}
|
2013-05-24 11:42:27 +08:00
|
|
|
|
|
|
|
cocos2d::extension::CCEditBox* pEditBox= getEditBoxImplMac()->getCCEditBox();
|
|
|
|
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
|
|
|
|
{
|
|
|
|
cocos2d::CCScriptEngineProtocol* pEngine = cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine();
|
|
|
|
pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
|
|
|
|
}
|
2013-01-09 22:34:53 +08:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)textFieldShouldEndEditing:(NSTextField *)sender
|
|
|
|
{
|
|
|
|
editState_ = NO;
|
|
|
|
cocos2d::extension::CCEditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();
|
|
|
|
if (pDelegate != NULL)
|
|
|
|
{
|
|
|
|
pDelegate->editBoxEditingDidEnd(getEditBoxImplMac()->getCCEditBox());
|
|
|
|
pDelegate->editBoxReturn(getEditBoxImplMac()->getCCEditBox());
|
|
|
|
}
|
2013-05-24 11:42:27 +08:00
|
|
|
|
|
|
|
cocos2d::extension::CCEditBox* pEditBox= getEditBoxImplMac()->getCCEditBox();
|
|
|
|
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
|
|
|
|
{
|
|
|
|
cocos2d::CCScriptEngineProtocol* pEngine = cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine();
|
|
|
|
pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox);
|
|
|
|
pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(), "return",pEditBox);
|
|
|
|
}
|
2013-01-09 22:34:53 +08:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delegate method called before the text has been changed.
|
|
|
|
* @param textField The text field containing the text.
|
|
|
|
* @param range The range of characters to be replaced.
|
|
|
|
* @param string The replacement string.
|
|
|
|
* @return YES if the specified text range should be replaced; otherwise, NO to keep the old text.
|
|
|
|
*/
|
|
|
|
- (BOOL)textField:(NSTextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
|
|
|
|
{
|
|
|
|
if (getEditBoxImplMac()->getMaxLength() < 0)
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
NSUInteger oldLength = [[textField stringValue] length];
|
|
|
|
NSUInteger replacementLength = [string length];
|
|
|
|
NSUInteger rangeLength = range.length;
|
|
|
|
|
|
|
|
NSUInteger newLength = oldLength - rangeLength + replacementLength;
|
|
|
|
|
|
|
|
return newLength <= getEditBoxImplMac()->getMaxLength();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called each time when the text field's text has changed.
|
|
|
|
*/
|
|
|
|
- (void)controlTextDidChange:(NSNotification *)notification
|
|
|
|
{
|
|
|
|
cocos2d::extension::CCEditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();
|
|
|
|
if (pDelegate != NULL)
|
|
|
|
{
|
|
|
|
pDelegate->editBoxTextChanged(getEditBoxImplMac()->getCCEditBox(), getEditBoxImplMac()->getText());
|
|
|
|
}
|
2013-05-24 11:42:27 +08:00
|
|
|
|
|
|
|
cocos2d::extension::CCEditBox* pEditBox= getEditBoxImplMac()->getCCEditBox();
|
|
|
|
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
|
|
|
|
{
|
|
|
|
cocos2d::CCScriptEngineProtocol* pEngine = cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine();
|
|
|
|
pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox);
|
|
|
|
}
|
2013-01-09 22:34:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
2013-01-04 20:16:03 +08:00
|
|
|
|
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
|
|
|
CCEditBoxImpl* __createSystemEditBox(CCEditBox* pEditBox)
|
|
|
|
{
|
|
|
|
return new CCEditBoxImplMac(pEditBox);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCEditBoxImplMac::CCEditBoxImplMac(CCEditBox* pEditText)
|
2013-06-15 14:03:30 +08:00
|
|
|
: CCEditBoxImpl(pEditText), _sysEdit(NULL), _maxTextLength(-1)
|
|
|
|
, _anchorPoint(ccp(0.5f, 0.5f))
|
2013-01-04 20:16:03 +08:00
|
|
|
{
|
|
|
|
//! TODO: Retina on Mac
|
2013-06-15 14:03:30 +08:00
|
|
|
//! _inRetinaMode = [[EAGLView sharedEGLView] contentScaleFactor] == 2.0f ? true : false;
|
|
|
|
_inRetinaMode = false;
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
CCEditBoxImplMac::~CCEditBoxImplMac()
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
[_sysEdit release];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::doAnimationWhenKeyboardMove(float duration, float distance)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
if ([_sysEdit isEditState] || distance < 0.0f)
|
|
|
|
[_sysEdit doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CCEditBoxImplMac::initWithSize(const CCSize& size)
|
|
|
|
{
|
2013-01-09 22:34:53 +08:00
|
|
|
CCEGLViewProtocol* eglView = CCEGLView::sharedOpenGLView();
|
2013-01-04 20:16:03 +08:00
|
|
|
|
2013-01-09 22:34:53 +08:00
|
|
|
NSRect rect = NSMakeRect(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY());
|
2013-01-04 20:16:03 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
if (_inRetinaMode) {
|
2013-01-09 22:34:53 +08:00
|
|
|
rect.size.width /= 2.0f;
|
|
|
|
rect.size.height /= 2.0f;
|
|
|
|
}
|
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
_sysEdit = [[EditBoxImplMac alloc] initWithFrame:rect editBox:this];
|
2013-01-09 22:34:53 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
if (!_sysEdit)
|
2013-01-09 22:34:53 +08:00
|
|
|
return false;
|
2013-01-04 20:16:03 +08:00
|
|
|
|
2013-01-09 22:34:53 +08:00
|
|
|
return true;
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
2013-02-25 22:33:16 +08:00
|
|
|
void CCEditBoxImplMac::setFont(const char* pFontName, int fontSize)
|
|
|
|
{
|
|
|
|
//TODO:
|
|
|
|
// if(pFontName == NULL)
|
|
|
|
// return;
|
|
|
|
// NSString * fntName = [NSString stringWithUTF8String:pFontName];
|
|
|
|
// UIFont *textFont = [UIFont fontWithName:fntName size:fontSize];
|
|
|
|
// if(textFont != nil)
|
2013-06-15 14:03:30 +08:00
|
|
|
// [_sysEdit.textField setFont:textFont];
|
2013-02-25 22:33:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize)
|
|
|
|
{
|
|
|
|
// TODO need to be implemented.
|
|
|
|
}
|
|
|
|
|
2013-01-04 20:16:03 +08:00
|
|
|
void CCEditBoxImplMac::setFontColor(const ccColor3B& color)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_sysEdit.textField.textColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setPlaceholderFontColor(const ccColor3B& color)
|
|
|
|
{
|
|
|
|
// TODO need to be implemented.
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setInputMode(EditBoxInputMode inputMode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setMaxLength(int maxLength)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_maxTextLength = maxLength;
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int CCEditBoxImplMac::getMaxLength()
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
return _maxTextLength;
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setInputFlag(EditBoxInputFlag inputFlag)
|
|
|
|
{
|
|
|
|
// TODO: NSSecureTextField
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setReturnType(KeyboardReturnType returnType)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CCEditBoxImplMac::isEditing()
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
return [_sysEdit isEditState] ? true : false;
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setText(const char* pText)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_sysEdit.textField.stringValue = [NSString stringWithUTF8String:pText];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const char* CCEditBoxImplMac::getText(void)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
return [_sysEdit.textField.stringValue UTF8String];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::setPlaceHolder(const char* pText)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
[[_sysEdit.textField cell] setPlaceholderString:[NSString stringWithUTF8String:pText]];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
2013-03-14 14:29:22 +08:00
|
|
|
NSPoint CCEditBoxImplMac::convertDesignCoordToScreenCoord(const CCPoint& designCoord, bool bInRetinaMode)
|
2013-01-04 20:16:03 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
NSRect frame = [_sysEdit.textField frame];
|
2013-03-14 14:29:22 +08:00
|
|
|
CGFloat height = frame.size.height;
|
2013-01-04 20:16:03 +08:00
|
|
|
|
2013-03-14 14:29:22 +08:00
|
|
|
CCEGLViewProtocol* eglView = CCEGLView::sharedOpenGLView();
|
|
|
|
|
2013-01-04 20:16:03 +08:00
|
|
|
CCPoint visiblePos = ccp(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());
|
|
|
|
CCPoint screenGLPos = ccpAdd(visiblePos, eglView->getViewPortRect().origin);
|
|
|
|
|
2013-03-14 14:29:22 +08:00
|
|
|
//TODO: I don't know why here needs to substract `height`.
|
|
|
|
NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height);
|
2013-01-04 20:16:03 +08:00
|
|
|
|
2013-01-09 22:34:53 +08:00
|
|
|
if (bInRetinaMode) {
|
2013-01-04 20:16:03 +08:00
|
|
|
screenPos.x = screenPos.x / 2.0f;
|
|
|
|
screenPos.y = screenPos.y / 2.0f;
|
|
|
|
}
|
2013-01-09 22:34:53 +08:00
|
|
|
|
2013-01-04 20:16:03 +08:00
|
|
|
CCLOG("[EditBox] pos x = %f, y = %f", screenGLPos.x, screenGLPos.y);
|
|
|
|
return screenPos;
|
|
|
|
}
|
|
|
|
|
2013-03-14 14:29:22 +08:00
|
|
|
void CCEditBoxImplMac::adjustTextFieldPosition()
|
2013-01-04 20:16:03 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
CCSize contentSize = _editBox->getContentSize();
|
2013-03-14 14:29:22 +08:00
|
|
|
CCRect rect = CCRectMake(0, 0, contentSize.width, contentSize.height);
|
2013-02-25 22:33:16 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
rect = CCRectApplyAffineTransform(rect, _editBox->nodeToWorldTransform());
|
2013-03-14 14:29:22 +08:00
|
|
|
|
|
|
|
CCPoint designCoord = ccp(rect.origin.x, rect.origin.y + rect.size.height);
|
2013-06-15 14:03:30 +08:00
|
|
|
[_sysEdit setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)];
|
2013-03-14 14:29:22 +08:00
|
|
|
}
|
2013-02-25 22:33:16 +08:00
|
|
|
|
2013-03-14 14:29:22 +08:00
|
|
|
void CCEditBoxImplMac::setPosition(const CCPoint& pos)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_position = pos;
|
2013-03-14 14:29:22 +08:00
|
|
|
adjustTextFieldPosition();
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
2013-03-03 18:58:51 +08:00
|
|
|
void CCEditBoxImplMac::setVisible(bool visible)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
[_sysEdit.textField setHidden:!visible];
|
2013-03-03 18:58:51 +08:00
|
|
|
}
|
|
|
|
|
2013-01-04 20:16:03 +08:00
|
|
|
void CCEditBoxImplMac::setContentSize(const CCSize& size)
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_contentSize = size;
|
2013-01-04 20:16:03 +08:00
|
|
|
CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height);
|
|
|
|
}
|
|
|
|
|
2013-02-25 22:33:16 +08:00
|
|
|
void CCEditBoxImplMac::setAnchorPoint(const CCPoint& anchorPoint)
|
|
|
|
{
|
|
|
|
CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y);
|
2013-06-15 14:03:30 +08:00
|
|
|
_anchorPoint = anchorPoint;
|
|
|
|
setPosition(_position);
|
2013-02-25 22:33:16 +08:00
|
|
|
}
|
|
|
|
|
2013-01-04 20:16:03 +08:00
|
|
|
void CCEditBoxImplMac::visit(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::openKeyboard()
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
[_sysEdit openKeyboard];
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::closeKeyboard()
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
[_sysEdit closeKeyboard];
|
2013-03-14 14:29:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCEditBoxImplMac::onEnter(void)
|
|
|
|
{
|
|
|
|
adjustTextFieldPosition();
|
2013-01-04 20:16:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_CC_EXT_END
|
|
|
|
|
2013-01-15 15:11:20 +08:00
|
|
|
#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
|
|
|
|
|
|
|
|