API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPSearchField Class Reference

#import <CPSearchField.h>

+ Inheritance diagram for CPSearchField:

Instance Methods

(CPButton- cancelButton
 
(CGRect) - cancelButtonRectForBounds:
 
(void) - cancelOperation:
 
(CGRect) - contentRectForBounds:
 
(CPMenu- defaultSearchMenuTemplate
 
(void) - encodeWithCoder:
 
(CPView- hitTest:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(BOOL) - isOpaque
 
(int) - maximumRecents
 
(CPMenu- menu
 
(void) - menuDidClose:
 
(void) - menuWillOpen:
 
(void) - mouseDown:
 
(CPString- recentsAutosaveName
 
(CPArray- recentSearches
 
(void) - resetCancelButton
 
(void) - resetSearchButton
 
(BOOL) - resignFirstResponder
 
(CPButton- searchButton
 
(CGRect) - searchButtonRectForBounds:
 
(CPMenu- searchMenuTemplate
 
(CGRect) - searchTextRectForBounds:
 
(void) - sendAction:to:
 
(BOOL) - sendsSearchStringImmediately
 
(BOOL) - sendsWholeSearchString
 
(void) - setCancelButton:
 
(void) - setMaximumRecents:
 
(void) - setRecentsAutosaveName:
 
(void) - setRecentSearches:
 
(void) - setSearchButton:
 
(void) - setSearchMenuTemplate:
 
(void) - setSendsSearchStringImmediately:
 
(void) - setSendsWholeSearchString:
 
(void) - viewWillMoveToSuperview:
 
- Instance Methods inherited from CPTextField
(BOOL) - acceptsFirstResponder
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bezelRectForBounds:
 
(CPTextFieldBezelStyle) - bezelStyle
 
(void) - copy:
 
(CPView- createEphemeralSubviewNamed:
 
(void) - cut:
 
(id) - delegate
 
(void) - deleteBackward:
 
(void) - doCommandBySelector:
 
(BOOL) - drawsBackground
 
(void) - insertNewline:
 
(void) - insertNewlineIgnoringFieldEditor:
 
(void) - insertTabIgnoringFieldEditor:
 
(BOOL) - isBezeled
 
(BOOL) - isBordered
 
(BOOL) - isEditable
 
(BOOL) - isSecure
 
(BOOL) - isSelectable
 
(void) - keyDown:
 
(void) - keyUp:
 
(void) - layoutSubviews
 
(void) - mouseDragged:
 
(void) - mouseUp:
 
(BOOL) - needsPanelToBecomeKey
 
(id) - objectValue
 
(void) - paste:
 
(CPString- placeholderString
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - selectAll:
 
(CPRange) - selectedRange
 
(void) - selectText:
 
(void) - setBezeled:
 
(void) - setBezelStyle:
 
(void) - setBordered:
 
(void) - setDelegate:
 
(void) - setDrawsBackground:
 
(void) - setEditable:
 
(void) - setEnabled:
 
(void) - setObjectValue:
 
(void) - setPlaceholderString:
 
(void) - setSecure:
 
(void) - setSelectable:
 
(void) - setSelectedRange:
 
(void) - setTextFieldBackgroundColor:
 
(void) - sizeToFit
 
(void) - takeValueFromKeyPath:ofObjects:
 
(void) - textDidBlur:
 
(void) - textDidChange:
 
(void) - textDidFocus:
 
(CPColor- textFieldBackgroundColor
 
- Instance Methods inherited from CPControl
(SEL) - action
 
(CPTextAlignment) - alignment
 
(BOOL) - continueTracking:at:
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPImageScaling) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(int) - nextState
 
(void) - performClick:
 
(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) - setTextColor:
 
(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
 
(void) - textDidBeginEditing:
 
(void) - textDidEndEditing:
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(void) - unhighlightButtonTimerDidFinish:
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(BOOL) - acceptsFirstMouse:
 
(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
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(CALayer- layer
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(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:
 
(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) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(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) - viewDidHide
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(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:
 
(void) - mouseMoved:
 
(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:
 
(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
 
(void) + initialize
 
- Class Methods inherited from CPTextField
(CPTextField+ labelWithTitle:
 
(CPTextField+ labelWithTitle:theme:
 
(CPTextField+ roundedTextFieldWithStringValue:placeholder:width:
 
(CPTextField+ roundedTextFieldWithStringValue:placeholder:width:theme:
 
(CPTextField+ textFieldWithStringValue:placeholder:width:
 
(CPTextField+ textFieldWithStringValue:placeholder:width:theme:
 
(id) + themeAttributes
 
- Class Methods inherited from CPView
(CPMenu+ defaultMenu
 
(CPSet+ keyPathsForValuesAffectingBounds
 
(CPSet+ keyPathsForValuesAffectingFrame
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

Detailed Description

The CPSearchField class defines the programmatic interface for text fields that are optimized for text-based searches. A CPSearchField object directly inherits from the CPTextField class. The search field implemented by these classes presents a standard user interface for searches, including a search button, a cancel button, and a pop-up icon menu for listing recent search strings and custom search categories.

When the user types and then pauses, the text field's action message is sent to its target. You can query the text field's string value for the current text to search for. Do not rely on the sender of the action to be an CPMenu object because the menu may change. If you need to change the menu, modify the search menu template and call the setSearchMenuTemplate: method to update.

Definition at line 2 of file CPSearchField.h.

Method Documentation

- (CPButton) cancelButton
implementation

Returns the button object used to display the cancel-button image.

Returns
The cancel button.

Definition at line 203 of file CPSearchField.j.

- (CGRect) cancelButtonRectForBounds: (CGRect)  rect
implementation

Modifies the bounding rectangle for the cancel button.

Parameters
rectThe updated bounding rectangle to use for the cancel button. The default value is the value passed into the rect parameter. Subclasses can override this method to return a new bounding rectangle for the cancel button. You might use this method to provide a custom layout for the search field control.

Definition at line 267 of file CPSearchField.j.

- (void) cancelOperation: (id)  sender
implementation

Definition at line 694 of file CPSearchField.j.

- (CGRect) contentRectForBounds: (CGRect)  bounds
implementation

Reimplemented from CPTextField.

Definition at line 406 of file CPSearchField.j.

- (CPMenu) defaultSearchMenuTemplate
implementation

Provides the common case items for a recent searches menu. If there are not recent searches, displays a single disabled item:

No Recent Searches

If there are 1 more recent searches, it displays:

Recent Searches
   recent search 1
   recent search 2
   etc.
---------------------
Clear Recent Searches

If you wish to add items before or after the template, you can. If you put items before, a separator will automatically be placed before the default template item. If you add items after the default template, it is your responsibility to add a separator.

To add a custom item:

item = [[CPMenuItem alloc] initWithTitle:"google" action:(google:) keyEquivalent:""]; [item setTag:700]; [item setTarget:self]; [template addItem:item];

Be sure that your custom items do not use tags in the range 1000-1003 inclusive. If you wish to maintain state in custom menu items that you add, you will need to maintain the item state yourself, then in the action method of the custom items, modify the items in the search menu template and send [searchField setSearchMenuTemplate:template] to update the menu.

Definition at line 550 of file CPSearchField.j.

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPTextField.

Definition at line 66 of file CPSearchField.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 CPTextField.

Provided by category CPSearchField(CPCoding).

Definition at line 768 of file CPSearchField.j.

- (CPView) hitTest: (CGPoint)  aPoint
implementation

Definition at line 480 of file CPSearchField.j.

+ (void) initialize
implementation

Reimplemented from CPControl.

Definition at line 71 of file CPSearchField.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 CPTextField.

Provided by category CPSearchField(CPCoding).

Definition at line 791 of file CPSearchField.j.

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPTextField.

Definition at line 83 of file CPSearchField.j.

- (BOOL) isOpaque
implementation

Returns whether the receiver is completely opaque. By default, returns NO.

Reimplemented from CPView.

Definition at line 422 of file CPSearchField.j.

- (int) maximumRecents
implementation

Returns the maximum number of recent search strings to display in the custom search menu.

Returns
The maximum number of search strings that can appear in the menu. This value is between 0 and 254.

Definition at line 338 of file CPSearchField.j.

- (CPMenu) menu
implementation

Reimplemented from CPResponder.

Definition at line 417 of file CPSearchField.j.

- (void) menuDidClose: (CPMenu menu
implementation

Definition at line 667 of file CPSearchField.j.

- (void) menuWillOpen: (CPMenu menu
implementation

Definition at line 662 of file CPSearchField.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 CPTextField.

Definition at line 494 of file CPSearchField.j.

- (CPString) recentsAutosaveName
implementation

Returns the key under which the prior list of recent search strings has been archived.

Returns
The autosave name, which is used as a key in the standard user defaults to save the recent searches. The default value is nil, which causes searches not to be autosaved.

Definition at line 384 of file CPSearchField.j.

- (CPArray) recentSearches
implementation

Returns the list of recent search strings for the control.

Returns
An array of CPString objects, each of which contains a search string either displayed in the search menu or from a recent autosave archive. If there have been no recent searches and no prior searches saved under an autosave name, this array may be empty.

Definition at line 361 of file CPSearchField.j.

- (void) resetCancelButton
implementation

Resets the cancel button to its default attributes. This method resets the target, action, regular image, and pressed image. This method gives you a way to customize the cancel button for specific situations and then reset the button defaults without having to undo changes individually.

Definition at line 212 of file CPSearchField.j.

- (void) resetSearchButton
implementation

Resets the search button to its default attributes. This method resets the target, action, regular image, and pressed image. By default, when users click the search button or press the Return key, the action defined for the receiver is sent to its designated target. This method gives you a way to customize the search button for specific situations and then reset the button defaults without having to undo changes individually.

Definition at line 168 of file CPSearchField.j.

- (BOOL) resignFirstResponder
implementation

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.

Reimplemented from CPTextField.

Definition at line 489 of file CPSearchField.j.

- (CPButton) searchButton
implementation

Returns the button used to display the search-button image.

Returns
The search button.

Definition at line 159 of file CPSearchField.j.

- (CGRect) searchButtonRectForBounds: (CGRect)  rect
implementation

Modifies the bounding rectangle for the search button.

Parameters
rectThe current bounding rectangle for the search button. Subclasses can override this method to return a new bounding rectangle for the search button. You might use this method to provide a custom layout for the search field control.

Definition at line 257 of file CPSearchField.j.

- (CPMenu) searchMenuTemplate
implementation

Returns the menu template object used to dynamically construct the search pop-up icon menu.

Returns
The current menu template.

Definition at line 277 of file CPSearchField.j.

- (CGRect) searchTextRectForBounds: (CGRect)  rect
implementation

Modifies the bounding rectangle for the search-text field.

Parameters
rectThe current bounding rectangle for the search text field.
Returns
The updated bounding rectangle to use for the search text field. The default value is the value passed into the rect parameter. Subclasses can override this method to return a new bounding rectangle for the text-field object. You might use this method to provide a custom layout for the search field control.

Definition at line 231 of file CPSearchField.j.

- (void) sendAction: (SEL)  anAction
to: (id)  anObject 
implementation

Causes anAction to be sent to anObject.

Parameters
anActionthe action to send
anObjectthe object to which the action will be sent

Reimplemented from CPControl.

Definition at line 459 of file CPSearchField.j.

- (BOOL) sendsSearchStringImmediately
implementation

Returns a Boolean value indicating whether the receiver sends its action immediately upon being notified of changes to the search field text or after a brief pause.

Returns
YES if the text field sends its action immediately upon notification of any changes to the search field; otherwise, NO.

Definition at line 319 of file CPSearchField.j.

- (BOOL) sendsWholeSearchString
implementation

Returns a Boolean value indicating whether the receiver sends the search action message when the user clicks the search button (or presses return) or after each keystroke.

Returns
YES if the action message is sent all at once when the user clicks the search button or presses return; otherwise, NO if the search string is sent after each keystroke. The default value is NO.

Definition at line 301 of file CPSearchField.j.

- (void) setCancelButton: (CPButton button
implementation

Sets the button object used to display the cancel-button image.

Parameters
buttonThe cancel button.

Definition at line 183 of file CPSearchField.j.

- (void) setMaximumRecents: (int)  max
implementation

Sets the maximum number of search strings that can appear in the search menu.

Parameters
maxRecentsThe maximum number of search strings that can appear in the menu. This value can be between 0 and 254. Specifying a value less than 0 sets the value to the default, which is 10. Specifying a value greater than 254 sets the maximum to 254.

Definition at line 347 of file CPSearchField.j.

- (void) setRecentsAutosaveName: (CPString name
implementation

Sets the autosave name under which the receiver automatically archives the list of recent search strings.

Parameters
nameThe autosave name, which is used as a key in the standard user defaults to save the recent searches. If you specify nil or an empty string for this parameter, no autosave name is set and searches are not autosaved.

Definition at line 393 of file CPSearchField.j.

- (void) setRecentSearches: (CPArray searches
implementation

Sets the list of recent search strings to list in the pop-up icon menu of the receiver.

Parameters
searchesAn array of CPString objects containing the search strings. You might use this method to set the recent list of searches from an archived copy.

Definition at line 371 of file CPSearchField.j.

- (void) setSearchButton: (CPButton button
implementation

Sets the button used to display the search-button image

Parameters
buttonThe search button.

Definition at line 142 of file CPSearchField.j.

- (void) setSearchMenuTemplate: (CPMenu aMenu
implementation

Sets the menu template object used to dynamically construct the receiver's pop-up icon menu.

Parameters
menuThe menu template to use. The receiver looks for the tag constants described in ŇMenu tagsÓ to determine how to populate the menu with items related to recent searches. See ŇConfiguring a Search MenuÓ for a sample of how you might set up the search menu template.

Definition at line 287 of file CPSearchField.j.

- (void) setSendsSearchStringImmediately: (BOOL)  flag
implementation

Sets whether the text field sends its action message to the target immediately upon notification of any changes to the search field text or after a brief pause.

Parameters
flagYES to send the text field's action immediately upon notification of any changes to the search field; otherwise, NO if you want the text field to pause briefly before sending its action message. Pausing gives the user the opportunity to type more text into the search field before initiating the search.

Definition at line 328 of file CPSearchField.j.

- (void) setSendsWholeSearchString: (BOOL)  flag
implementation

Sets whether the receiver sends the search action message when the user clicks the search button (or presses return) or after each keystroke.

Parameters
flagYES to send the action message all at once when the user clicks the search button or presses return; otherwise, NO to send the search string after each keystroke.

Definition at line 310 of file CPSearchField.j.

- (void) viewWillMoveToSuperview: (CPView aView
implementation

Called when the receiver is about to be moved to a new view.

Parameters
aViewthe view to which the receiver will be moved

Reimplemented from CPView.

Definition at line 125 of file CPSearchField.j.


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