mirror of https://github.com/axmolengine/axmol.git
make UIEditBox code compatible with 32bit project
This commit is contained in:
parent
3177f3431e
commit
57badc99aa
|
@ -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;
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -27,5 +27,8 @@
|
|||
#include "CCUITextInput.h"
|
||||
|
||||
@interface CCUIMultilineTextField : NSTextView <CCUITextInput>
|
||||
{
|
||||
NSString* _placeHolder;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
@implementation CCUIMultilineTextField
|
||||
{
|
||||
NSString* _placeHolder;
|
||||
}
|
||||
|
||||
@synthesize placeHolder = _placeHolder;
|
||||
|
||||
-(void)dealloc
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#include "CCUITextInput.h"
|
||||
|
||||
@interface CCUIPasswordTextField : NSSecureTextField<CCUITextInput>
|
||||
{
|
||||
NSMutableDictionary* _placeholderAttributes;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
|
||||
@implementation CCUIPasswordTextField
|
||||
{
|
||||
NSMutableDictionary* _placeholderAttributes;
|
||||
}
|
||||
|
||||
@synthesize placeholderAttributes = _placeholderAttributes;
|
||||
|
||||
-(id) initWithFrame:(NSRect)frameRect
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#include "CCUITextInput.h"
|
||||
|
||||
@interface CCUISingleLineTextField : NSTextField<CCUITextInput>
|
||||
{
|
||||
NSMutableDictionary* _placeholderAttributes;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
@implementation CCUISingleLineTextField
|
||||
{
|
||||
NSMutableDictionary* _placeholderAttributes;
|
||||
}
|
||||
|
||||
@synthesize placeholderAttributes = _placeholderAttributes;
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CCUITextFieldFormatter : NSFormatter
|
||||
{
|
||||
int _maximumLength;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) int maximumLength;
|
||||
|
||||
@end
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
@implementation CCUITextFieldFormatter
|
||||
{
|
||||
int _maximumLength;
|
||||
}
|
||||
|
||||
@synthesize maximumLength = _maximumLength;
|
||||
|
|
Loading…
Reference in New Issue