TweetFollow Us on Twitter

September 93 - Classy

Classy

William L. Colsher

Classy was recently purchased by Symantec and has been taken off the market. They have said that they will be rereleasing it at some point in the future, perhaps synchronized with other product releases. With the current Bedrock effort, and rumors of a Symantec C++ for Windows and a revised Think Class Library, there are a variety of scenarios one can imagine. Regardless, this article is probably a first in the history of computer journalism–a review of a "finished" product that has not yet been released. We thought you might enjoy it if for no other reason than to get a glimpse of what Symantec might have up its sleeve.

Classy is an object programming utility for use with Think C++ 6.0. It consists of a MacDraw-like view editor with an integrated code generator and a set of classes that implement view resources, stream I/O, and a variety of other useful extensions to the Think Class Library.

The Classy System

Like most programmers, I have a tendency to drag new applications to my drive and double click. Classy slowed me down a bit, since it comes as a CompactorPro archive. While Classy extracted itself (to a total of about 2MB), I read the installation chapter of the manual (Chapter 13-I guess these guys know programmers.) I found the installation process a bit confusing. I suspect this was mostly me-most of my work is with MPW (though that could change with Symantec C++ and Classy on my drive.) Post-extraction installation consists of dragging a couple of folders to the "Symantec C++ for Macintosh" folder (this is where I got confused-I had forgotten about THINK's approach to directories) and then running a program called "GENERALizer." That utility installs the Classy updates to the Think Class Library. Finally, a printed release note documents a couple of bug patches you must manually apply to the Symantec OOPS library.

Once installed, Classy's 24 classes are at your service (see Classy Classes on the next page). They can be used in an existing application just like any of the TCL classes. The best way to use the new classes is to fire up the Classy view editor (also named Classy) and build an application. But first, let's take a look at a few of the key classes.

Classy Classes

Of the 24 Classy classes most are user interface items that either enhance or replace TCL equivalents. However several are particularly worthy of note. First among these are the stream I/O classes. In order of inheritance they are:
CStream
CBufferedStream
CHandleStream       CFileStream

These classes provide the infrastructure necessary to implement Classy's object I/O system. Get and Put functions are provided for all the "standard" data types (like PutChar(), PutBoolean(), and so on) as well as handles and pointers. In addition, there are GetObject and PutObject member functions that operate on CObject and its descendants.

The real power of the stream extensions comes from a pair of new virtual member functions Classy adds to CObject: PutTo and GetFrom. As you might expect, these two functions form the basis of a system that greatly simplifies manipulating your document's data.

To make that job even easier, Classy has added CSaver, a subclass of TCL's CDocument. CSaver implements the all the basic document I/O functions (like OpenFile and DoSave) using CFileStream. It knows what to read or write by adding a new data member called "itsContents." This data member is a pointer to the document's contents. Obviously, most applications will have more than a single data object in their document. The trick is to define a root object with PutTo and GetFrom member functions that deal with the "real" data objects correctly. If you then define a correct PutTo and GetFrom for each of your data objects everything else will be automatic. If this sounds a little confusing, don't worry: the Classy manual is pretty good on this point.

There is a great deal more to creating a complete application and document, but I know that what you really want to hear about is the view editor.

Using the Classy View Editor

The first step in using the Classy view editor is to make a copy of the Classy "starter" project and resource file. As with TCL, the starter project is already set up with the "basic" segments you need. The ".rsrc" file is particularly interesting because it is actually the Classy program's "document." As such, it displays the Classy document icon rather than the familiar jack-in-a-box. You can still use it for your own resources of course, but double-click and you're into Classy, designing your application.

Before leaping into the view editor, you need to tell Classy a little bit about the application you intend to write. By selecting the "Application…" item in the Edit menu you can give Classy the information it will need to generate code for you. This information includes an application ID that is used to generate unique identifiers, a copyright message that will be placed in each source file, and your application's signature and file types (the ones you faithfully registered with Apple using the "C/F Registration Requests" stack).

The first step of course is to create a new view. For those of us used to MacApp terminology, a Classy view is most often a window of some kind and what we would call subviews are called "panes." (This corresponds to the TCL class terminology.) All the window types you would expect are available including Alert, Dialog, Floating Window, and Tearoff Menus. Classy's tearoff menus are so easy to use I put two of 'em in my test application.

One special window is the "Main Window." In TCL, documents are associated with a single main window (rather than a list of windows as in MacApp). Classy makes this connection for you when you select "Main Window" as the type of window. When creating your main window you do need to be careful not to make the name too long. Classy will generate class names from what you enter and file names that are even longer. When the Symantec C++ compiler gets hold of those names and adds ".XSYM" you can end up over the 31 character limit (yes, it happened to me).

Once a particular window type is selected, its attributes can be edited by selecting the View Info menu item (see Figure 1-Main Window View Info). As you can see from the illustration, you can do quite a bit of customization. There are additional "info windows" for alerts and floating windows as well.

Panes in the view

Classy's view editor takes a MacDraw like approach (see Figure 2-Editing in Classy). To add a pane to your view just click on a tool and then click where you want the item to appear. Hold down the mouse button and you can size the pane. A pane can be resized later by selecting it and dragging its resize handle or by entering exact sizes in its data member's dialog. Multiple panes can be selected and dragged as a group. There are also some very nice alignment tools that manipulate groups of items. Most of the pane attributes (such as font and alignment) can be applied singly or to groups.

The tools in the floating palette are almost all self explanatory. A few are less than obvious however: the "Warning Icon" produces an icon button and the shadowed version yields a nifty multi-state button. The "thing" that holds an overlapping ellipse and square yields a picture button and its shadowed twin a multi-state version of the same. Multi-state buttons can have different graphics for on/off and hilight states).

Of course, virtually every object placed in a view will need a bit of tweaking before it's just right. Classy provides an interface to the data members of each pane that is similar to that used in Apple's ViewEdit (see Figure 3-Editing Data Members). When you need to go further, the Classes… menu item provides a dialog that gives you the ability to define new subclasses of existing classes. You can even define new data members for the class, and Classy will automatically generate the appropriate stream I/O calls so that your new classes will instantiate fully with no additional intervention on your part.

Commands and Menus

As you might expect, Classy provides a nice editing dialog for commands (see Figure 4-Editing Commands). In the illustration I've created a new command constant "cmdSpeak-Phonemes." Classy automatically gave it a number (that I can change if necessary). I've chosen the class CPronunciation_Dict to handle the command and selected "Call" as the action. When the time comes to generate code Classy will insert a "case cmdSpeakPhonemes:" in the switch in x_CPronunciation_ Dict.cp's DoCommand() method. It will also create an empty method called DoCmdSpeakPhonemes() that I will later override in CPronunciation_Dict.cp to do what it needs to do. I'll discuss the way Classy generates code and file names later.

Menus are created and edited in a two layered process (see Figure 6-Editing Menus). First you select a menu to edit (back window) and then click the "Edit Menu Items" button (hidden in the illustration). The subsequent "Menu Edit" dialog provides all the tools necessary to make your menus look and perform as you want them to. Recall that when you create a command you specify the class that will handle it. When you create a menu item and specify its command you're all done. The connection has been made and there's an empty method waiting to be implemented. Buttons have commands associated with them in the same way.

Generating Code

When the time comes to generate code, Classy uses a set of templates (which you can edit) to generate pairs of ".cp" and ".h" files for each class you created. One set of files is prefixed with "x_." These files contain the code that Classy controls and will modify when you make changes in the view editor. The classes in these files are also prefixed with "x_." The second set of files contain the skeleton code that you will modify. The classes in these files have the names you would expect and are sub-classed from the corresponding "x_" classes.

This two layer approach means that both you and Classy are free to make changes at will and can do so without treading on each other's territory. This flexibility costs almost nothing at run time, and since it is administered by Classy there is virtually no "mind share" involved either.

After the code is generated you add it to your Think project in the usual way. The starter project comes with a "place holder" segment already set up for you. When the compiler finishes its job you'll have a complete working skeleton of your application. For what it's worth, the program I developed to test Classy took about two hours from the time I sat down to the first running prototype. That includes the interface, two tear-off menu palettes which worked perfectly from the start, and a few additional windows. Pretty darn productive if you ask me.

Stylistically, Classy's code is very similar to TCL. A big comment block containing a description of the class and copyright information (with your name) heads up each file. Additional comment blocks describing their use separate each method and two or three line comments regarding implementation act as place holders in empty methods. Although I have only a passing familiarity with TCL, I found Classy's code easy to understand and modify.

Summary

Classy is one of the great bargains among Macintosh development tools. Object Factory has done a tremendous job in every area from Object I/O, to TCL bug fixes, to the fastest view editor I've ever seen.

As you can probably tell, I really like Classy. Nevertheless, it is not completely without flaws (but hey, it's only version 1.06!). I came across a couple of small bugs, neither of which affected my project or the generated code in any way. The documentation, while adequate, has a lot of room for improvement. It is particularly frustrating for a new user to search through the program's menus for things that aren't there anymore or have changed name or location. Finally, Classy's user interface could use a bit of tuning up. I already mentioned that I was allowed to enter class names that would eventually result in illegal file names. And my favorite annoyance was the need to hit Cmd-L to edit a pane's data members. A simple double-click like everybody else uses would be nice.

In spite of a number of very minor flaws, Classy is an eminently usable, utterly indispensable tool for anyone who uses TCL. It is highly recommended.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.