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.

Article Preview


Buy Now

Print:
PDF:

Review

Toolbar Utilities

Issue: 5.5 (July/August 2007)
Author: David Mancuso
Article Description: No description available.
Article Length (in bytes): 3,621
Starting Page Number: 10
RBD Number: 5507
Resource File(s): None
Related Link(s): None
Known Limitations: None

Full text of article...

Toolbar Utilities began as a thread on the REALbasic Network User's Group mailing list (the NUG). The email discussion thread was about setting window toolbar modes. OS X users expect the window title bar toolbar widget (I call it the "tic-tac") to be able to remember the modes of the toolbar. For instance, clicking the widget hides the toolbar, and Apple-clicking the toolbar cycles through icon, text, and icon and text modes. REALbasic apps use the tic-tac, but you can't get the state of the toolbar and use it later. The question on the NUG list was essentially "How do we get access to this state and use it?"

The discussion resulted in some examples from Thom McGrath and Charles Yeomans. They showed how declares could add this toolbar mode functionality to REALbasic applications. Brad Rhine felt that the tips should be bundled into a module, so he created Toolbar Utilities and posted it on his website as open source. The posted module is ready to drop into a project and use immediately. It requires REALbasic 2006r2 or greater.

The module contains eight methods. One method lets you cycle an application's modes from Icon Only to Text Only and then Icon and Text. Another method lets you set icons to large and small icon size. Default, a third available size, is effectively the same as large (it's in the toolbar framework, just not used at this point). You can also set toolbars to be visible or not visible for each window. Finally, you can turn the title bar widget on or off in windows so that it's gone completely if you wish. You can get or set properties for each of these behaviors. Most importantly, you can save the state of the toolbar and bring that state back when you reinstantiate a window in your app.

Toolbar Utilities comes with documentation notes in the module. They explain what the methods do and how to call them. The declares themselves are straightforward and easy to use.

The methods work for Mac but won't provide any functionality for Windows or Linux platforms, since they're all declares to Carbon. In the future, it's hoped that the module can be expanded to include Windows and Linux functionality. While there's no toolbar widget on those platforms, the ability to get and set toolbar properties is still desirable. As Toolbar Utilities is an open source project, contributors to development are welcome.

Toolbar Utilities is a great leveraging of REALbasic community resources. The NUG list and the REALbasic forums are valuable places to find these nuggets of code. It's nice to see developers pulling these tips and providing them in a ready to use format. Hopefully we'll see more packaged modules and classes like Toolbar Utilities.

IN BRIEF
 
Product
Toolbar Utilities 1.0
 
Manufacturer
Brad Rhine
 
Price
Free, open source
 
Contact Info
http://bradrhine.com/pages/opensource.php
 
Pros
Delivers effective control over toolbar states
 
Cons
Not cross-platform; Mac-only in version 1
 
Rating (1.0-5.0):
4.2

End of article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com