make UIEditBox code compatible with 32bit project

This commit is contained in:
肖峰 2016-02-15 17:38:54 +08:00
parent 3177f3431e
commit 57badc99aa
10 changed files with 26 additions and 8 deletions

View File

@ -31,6 +31,11 @@
#pragma mark - UIEditBox mac implementation
@interface UIEditBoxImplMac : NSObject <NSTextFieldDelegate, NSTextViewDelegate>
{
BOOL _editState;
NSView<CCUITextInput> * _textInput;
void * _editBox;
}
@property (nonatomic, retain) NSView<CCUITextInput> *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;

View File

@ -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];
}

View File

@ -27,5 +27,8 @@
#include "CCUITextInput.h"
@interface CCUIMultilineTextField : NSTextView <CCUITextInput>
{
NSString* _placeHolder;
}
@end

View File

@ -31,8 +31,8 @@
@implementation CCUIMultilineTextField
{
NSString* _placeHolder;
}
@synthesize placeHolder = _placeHolder;
-(void)dealloc

View File

@ -27,6 +27,9 @@
#include "CCUITextInput.h"
@interface CCUIPasswordTextField : NSSecureTextField<CCUITextInput>
{
NSMutableDictionary* _placeholderAttributes;
}
@end

View File

@ -33,8 +33,8 @@
@implementation CCUIPasswordTextField
{
NSMutableDictionary* _placeholderAttributes;
}
@synthesize placeholderAttributes = _placeholderAttributes;
-(id) initWithFrame:(NSRect)frameRect

View File

@ -27,6 +27,9 @@
#include "CCUITextInput.h"
@interface CCUISingleLineTextField : NSTextField<CCUITextInput>
{
NSMutableDictionary* _placeholderAttributes;
}
@end

View File

@ -33,7 +33,6 @@
@implementation CCUISingleLineTextField
{
NSMutableDictionary* _placeholderAttributes;
}
@synthesize placeholderAttributes = _placeholderAttributes;

View File

@ -26,6 +26,10 @@
#import <Foundation/Foundation.h>
@interface CCUITextFieldFormatter : NSFormatter
{
int _maximumLength;
}
@property (nonatomic, assign) int maximumLength;
@end

View File

@ -27,7 +27,6 @@
@implementation CCUITextFieldFormatter
{
int _maximumLength;
}
@synthesize maximumLength = _maximumLength;