Class CPTextField

CPObject
    extended byCPResponder
        extended byCPView
            extended byCPControl
                extended byCPTextField
Direct Known Subclasses:
CPSecureTextField

@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 CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass

Methods inherited from class CPResponder
acceptsFirstResponder, becomeFirstResponder, deleteBackward, doCommandBySelector, insertLineBreak, insertText, interpretKeyEvents, keyDown, keyUp, menu, mouseDown, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseUp, nextResponder, noResponderFor, performKeyEquivalent, resignFirstResponder, scrollWheel, setMenu, setNextResponder, tryToPerform, undoManager

Methods inherited from class CPView
initWithFrame, acceptsFirstMouse, addSubview, addSubview, adjustScroll, alphaValue, autoresizesSubviews, autoresizingMask, autoscroll, backgroundColor, bounds, convertPoint, convertPoint, convertRect, convertRect, convertSize, convertSize, didAddSubview, display, displayIfNeeded, displayIfNeededInRect, displayRect, displayRectIgnoringOpacity, dragImage, dragView, drawRect, enclosingMenuItem, enclosingScrollView, enterFullScreenMode, exitFullScreenModeWithOptions, frame, hitTest, hitTests, isDescendantOf, isFlipped, isHidden, isHiddenOrHasHiddenAncestor, isInFullScreenMode, isOpaque, lockFocus, mouseDown, mouseDownCanMoveWindow, needsDisplay, postsBoundsChangedNotifications, postsFrameChangedNotifications, reflectScrolledClipView, registerForDraggedTypes, registeredDraggedTypes, removeFromSuperview, replaceSubview, resizeSubviewsWithOldSize, resizeWithOldSuperviewSize, scrollClipView, scrollPoint, scrollRectToVisible, scrollRect, setAlphaValue, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setBoundsOrigin, setBoundsSize, setFrame, setFrameOrigin, setFrameSize, setHidden, setHitTests, setNeedsDisplay, setNeedsDisplayInRect, setPostsBoundsChangedNotifications, setPostsFrameChangedNotifications, subviews, superview, unlockFocus, unregisterDraggedTypes, viewDidMoveToSuperview, viewDidMoveToWindow, viewWillMoveToSuperview, viewWillMoveToWindow, visibleRect, willRemoveSubview, window

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

initWithCoder

-(id)initWithCoder:(CPCoder)aCoder
Initializes the textfield with data from a coder.
Parameters:
aCoder - the coder from which to read the textfield data
Returns:
the initialized textfield

initWithFrame

-(id)initWithFrame:(CGRect)aFrame
Initializes the receiver for usage with the specified bounding rectangle
Parameters:
aFrame
Returns:
the initialized view

acceptsFirstResponder

-(BOOL)acceptsFirstResponder
Returns YES if the receiver is able to become the first responder. NO otherwise.

becomeFirstResponder

-(BOOL)becomeFirstResponder
Notifies the receiver that it will become the first responder. The receiver can reject first responder if it returns NO. The default implementation always returns YES.
Returns:
YES if the receiver accepts first responder status.

bezelStyle

-(CPTextFieldBezelStyle)bezelStyle
Returns the textfield's bezel style.

encodeWithCoder

-(void)encodeWithCoder:(CPCoder)aCoder
Encodes the data of this textfield into the provided coder.
Parameters:
aCoder - the coder into which the data will be written

isBezeled

-(BOOL)isBezeled
Returns YES if the textfield draws a bezeled border.

isBordered

-(BOOL)isBordered
Returns YES if the textfield has a border.

isEditable

-(BOOL)isEditable
Returns YES if the textfield is currently editable by the user.

isSelectable

-(BOOL)isSelectable
Returns YES if the field's text is selectable by the user.

resignFirstResponder

-(BOOL)resignFirstResponder
Notifies the receiver that it has been asked to give up first responder status.
Returns:
YES if the receiver is willing to give up first responder status.

setAlignment

-(void)setAlignment:(CPTextAlignment)anAlignment
Sets the alignment of the text in the field.
Parameters:
anAlignment -

setBezelStyle

-(void)setBezelStyle:(CPTextFieldBezelStyle)aBezelStyle
Sets the textfield's bezel style.
Parameters:
aBezelStyle - the constant for the desired bezel style

setBezeled

-(void)setBezeled:(BOOL)shouldBeBezeled
Sets whether the textfield will have a bezeled border.
Parameters:
shouldBeBezeled - YES means the textfield will draw a bezeled border

setBordered

-(void)setBordered:(BOOL)shouldBeBordered
Sets whether the textfield will have a border drawn.
Parameters:
shouldBeBordered - YES makes the textfield draw a border

setEditable

-(void)setEditable:(BOOL)shouldBeEditable
Parameters:
shouldBeEditable

setFrameSize

-(void)setFrameSize:(CGSize)aSize
Sets the receiver's frame size. If 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.
Parameters:
aSize - the new size for the frame

setLineBreakMode

-(void)setLineBreakMode:(CPLineBreakMode)aLineBreakMode
Sets the way line breaks occur in the text field.
Parameters:
aLineBreakMode - the line break style

setSelectable

-(void)setSelectable:(BOOL)aFlag
Sets whether the field's text is selectable by the user.
Parameters:
aFlag - YES makes the text selectable

setStringValue

-(void)setStringValue:(CPString)aStringValue
Sets the string the text field.
Parameters:
aStringValue

sizeToFit

-(void)sizeToFit
Adjusts the text field's size in the application.

stringValue

-(CPString)stringValue
Returns the string the text field.

Created on Sat Sep 13 14:15:43 PDT 2008