User Reports


Zinc Interface Library

Comments by David Brumbaugh


David Brumbaugh is a project manager at Advanced Information Services, asystems integrator in Peoria, IL. He has been programming in C for over fiveyears and in C++ for over a year. He can be reached by mail at 2807 N. Renwood Ave., Peoria, IL 61604.

Introduction

The Zinc Interface Library is a C++ user interface library from Zinc Software Inc. for PC compatible computers. It supports MS-DOS text mode, MS-DOS graphics mode and MS-Windows 3.x interfaces. I'm reporting on Zinc Version 2.0 for Borland C++. Zinc also supports the Zortech C++ complier.

C programmers moving to C++ and experienced C++ programmers will find the Zinc Interface Library helpful. I've been using it for over a year on projects I've been working on at home.

Features

Zinc's primary feature is a C++ class library. It consists of class definitions, object code and optionally, source code for those classes. The class library is designed so that your application only needs to have one set of source code for writing applications in text mode for MS-DOS, graphics mode for MS-DOS (CGA, EGA, VGA, Hercules compatible) and MS-Windows 3.x.

The user interface created in all three modes is SAA compliant. This means it has windows, menus, dialogue boxes, list boxes, optional mouse support, and all the other features users have come to expect in modern software.

All three modes, text, graphics and MS-Windows have the same basic look and feel. The UI_DISPLAY class encapsulates the three display types in its descendants. The UI_DISPLAY class defines all the things that a program can do to a user's display.

Text mode applications use the PC extended ASCII graphics set for windows. The programmer has several options when using text mode:

1. The application can automatically detect the current text mode and use it. This is the default.

2. The programmer can explicitly use 25x80, 25x40 or 43x80 (which gives 50x80 on VGA).

3. The programmer can give the user a choice on which mode to use.

Graphics mode MS-DOS display classes use complier specific libraries. The library I have uses BGI (Borland Graphic Interface). The documentation indicates that there is similar support for Zortech's graphic library. An application can switch from graphics to text mode and back without loosing the information in the user's windows. Besides the text mode features, the graphics display classes have support for graphic specific features like arcs, polygons, bitmaps, etc.

While one MS-DOS application can support both text and graphics, you must recompile your program to support MS-Windows. You also must add a couple of #ifdef statements to call WinMain instead of main, and to redefine how colors are used. Other than that, all my MS-DOS applications, including graphic applications, ran without modification on MS-Windows.

The strong points of the class library far out-weigh the weak points. Because the class library is set up in a very logical hierarchy, it is easy to learn.

The field validation capability is one of my favorite features. All user input can be validated by the program. Most common validations are included and the programmer can define his own easily.

The library is fairly robust. Most of the errors I found in my programs were my own. When they weren't there was usually a fix on their BBS. The library is complete and generally well designed.

The only weak points that I found were in the MS-Windows mode. The first is that since it always displays its bitmaps one pixel at a time, bitmap displays in MS-Windows are very slow.

When I tried to work around this by using Windows bitmaps, I discovered that there is no obvious way to use Windows resources with Zinc. Zinc has its own version of resources, and the BBS contains some programs to convert Windows bitmaps to Zinc bitmaps and Windows icons to Zinc icons.

Finally, Zinc doesn't have any direct support for MS-Windows Multiple Document Interface (MDI). MDI applications keep all the child windows of a main window confined within the boundary of the main window. Some programmer's will see this as a bigger problem than others.

The other major feature that comes with Zinc is the Zinc Designer. The Zinc Designer is a program that allows the programmer to draw windows, dialogues, menus, bitmaps etc. Using the Designer is faster than writing the equivalent source code. It allows the programmer to make better "Look and Feel" decisions.

I found several weak points with the Designer. Some of the features that Zinc supports, like radio buttons and check boxes, are not supported by the Designer. The menu items in the Designer are cumbersome to edit. My final complaint is that the Designer generates only binary objects, not source code. I would like to see both.

Documentation

The Zinc documentation consists of three books: The Programmer's Guide, The Programmer's Tutorial, and The Programmer's Reference. It also includes a Quick Reference Guide containing a list of the most common constructors, flags, event information, and a class hierarchy.

The Programmer's Guide provides a good overview of the concepts in the Zinc Interface Library. It is a short book that hits the most important points of the library. It also contains a user's guide to the Zinc Designer.

The Programmer's Tutorial is a clear and simple book to help the programmer get started. It is short enough to stay interesting. That is a major accomplishment when you consider that it not only contains lessons on using the Zinc Library, but a C++ and object-oriented design tutorial as well. The examples are excellent. They are clear and many are useful building blocks for your own applications.

The Programmer's Reference is a well organized book that covers most of the classes that come with Zinc. It could be more complete in its handling of specific classes. For example, the width parameter in the Line method of UI_DOS_BGI_DISPLAY is ignored. I spent about two hours trying to find the bug in my code before I checked with technical support. They agreed that it should have been documented.

Support

I have found Zinc technical support to be absolutely terrific. I usually use the Zinc BBS for support. It is well organized and well maintained. It contains corrections, news, user contributions and additional examples. The message base provides contact with the people at Zinc and with other users. I usually search the message base and find the answer I'm looking for without having to post a question.

When I can't wait for the BBS I call Zinc's voice line. I've never had a long wait when I've called. The support people are very friendly, helpful and knowledgeable. They usually understood my problem better than I did and had helpful suggestions in addition to the answers to my questions.

Competition

Borland's ObjectWindows and Turbo Vision are the other C++ user interface libraries I am familiar with. Borland chose to use separate class hierarchies for MS-DOS text and MS-Windows user interface. That means that if you want to write one application for both MS-DOS and Windows, you have to write two separate programs.

ObjectWindows has more direct support for MS-Windows than Zinc. It includes classes that can use Windows resources, for example. But, it lacks the field specific editing features, like dates, that Zinc has.

Turbo Vision is a text mode user interface class library. It has features Zinc doesn't, like the THistory class that allows the user to keep a list of data entry choices. It also lacks certain features, like the extensive field support, that Zinc has. Turbo Vision also lacks the MS-DOS graphics support that Zinc has.

Generally, if you're doing strictly MS-Windows programming, Borland's OWL has a slight edge because it is strictly for Windows. Its bitmaps are displayed faster, it can use resources from Borland's Resource Workshop (or other sources) and there is full MDI support.

If you want to write strictly text mode programs, Zinc has a slight edge over Turbo Vision because it has more support for formatted and validated data entry fields. If you want to write MS-DOS graphics mode programs, Zinc wins hands down because neither Turbo Vision or OWL supports that mode.

If you want to write applications that can be used across all three platforms, I recommend Zinc because you'll be doing less rewriting of code. The Zinc library fulfills the promise of code reuseablity much better than either ObjectWindows or Turbo Vision.

Conclusion

The Zinc Interface Library is a good value. There is no doubt that Zinc will save time for C++ programmers who write programs for the PC. It lets you program for three PC platforms in the time it usually takes to write code for one. The examples of C++ code will be of great help to the new C++ programmer. The library is an example of good Object Oriented Design.

I have only two suggestions for improvements. I would like to see a more complete reference manual. I also would like to see the Windows library have more support for the features of Windows 3.x.

I would recommend the Zinc Interface Library to any C++ programmer who wants to write applications for the PC.

Editor's Note:

As this issue went to press, we were informed that Zinc Interface Library v3.0 is now available. According to a Zinc representative, version 3.0 addresses some of the problems noted in this User Report. New features include direct use of Windows bitmap functions; MDI support for Windows and DOS; new window objects such as toolbar, combo box, checkbox, radio button, and buttons with associated bitmaps; Zinc Designer adds a toolbar and access to all library features including user functions and validation routines. For more information contact Zinc Software Incorporated, 405 South 100 St. Suite 201, Pleasant Grove, UT 84062, (801) 785-8900, FAX (801) 785-8996.