Article Preview
Buy Now
REVIEW
MaxiToolbar Pro
Issue: 2.5 (May/June 2004)
Author: Marc Zeedar
Article Description: No description available.
Article Length (in bytes): 4,068
Starting Page Number: 8
Article Number: 2503
Related Web Link(s):
http://ebutterfly.com/rb/maxitoolbar.asp
Full text of article...
So you've just finished your fantastic REALbasic application, designed with an attractive Mac OS X toolbar. When you go to compile, it hits you: RB's Mac OS X toolbar support doesn't work under Windows or Mac Classic. What are you going to do?
The answer is MaxiToolbar Pro (MTP for short). Formerly sold as Toolbar Buttons Pro by Everyday Software, MTP has been acquired and updated by Electric Butterfly.
MaxiToolbar Pro is a collection of classes for REALbasic that allows you to create a toolbar that works in Mac OS X, Mac Classic, and Windows. The toolbar looks and functions just like standard Mac OS X toolbars, including menu buttons, icon mode (icon and text, icon only, text only), and button wrap (a submenu appears on the right when the toolbar display isn't wide enough to show all the buttons). The toolbar looks almost exactly the same under Windows and Mac Classic, so you don't have to redesign anything. The current release of MTP doesn't support a "small icons" mode, nor does it allow the user to reconfigure the toolbar.
Additional features such as help tags and contextual menus within the toolbar are also supported. New with version 1.3 is a "flexible spacer" button type which shifts your final button to the far right of a toolbar (like the "burn" button in iTunes).
Using MTP is not difficult, but it could be easier. There are several classes that must be imported into your project and the manual warns that due to the way REALbasic handles cross-linked classes, you must import them in a certain order. This adds several steps to what should be a simple process. It would have been better to name the classes in such a way that they import in the correct order.
After the classes are in your project, you place a series of canvas objects on your window to represent your toolbar. You simply set each canvas to a particular class (for instance, a toolbar, a button, a menu button, a separator, etc.).
Then you must add some initialization code to each button (link the correct icon to the button, install the button's label and help tag, etc.). The most important is setting each button's
itemIndex
property to a number that indicates the order the button appears on the toolbar. On a multi-button toolbar I got confused and had a couple buttons numbered incorrectly and the toolbar didn't work right at all.None of this is difficult, but it's easy to make mistakes. While the example project shows you how to code the toolbar, since RB can't open two projects at once it'd be nice if this code were available within the imported classes somewhere (i.e., inside a notes field).
Minor learning curve aside, if you want to create a Mac OS X-style toolbar and use it in all versions of your application (Classic and Windows), you'll be happy with MTP.
End of article.