Earlier, this manual described how to incorporate preconfigured components, such as buttons and navigation tools, into forms and reports. These components were taken from those that are distributed as part of Rekall. However, Rekall also provides the means to construct your own components, which you can then use as often as you need.
This chapter is divided into four main parts. The first part describes the basics of building your own components. This does not involve any scripting; although this limits the level of functionality that you can achieve, it can still be used to provide a useful set of components. If you have no intention of writing any scripts of your own, you can skip the second and third parts of this chapter.
The second part describes the Event/Slot mechanism that Rekall provides. Although the use of this mechanism is not restricted to reusable components (it can be used anywhere in a form or report), its major use is with reusable components, since it provides a way of bundling a set of objects which will be used in a form or report together with the code that is needed to make use of them.
The third part then gives some examples of constructing resuable components which make use of the event/slot mechanism.
The fourth part discusses linking components, as opposed to pasting them.
The fifth part describes how you can directly invoke events and slots from script code, and how you can use unattached slots as a way of associating arbitrary code with objects (in effect giving methods to Rekall objects like buttons or fields).
Before going any futher, it is worth describing where Rekall can store components. There are three places. Firstly, there is the stock component set that comes with the Rekall distribution; secondly, components can be stored inside databases (just like forms and reports); and thirdly, they can be stored in a local directory (on Linux this is $HOME/.rekall/components. Normally, any components that you create yourself would be stored in a database or locally; storing in the database would be appropriate if you want to share them between all users of the database, while locally would be appropriate for your own personal components ( Storing locally makes it easier to use the components in several Rekall databases, since they are accessible whatever Rekall database you have open. On the other hand, you could create a server database purely to hold components, and access it from all your Rekall databases. ) .
If you want you can store your components with the stock components, since stock components are just stored in files in a known directory, but (on Linux) you would normally need root access to do this, and they might be lost when upgrading - be warned.
Components: Rolling Your Own