#import <FindPanelController.h>
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 | |
|
|
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:
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.
Definition at line 53 of file FindPanelController.m. References setFindString:. Here is the call graph for this function: ![]() |
|
|
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. |
|
|
Referenced by setFindOption:. |
|
|
Definition at line 14 of file FindPanelController.m. References panel. |
|
|
Load the Find panel from FindPanel.nib.
Definition at line 8 of file FindPanelController.m. |
|
|
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.
Definition at line 34 of file FindPanelController.m. References caseCheckBox, caseSensitive, wrapCheckBox, and wrapSearch. Here is the call graph for this function: ![]() |
|
|
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.
Definition at line 42 of file FindPanelController.m. References length(), and stringField. Referenced by actionButton:. Here is the call graph for this function: ![]() |
|
|
Make the Find panel the visible, frontmost, and key window.
Definition at line 26 of file FindPanelController.m. References panel. |
|
|
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.
Definition at line 64 of file FindPanelController.m. References stringField. |
|
|
Referenced by setFindOption:. |
|
|
case-sensitivity checkbox
Definition at line 19 of file FindPanelController.h. Referenced by setFindOption:. |
|
|
whether the search minds letter case
Definition at line 26 of file FindPanelController.h. |
|
|
find-next button
Definition at line 20 of file FindPanelController.h. |
|
|
the panel itself
Definition at line 21 of file FindPanelController.h. Referenced by awakeFromNib, dealloc, and show:. |
|
|
find-previous button
Definition at line 22 of file FindPanelController.h. |
|
|
the what-to-find field
Definition at line 23 of file FindPanelController.h. Referenced by setFindString:, and windowDidBecomeKey:. |
|
|
search-wraps checkbox
Definition at line 24 of file FindPanelController.h. Referenced by setFindOption:. |
|
|
whether the search wraps around at end-of-text
Definition at line 27 of file FindPanelController.h. |
1.4.4