DialogHandler
Volume Number: 6
Issue Number: 1
Column Tag: Kelly's Corner
DialogHandler™ Helps Dialogs
By Dave Kelly, MacTutor Editorial Board
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
DialogHandler™ Handles Your Dialogs!
If you’d like to cut your programming time Extender DialogHandler™ will come
to the rescue. I’m busy and my time is worth something so why should I reinvent the
wheel? DialogHandler™ is different from the other programming tools that I’ve
mentioned before such as Prototyper™ which generates code for you. Instead you get a
set of already programmed routines which you use to write your code. DialogHandler
does not create the “shell” for you so you can use your own and take advantage of over
160 routines which are very well documented. Because you are writing the code which
accesses the routines, you are able to understand and organize your program in the way
you want.
This month I’ve been working with DialogHandler and I can see there are some
definite advantages to using it. The major advantage is that DialogHandler takes care of
the nitty-gritty details of handling the items in your dialog. Both Pascal and C
versions are available which conveniently provide dialog control for check boxes, push
buttons, radio buttons (with multiple sets), pop-up menus, icons (including
animation), pictures, all types of edit fields and more. DialogHandler comes with
100% source code so you can study the routines to learn more about programming the
Macintosh. Although you have the source code, you won’t need to figure out how to
modify the source code since nearly every routine has hooks to user defined procedures
so you can extend the routines without having to figure out what or how to modify the
source code.
The place to start is with the documentation. At first glance DialogHandler looks
like another volume of Inside Macintosh. Don’t “judge a book by its cover” though
because the entire manual was carefully organized to help you get the most out of it.
The manual is divided into three or four major sections (in two 3-ring binders):
• Concepts and Examples: This section gives an overview of all of the routines
included in DialogHandler with demo examples. I strongly recommend starting
with the Concepts and Examples section first. Even if you think you already know
it all, a brief skim through of this section will probably answer whatever
questions you might ask when you get stuck on something. The demo examples
cover any and everything you might do with the routines. There is a demo for
each set of routines and one big one appropriately named “The Kitchen Sink”
which implements everything all in one dialog.
Figure 1. The Kitchen Sink
As you can see from just looking at the “Kitchen Sink” dialog, push buttons,
multiple sets of Radio buttons, check boxes, counters, pictures, icons, pop-up menus,
multiple user defined pull down menu bars, edit string, edit integer, edit LongInt, edit
real, static string, static integer, static LongInt, static real and lists. In addition, note
that key equivalents may be assigned to any of the items. A few utility routines are
included too for convenience.
• Reference: This section is organized alphabetically by procedure/function names
with syntax and all parameters explained.
• Advanced Topics and Appendix: Hints and essential information for setting up
DialogHandler with your specific compiler. One appendix gives a summary of all
DialogHandler routines.
• A very extensive index to help you find whatever, every which way you can.