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

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.