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 Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
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 »

Price Scanner via MacPrices.net

Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more
Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more

Jobs Board

*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL 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
*Apple* Software Engineer - HP Inc. (United...
…Mobile, Windows and Mac applications. We are seeking a high energy Senior Apple mobile engineer who can lead and drive application development while also enabling Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.