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
|
#pragma mark - UIEditBox mac implementation
|
||||||
|
|
||||||
@interface UIEditBoxImplMac : NSObject <NSTextFieldDelegate, NSTextViewDelegate>
|
@interface UIEditBoxImplMac : NSObject <NSTextFieldDelegate, NSTextViewDelegate>
|
||||||
|
{
|
||||||
|
BOOL _editState;
|
||||||
|
NSView<CCUITextInput> * _textInput;
|
||||||
|
void * _editBox;
|
||||||
|
}
|
||||||
|
|
||||||
@property (nonatomic, retain) NSView<CCUITextInput> *textInput;
|
@property (nonatomic, retain) NSView<CCUITextInput> *textInput;
|
||||||
@property (nonatomic, readonly) NSWindow *window;
|
@property (nonatomic, readonly) NSWindow *window;
|
||||||
|
@ -38,7 +43,7 @@
|
||||||
@property (nonatomic, readonly, getter = isEditState) BOOL editState;
|
@property (nonatomic, readonly, getter = isEditState) BOOL editState;
|
||||||
@property (nonatomic, assign) void *editBox;
|
@property (nonatomic, assign) void *editBox;
|
||||||
@property (nonatomic, assign) NSString *text;
|
@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::InputFlag dataInputMode;
|
||||||
@property (nonatomic, assign) cocos2d::ui::EditBox::KeyboardReturnType keyboardReturnType;
|
@property (nonatomic, assign) cocos2d::ui::EditBox::KeyboardReturnType keyboardReturnType;
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,10 @@
|
||||||
- (void)updateFrame:(CGRect)rect
|
- (void)updateFrame:(CGRect)rect
|
||||||
{
|
{
|
||||||
NSRect frame = self.textInput.frame;
|
NSRect frame = self.textInput.frame;
|
||||||
frame.origin = rect.origin;
|
frame.origin.x = rect.origin.x;
|
||||||
frame.size = rect.size;
|
frame.origin.y = rect.origin.y;
|
||||||
|
frame.size.height = rect.size.height;
|
||||||
|
frame.size.width = rect.size.width;
|
||||||
|
|
||||||
self.textInput.frame = frame;
|
self.textInput.frame = frame;
|
||||||
[self.window makeFirstResponder:self.window.contentView];
|
[self.window makeFirstResponder:self.window.contentView];
|
||||||
|
|
|
@ -27,5 +27,8 @@
|
||||||
#include "CCUITextInput.h"
|
#include "CCUITextInput.h"
|
||||||
|
|
||||||
@interface CCUIMultilineTextField : NSTextView <CCUITextInput>
|
@interface CCUIMultilineTextField : NSTextView <CCUITextInput>
|
||||||
|
{
|
||||||
|
NSString* _placeHolder;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
|
|
||||||
@implementation CCUIMultilineTextField
|
@implementation CCUIMultilineTextField
|
||||||
{
|
{
|
||||||
NSString* _placeHolder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize placeHolder = _placeHolder;
|
@synthesize placeHolder = _placeHolder;
|
||||||
|
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
#include "CCUITextInput.h"
|
#include "CCUITextInput.h"
|
||||||
|
|
||||||
@interface CCUIPasswordTextField : NSSecureTextField<CCUITextInput>
|
@interface CCUIPasswordTextField : NSSecureTextField<CCUITextInput>
|
||||||
|
{
|
||||||
|
NSMutableDictionary* _placeholderAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
@implementation CCUIPasswordTextField
|
@implementation CCUIPasswordTextField
|
||||||
{
|
{
|
||||||
NSMutableDictionary* _placeholderAttributes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize placeholderAttributes = _placeholderAttributes;
|
@synthesize placeholderAttributes = _placeholderAttributes;
|
||||||
|
|
||||||
-(id) initWithFrame:(NSRect)frameRect
|
-(id) initWithFrame:(NSRect)frameRect
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
#include "CCUITextInput.h"
|
#include "CCUITextInput.h"
|
||||||
|
|
||||||
@interface CCUISingleLineTextField : NSTextField<CCUITextInput>
|
@interface CCUISingleLineTextField : NSTextField<CCUITextInput>
|
||||||
|
{
|
||||||
|
NSMutableDictionary* _placeholderAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
@implementation CCUISingleLineTextField
|
@implementation CCUISingleLineTextField
|
||||||
{
|
{
|
||||||
NSMutableDictionary* _placeholderAttributes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize placeholderAttributes = _placeholderAttributes;
|
@synthesize placeholderAttributes = _placeholderAttributes;
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@interface CCUITextFieldFormatter : NSFormatter
|
@interface CCUITextFieldFormatter : NSFormatter
|
||||||
|
{
|
||||||
|
int _maximumLength;
|
||||||
|
}
|
||||||
|
|
||||||
@property (nonatomic, assign) int maximumLength;
|
@property (nonatomic, assign) int maximumLength;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
@implementation CCUITextFieldFormatter
|
@implementation CCUITextFieldFormatter
|
||||||
{
|
{
|
||||||
int _maximumLength;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize maximumLength = _maximumLength;
|
@synthesize maximumLength = _maximumLength;
|
||||||
|
|
Loading…
Reference in New Issue