Main Page | Modules | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

FindPanelController Class Reference
[Panels]

#import <FindPanelController.h>


Detailed Description

Controller for the find-text panel.

Crescat's find panel is unremarkable, providing a search in both directions, case-sensitive or not, wrapping or not. It takes search strings from the global Find pasteboard, and puts its own find text on the Find pasteboard.

Instantiate this controller only once, with [[FindPanelController alloc] init]. This will load what you want to be the one and only Find panel from the NIB. The user may close the panel, but it can always be shown again by sending show: (FindPanelController) to the controller.

Its associated NIB is FindPanel.nib.

Definition at line 17 of file FindPanelController.h.

Public Member Functions

(IBAction) - actionButton:
 Perform a standard find-panel action (expect find-forward or -reverse).
(IBAction) - setFindOption:
 Respond to the case-sensitivity and wrap-search check boxes.
(IBAction) - setFindString:
 Set the search pasteboard from the search field.
(void) - show:
 Make the Find panel the visible, frontmost, and key window.
(BOOL) - caseSensitive
(BOOL) - wrapSearch
(id) - init [implementation]
 Load the Find panel from FindPanel.nib.
(void) - dealloc [implementation]
(void) - awakeFromNib [implementation]
 Post-loading cleanup.
(void) - windowDidBecomeKey: [implementation]
 Window-became-key notification; check the global find pasteboard.

Protected Attributes

IBOutlet NSButton * caseCheckBox
 case-sensitivity checkbox
IBOutlet NSButton * nextButton
 find-next button
IBOutlet NSPanel * panel
 the panel itself
IBOutlet NSButton * prevButton
 find-previous button
IBOutlet NSTextField * stringField
 the what-to-find field
IBOutlet NSButton * wrapCheckBox
 search-wraps checkbox
BOOL caseSensitive
 whether the search minds letter case
BOOL wrapSearch
 whether the search wraps around at end-of-text


Member Function Documentation

- (IBAction) actionButton: (id)  sender  
 

Perform a standard find-panel action (expect find-forward or -reverse).

The standard practice seems to be that find-panel-related messages go through a bottleneck action method which decides what to do based on the tag of the sender:

  • 1 means show the Find panel.
  • 2 means find forward.
  • 3 means find backward.
  • 7 means enter the selection on the find pasteboard.

These are the codes taken care of by Crescat; the rest are passed up the chain in the performFindPanelAction: message.

This method sends performFindPanelAction: to the responder chain, with the sender as the parameter. The nextButton and prevButton are tagged 2 and 3 respectively.

Parameters:
sender id, the sender of the message by the IBAction protocol.

Definition at line 53 of file FindPanelController.m.

References setFindString:.

Here is the call graph for this function:

- (void) awakeFromNib   [implementation]
 

Post-loading cleanup.

Sets becomesKeyOnlyIfNeeded to YES, so the panel will be less likely to surprise the user by stealing keyboard focus.

Definition at line 21 of file FindPanelController.m.

References panel.

- (BOOL) caseSensitive  
 

Referenced by setFindOption:.

- (void) dealloc   [implementation]
 

Definition at line 14 of file FindPanelController.m.

References panel.

- (id) init   [implementation]
 

Load the Find panel from FindPanel.nib.

Return values:
self 

Definition at line 8 of file FindPanelController.m.

- (IBAction) setFindOption: (id)  sender  
 

Respond to the case-sensitivity and wrap-search check boxes.

This method identifies the sender as either caseCheckBox or caseCheckBox, and sets the caseSensitive or wrapSearch flag according to the check box's new state.

Parameters:
sender id, the sender by the IBAction protocol.

Definition at line 34 of file FindPanelController.m.

References caseCheckBox, caseSensitive, wrapCheckBox, and wrapSearch.

Here is the call graph for this function:

- (IBAction) setFindString: (id)  sender  
 

Set the search pasteboard from the search field.

Transfers the contents of stringField as a string to the global Find pasteboard. This method does not change the search pasteboard if the search field is empty.

Parameters:
sender id, the sender by the IBAction protocol.

Definition at line 42 of file FindPanelController.m.

References length(), and stringField.

Referenced by actionButton:.

Here is the call graph for this function:

- (void) show: (id)  sender  
 

Make the Find panel the visible, frontmost, and key window.

Parameters:
sender id, the sender by the IBAction protocol.

Definition at line 26 of file FindPanelController.m.

References panel.

- (void) windowDidBecomeKey: (NSNotification *)  notice   [implementation]
 

Window-became-key notification; check the global find pasteboard.

If the global find pasteboard has a string on it, set the find panel's search string to contain the text on the pasteboard.

Parameters:
notice NSNotification, the notification in the NSNotification protocol.

Definition at line 64 of file FindPanelController.m.

References stringField.

- (BOOL) wrapSearch  
 

Referenced by setFindOption:.


Field Documentation

- (IBOutlet NSButton*) caseCheckBox [protected]
 

case-sensitivity checkbox

Definition at line 19 of file FindPanelController.h.

Referenced by setFindOption:.

- (BOOL) caseSensitive [protected]
 

whether the search minds letter case

Definition at line 26 of file FindPanelController.h.

- (IBOutlet NSButton*) nextButton [protected]
 

find-next button

Definition at line 20 of file FindPanelController.h.

- (IBOutlet NSPanel*) panel [protected]
 

the panel itself

Definition at line 21 of file FindPanelController.h.

Referenced by awakeFromNib, dealloc, and show:.

- (IBOutlet NSButton*) prevButton [protected]
 

find-previous button

Definition at line 22 of file FindPanelController.h.

- (IBOutlet NSTextField*) stringField [protected]
 

the what-to-find field

Definition at line 23 of file FindPanelController.h.

Referenced by setFindString:, and windowDidBecomeKey:.

- (IBOutlet NSButton*) wrapCheckBox [protected]
 

search-wraps checkbox

Definition at line 24 of file FindPanelController.h.

Referenced by setFindOption:.

- (BOOL) wrapSearch [protected]
 

whether the search wraps around at end-of-text

Definition at line 27 of file FindPanelController.h.


The documentation for this class was generated from the following files:
Generated on Fri Sep 30 12:01:13 2005 for Crescat by  doxygen 1.4.4