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

Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »

Price Scanner via MacPrices.net

13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more

Jobs Board

Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple 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.