CPObjectCPResponder
CPView
CPControl
CPTextField
@implementation CPTextField : CPControl
This control displays editable text in a Cappuccino application.
Method Summary | |
---|---|
-(id) | initWithCoder:(CPCoder)aCoder Initializes the textfield with data from a coder. |
-(id) | initWithFrame:(CGRect)aFrame Initializes the receiver for usage with the specified bounding rectangle. |
-(BOOL) | acceptsFirstResponder Returns YES if the receiver is able to become the first responder. |
-(BOOL) | becomeFirstResponder Notifies the receiver that it will become the first responder. |
-(CPTextFieldBezelStyle) | bezelStyle Returns the textfield's bezel style. |
-(void) | encodeWithCoder:(CPCoder)aCoder Encodes the data of this textfield into the provided coder. |
-(BOOL) | isBezeled Returns YES if the textfield draws a
bezeled border. |
-(BOOL) | isBordered Returns YES if the textfield has
a border. |
-(BOOL) | isEditable Returns YES if the textfield is currently
editable by the user. |
-(BOOL) | isSelectable Returns YES if the field's text is
selectable by the user. |
-(BOOL) | resignFirstResponder Notifies the receiver that it has been asked to give up first responder status. |
-(void) | setAlignment:(CPTextAlignment)anAlignment Sets the alignment of the text in the field. |
-(void) | setBezelStyle:(CPTextFieldBezelStyle)aBezelStyle Sets the textfield's bezel style. |
-(void) | setBezeled:(BOOL)shouldBeBezeled Sets whether the textfield will have a bezeled border. |
-(void) | setBordered:(BOOL)shouldBeBordered Sets whether the textfield will have a border drawn. |
-(void) | setEditable:(BOOL)shouldBeEditable |
-(void) | setFrameSize:(CGSize)aSize Sets the receiver's frame size. |
-(void) | setLineBreakMode:(CPLineBreakMode)aLineBreakMode Sets the way line breaks occur in the text field. |
-(void) | setSelectable:(BOOL)aFlag Sets whether the field's text is selectable by the user. |
-(void) | setStringValue:(CPString)aStringValue Sets the string the text field. |
-(void) | sizeToFit Adjusts the text field's size in the application. |
-(CPString) | stringValue Returns the string the text field. |
Methods inherited from class CPControl |
---|
initWithFrame, action, alignment, backgroundColorForName, floatValue, font, isEnabled, mouseUp, sendAction, setAction, setAlignment, setBackgroundColor, setBackgroundColorWithName, setBackgroundColor, setEnabled, setFloatValue, setFont, setTarget, setTextColor, setTextShadow, target, textColor, textShadow |
Method Detail |
---|
-(id)initWithCoder:(CPCoder)aCoder
aCoder
- the coder from which to read the textfield data-(id)initWithFrame:(CGRect)aFrame
aFrame
-(BOOL)acceptsFirstResponder
YES
if the receiver is able to become the first responder. NO
otherwise.-(BOOL)becomeFirstResponder
NO
. The default implementation always returns YES
.YES
if the receiver accepts first responder status.
-(CPTextFieldBezelStyle)bezelStyle
-(void)encodeWithCoder:(CPCoder)aCoder
aCoder
- the coder into which the data
will be written-(BOOL)isBezeled
YES
if the textfield draws a
bezeled border.-(BOOL)isBordered
YES
if the textfield has
a border.-(BOOL)isEditable
YES
if the textfield is currently
editable by the user.-(BOOL)isSelectable
YES
if the field's text is
selectable by the user.-(BOOL)resignFirstResponder
YES
if the receiver is willing to give up first responder status.
-(void)setAlignment:(CPTextAlignment)anAlignment
anAlignment
- -(void)setBezelStyle:(CPTextFieldBezelStyle)aBezelStyle
aBezelStyle
- the constant for the desired bezel style-(void)setBezeled:(BOOL)shouldBeBezeled
shouldBeBezeled
- YES
means the textfield
will draw a bezeled border-(void)setBordered:(BOOL)shouldBeBordered
shouldBeBordered
- YES
makes the
textfield draw a border-(void)setEditable:(BOOL)shouldBeEditable
shouldBeEditable
-(void)setFrameSize:(CGSize)aSize
aSize
is the same as the frame's current dimensions, this
method simply returns. The method posts a CPViewFrameDidChangeNotification
to the
default notification center if the receiver is configured to do so.aSize
- the new size for the frame-(void)setLineBreakMode:(CPLineBreakMode)aLineBreakMode
aLineBreakMode
- the line break style-(void)setSelectable:(BOOL)aFlag
aFlag
- YES
makes the text selectable-(void)setStringValue:(CPString)aStringValue
aStringValue
-(void)sizeToFit
-(CPString)stringValue
Created on Sat Sep 13 14:15:43 PDT 2008