| Search Locate Previous Next | Contents |
You will find all the supplied classes as child namespaces off #.Class, and you can use the GetCls and SaveCls functions in this namespace to import classes from file and to save any changes you make. These functions will accept a full pathname, but the file path defaults to the path specified in your causeway.ini [paths] section, for example:
[Paths] Class=c:\apl\causeway Classdoc=d:\products\common\cprohlp
Note that you can save the class specification as a separate ASCII text file using SaveSpec and GetSpec if you prefer to edit this variable using an external text editor. These files are placed by default into the ClassDoc directory.
If you need to upgrade an existing class (for example the TreeView) you should use the same function:
)cs Class GetCls 'TR' © Import it from file #.CPro.Build © Register it with the CPro engine
The call to #.CPro.Build is essential whenever you add, delete or modify a class.
You can use the simple utility Classes to list all the classes available in a given class library. Note that this will not see a namespace as a class until Class.ParseSpec has been run on it at least once to create the appropriate variables from the specification.
Contents of a Class Namespace
All classes contain the same basic set of standard functions:
Create called initially to make the object
Refresh called whenever a runtime property changes, to refresh the control
Read called when the user changes the control to return the new value
Destroy called when the control is deleted
There may be other functions, typically callbacks such as onKeyPress, which only appear in the classes that require them. You will also find a small number of variables, all but one of which are generated automatically by CPro.Build and can be ignored. Everything Causeway needs to know about the class is stored in a text variable called specification, which has the standard form:
[Design] Name=Action Button Type=Button ... for the designer to use [Properties] ... property names and types [Events] ... any class-specific event codes [Cue Card] ... instructions for use [QA] ... testing script (optional) [Release Notes] ... optional but recommended
You can edit this with the normal Dyalog editor when you need to add or modify the class definition, but remember to run Class.ParseSpec if you change the properties or custom events. This generates working copies of the [Properties] and [Events] sections for fast access by Causeway. See the notes on the specification format for full details.