XPG RESOURCES In addition to the standard X resources, xpg supports application-specific resources, and what I call class-specific resources. Application-specific resources change aspects of xpg global to all classes, while class-specific resources control xpg's behavior for individual classes. Whenever command-line switches are relevant for a specific resource, it is mentioned in the resource description. Command-line switches always override their resource equivalent. Application-Specific Resources These resources take the form: xpg. : Name Class Type Default Value _______________________________________________________________ database Database String user's database class Class String "" showPgClasses ShowPgClasses Boolean False database: The Postgres database which xpg uses. If this resource is not set, the database carrying the name of the user is used. The command-line switch "-db" is equivalent to setting this resource, and overrides it. class: The relation to view when xpg starts. If this resource is not set, xpg starts with an empty viewer. The "-class" command-line switch overrides this resource. showPgClasses: Whether or not to include the Postgres catalog classes in the list available to the user for choosing classes to view. When this resource is True, xpg does not show the classes starting with "pg_" nor the special class "xpg_scripts"; Still, you can always view any class (even hidden) by typing its name in the Class List Dialog's text field. The command-line switch "-showPgClasses" is equivalent to setting this resource to True, while "-hidePgClasses" is equivalent to setting this resource to False. Both switches override the resource value. Class-Specific Resource These resources take the form: xpg.class... : The and parts can be replaced, separately or together, by the '*' wildcard, to apply the resource setting to groups of classes or databases. Whenever command-line switches are relevant for a specific resource, it is mentioned in the resource description. Command-line switches always override their resource equivalent, and apply to all classes and databases. Name Class Type Default Value _____________________________________________________________________________ key Key String "" separator Separator String " " font Font XmFontList fixed printCmd PrintCmd String "cat" autoSort AutoSort Boolean True floatPrecision FloatPrecision int -1 arrayCmd[1-3] ArrayCmd String "" arrayCmdPath[1-3] ArrayCmdPath String "." arrayCmdName[1-3] ArrayCmdName String "Command " printSum PrintTotals Boolean False printProduct PrintTotals Boolean False printCount PrintTotals Boolean False printAverage PrintTotals Boolean False printStdDev PrintTotals Boolean False printMin PrintTotals Boolean False printMax PrintTotals Boolean False yearRangeFrom YearRange String "-2" yearRangeTo YearRange String "+2" helpFile HelpFile String NULL key: A comma-separated list of attribute names to be treated as key attributes (see the KEY ATTRIBUTES section). When classes are viewed, all attributes which are listed in this resource are automatically selected to be key-attributes. The "-key" command-line switch can be used for overriding this resource for all classes. separator: String to be used to separate between the attributes' columns in the viewer. Both the rightmost and leftmost characters of the actual separator must be spaces, so xpg adds them automatically if the resource value does not have them. font: Font to use for the viewer's data. It affects the font of the following areas of the viewer: The data table, the attribute names, the key area, and the key names. The same resource groups these four areas, because their nature requires them to have the same font. For this reason, xpg enforces this font on these areas, and sets them to font "fixed" if the resource is not set; as a result you cannot set these areas' fonts individually using their regular fontList resource. Note: you must use fixed-sized fonts (non-proportional) in order to get reasonable appearance in the viewer. Also, a small bug in viewer appearance has been found in the last minute when using fonts other than "fixed". printCmd: Unix command for printing relation data. xpg uses the popen(3) function to run this command, and pipe the relation data into it. It is the external command's responsibility to parse the header data and the relation data, and format the output. Although xpg comes with a formatter (see the PRINTING section), the default resource value is not set to this formatter; it is set to the "cat" Unix command, and the system administrator or the user should set this resource to the full pathname of the desired command. For more information on xpg's print header and data format, read the comments included in the print formatter which comes with xpg, in the file 'print.filter'. The "-printCmd" command-line switch overrides this resource for all classes. autoSort: If True, this resource tells xpg to automatically sort the class by the key attributes which are in effect, whenever the class is redisplayed (by an explicit request, after selection or deselection of key attributes, or after applying class operations). The "-autoSort" command-line switch overrides this resource to be True for all classes, while "-noAutoSort" does the same thing with False. floatPrecision: Sets the number of digits to the right of the decimal point after which xpg truncates numbers of float type, for viewing and printing. Set this resource to -1 to prevent xpg from formatting floating-point numbers in any way. The "-floatPrecision" command-line switch overrides this resource for all classes. arrayCmd[1-3], arrayCmdPath[1-3], arrayCmdName[1-3]: This set of resources is used for defining commands to be applied to array elements using the Array Dialog (see the ARRAY DIALOG section). arrayCmd is the full pathname of the command to execute; arrayCmdPath is a directory to which xpg chdir's before executing the command; arrayCmdName is the label appearing on the command's button in the Array Dialog. Note: If arrayCmd is not set (ie. it remains with the default value of ""), xpg makes the corresponding command-button in the Array Dialog invisible. You can include the special string "%%" (without the quotes) in the arrayCmd resources. When executing the command, this string is replaced by the array value currently selected. Refer to the ARRAY DIALOG section for more details and for an example of using this resource set. printSum, printProduct, printCount, printAverage, printStdDev, printMin, printMax: This resource set is used for presetting certain aggregate functions to be performed on the relation and included in the printouts created by xpg. Setting one of these resources to True is equivalent to "checking" the corresponding function in the Options Dialog of the Print menu (see the PRINTING section). yearRangeFrom, yearRangeTo: These two resources can be used for setting the range of years displayed in the Date/Time Dialog (see the CLASS OPERATIONS dialog). In these resources you can use either absolute or relative values: an absolute year value is a simple integer value; a relative year value is an integer value preceded by a '+' or '-' character, and is relative to the current year. You can use any combination of relative and absolute values for this resource set. You cannot use ranges which span more than 50 years - such ranges are rejected and the default range (-2..+2) is used instead. helpFile: Use this resource for defining a file as a help text for the class. After setting this resource to the full pathname of a text file, the user can read this text by choosing the Help On Class item from the Help menu (see the CLASS HELP section).