PsiFS: File Format Converters

!PsiFSRes

!PsiFSRes

A toolbox resource file called !PsiFSRes can be provided to allow options for the file format converter to be selected.

The !PsiFSRes file is loaded by PsiFS immediately after processing the associated !PsiFS file. The templates within the file are merged with those belonging to PsiFS itself, as well as those belonging to other file format converters, so it is essential that unique names are used for all templates. Hence, the converter part of the PsiFSConverter$converter variable should be used as a prefix for all template names.

Any number of toolbox templates may be included within the resource file, and any template may be used for any combination of file format converters. However, there are some restrictions; these are described in the following sections.

Object Flags

The object flags for each toolbox template must be set as follows:
FlagTypeSetting
Auto-createRequiredNo
Auto-showRequiredNo
Shared objectRequiredNo
Ancestor objectRequiredNo

Window Properties

All toolbox templates must be window objects. The Main window properties should be set as follows:
PropertyTypeSetting
TitleRecommended"PsiFS conversion options"
Justify titleRecommendedCentre
BackRecommendedOn
CloseRecommendedOn
ToggleRecommendedOff
HscrollRecommendedOff
VscrollRecommendedOff
SizeRecommendedOff
Show menuRequiredOff
Default input focusRecommendedInvisible caret or In gadget
Auto-openRequiredOn
Auto-closeRequiredOn
Deliver event before showingRequiredDefault
Deliver event when hiddenRequiredDefault
Help textRecommended"This window allows options for the file conversion to be selected."

The Other window properties should also be set as follows:
PropertyTypeSetting
PaneRequiredOff
Hot keysRequiredOff
MoveableRecommendedOn
Auto-redrawRequiredOn
BackdropRequiredOff
Real coloursRecommendedOff
Allow off-screenRecommendedOff
Force on-screenRecommendedOff
Button typeRequired0
Extendable XRecommendedOff
Extendable YRecommendedOff
User scrollRequiredOff
Sprite areaRecommendedWimp
PointerRecommendedOff

The Window colours should be set at the defaults as follows:
PropertyTypeColour
Title barForegroundRecommended7
BackgroundRecommended2
Input focusRecommended12
Work areaForegroundRecommended7
BackgroundRecommended1
Scroll barsForegroundRecommended1
BackgroundRecommended3

The Minimum size and Work area should normally both be set to the normal size of the window. No toolbars should be attached to the window.

Gadgets

Any number of gadgets may be included within each window, although there are restrictions on the types and settings that can be used. These restrictions are described within the following sections.

All gadgets types other than Label and Labelled Box should have appropriate help text specified. Also, all gadget types other than Action Button should have delivery of events disabled; they are not required by PsiFS. The initial values specified for each gadget within the resource file are used as a defaults if no previously used options are available.

There are no specific requirements concerning component IDs, other than that they need to agree with the values specified in the !PsiFS file.

Gadgets - Action Button

Exactly two Action Button gadgets should be included in the window. The first is used by the user to accept the selected options:
PropertyTypeSetting
Component IDRecommended&0
TextRecommended"Set"
Show objectRequiredOff
Deliver eventRequiredDefault
DefaultRequiredOn
CancelRequiredOff
LocalRequiredOn
Help textRecommended"Click SELECT (or press RETURN) to apply the changes.|MClick ADJUST to apply changes without closing the box."
FadedRequiredOff

The second is used by the user to discard the selected options:
PropertyTypeSetting
Component IDRecommended&1
TextRecommended"Cancel"
Show objectRequiredOff
Deliver eventRequiredDefault
DefaultRequiredOff
CancelRequiredOn
LocalRequiredOn
Help textRecommended"Click SELECT (or press ESCAPE) to close the box without applying any changes.|MClick ADJUST to reset the contents of the box."
FadedRequiredOff

Additional Action Button gadgets are not supported.

Gadgets - Label

Label gadgets may be freely used to annotate options:
PropertyTypeSetting
Component IDNo requirement
JustifyNo requirement
Display borderRecommendedOff
Help textNo requirement
FadedRecommendedOff

Gadgets - Labelled Box

Labelled Box gadgets may be freely used to group or annotate options:
PropertyTypeSetting
Component IDNo requirement
TextNo requirement
SpriteNo requirement
Help textNo requirement
FadedRecommendedOff

Gadgets - Number Range

Number Range gadgets may be used to allow numeric options:
PropertyTypeSetting
Component IDNo requirement
Deliver events when value changesRequiredOff
MinimumRequired>= 0
MaximumRequired<= 2,147,483,647
InitialSet to desired default
PrecisionRecommended0
Step sizeNo requirement
Has numerical displayNo requirement
WritableNo requirement
JustifyNo requirement
Display widthNo requirement
Has adjustersNo requirement
Has sliderNo requirement
Slider colourNo requirement
Link to gadgetsSet appropriately
Help textSet appropriately
FadedRecommendedOff

The "N" specification is used for Number Range options. The value returned is an unscaled interger in the range 0 to 2,147,483,647; any Precision specification is ignored. If a fractional value is required then it must be post-processed to scale the value as appropriate.

Gadgets - Option Button

Option Button gadgets may be used to allow binary options:
PropertyTypeSetting
Component IDNo requirement
TextNo requirement
Deliver eventRequiredNone
SelectedSet to desired default
Help textSet appropriately
FadedRecommendedOff

The "O" specification is used for Option Button options. No value is returned; the state of the gadget is indicated by the presence of the specified switch.

Gadgets - Radio Button

Radio Button gadgets may be used to allow a single choice from a set of options:
PropertyTypeSetting
Component IDNo requirement
GroupSet appropriately
TextNo requirement
Deliver eventRequiredNone
SelectedSet to desired default
Help textSet appropriately
FadedRecommendedOff

The "R" specification is used for Radio Button options. No value is returned; the state of the gadget is indicated by the presence of the specified switch. Note that exactly one switch will be returned for a particular radio group.

Gadgets - String Set

String Set gadgets may be used to allow a single choice from a set of string options:
PropertyTypeSetting
Component IDNo requirement
TitleNo requirement
StringsNo requirement
InitialSet to desired default
Has display fieldNo requirement
WritableNo requirement
JustifyNo requirement
Value changedRequiredOff
About to be shownRequiredOff
Specify allowed charactersRecommendedDisable " ", """ and "-" to prevent quoted values
Link to gadgetsSet appropriately
Help textSet appropriately
FadedRecommendedOff

The "S" specification is used for String Set options. The value returned is the selected string. Note that the value will be quoted if it contains " " (space) or """ (quotation mark) characters, or if it starts with a "-" (hyphen-minus) character. If values different from the displayed strings are required then post-processing must be used to map the value as appropriate.

Gadgets - Writable Field

Writable Field gadgets may be used to allow user specified text options:
PropertyTypeSetting
Component IDNo requirement
TextSet to desired default
JustifyNo requirement
Specify allowed charactersRecommendedDisable " ", """ and "-" to prevent quoted values
Password behaviourSet appropriately
Link to gadgetsSet appropriately
Deliver events when value changesRequiredOff
Help textSet appropriately
FadedRecommendedOff

The "W" specification is used for Writable Field options. The value returned is the entered string. Note that the value will be quoted if it contains " " (space) or """ (quotation mark) characters, or if it starts with a "-" (hyphen-minus) character.

Gadgets - Other

No other gadget types are currently supported by PsiFS, so they must not be used. These include, but are not restricted to, Adjuster, Button, Display Field, Draggable, Popup Menu, Scroll List, Slider, Text Area and Tool Action gadgets.

[Contents] [Up] Copyright © Alexander Thoukydides, 1998, 1999, 2000, 2001, 2002