diff --git a/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.h b/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.h index b1177bb456..61871c6431 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.h +++ b/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.h @@ -31,6 +31,11 @@ #pragma mark - UIEditBox mac implementation @interface UIEditBoxImplMac : NSObject +{ + BOOL _editState; + NSView * _textInput; + void * _editBox; +} @property (nonatomic, retain) NSView *textInput; @property (nonatomic, readonly) NSWindow *window; @@ -38,7 +43,7 @@ @property (nonatomic, readonly, getter = isEditState) BOOL editState; @property (nonatomic, assign) void *editBox; @property (nonatomic, assign) NSString *text; -@property (nonatomic, assign) CGRect frameRect; +@property (nonatomic, assign) NSRect frameRect; @property (nonatomic, assign) cocos2d::ui::EditBox::InputFlag dataInputMode; @property (nonatomic, assign) cocos2d::ui::EditBox::KeyboardReturnType keyboardReturnType; diff --git a/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm b/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm index 84a8b5cd72..51bc117a7b 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm +++ b/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm @@ -110,9 +110,11 @@ - (void)updateFrame:(CGRect)rect { NSRect frame = self.textInput.frame; - frame.origin = rect.origin; - frame.size = rect.size; - + frame.origin.x = rect.origin.x; + frame.origin.y = rect.origin.y; + frame.size.height = rect.size.height; + frame.size.width = rect.size.width; + self.textInput.frame = frame; [self.window makeFirstResponder:self.window.contentView]; } diff --git a/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.h b/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.h index 305638a563..4798016715 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.h +++ b/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.h @@ -27,5 +27,8 @@ #include "CCUITextInput.h" @interface CCUIMultilineTextField : NSTextView +{ + NSString* _placeHolder; +} @end diff --git a/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.m b/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.m index 0891343b94..6ffacb4cfb 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.m +++ b/cocos/ui/UIEditBox/Mac/CCUIMultilineTextField.m @@ -31,8 +31,8 @@ @implementation CCUIMultilineTextField { - NSString* _placeHolder; } + @synthesize placeHolder = _placeHolder; -(void)dealloc diff --git a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h index 62482fa714..c0698ce8cb 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h +++ b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h @@ -27,6 +27,9 @@ #include "CCUITextInput.h" @interface CCUIPasswordTextField : NSSecureTextField +{ + NSMutableDictionary* _placeholderAttributes; +} @end diff --git a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m index 18858cd3be..19e111deeb 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m +++ b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m @@ -33,8 +33,8 @@ @implementation CCUIPasswordTextField { - NSMutableDictionary* _placeholderAttributes; } + @synthesize placeholderAttributes = _placeholderAttributes; -(id) initWithFrame:(NSRect)frameRect diff --git a/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.h b/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.h index da001e09df..77e6548d3b 100644 --- a/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.h +++ b/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.h @@ -27,6 +27,9 @@ #include "CCUITextInput.h" @interface CCUISingleLineTextField : NSTextField +{ + NSMutableDictionary* _placeholderAttributes; +} @end diff --git a/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.m b/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.m index 225466c059..46ae2e66d4 100644 --- a/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.m +++ b/cocos/ui/UIEditBox/Mac/CCUISingleLineTextField.m @@ -33,7 +33,6 @@ @implementation CCUISingleLineTextField { - NSMutableDictionary* _placeholderAttributes; } @synthesize placeholderAttributes = _placeholderAttributes; diff --git a/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.h b/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.h index 2499aa306d..75ce35d5c0 100644 --- a/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.h +++ b/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.h @@ -26,6 +26,10 @@ #import @interface CCUITextFieldFormatter : NSFormatter +{ + int _maximumLength; +} + @property (nonatomic, assign) int maximumLength; @end diff --git a/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.m b/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.m index 19869c474f..3f70d5326d 100644 --- a/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.m +++ b/cocos/ui/UIEditBox/Mac/CCUITextFieldFormatter.m @@ -27,7 +27,6 @@ @implementation CCUITextFieldFormatter { - int _maximumLength; } @synthesize maximumLength = _maximumLength;