C WINDOWS TOOLKIT

Tom Castle

Tom Castle is a chemist who frequently writes programming articles. He can be reached at 8734 Merrimac, Richland, MI 49083, or on MCI Mail: tcastle.


Product Information

C Windows Toolkit, Version 2.0; Magna Carta Software, PO Box 475594, Garland, TX 75047, 214-226-6909. FAX 214-226-0386. BBS (for downloading demo and examples of applications) 214-226-8088. Requirements: IBM PC, XT, AT, PS2, or compatible. Compilers: Turbo C 2.0, Microsoft C 5.0, MS QuickC, and Mix Power C. Price: $99.95 (includes source code).

There are quite a few windowing toolboxes available to C programmers. One kit in particular, C Windows Toolkit from Magna Carta, is an exceptional value. Aside from a generous library, the package includes a font editor, a pop-up ruler for window alignment, the library source code, and a 359-page manual with a tutorial covering video architectures and the toolbox functions.

The guts of C Windows Toolkit, of course, is window management. The toolbox separates the creation of a window from its presentation so that construction is transparent and the display event is instantaneous. Many of the window attributes, such as colors, size, location, borders, and shadowing, are set by individual functions, so you may have quite a bit of code after building a window with all the works. Also, you may wind up with a fairly hefty header file because all the information used to construct windows and menus is kept in a series of data structures.

By assigning priorities to your windows, the active (highest priority) window will be in the foreground -- overlapping the underlying elements. If you bring a window to the foreground, the priorities of the other windows will be adjusted automatically.

You can settle for writing formatted output to windows, but the Toolkit also includes facilities for virtual screens. With virtual screens, limited in size only by free memory, your window can act like a viewing port for the underlying text.

The Toolkit contains some nice surprises for window handling. You have the ability to load and store windows on disk, zoom and contract windows from various vantage points and speeds, and even produce an opening curtain presentation.

The Toolkit provides all the necessary functions to display and make selections from pop-up menus. You create scrolling menus by defining a menu box of a certain size and then using a virtual screen to hold the actual text of the menu items. Pretty slick. As another option, menus can be sized automatically by not specifying any dimensions. Functions for the creation of line menus or the top bars of pulldown menus aren't included in this version of the Toolkit. Those functions, however, can be downloaded from Magna Carta's BBS.

Menu selection can be accomplished by scrolling highlight bars, or optionally by key press of a designated highlighted letter in the menu name. The mouse isn't supported yet. Because separate functions are available for adding and removing highlighting from a menu item, multiple selections are possible from your menus.

Magna Carta probably felt a need to round out the package, so they threw in the kitchen sink. Several keyboard input routines are available. They also threw in all sorts of system and hardware detection functions: Enhanced keyboards, Hercules RAMfont support, video adapters, EGA ROM parameters, and active ANSI.SYS files. There is also a lot of support for EGA and VGA options like the number of lines per screen, palette selection, split screens, smooth scrolling and panning, and ROM fonts.

In addition, they give you TSR clocks, stopwatches, and alarm clocks you can display. Speaker control and delay timers are also squeezed into the library.

There are two major new additions to the library in version 2.0. One set of functions is for data entry fields, including parsing and validation. The other set is a collection of functions for building a text editor.

Two considerations, in addition to the function library and documentation, make C Windows Toolkit very attractive. First, Magna Carta doesn't require royalties on the run-time package or any example code included in your application. Second, at no extra cost, they include the source code to the entire library -- of which about 98 percent is written in C for easy inspection and modification. Like it or not, windows are with us. With that stark fact in mind, you have a choice to make; your time or your money. Magna Carta's C Windows Toolkit makes that choice a little easier.


Copyright © 1989, Dr. Dobb's Journal