Resources
Text Control has several built-in resources like information strings, error messages and dialog
boxes. These resources are available in different languages. When a new control is created Text Control
selects the current set system language as the default one. With the
Language property this setting can be altered independent of
the system language. The description of the Language property
lists all currently available built-in languages. To alter the language of the Button Bar and Status Bar
the appropriate Language properties must be
used.
To display resources in additional languages external resource libraries can be built and then
set with the ResourceFile property. A resource library is
a dynamic link library that only contains resources. The ResourceKit subdiretory contains
the basic files to create such a DLL file. The following is a list of these files:
- TXRES.C (Contains the DLL's entry point)
- TXRES.RC (Contains Text Control's resources in English)
- TXRES.H (Contains the definitions of all resource identifiers)
Furthermore Microsoft Visual C++ project files are contained that can be used to build the resource
library.
The TXRES.RC file has the following contents:
- Dialog box templates for the built-in dialog boxes.
- String tables that contain information strings, error messages and the status strings of the
Status Bar. Strings must not be larger than 255 characters.
- Bitmaps for the bold, italic and underline buttons of the button bar. The bitmap files are in
the \BMP subdirectory.
To avoid conflicts with other programs that also uses own resources or with future versions of
TX Text Control the following points are important:
- The resource library should have a unique file name. The resource kit project builds a DLL file
named TXRES.DLL. This name should be changed.
- The resource library should be placed in the same directory as the final application. Get the
full path name of the apllication's executable file at run time and specify the resource library's file
name including this path when setting the ResourceFile property.
At runtime Text Control determines resources in the following way:
- The Language property is initialized with the system
default language. If the system language is not built-in, Text Control displays English resources.
- When the Language property has been changed with an
identifier of a built-in language, Text Control displays resources in this language independent of the
system language.
- When the ResourceFile property has been set, Text
Control tries to load the resources from this library. In this case the
Language property is ignored. When the resource library does
not contain a needed resource or when the specified file could not be found, Text Control displays English
resources without reporting an error.
- Setting the ResourceFile and
Language properties of a Text Control does not automatically set
the appropriate properties of a connected Button Bar or Status Bar to the same values. These properties must
be changed independently.