API  0.9.8
 All Classes Files Functions Variables Typedefs Macros Groups Pages
CPTextField Class Reference

#import <CPTextField.h>

+ Inheritance diagram for CPTextField:

Instance Methods

(BOOL) - acceptsFirstMouse:
 
(BOOL) - acceptsFirstResponder
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bezelRectForBounds:
 
(CPTextFieldBezelStyle) - bezelStyle
 
(CGRect) - contentRectForBounds:
 
(void) - copy:
 
(CPView- createEphemeralSubviewNamed:
 
(void) - cut:
 
(id) - delegate
 
(void) - delete:
 
(void) - deleteBackward:
 
(void) - deleteForward:
 
(void) - doCommandBySelector:
 
(BOOL) - drawsBackground
 
(void) - encodeWithCoder:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(void) - insertNewline:
 
(void) - insertNewlineIgnoringFieldEditor:
 
(void) - insertTabIgnoringFieldEditor:
 
(BOOL) - isBezeled
 
(BOOL) - isBordered
 
(BOOL) - isEditable
 
(BOOL) - isSecure
 
(BOOL) - isSelectable
 
(void) - keyDown:
 
(void) - keyUp:
 
(void) - layoutSubviews
 
(void) - mouseDown:
 
(void) - mouseDragged:
 
(void) - mouseMoved:
 
(void) - mouseUp:
 
(BOOL) - needsPanelToBecomeKey
 
(id) - objectValue
 
(void) - paste:
 
(CPString- placeholderString
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(BOOL) - resignFirstResponder
 
(void) - selectAll:
 
(CPRange) - selectedRange
 
(void) - selectText:
 
(void) - setBezeled:
 
(void) - setBezelStyle:
 
(void) - setBordered:
 
(void) - setControlSize:
 
(void) - setDelegate:
 
(void) - setDrawsBackground:
 
(void) - setEditable:
 
(void) - setEnabled:
 
(void) - setObjectValue:
 
(void) - setPlaceholderString:
 
(void) - setSecure:
 
(void) - setSelectable:
 
(void) - setSelectedRange:
 
(void) - setTextColor:
 
(void) - setTextFieldBackgroundColor:
 
(void) - sizeToFit
 
(void) - takeValueFromKeyPath:ofObjects:
 
(void) - textDidBeginEditing:
 
(void) - textDidBlur:
 
(void) - textDidChange:
 
(void) - textDidEndEditing:
 
(void) - textDidFocus:
 
(CPColor- textFieldBackgroundColor
 
(BOOL) - validateUserInterfaceItem:
 
(void) - viewDidHide
 
(void) - viewDidUnhide
 
- Instance Methods inherited from CPControl
(SEL) - action
 
(CPTextAlignment) - alignment
 
(BOOL) - continueTracking:at:
 
(CPControlSize) - controlSize
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPUInteger) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(CPInteger) - nextState
 
(void) - performClick:
 
(BOOL) - sendAction:to:
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(void) - setContinuous:
 
(void) - setDoubleValue:
 
(void) - setFloatValue:
 
(void) - setFont:
 
(void) - setFormatter:
 
(void) - setHighlighted:
 
(void) - setImagePosition:
 
(void) - setImageScaling:
 
(void) - setIntegerValue:
 
(void) - setIntValue:
 
(void) - setLineBreakMode:
 
(void) - setSendsActionOnEndEditing:
 
(void) - setState:
 
(void) - setStringValue:
 
(void) - setTarget:
 
(void) - setTextShadowColor:
 
(void) - setTextShadowOffset:
 
(void) - setVerticalAlignment:
 
(BOOL) - startTrackingAt:
 
(void) - stopTracking:at:mouseIsUp:
 
(CPString- stringValue
 
(void) - takeDoubleValueFrom:
 
(void) - takeFloatValueFrom:
 
(void) - takeIntegerValueFrom:
 
(void) - takeIntValueFrom:
 
(void) - takeObjectValueFrom:
 
(void) - takeStringValueFrom:
 
(id) - target
 
(CPColor- textColor
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(void) - unhighlightButtonTimerDidFinish:
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(id) - currentValueForThemeAttribute:
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGSize) - frameSize
 
(BOOL) - hasThemeAttribute:
 
(BOOL) - hasThemeState:
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(CPString- identifier
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - registerThemeValues:
 
(void) - registerThemeValues:inherit:
 
(void) - removeFromSuperview
 
(void) - replaceSubview:with:
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setFrame:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setIdentifier:
 
(void) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setTheme:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(CPTheme- theme
 
(CPString- themeClass
 
(unsigned) - themeState
 
(CPString- toolTip
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(id) - valueForThemeAttribute:
 
(id) - valueForThemeAttribute:inState:
 
(void) - viewDidChangeTheme
 
(void) - viewDidEndLiveResize
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewWillDraw
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 
- Instance Methods inherited from CPResponder
(void) - flagsChanged:
 
(void) - insertBackTab:
 
(void) - insertLineBreak:
 
(void) - insertTab:
 
(void) - insertText:
 
(void) - interpretKeyEvents:
 
(CPMenu- menu
 
(CPResponder- nextResponder
 
(void) - noResponderFor:
 
(void) - rightMouseUp:
 
(void) - scrollWheel:
 
(void) - setMenu:
 
(void) - setNextResponder:
 
(BOOL) - tryToPerform:with:
 
(CPUndoManager- undoManager
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPString+ defaultThemeClass
 
(CPTextField+ labelWithTitle:
 
(CPTextField+ labelWithTitle:theme:
 
(CPTextField+ roundedTextFieldWithStringValue:placeholder:width:
 
(CPTextField+ roundedTextFieldWithStringValue:placeholder:width:theme:
 
(CPTextField+ textFieldWithStringValue:placeholder:width:
 
(CPTextField+ textFieldWithStringValue:placeholder:width:theme:
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(CPMenu+ defaultMenu
 
(BOOL) + isHighDPIDrawingEnabled
 
(CPSet) + keyPathsForValuesAffectingBounds
 
(CPSet) + keyPathsForValuesAffectingFrame
 
(void) + setHighDPIDrawingEnabled:
 

Detailed Description

This control displays editable text in a Cappuccino application.

Definition at line 2 of file CPTextField.h.

Method Documentation

- (BOOL) acceptsFirstMouse: (CPEvent anEvent
implementation

Only text fields that can become first responder accept first mouse.

Reimplemented from CPControl.

Definition at line 934 of file CPTextField.j.

- (BOOL) acceptsFirstResponder
implementation

Reimplemented from CPResponder.

Definition at line 589 of file CPTextField.j.

- (BOOL) becomeFirstResponder
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField.

Definition at line 595 of file CPTextField.j.

- (CGRect) bezelRectForBounds: (CGRect)  bounds
implementation

Definition at line 1784 of file CPTextField.j.

- (CPTextFieldBezelStyle) bezelStyle
implementation

Returns the textfield's bezel style.

Definition at line 496 of file CPTextField.j.

- (CGRect) contentRectForBounds: (CGRect)  bounds
implementation

Reimplemented in CPSearchField.

Definition at line 1777 of file CPTextField.j.

- (void) copy: (id)  sender
implementation

Definition at line 1478 of file CPTextField.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Reimplemented in CPComboBox.

Definition at line 1802 of file CPTextField.j.

- (void) cut: (id)  sender
implementation

Definition at line 1513 of file CPTextField.j.

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 220 of file CPTextField.j.

- (id) delegate
implementation

Reimplemented in CPComboBox.

Definition at line 1772 of file CPTextField.j.

- (void) delete: (id)  sender
implementation

Definition at line 1688 of file CPTextField.j.

- (void) deleteBackward: (id)  sender
implementation

Reimplemented in CPTokenField.

Definition at line 1668 of file CPTextField.j.

- (void) deleteForward: (id)  sender
implementation

Reimplemented in CPTokenField.

Definition at line 1702 of file CPTextField.j.

- (void) doCommandBySelector: (SEL)  aSelector
implementation

Invoke the action specified by aSelector on the current responder.

This is implemented by CPResponder and by default it passes any unrecognized actions on to the next responder but text fields apparently aren't supposed to do that according to this documentation by Apple:

http://developer.apple.com/mac/library/documentation/cocoa/reference/NSTextInputClient_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/NSTextInputClient/doCommandBySelector:

Reimplemented from CPResponder.

Definition at line 1062 of file CPTextField.j.

- (BOOL) drawsBackground
implementation

Returns YES if the textfield draws a background.

Definition at line 542 of file CPTextField.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Encodes the data of this textfield into the provided coder.

Parameters
aCoderthe coder into which the data will be written

Reimplemented from CPControl.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Provided by category CPTextField(CPCoding).

Definition at line 2021 of file CPTextField.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the textfield with data from a coder.

Parameters
aCoderthe coder from which to read the textfield data
Returns
the initialized textfield

Reimplemented from CPControl.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Provided by category CPTextField(CPCoding).

Definition at line 1991 of file CPTextField.j.

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPControl.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 355 of file CPTextField.j.

- (void) insertNewline: (id)  aSender
implementation

Insert a line break at the caret position or selection.

Parameters
aSenderthe object requesting this

Reimplemented from CPResponder.

Reimplemented in CPTokenField.

Definition at line 1068 of file CPTextField.j.

- (void) insertNewlineIgnoringFieldEditor: (id)  sender
implementation

Definition at line 1105 of file CPTextField.j.

- (void) insertTabIgnoringFieldEditor: (id)  sender
implementation

Definition at line 1110 of file CPTextField.j.

- (BOOL) isBezeled
implementation

Returns YES if the textfield draws a bezeled border.

Definition at line 474 of file CPTextField.j.

- (BOOL) isBordered
implementation

Returns YES if the textfield has a border.

Definition at line 519 of file CPTextField.j.

- (BOOL) isEditable
implementation

Returns YES if the textfield is currently editable by the user.

Definition at line 406 of file CPTextField.j.

- (BOOL) isSecure
implementation

Returns YES if the field's text is secure (password entry).

Reimplemented in CPSecureTextField.

Definition at line 453 of file CPTextField.j.

- (BOOL) isSelectable
implementation

Returns YES if the field's text is selectable by the user.

Definition at line 436 of file CPTextField.j.

- (void) keyDown: (CPEvent anEvent
implementation

Notifies the receiver that the user has pressed a key.

Parameters
anEventinformation about the key press

Reimplemented from CPResponder.

Reimplemented in CPTokenField.

Definition at line 1033 of file CPTextField.j.

- (void) keyUp: (CPEvent anEvent
implementation

Notifies the receiver that the user has released a key.

Parameters
anEventinformation about the key press

Reimplemented from CPResponder.

Reimplemented in CPTokenField.

Definition at line 1015 of file CPTextField.j.

+ (CPTextField) labelWithTitle: (CPString aTitle
implementation

Definition at line 205 of file CPTextField.j.

+ (CPTextField) labelWithTitle: (CPString aTitle
theme: (CPTheme aTheme 
implementation

Definition at line 210 of file CPTextField.j.

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField, and CPComboBox.

Definition at line 1824 of file CPTextField.j.

- (void) mouseDown: (CPEvent anEvent
implementation

Notifies the receiver that the user has clicked the mouse down in its area.

Parameters
anEventcontains information about the click

Reimplemented from CPControl.

Reimplemented in CPTokenField, and CPSearchField.

Definition at line 956 of file CPTextField.j.

- (void) mouseDragged: (CPEvent anEvent
implementation

Notifies the receiver that the user has initiated a drag over it. A drag is a mouse movement while the left button is down.

Parameters
anEventcontains information about the drag

Reimplemented from CPResponder.

Definition at line 1007 of file CPTextField.j.

- (void) mouseMoved: (CPEvent anEvent
implementation

Notifies the receiver that the user has moved the mouse (with no buttons down).

Parameters
anEventcontains information about the movement

Reimplemented from CPResponder.

Definition at line 950 of file CPTextField.j.

- (void) mouseUp: (CPEvent anEvent
implementation

Notifies the receiver that the user has released the left mouse button.

Parameters
anEventcontains information about the release

Reimplemented from CPResponder.

Reimplemented in CPTokenField.

Definition at line 980 of file CPTextField.j.

- (BOOL) needsPanelToBecomeKey
implementation

Text fields require panels to become key window, so this returns YES if the text field is ready to become the first responder as well.

Reimplemented from CPView.

Definition at line 926 of file CPTextField.j.

- (id) objectValue
implementation

Returns the string in the text field.

Reimplemented from CPControl.

Reimplemented in CPTokenField.

Definition at line 1227 of file CPTextField.j.

- (void) paste: (id)  sender
implementation

Reimplemented in CPComboBox.

Definition at line 1538 of file CPTextField.j.

- (CPString) placeholderString
implementation

Returns the receiver's placeholder string

Definition at line 1353 of file CPTextField.j.

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Reimplemented in CPComboBox.

Definition at line 1791 of file CPTextField.j.

- (BOOL) resignFirstResponder
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 760 of file CPTextField.j.

+ (CPTextField) roundedTextFieldWithStringValue: (CPString aStringValue
placeholder: (CPString aPlaceholder
width: (float)  aWidth 
implementation

Definition at line 183 of file CPTextField.j.

+ (CPTextField) roundedTextFieldWithStringValue: (CPString aStringValue
placeholder: (CPString aPlaceholder
width: (float)  aWidth
theme: (CPTheme aTheme 
implementation

Definition at line 188 of file CPTextField.j.

- (void) selectAll: (id)  sender
implementation

Definition at line 1663 of file CPTextField.j.

- (CPRange) selectedRange
implementation

Definition at line 1571 of file CPTextField.j.

- (void) selectText: (id)  sender
implementation

Make the receiver the first responder and select all the text in the field.

Definition at line 1437 of file CPTextField.j.

- (void) setBezeled: (BOOL)  shouldBeBezeled
implementation

Sets whether the textfield will have a bezeled border.

Parameters
shouldBeBezeledYES means the textfield will draw a bezeled border

Definition at line 463 of file CPTextField.j.

- (void) setBezelStyle: (CPTextFieldBezelStyle)  aBezelStyle
implementation

Sets the textfield's bezel style.

Parameters
aBezelStylethe constant for the desired bezel style

Definition at line 483 of file CPTextField.j.

- (void) setBordered: (BOOL)  shouldBeBordered
implementation

Sets whether the textfield will have a border drawn.

Parameters
shouldBeBorderedYES makes the textfield draw a border

Definition at line 508 of file CPTextField.j.

- (void) setControlSize: (CPControlSize)  aControlSize
implementation

Sets the control's size.

Parameters
aControlSizethe control's size

Reimplemented from CPControl.

Definition at line 238 of file CPTextField.j.

- (void) setDelegate: (id <CPTextFieldDelegate>)  aDelegate
implementation

Definition at line 1745 of file CPTextField.j.

- (void) setDrawsBackground: (BOOL)  shouldDrawBackground
implementation

Sets whether the textfield will have a background drawn.

Parameters
shouldDrawBackgroundYES makes the textfield draw a background

Definition at line 528 of file CPTextField.j.

- (void) setEditable: (BOOL)  shouldBeEditable
implementation

Sets whether or not the receiver text field can be edited. If NO, any ongoing edit is ended.

Reimplemented in CPTokenField.

Definition at line 378 of file CPTextField.j.

- (void) setEnabled: (BOOL)  shouldBeEnabled
implementation

Sets whether the field reacts to events. If NO, any ongoing edit is ended.

Reimplemented from CPControl.

Reimplemented in CPTokenField.

Definition at line 415 of file CPTextField.j.

- (void) setObjectValue: (id)  anObject
implementation

Sets the receiver's object value.

Reimplemented from CPControl.

Reimplemented in CPTokenField, and CPComboBox.

Definition at line 1279 of file CPTextField.j.

- (void) setPlaceholderString: (CPString aStringValue
implementation

Sets a placeholder string for the receiver. The placeholder is displayed until editing begins, and after editing ends, if the text field has an empty string value

Definition at line 1335 of file CPTextField.j.

- (void) setSecure: (BOOL)  aFlag
implementation

Sets whether the field's text is secure.

Parameters
aFlagYES makes the text secure

Definition at line 445 of file CPTextField.j.

- (void) setSelectable: (BOOL)  aFlag
implementation

Sets whether the field's text is selectable by the user.

Parameters
aFlagYES makes the text selectable

Definition at line 428 of file CPTextField.j.

- (void) setSelectedRange: (CPRange)  aRange
implementation

Definition at line 1611 of file CPTextField.j.

- (void) setTextColor: (CPColor aColor
implementation

Sets the text color of the receiver.

Parameters
aColor- A CPColor object.

Reimplemented from CPControl.

Definition at line 1891 of file CPTextField.j.

- (void) setTextFieldBackgroundColor: (CPColor aColor
implementation

Sets the background color, which is shown for non-bezeled text fields with drawsBackground set to YES

Parameters
aColorThe background color

Definition at line 551 of file CPTextField.j.

- (void) sizeToFit
implementation

For non-bezeled text fields (typically a label), sizeToFit has two behaviors, depending on the line break mode of the receiver.

For non-bezeled receivers with a non-wrapping line break mode, sizeToFit will change the frame of the receiver to perfectly fit the current text in stringValue in the current font, respecting the current theme value for content-inset. For receivers with a wrapping line break mode, sizeToFit will wrap the text within the current width (respecting the current content-inset), so it will ONLY change the HEIGHT.

For bezeled text fields (typically editable fields), sizeToFit will ONLY change the HEIGHT of the text field. It will not change the width of the text field. sizeToFit will attempt to change the height to fit a single line of text, respecting the current theme values for min-size, max-size and content-inset.

The logic behind this decision is that most of the time you do not know what content will be placed in a bezeled text field, so you want to just choose a fixed width and leave it at that size. However, since you don't know how tall it needs to be if you change the font, sizeToFit will still be useful for making the textfield an appropriate height.

Definition at line 1378 of file CPTextField.j.

- (void) takeValueFromKeyPath: (CPString aKeyPath
ofObjects: (CPArray)  objects 
implementation

Definition at line 1868 of file CPTextField.j.

- (void) textDidBeginEditing: (CPNotification note
implementation

Reimplemented from CPControl.

Definition at line 1179 of file CPTextField.j.

- (void) textDidBlur: (CPNotification note
implementation

Definition at line 1142 of file CPTextField.j.

- (void) textDidChange: (CPNotification note
implementation

Reimplemented from CPControl.

Reimplemented in CPTokenField, and CPComboBox.

Definition at line 1166 of file CPTextField.j.

- (void) textDidEndEditing: (CPNotification note
implementation

Reimplemented from CPControl.

Definition at line 1191 of file CPTextField.j.

- (void) textDidFocus: (CPNotification note
implementation

Definition at line 1154 of file CPTextField.j.

- (CPColor) textFieldBackgroundColor
implementation

Returns the background color.

Definition at line 565 of file CPTextField.j.

+ (CPTextField) textFieldWithStringValue: (CPString aStringValue
placeholder: (CPString aPlaceholder
width: (float)  aWidth 
implementation

Definition at line 162 of file CPTextField.j.

+ (CPTextField) textFieldWithStringValue: (CPString aStringValue
placeholder: (CPString aPlaceholder
width: (float)  aWidth
theme: (CPTheme aTheme 
implementation

Definition at line 167 of file CPTextField.j.

+ (CPDictionary) themeAttributes
implementation

Reimplemented from CPControl.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 225 of file CPTextField.j.

- (BOOL) validateUserInterfaceItem: (id /*<CPValidatedUserInterfaceItem>*/)  anItem
implementation

Definition at line 1916 of file CPTextField.j.

- (void) viewDidHide
implementation

Called when the return value of isHiddenOrHasHiddenAncestor becomes YES, e.g. when this view becomes hidden due to a setHidden:YES message to itself or to one of its superviews.

Note: in the current implementation, viewDidHide may be called multiple times if additional superviews are hidden, even if isHiddenOrHasHiddenAncestor was already YES.

Reimplemented from CPView.

Definition at line 1900 of file CPTextField.j.

- (void) viewDidUnhide
implementation

Called when the return value of isHiddenOrHasHiddenAncestor becomes NO, e.g. when this view stops being hidden due to a setHidden:NO message to itself or to one of its superviews.

Note: in the current implementation, viewDidUnhide may be called multiple times if additional superviews are unhidden, even if isHiddenOrHasHiddenAncestor was already NO.

Reimplemented from CPView.

Definition at line 1908 of file CPTextField.j.


The documentation for this class was generated from the following files: