Home |
String Table |
String TableIf you have enabled the use of string tables in the Window Builder Project | Configure | Language dialog, Window Builder will maintain a table containing all strings for all languages used by the application. In this environment, all PegTextThing derived classes are constructed using StringID information, rather than literal strings. This allows your system software to easily convert between different supported languages. Please note that you can also maintain string tables outside Window Builder using program Mkstrtab. The String Table is composed of an array of literal strings, a two-dimensional array of string pointers, and an enumeration of string ID values. String ID values are just indexes selecting the correct row from the two-dimensional table. Each table column is associated with one of the supported languages. If the application supports only one language, the String Table is simply a single list of literal strings, an array of string pointers, and an associated String ID enumeration. The correct string table column is selected by the current language, which is maintained in a static member variable of the PegTextThing class. This variable should be loaded with one of the enumerated language names when the active language is selected by calling the PegTextThing::SetLanguage() function. The default language is the first language configured in the Configure | Languages dialog box. The string table is saved to the filename specified in the Configure | Directories dialog. The enumeration of the language names and the string table IDs is saved in the corresponding String Table header file. Each source file that uses the String Table must include the String Table header file in order to resolve the string IDs and language names. This include is added to each source file generated by Window Builder. The String Table is edited by selecting the Project | String Table command on the Project window menu bar. The left-hand side of the String Table Editor window displays a PegSpreadSheet object containing each of the strings used in your system. Each row of the table corresponds to a StringID, and each column of the table corresponds to a supported language. The enumerated language names are displayed as the table column headers. The String Table can be displayed in a two-column or three-column format. You can change the format by right-clicking over the spreadsheet and selecting the desired format in the pop-up menu. You can also sort the string table entries by using the right-click pop-up menu. This menu provides commands to shift the selected entry up or down in the string table. The first language listed on your language configuration page is your project's Reference Language. This language will usually be English, but may be any language desired. The reference language is important because this is the language you are working in when you work in the target window. This is also the language which is always displayed when you view the table in three column mode.
|