22 |
*/ |
*/ |
23 |
|
|
24 |
#include <Foundation/NSException.h> |
#include <Foundation/NSException.h> |
25 |
|
#include <AppKit/NSEvent.h> |
26 |
|
|
27 |
#include "Interface/UiTextField.h" |
#include "Interface/UiTextField.h" |
28 |
|
|
29 |
|
@interface UiTextField (Delegate) |
30 |
|
|
31 |
|
- (BOOL) leftMouse: (NSEvent *)event; |
32 |
|
- (void) key: (NSEvent *)event; |
33 |
|
|
34 |
|
@end |
35 |
|
|
36 |
/** |
/** |
37 |
* UiTextField implementation |
* UiTextField implementation |
38 |
*/ |
*/ |
62 |
_color = blueColor; |
_color = blueColor; |
63 |
_renderText = [[UiText alloc] initWithText: text |
_renderText = [[UiText alloc] initWithText: text |
64 |
height: _height]; |
height: _height]; |
65 |
|
[self sizeToFit]; |
66 |
} |
} |
67 |
|
|
68 |
return self; |
return self; |
121 |
_height = height; |
_height = height; |
122 |
} |
} |
123 |
|
|
124 |
|
- (BOOL) canHaveFocus |
125 |
|
{ |
126 |
|
return YES; |
127 |
|
} |
128 |
|
|
129 |
|
- (BOOL) leftMouseDown: (NSEvent *)event |
130 |
|
{ |
131 |
|
/* FIXME - change the name of leftMouse */ |
132 |
|
[self leftMouse: event]; |
133 |
|
|
134 |
|
return YES; |
135 |
|
} |
136 |
|
|
137 |
|
- (BOOL) keyDown: (NSEvent *)event |
138 |
|
{ |
139 |
|
/* FIXME - change the name of key */ |
140 |
|
[self key: event]; |
141 |
|
|
142 |
|
return YES; |
143 |
|
} |
144 |
|
|
145 |
@end |
@end |