appwindow
The most used type in the application framework is the appwindow. Unlike the application type, it is used as is, rather than having another type derived from it. This type is responsible for managing the database tables, opening forms, enabling and disabling menu and tool bar elements by using call backs via the onmanagemenu and onmanagetoolbar events and manages other window-specific information, such as the last selected unique key for the master table of the form, the current table, current directory path (for consistency when opening files and presenting file selection dialogs to the user), and provides a property that can hold a report so that it can be opened and retained within the window. Additional information about working with the application framework can be found in Chapter 26, Using the SIMPOL Application Framework. The details of the appwindow type are show below:
Property | Description |
---|---|
type(application) app | Holds a reference to the application object (or a derived application object). |
dlistnode appnode | This is the dlistnode node that is a member of the windows dring in the application type. It makes iteration through the appwindow objects possible. |
string currentpath | The most recent path used to load or save a file (this starts at the current directory and is the responsibility of the application programmer to update). |
tableinfo currenttable | The a tableinfo object containing the current table for the window. This is typically the same as the form's master table. |
boolean disablewindowresize | Normally when the openformdirect()
method is called, the window is resized to exactly fit the form. Set
this to .false to disable this feature. |
boolean fastselection | This should be set to .true if in the loop for
a fast forward or rewind operation. Otherwise it is set to
.false . |
dataform1 form | A reference to the form that is currently loaded into the window. |
string lastinternaluniquekey | This property is meant to be updated by the record selection code
and assumes that the database tables have been opened such that the
internal record ID is exposed (as is done in the
appwindow.opendatatable()
method. It contains the the most recent internal record key. This
can be useful in various situations where a table does not have a
unique index. |
anyvalue lastselkeyvalue | This value is the most recent entry into the select key lookup dialog. It will be used to pre-set the prompt, so that the most recent entry reappears when searching, as long as the search index is the same. It should be cleared when changing indexes. |
wxmenubar mb | This contains a reference to the menu bar for the window. It isn't necessary, since it can be reached via the wxwindow property w, but it is convenient. |
event ondeleterecord | Use this event, together with the supplied function deleterecord() to provide any required special handling when deleting a record. |
event onmanagemenu | If there are one or more entries in the menu that need to be
enabled or disabled when any of a number of things occurs, such as
adding, modifying, saving, or deleting a record, opening or closing
a table or form, then by assigning a handler for this event, the
code will be called. The function prototype is:
(appwindow
appw , wxmenubar
mb , integer
eventtype , string
tablename , type(*)
reference ). The event types are listed
below. |
event onmanagetoolbar | If there are one or more entries in the tool bar that need to be
enabled or disabled when any of a number of things occurs, such as
adding, modifying, saving, or deleting a record, opening or closing
a table or form, then by assigning a handler for this event, the
code will be called. The function prototype is:
(appwindow
appw , wxtoolbar
tb , integer
eventtype , string
tablename , type(*)
reference ). The event types are listed
below. |
type(*) report | This property provides a place holder for a report. It could be a Quick Report, a Graphic Report, or even one of your own derivations from report1. The advantage is that the report can be presented again to the user once defined. |
wxstatusbar sb | Contains a reference to the status bar for the window. It isn't necessary, since it can be reached via the wxwindow property w, but it is convenient. |
dring tables | This is the parent for the ring of database tables stored as tableinfo types. |
wxtoolbar tb | This contains a reference to the tool bar for the window. It isn't necessary, since it can be reached via the wxwindow property w, but it is convenient. |
type(wxcontainer) w | This property holds the reference to the actual wxwindow object displayed on the screen. It is declared as type(wxcontainer) so that it can hold a wxdialog as well as a wxwindow. |
Here is the list of parameter values and the symbolic constant names used in
the application framework source code that can be passed to the handler functions for
the onmanagemenu and onmanagetoolbar events:
(1) iEV_OPENFORM
(2) iEV_CLOSEALL
(3) iEV_CHANGECURRENTTABLE
(4) iEV_NEWRECORD
(5) iEV_SAVERECORD
(6) iEV_CLOSETABLE
(7) iEV_OPENTABLE
(8) iEV_CHANGERECORD