Long Text Lists
Volume Number 8
Issue Number: 6
Column Tag: Pascal Workshop
Related Info: List Manager Dialog Manager
Long Text Lists in Object Pascal
Here's how you can do very big lists without using the List Manager.
By David Rand
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
About the author
David Rand is a programmer at the Centre de recherches mathématiques of the
Université de Montréal.
The purpose of this article is to present a scrollable vertical list of text
implemented in Object Pascal without using the List Manager. The list appears in a sort
of modeless dialog box, but without using the Dialog Manager. I will refer to this type of
dialog box as a “pseudo- dialog”. Several other objects are also included in order to give
a more general overview of the implementation of custom “ dialog” items as objects.
The result is a very small class library whose hierarchy is illustrated in Figure 1. The
two main objects, both direct descendants of the generic object type TObject, are the
type TPseudoDialog which implements the window, and the type TPDialogItem which
represents a generic pseudo-dialog item and is the parent of all other object types in
the hierarchy.
This demonstration illustrates the following:
• an application “shell” which manages events appropriately;
• activation and deactivation of most items as well as the pseudo-dialog as a whole;
• the use of distinct fonts, font sizes and font styles for the different items;
• communication between the main program and the objects in the pseudo- dialog;
• a one-dimensional scrollable text list whose contents are not limited to 32 K in
size and whose font, font size and font style are chosen from menus;
• a variety of buttons, including toggle buttons and buttons with a
three-dimensional appearance, with command key equivalents;
• a static text item;
• an icon item;
• a simple animation item;
• a simple installation method for items, allowing the programmer to configure
other pseudo- dialogs using the items included here or one’s own implementations
of new descendants of TPDialogItem.
Figure 1