API  0.9.10
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) - cursorUpdate:
 
(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) - mouseUp:
 
(BOOL) - needsPanelToBecomeKey
 
(id) - objectValue
 
(void) - paste:
 
(CPString- placeholderString
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(BOOL) - resignFirstResponder
 
(void) - rightMouseDown:
 
(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
 
(void) - updateTrackingAreas
 
(BOOL) - validateUserInterfaceItem:
 
(void) - viewDidHide
 
(void) - viewDidUnhide
 
- Instance Methods inherited from CPControl
(SEL) - action
 
(CPTextAlignment) - alignment
 
(CPWritingDirection) - baseWritingDirection
 
(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) - setBaseWritingDirection:
 
(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:
 
(void) - addTrackingArea:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(CAAnimation- animationForKey:
 
(CPDictionary- animations
 
(id) - animator
 
(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:
 
(CPString- debug_description
 
(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:
 
(CPAppearance- effectiveAppearance
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGRect) - frameRectOfView:inSuperviewSize:
 
(CGSize) - frameSize
 
(CGRect) - frameWithNewSuperviewSize:
 
(BOOL) - hasCustomDrawRect
 
(BOOL) - hasCustomLayoutSubviews
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(void) - layout
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(void) - objectDidChangeTheme
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeAllTrackingAreas
 
(void) - removeFromSuperview
 
(void) - removeTrackingArea:
 
(void) - replaceSubview:with:
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAnimations:
 
(void) - setAppearance:
 
(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) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(void) - viewDidEndLiveResize
 
(void) - viewDidLayout
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewWillDraw
 
(void) - viewWillLayout
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 

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
(Class) + animatorClass
 
(CAAnimation+ defaultAnimationForKey:
 
(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

◆ acceptsFirstMouse:()

- (BOOL) acceptsFirstMouse: (CPEvent anEvent
implementation

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

Reimplemented from CPControl.

Definition at line 974 of file CPTextField.j.

◆ acceptsFirstResponder()

- (BOOL) acceptsFirstResponder
implementation

Definition at line 590 of file CPTextField.j.

◆ becomeFirstResponder()

- (BOOL) becomeFirstResponder
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField.

Definition at line 596 of file CPTextField.j.

◆ bezelRectForBounds:()

- (CGRect) bezelRectForBounds: (CGRect)  bounds
implementation

Definition at line 1809 of file CPTextField.j.

◆ bezelStyle()

- (CPTextFieldBezelStyle) bezelStyle
implementation

Returns the textfield's bezel style.

Definition at line 497 of file CPTextField.j.

◆ contentRectForBounds:()

- (CGRect) contentRectForBounds: (CGRect)  bounds
implementation

Reimplemented in CPSearchField.

Definition at line 1802 of file CPTextField.j.

◆ copy:()

- (void) copy: (id)  sender
implementation

Definition at line 1503 of file CPTextField.j.

◆ createEphemeralSubviewNamed:()

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Reimplemented in CPComboBox.

Definition at line 1827 of file CPTextField.j.

◆ cursorUpdate:()

- (void) cursorUpdate: (CPEvent anEvent
implementation

Provided by category CPTextField(CPTrackingArea).

Definition at line 2193 of file CPTextField.j.

◆ cut:()

- (void) cut: (id)  sender
implementation

Definition at line 1538 of file CPTextField.j.

◆ defaultThemeClass()

+ (CPString) defaultThemeClass
implementation

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 215 of file CPTextField.j.

◆ delegate()

- (id) delegate
implementation

Reimplemented in CPComboBox.

Definition at line 1797 of file CPTextField.j.

◆ delete:()

- (void) delete: (id)  sender
implementation

Definition at line 1713 of file CPTextField.j.

◆ deleteBackward:()

- (void) deleteBackward: (id)  sender
implementation

Reimplemented in CPTokenField.

Definition at line 1693 of file CPTextField.j.

◆ deleteForward:()

- (void) deleteForward: (id)  sender
implementation

Reimplemented in CPTokenField.

Definition at line 1727 of file CPTextField.j.

◆ doCommandBySelector:()

- (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:

Definition at line 1108 of file CPTextField.j.

◆ drawsBackground()

- (BOOL) drawsBackground
implementation

Returns YES if the textfield draws a background.

Definition at line 543 of file CPTextField.j.

◆ encodeWithCoder:()

- (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 2084 of file CPTextField.j.

◆ initWithCoder:()

- (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 2054 of file CPTextField.j.

◆ initWithFrame:()

- (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 350 of file CPTextField.j.

◆ insertNewline:()

- (void) insertNewline: (id)  sender
implementation

Reimplemented in CPTokenField.

Definition at line 1114 of file CPTextField.j.

◆ insertNewlineIgnoringFieldEditor:()

- (void) insertNewlineIgnoringFieldEditor: (id)  sender
implementation

Definition at line 1151 of file CPTextField.j.

◆ insertTabIgnoringFieldEditor:()

- (void) insertTabIgnoringFieldEditor: (id)  sender
implementation

Definition at line 1156 of file CPTextField.j.

◆ isBezeled()

- (BOOL) isBezeled
implementation

Returns YES if the textfield draws a bezeled border.

Definition at line 475 of file CPTextField.j.

◆ isBordered()

- (BOOL) isBordered
implementation

Returns YES if the textfield has a border.

Definition at line 520 of file CPTextField.j.

◆ isEditable()

- (BOOL) isEditable
implementation

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

Definition at line 403 of file CPTextField.j.

◆ isSecure()

- (BOOL) isSecure
implementation

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

Reimplemented in CPSecureTextField.

Definition at line 454 of file CPTextField.j.

◆ isSelectable()

- (BOOL) isSelectable
implementation

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

Definition at line 437 of file CPTextField.j.

◆ keyDown:()

- (void) keyDown: (CPEvent anEvent
implementation

Reimplemented in CPTokenField.

Definition at line 1079 of file CPTextField.j.

◆ keyUp:()

- (void) keyUp: (CPEvent anEvent
implementation

Reimplemented in CPTokenField.

Definition at line 1061 of file CPTextField.j.

◆ labelWithTitle:()

+ (CPTextField) labelWithTitle: (CPString aTitle
implementation

Definition at line 200 of file CPTextField.j.

◆ labelWithTitle:theme:()

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

Definition at line 205 of file CPTextField.j.

◆ layoutSubviews()

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField, and CPComboBox.

Definition at line 1849 of file CPTextField.j.

◆ mouseDown:()

- (void) mouseDown: (CPEvent anEvent
implementation

Reimplemented from CPControl.

Reimplemented in CPTokenField, and CPSearchField.

Definition at line 990 of file CPTextField.j.

◆ mouseDragged:()

- (void) mouseDragged: (CPEvent anEvent
implementation

Definition at line 1053 of file CPTextField.j.

◆ mouseUp:()

- (void) mouseUp: (CPEvent anEvent
implementation

Reimplemented in CPTokenField.

Definition at line 1018 of file CPTextField.j.

◆ needsPanelToBecomeKey()

- (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 966 of file CPTextField.j.

◆ objectValue()

- (id) objectValue
implementation

Returns the string in the text field.

Reimplemented from CPControl.

Reimplemented in CPTokenField.

Definition at line 1252 of file CPTextField.j.

◆ paste:()

- (void) paste: (id)  sender
implementation

Reimplemented in CPComboBox.

Definition at line 1563 of file CPTextField.j.

◆ placeholderString()

- (CPString) placeholderString
implementation

Returns the receiver's placeholder string

Definition at line 1378 of file CPTextField.j.

◆ rectForEphemeralSubviewNamed:()

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Reimplemented in CPComboBox.

Definition at line 1816 of file CPTextField.j.

◆ resignFirstResponder()

- (BOOL) resignFirstResponder
implementation

Reimplemented from CPView.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 792 of file CPTextField.j.

◆ rightMouseDown:()

- (void) rightMouseDown: (CPEvent anEvent
implementation

Reimplemented from CPView.

Definition at line 1045 of file CPTextField.j.

◆ roundedTextFieldWithStringValue:placeholder:width:()

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

Definition at line 178 of file CPTextField.j.

◆ roundedTextFieldWithStringValue:placeholder:width:theme:()

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

Definition at line 183 of file CPTextField.j.

◆ selectAll:()

- (void) selectAll: (id)  sender
implementation

Definition at line 1688 of file CPTextField.j.

◆ selectedRange()

- (CPRange) selectedRange
implementation

Definition at line 1596 of file CPTextField.j.

◆ selectText:()

- (void) selectText: (id)  sender
implementation

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

Definition at line 1462 of file CPTextField.j.

◆ setBezeled:()

- (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 464 of file CPTextField.j.

◆ setBezelStyle:()

- (void) setBezelStyle: (CPTextFieldBezelStyle)  aBezelStyle
implementation

Sets the textfield's bezel style.

Parameters
aBezelStylethe constant for the desired bezel style

Definition at line 484 of file CPTextField.j.

◆ setBordered:()

- (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 509 of file CPTextField.j.

◆ setControlSize:()

- (void) setControlSize: (CPControlSize)  aControlSize
implementation

Sets the control's size.

Parameters
aControlSizethe control's size

Reimplemented from CPControl.

Definition at line 233 of file CPTextField.j.

◆ setDelegate:()

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

Definition at line 1770 of file CPTextField.j.

◆ setDrawsBackground:()

- (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 529 of file CPTextField.j.

◆ setEditable:()

- (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 373 of file CPTextField.j.

◆ setEnabled:()

- (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 412 of file CPTextField.j.

◆ setObjectValue:()

- (void) setObjectValue: (id)  anObject
implementation

Sets the receiver's object value.

Reimplemented from CPControl.

Reimplemented in CPTokenField, and CPComboBox.

Definition at line 1304 of file CPTextField.j.

◆ setPlaceholderString:()

- (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 1360 of file CPTextField.j.

◆ setSecure:()

- (void) setSecure: (BOOL)  aFlag
implementation

Sets whether the field's text is secure.

Parameters
aFlagYES makes the text secure

Definition at line 446 of file CPTextField.j.

◆ setSelectable:()

- (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 427 of file CPTextField.j.

◆ setSelectedRange:()

- (void) setSelectedRange: (CPRange)  aRange
implementation

Definition at line 1636 of file CPTextField.j.

◆ setTextColor:()

- (void) setTextColor: (CPColor aColor
implementation

Sets the text color of the receiver.

Parameters
aColor- A CPColor object.

Reimplemented from CPControl.

Definition at line 1916 of file CPTextField.j.

◆ setTextFieldBackgroundColor:()

- (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 552 of file CPTextField.j.

◆ sizeToFit()

- (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 1403 of file CPTextField.j.

◆ takeValueFromKeyPath:ofObjects:()

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

Definition at line 1893 of file CPTextField.j.

◆ textDidBeginEditing:()

- (void) textDidBeginEditing: (CPNotification note
implementation

Reimplemented from CPControl.

Definition at line 1225 of file CPTextField.j.

◆ textDidBlur:()

- (void) textDidBlur: (CPNotification note
implementation

Definition at line 1188 of file CPTextField.j.

◆ textDidChange:()

- (void) textDidChange: (CPNotification note
implementation

Reimplemented from CPControl.

Reimplemented in CPTokenField, and CPComboBox.

Definition at line 1212 of file CPTextField.j.

◆ textDidEndEditing:()

- (void) textDidEndEditing: (CPNotification note
implementation

Reimplemented from CPControl.

Definition at line 1237 of file CPTextField.j.

◆ textDidFocus:()

- (void) textDidFocus: (CPNotification note
implementation

Definition at line 1200 of file CPTextField.j.

◆ textFieldBackgroundColor()

- (CPColor) textFieldBackgroundColor
implementation

Returns the background color.

Definition at line 566 of file CPTextField.j.

◆ textFieldWithStringValue:placeholder:width:()

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

Definition at line 157 of file CPTextField.j.

◆ textFieldWithStringValue:placeholder:width:theme:()

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

Definition at line 162 of file CPTextField.j.

◆ themeAttributes()

+ (CPDictionary) themeAttributes
implementation

Reimplemented from CPControl.

Reimplemented in CPTokenField, CPComboBox, and CPSearchField.

Definition at line 220 of file CPTextField.j.

◆ updateTrackingAreas()

- (void) updateTrackingAreas
implementation

Invoked automatically when the view’s geometry changes such that its tracking areas need to be recalculated.

You should override this method to remove out of date tracking areas and add recomputed tracking areas;

Cocoa calls this on every view, whereas they have tracking area(s) or not. Cappuccino behaves differently :

  • updateTrackingAreas is called when placing a view in the view hierarchy (that is in a window)
  • if you have only CPTrackingInVisibleRect tracking areas attached to a view, it will not be called again (until you move the view in the hierarchy)
  • if you have at least one non-CPTrackingInVisibleRect tracking area attached, it will be called every time the view geometry could be modified You don't have to touch to CPTrackingInVisibleRect tracking areas, they will be automatically updated

Please note that it is the owner of a tracking area who is called for updateTrackingAreas. But, if a view without any tracking area is inserted in the view hierarchy (that is, in a window), the view is called for updateTrackingAreas. This enables you to use updateTrackingArea to initially attach your tracking areas to the view.

Reimplemented from CPControl.

Provided by category CPTextField(CPTrackingArea).

Definition at line 2177 of file CPTextField.j.

◆ validateUserInterfaceItem:()

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

Definition at line 1941 of file CPTextField.j.

◆ viewDidHide()

- (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 1925 of file CPTextField.j.

◆ viewDidUnhide()

- (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 1933 of file CPTextField.j.


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