This document describes the "helper classes" for integrating an OOFILE database with the zApp application framework.
PHILOSOPHY
The main philosophy of our gui integration is cooperation. The helper classes for a given framework should make it possible to take a standard application written in that framework, possibly generated by a screen designer, and quickly convert it to work with OOFILE.
It is assumed your framework provides editing classes that manage the editing of a piece of information - we are concerned with storage. Each major editing tool that needs to store data is subclassed to override the "get" and "set" methods normally used to map the control to storage (usually a variable). This allows quick renaming of standard controls. If you have your own, you can copy our logic - it's just a mapping onto the appropriate assignment of values to and from a field, as shown in the ooftest1 example.
MANAGING EDITING
Few app frameworks inherently support multi-page dialogs. Our mixin despatches to your code for several common operations:
- again bit about subclassing to manage multiple page editing
Moving between pages:
dbEditMgr mixes in several methods, leavingPage, startPageTransition, completePageTransition & newRecord.
EMBEDDED TABLES
zApp's table classes have a few limitations (unable to add rows, no controls in cells) so our integration for embedded tables is currently based on FarPoint's Spread/VBX spreadsheet control.
Note: there are early classes for zApp integration with listboxes and zTables included in oofzapp.cpp but they are not supported at this time.
dbSSTable is the base class for managing the control, from which descends dbSSViewTable. The latter abstract base class is based on a dbView as the interface to the database.
dbSSBrowseTable and dbSSEditTable are concrete classes that wrap some common settings
DISCUSSION OF BROWSER HERE
EMBEDDED EDITING TABLES
dbSSEditTable manages these. In many interfaces, a related file will be edited through an embedded table. Thus the entire set of related records will probably be brought in, shown in the table, edited and written out again.
SAVING RELATED RECORDS
This is transparent due to the propagation of dbTable::saveRecord, provided modified records are updated by assigning to the fields - giving a set of cached dirty records to write out in one go.
ADDING RECORDS
A dbSSEditTable would normally be associated with some buttons or other controls. The event-handling procedures (eg: clickedAddUse) send an addRow message to the table.
SPREAD/VBX EVENTS
Normally, in zApp, if you don't need events then you use zVBXControl directly. If you want to trap events, subclass zVBXControl and write your own
virtual long zVBXControl::eventVBX(zVBXEvent *) to parse events.
CSpreadSheet includes virtual methods for us with nice clean parameters, and its own event dispatching. Thus, for our Spread/VBX based browsers, we just need to subclass CSpreadSheet and replace these methods with something that calls our own SSTable.