TweetFollow Us on Twitter

Tools Plus
Volume Number:12
Issue Number:7
Column Tag:Programming Tools

Tools Plus 3.0

Paradise for “control” freaks

By Rich Parker

Everyone Wants
to Program the Mac

Almost all Mac owners, at one point or another, harbor a desire to program their own machine. Some may be well served by products like HyperCard, but others just can’t wait to learn C, C++, or Pascal, so that they can write the next “killer” application.

If they start programming by buying books that illustrate programs that use the standard ANSI libraries, they might make quite a bit of progress in learning the language and writing routines that use a “console” interface. At some point, though, the realization sinks in that these aren’t “real” Mac applications, and then the trouble begins. The age-old question that I see over and over again on the online services is: “How do I get started writing ‘real’ Mac programs?”

Most people are directed to read one of Dave Mark’s or Dan Sydow’s fine books on the subject of Mac programming for their favorite language, but these books provide only the basic information needed to write “real” Mac programs. At some point, the (now quite distressed) user is directed to the almighty gospel of Inside Macintosh to further his or her knowledge. This is the point at which most budding programmers wimp out, and I don’t really blame them. I think you will agree that trying to learn to program the Mac by reading Inside Macintosh is like learning to play the piano by studying the details of music composition.

So What’s the Alternative?

I think it’s well known in the developer community that I favor the use of application frameworks. Developing Mac applications using PowerPlant, TCL, or MacApp is something that comes easily to me. But I also recognize the negative aspects of these frameworks, and readily admit that they are not a solution for all people or all applications.

In the first place, most application frameworks demand much more memory than would be required if one had the time to read, understand, and apply all of the appropriate built-in Mac toolbox routines to the problem. But the difficulty of understanding the Mac toolbox is equaled only by the steep learning curve of most of the current application frameworks. So we are left with an almost insoluble problem - whether to spend endless hours reading Inside Macintosh or to spend equally endless hours studying the structure and functionality of an application framework.

Tools Plus to the Rescue!

Steve Makohin, Steven Waters, and the folks at Water’s Edge Software realized that programming the Mac wasn’t easy. After all, they ran into these problems themselves when they first started. So they set out to create a set of high-level functions that would enable others to program the Mac much more easily, without having to worry about handling some of the more difficult aspects of Mac programming. The result was a set of binary libraries that could be included in projects for your favorite development environment, whose routines could be called to implement and manage exceedingly sophisticated Mac user interfaces. (After all, it’s the user interface that is the most complex aspect of any Mac application development.)

The first Tools Plus product was developed as a result of an R&D project in 1989. By 1992, after considerable prodding from various contractors and project managers, Makohin and Waters decided to polish their product to commercial readiness. A year later, Water’s Edge Software was formalized to become the delivery vehicle for Tools Plus, and to support its users.

The product has been continually enhanced, and version 3.0 of the Tools Plus product is even more capable than any previous version. It comes with a wealth of features that promise to make almost any Mac programming project a pleasure, rather than a pain.

What’s It All About?

Tools Plus version 3.0 consists of a set of GUI Building/Event-Managing libraries for Macintosh programmers using any of the following compilers:

• Metrowerks CodeWarrior C/C++ and CodeWarrior Pascal for either 680x0-based or Power Macintosh systems. All versions of CodeWarrior from 6.0 through 8.0 are supported. The Power Mac libraries are native for both C/C++ and Pascal.

• THINK Pascal version 4.0.2 or later for 68K development only.

• THINK C version 5.0.4 or later for 68K development only.

• Symantec C/C++ version 6.0.1 or later for 68K development only. This includes the newly released Symantec version 8.1, which supports 68K development with the Symantec Project Manager; however, in contrast to the CodeWarrior situation, where the PPC-native Tools Plus libraries have been available since mid-1995, native Power Macintosh libraries are not yet available in version 3.0 of Tools Plus for the SPM. [Portions of the Tools Plus source are in Pascal, and until recently there wasn’t SPM PPC-native Pascal support. Water’s Edge feels that the LS Pascal translator needs some maturing before they can release the code it generates. - man]

To use the Tools Plus product, you include the libraries and the ToolsPlus.c file in your Symantec or Metrowerks project (the ToolsPlus.h file is also needed). In the case of Pascal-based projects, the ToolsPlus.p file is added to the project along with the ToolsPlus libraries. Starter project files and all other requisite files (e.g., ToolsPlus.c, ToolsPlus.h, ToolsPlus.p) are provided in the product that you purchase. The products offered by Water’s Edge are as follows:

• Libraries for Symantec compilers (68K only), including THINK C and SPM v8.1 ($149).

• Libraries for the THINK Pascal compiler for 68K development ($149).

• Libraries for both THINK C/SPM and THINK Pascal for 68K development ($199).

• Libraries for Metrowerks CodeWarrior Bronze (68K only), including C, C++, and Pascal ($199).

• Libraries for Metrowerks CodeWarrior Gold (68K and PPC), including C, C++, and Pascal ($249).

• Tools Plus v3.0 Academic for any of the foregoing environments ($99 each).

• Super CDEFs, a collection of special “Control Definition” resources that you can include in your applications for any Macintosh ($89 when purchased alone, $39 for those with an academic discount, or free with the purchase of any non-academic Tools Plus developer kit).

What Features Do the Libraries Provide?

The Tools Plus libraries provide a comprehensive set of user interface elements and event-management features. Every control is created with a single statement in your application. The user interface elements include windows of various types, including all standard window types, floating palettes, movable modal dialogs, buttons, editing fields, raised or sunken 3D panels, and many other features. The best way to show you some of the things you’re likely to use is to display some screen shots of the Demo program that ships with every copy of the Tools Plus product, and is also available on all of the major online services (along with its source code). I built the demo application inside CodeWarrior version 8.0 for the PowerMac. The project file for that build is shown in Figure 1. You can see from the figure that the Demo program’s project file contains several of the standard Metrowerks libraries, as well as the Tools Plus.Lib library. The Demo program is 228K in size and runs in a partition of 384K. It includes examples of many of the features that are available in the Tools Plus product.

Figure 1. CodeWarrior project file for Demo program

The window in Figure 2 describes itself. When you move the cursor into the “Plus” cursor zone, the cursor changes into a plus-sign. When you move the cursor into the “Cross” cursor zone, the cursor changes into a cross. The lists demonstrate the use of different fonts with text in any selected color, and the buttons demonstrate the ability to create both standard and non-standard buttons. The checkboxes in the lower left corner demonstrate the ability to disable the “Two And Three” checkbox while the “Second Choice” checkbox is unchecked.

Figure 2. One of the Demo program’s feature demonstrations

Figure 3. More features from the Demo program

In Figure 3, various types of text field are shown. It also demonstrates the use of “live” scroll bars: instead of displaying a “ghost” outline of the thumb when it is dragged, the thumb of the horizontal scroll bar is redrawn in real time as you drag it. (The thumb of the vertical scroll bar displays the normal appearance of an outline when the thumb is dragged.)

Figure 4 simulates a setup window for a MIDI interface, with the two icon buttons selecting a port and the three radio buttons selecting the interface’s speed. (Despite the window’s name, I didn’t see any “Cursor Zones” in this example; the cursor remained in the shape of an arrow within the window.)

In Figure 5 the watch cursor is animated while the progress indicator (“thermometer”) is advancing.

Figure 4. Icon button example

Figure 5. Pretending to sort

Figure 6. Color-independent drawing

Figure 7. Self-sizing alert

Figure 6 illustrates how the Tools Plus library compensates for the color abilities (or lack thereof) of your Macintosh. When the figure is drawn on a monochrome monitor, the picture and accompanying text are drawn so that they are still entirely readable. I didn’t have two monitors to demonstrate to myself that one-half of the window would be drawn in monochrome and the other in color, but I did change the Monitors control panel settings to verify that the color text and the picture are perfectly readable when using the “Black & White” setting.

The alert shown in Figure 7 illustrates that you can put whatever text you want displayed, including carriage-return characters, and the Tools Plus libraries will create a dialog that’s exactly the right width and height to hold that text. (Carriage-return characters are specified as '\r' in the text string.)

The alert shown in Figure 8 demonstrates that dynamic alerts can contain any icon you choose, including the System’s standard icons. After pressing the Continue button in this alert, you are given the opportunity to see other examples of alerts, even alerts with no associated buttons. Clicking the mouse inside the alert dismisses it.

The Tools Plus libraries include a variety of pop-up menus (Figure 9). These can contain words, icons and words, icons only, what Water’s Edge calls “Pop-Down” menus that are used to specify immediate actions to perform, as well as pop-up menus of any size, using any font.

Figure 8. Self-sizing alert with icon of your choice

Figure 9. Various pop-up menus

Figure 10. A plethora of picture pushers

You might think that you’ve seen it all, but we’re just getting to the good stuff. The Tools Plus libraries also contain a large selection of picture buttons. A number of these are illustrated in Figure 10. (Sorry about the caption for the figure, but I couldn’t resist!) The variety of picture buttons available in the Tools Plus libraries is just amazing. Every one of these is created by a single line of code. The 3D buttons in the lower left are examples of CD-ROM controls. The buttons at the top of the window show some of the features of text-editor and drawing programs. The middle set of buttons in the top panel illustrate various text justification styles.

The “Step” and “Scroll” buttons in the middle of the figure illustrate how the values shown on the buttons can be modified by clicking on either the top or bottom of the button. Clicking on or near the plus-symbol or minus-symbol in one of the buttons causes the numerical value in that button to increment or decrement, respectively; plus, the “Step” button changes value each time it is clicked, whereas the “Scroll” button continues to increase or decrease in value as long as the mouse button is held down.

The button at the far right, in the middle of the window, has an associated value whose minimum, initial, and maximum are specified when the button is created. If the button is clicked near its right edge, then the button’s value is increased. If the button is clicked near its left edge, then the button’s value is decreased. (The display of “0š” below the button is managed separately and, according to the specifications for the “Globe” button, can vary from -179° to +180°.) The button is also specified to have medium acceleration, meaning that the value changes more and more quickly the longer the button is pressed. (An acceleration rate can be specified as slow, medium, or fast.) The “Globe” button is created by a single line of code:

NewPictButton( GlobeButton, 410, 153, GlobeIcon, 
 picbutRepeatEvents + picbutAutoValueChg + 
 picbutScaleMedAccel + picbutValueWrap + 
 picbutLeftRightSplit + picbutSelectAltImage +
 picbutDimUsingWhite, enabled, notSelected, -179, 0, 180);

Figure 11. Large text fields

Most of the style settings here are specified as symbolic names. The button’s ID (GlobeButton) is a unique value that identifies the button whenever it is referenced. The Demo program defines the GlobeButton symbol as the value 16. The icon for the button can be anything you want and is indicated by the GlobeIcon symbol, which is defined to refer to a 'cicn' resource of 460. The 410 and 153 values refer to the left and top positions of the button, and the numeric values in the last three arguments refer to the minimum, initial, and maximum values that the button can contain.

Figure 10 also shows an ON/OFF button whose caption changes whether it is on or off and also a toggle-switch which changes its appearance depending upon whether it is clicked to the left or right. It’s safe to say that the figure illustrates only a few of the multitude of picture button possibilities.

Some applications require text fields that exceed the standard 255 character-width provided by Str255 variables. The Tools Plus libraries provide text fields that are up to 32K characters in width. These are illustrated by Figure 11. You can display panes that contain quite large text fields. The lower pane in the figure illustrates a field that has both vertical and horizontal scroll bars. Each of the text panes has its own font, size, style, color, and justification. The horizontal scroll bar can occupy the entire width of the window, or it can be offset by any multiple of fifteen pixels, from 15 to 225. The offset is from the left edge of the window. There are so many options with each of these elements that it’s impossible to list all of the features here.

Figure 12. Panels and a 3D look

Water’s Edge saved the best window for last in its Demo menu; it shows how 3D panels can be used to spruce up your user interface (Figure 12). I like the raised and inset panels best. This figure shows how button groups and lists with a variety of appearances can be created easily by using the Tools Plus libraries. Once again, each of the elements in the figure was created with a single statement in the Demo program’s source code; this is clear testimony to the power of the libraries.

There are more features shown in the Demo program than are pictured here. Tools Plus provides floating palettes that are oriented either horizontally or vertically, and also tool bars that nestle directly under the menu bar in your application. All in all, it’s an incredibly rich collection of tools.

The product comes with a 392-page printed spiral-bound manual. It’s comprehensive and well written, and includes prototypes (in both C and Pascal) for calling the functions, plus examples and tips. It’s really good. And you also have the source code for the Demo application to compare against the manual’s explanations. Water’s Edge also provides source code tutorial samples illustrating how to create a “Hello World” application, plus buttons and panels, list boxes, editing fields, pop-up menus, picture buttons, tool bars and floating palettes, and so on. Each tutorial project is simple enough that the relevant features are all in one place.

SuperCDEFs Too!

Water’s Edge also offers a set of custom CDEFs (control definition resources) called SuperCDEFs, implementing many of the custom features of the Tools Plus libraries. As stated earlier, this product is available separately or with the purchase of a Tools Plus Development Kit for any of the listed development environments (not with an academic discount). To paraphrase the SuperCDEFs User’s Manual, it consists of a collection of high-quality contemporary controls, designed and implemented by professional Macintosh developers to be as reliable as Apple’s controls, and just as easy to use. The SuperCDEFs offer a range of styles, from subtle improvements over Apple’s own to a bold 3D appearance.

The CDEFs are arranged in categories encompassing buttons, tabs, sliders, and thermometer controls. 68K, native PPC, and fat versions of the controls are offered. The SuperCDEFs product comes with a comprehensive online user’s manual. I didn’t have a chance to test the CDEFs.

OK, They Did it, But Can I?

I think the answer to this question is: Maybe. It all depends on how much effort you are willing to put into learning the Tools Plus library functions.

One thing you’ll have to get used to is that the Tools Plus libraries provide a higher-level event loop called PollSystem that returns the current event in a special Poll structure. This lets the loop identify directly the element for which the event is destined, rather than requiring you to deal with mouse coordinates, “control parts,” or the like. The Tools Plus manual provides only one example of the main event loop, but it is in Pascal, rather than in both C and Pascal. Water’s Edge didn’t also provide a single library function to initialize the various toolbox managers, so you will have to start your application with the usual toolbox initialization calls. You also have to initialize the Tools Plus components with a call to InitToolsPlus. None of this is hard.

More important, there is no graphical interface for designing the interface. You have to design on graph paper, estimating coordinate values for the various elements - because, instead of using resources to describe the various controls, Water’s Edge requires that you include coordinates and sizes inside the function calls. This also has implications for “tweaking” the interface as the program design progresses - this involves modifying the code and not just the parameters of a resource.

The folks at Water’s Edge are aware of all this, and are currently working on a project code-named “Anthem” that will offer a MacDraw-like user interface design capability, and then generate source code targeted directly at the Tools Plus library function call interfaces. If this sounds like another AppMaker or Visual Architect tool to you, Water’s Edge is quick to point out that their objective is to reduce the complexity and volume of source code in a project, and this includes source code in a class library or code generated by an application builder. We’ll have to wait until the end of 1996 to see what Water’s Edge has in store for us in this regard.

In the meantime, if you are interested in developing applications that have “quality” written all over them, then Tools Plus is for you. It will take some time to get used to writing functions rather than using resources, but the result will be worth the effort. I tested both the CodeWarrior and Symantec versions of the product and found each of them to work perfectly. If I wasn’t hard at work on another book project at this time, I’d be very tempted to write a program using the Tools Plus product.

Water’s Edge Software, 2441 Lakeshore Road West, Box 70022, Oakville, Ontario, Canada, L6L 6M9.

Phone: 1-416-219-5628 Fax: 1-905-847-1638

WaterEdg@interlog.com

http://www.interlog.com/~wateredg

 
AAPL
$105.22
Apple Inc.
+0.39
MSFT
$46.13
Microsoft Corpora
+1.11
GOOG
$539.78
Google Inc.
-4.20

MacTech Search:
Community Search:

Software Updates via MacUpdate

Ember 1.8.2 - Versatile digital scrapboo...
Ember (formerly LittleSnapper) is your digital scrapbook of things that inspire you: websites, photos, apps or other things. Just drag in images that you want to keep, organize them into relevant... Read more
Tonality Pro 1.1.2 - Professional-grade...
Tonality Pro gives you the power to create stunning and dramatic black & white images. This is a complete monochrome image editor with more than 150 one-click style presets, totally unique... Read more
VueScan 9.4.49 - Scanner software with a...
VueScan is a scanning program that works with most high-quality flatbed and film scanners to produce scans that have excellent color fidelity and color balance. VueScan is easy to use, and has... Read more
OS X Server 4.0 - For OS X 10.10 Yosemit...
Designed for OS X and iOS devices, OS X Server makes it easy to share files, schedule meetings, synchronize contacts, develop software, host your own website, publish wikis, configure Mac, iPhone,... Read more
TotalFinder 1.6.12 - Adds tabs, hotkeys,...
TotalFinder is a universally acclaimed navigational companion for your Mac. Enhance your Mac's Finder with features so smart and convenient, you won't believe you ever lived without them. Tab-based... Read more
BusyCal 2.6.3 - Powerful calendar app wi...
BusyCal is an award-winning desktop calendar that combines personal productivity features for individuals with powerful calendar sharing capabilities for families and workgroups. BusyCal's unique... Read more
calibre 2.7 - Complete e-library managem...
Calibre is a complete e-book library manager. Organize your collection, convert your books to multiple formats, and sync with all of your devices. Let Calibre be your multi-tasking digital... Read more
Skitch 2.7.3 - Take screenshots, annotat...
With Skitch, taking, annotating, and sharing screenshots or images is as fun as it is simple.Communicate and collaborate with images using Skitch and its intuitive, engaging drawing and annotating... Read more
Delicious Library 3.3.2 - Import, browse...
Delicious Library allows you to import, browse, and share all your books, movies, music, and video games with Delicious Library. Run your very own library from your home or office using our... Read more
Art Text 2.4.8 - Create high quality hea...
Art Text is an OS X application for creating high quality textual graphics, headings, logos, icons, Web site elements, and buttons. Thanks to multi-layer support, creating complex graphics is no... Read more

Latest Forum Discussions

See All

Rami Ismail Opens Up distribute​() for D...
Rami Ismail Opens Up distribute​() for Developers Posted by Jessica Fisher on October 24th, 2014 [ permalink ] Rami Ismail, Chief Executive of Business and Development at indie game studio | Read more »
Great Hitman GO Goes on Sale and Gets Ne...
Great Hitman GO Goes on Sale and Gets New Update – Say That Three Times Fast Posted by Jessica Fisher on October 24th, 2014 [ permalink ] | Read more »
Rival Stars Basketball Review
Rival Stars Basketball Review By Jennifer Allen on October 24th, 2014 Our Rating: :: RESTRICTIVE BUT FUNUniversal App - Designed for iPhone and iPad Rival Stars Basketball is a fun mixture of basketball and card collecting but its... | Read more »
Rubicon Development Makes Over a Dozen o...
Rubicon Development Makes Over a Dozen of Their Games Free For This Weekend Only Posted by Jessica Fisher on October 24th, 2014 [ permalink ] | Read more »
I Am Dolphin Review
I Am Dolphin Review By Jennifer Allen on October 24th, 2014 Our Rating: :: NEARLY FIN-TASTICUniversal App - Designed for iPhone and iPad Swim around and eat nearly everything that moves in I Am Dolphin, a fun Ecco-ish kind of game... | Read more »
nPlayer looks to be the ultimate choice...
Developed by Newin Inc, nPlayer may seem like your standard video player – but is aiming to be the best in its field by providing high quality video play performance and support for a huge number of video formats and codecs. User reviews include... | Read more »
Fighting Fantasy: Caverns of the Snow Wi...
Fighting Fantasy: Caverns of the Snow Witch Review By Jennifer Allen on October 24th, 2014 Our Rating: :: CLASSY STORYTELLINGUniversal App - Designed for iPhone and iPad Fighting Fantasy: Caverns of the Snow Witch is a sterling... | Read more »
A Few Days Left (Games)
A Few Days Left 1.01 Device: iOS Universal Category: Games Price: $3.99, Version: 1.01 (iTunes) Description: Screenshots are in compliance to App Store's 4+ age rating! Please see App Preview for real game play! **Important: Make... | Read more »
Toca Boo (Education)
Toca Boo 1.0.2 Device: iOS Universal Category: Education Price: $2.99, Version: 1.0.2 (iTunes) Description: BOO! Did I scare you!? My name is Bonnie and my family loves to spook! Do you want to scare them back? Follow me and I'll... | Read more »
Intuon (Games)
Intuon 1.1 Device: iOS Universal Category: Games Price: $.99, Version: 1.1 (iTunes) Description: Join the battle with your intuition in a new hardcore game Intuon! How well do you trust your intuition? Can you find a needle in a... | Read more »

Price Scanner via MacPrices.net

Weekend sale: 13-inch 128GB MacBook Air for $...
Best Buy has the 2014 13-inch 1.4GHz 128GB MacBook Air on sale for $849.99, or $150 off MSRP, on their online store. Choose free home shipping or free local store pickup (if available). Price valid... Read more
Nimbus Note Cross=Platform Notes Utility
Nimbus Note will make sure you never forget or lose your valuable data again. Create and edit notes, save web pages, screenshots and any other type of data – and share it all with your friends and... Read more
NewerTech’s Snuglet Makes MagSafe 2 Power Con...
NewerTech has introduced the Snuglet, a precision-manufactured ring designed to sit inside your MagSafe 2 connector port, providing a more snug fit to prevent your power cable from unintentional... Read more
Apple Planning To Sacrifice Gross Margins To...
Digitimes Research’s Jim Hsiao says its analysts believe Apple is planning to sacrifice its gross margins to save its tablet business, which has recently fallen into decline. They project that Apple’... Read more
Who’s On Now? – First Instant-Connect Search...
It’s nighttime and your car has broken down on the side of the highway. You need a tow truck right away, so you open an app on your iPhone, search for the closest tow truck and send an instant... Read more
13-inch 2.5GHz MacBook Pro on sale for $949,...
Best Buy has the 13″ 2.5GHz MacBook Pro available for $949.99 on their online store. Choose free shipping or free instant local store pickup (if available). Their price is $150 off MSRP. Price is... Read more
Save up to $125 on Retina MacBook Pros
B&H Photo has the new 2014 13″ and 15″ Retina MacBook Pros on sale for up to $125 off MSRP. Shipping is free, and B&H charges NY sales tax only. They’ll also include free copies of Parallels... Read more
Apple refurbished Time Capsules available sta...
The Apple Store has certified refurbished Time Capsules available for up to $60 off MSRP. Apple’s one-year warranty is included with each Time Capsule, and shipping is free: - 2TB Time Capsule: $255... Read more
Textilus New Word, Notes and PDF Processor fo...
Textilus is new word-crunching, notes, and PDF processor designed exclusively for the iPad. I haven’t had time to thoroughly check it out yet, but it looks great and early reviews are positive.... Read more
WD My Passport Pro Bus-Powered Thunderbolt RA...
WD’s My Passport Pro RAID solution is powered by an integrated Thunderbolt cable for true portability and speeds as high as 233 MB/s. HighlightsOverviewSpecifications Transfer, Back Up And Edit In... Read more

Jobs Board

*Apple* Solutions Consultant - Apple Inc. (U...
…important role that the ASC serves is that of providing an excellent Apple Customer Experience. Responsibilities include: * Promoting Apple products and solutions Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Project Manager / Business Analyst, WW *Appl...
…a senior project manager / business analyst to work within our Worldwide Apple Fulfillment Operations and the Business Process Re-engineering team. This role will work Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.