Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Recent issues

Article Preview


Buy Now

Print:
PDF:

Review

HISearchField

Issue: 5.3 (March/April 2007)
Author: Toby Rush
Article Description: No description available.
Article Length (in bytes): 3,412
Starting Page Number: 8
RBD Number: 5303
Resource File(s): None
Related Web Link(s):

http://www.declaresub.com/

Known Limitations: None

Full text of article...

The OS X Spotlight-style search field is an attractive control missing from REALbasic's suite of built-in controls. Long-time REALbasic developer Charle Yeomans' solution, HISearchField, is sleek, functional, and designed with both the end user and developer in mind.

HISearchField provides all the standard and optional features of these controls: the Spotlight magnifying glass icon along with its optional menu, the cancel button (an X in a grey circle at the right end of the field), and descriptive text that appears in the absence of any user-provided search terms.

Everything is implemented in a way that very nicely complements REALbasic's built-in controls. The field itself has the following as gettable and settable properties:

CancelButton as Boolean - for showing/hiding the cancel button

SearchIcon as Boolean - for showing/hiding the magnifying glass icon

DescriptiveText as String - the grey text that displays when the field is otherwise empty

Text as String - the contents of the field

SelLength as Integer, SelStart as Integer - the placement and size of the current selection

The field also provides the property HasFocus as Boolean to indicate when the field has the focus.

HISearchField allows the user to write code for most of the same events as a normal editField (TextChanged, GotFocus, and LostFocus) as well as some that are specific to the search field: Cancel, which fires when the user clicks the cancel button in the control; MenuItemSelected, which fires when the user chooses a menuitem in the optional popup menu; and TextAccepted, which fires when the user presses return or enter in the search field (or changes the focus away from it).

The optional menu is provided by means of a separate (but included) object, the MacMenu. This object, accessible through HISearchFIeld.Menu, provides a popup menu with more capabilities than the built-in PopupMenu control provided by REALbasic, including styles for individual menu items and indented menu items.

Perhaps the best aspect of HISearchField is that while the entire control is written in REALbasic, everything is toolbox-based, so the interface matches the appearance and speed of search fields in applications like Safari, iTunes, or even the Finder itself. The control blends beautifully into the window in which it's placed, requiring only that the window's composite property be set to "true."

Equally attractive is HISearchField's price -- free -- which is a very good deal considering the capabilities provided by this control.

IN BRIEF
 
Product
HISearchField
 
Manufacturer
Charles Yeomans
 
Price
Free
 
Contact Info
http://www.declaresub.com/
 
Pros
Fully functional

Toolbox-based

Predictable coding interface

 
Cons
No documentation
 
Rating (1.0-5.0):
4.8

End of article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com