Each form will be made even more self-contained by adding activate and suspend functions to disable the F10 and Esc keys. Now the only way for the user to leave the form will be via the "Quit" pushbutton. The asymmetrical up/down behavior between fmp1 and fmp2 will be handled by setting the AUTOUPDN window option to request that the form automatically be brought down just before the call to the processing function returns. Another window option, AUTOFREE, will request that the form automatically be freed just before the call to the processing function returns. AUTOUPDN and AUTOFREE can be set for any object that can be made non-modal.
When using AUTOFREE, do not reference an object after you have exited or aborted it. The object is no longer in memory. If you are using the Vermont Views development libraries, you will receive a "Corrupted structure" error if you pass a pointer to this object to a Vermont Views function. If you are using the Vermont Views production libraries, this error will not be caught and memory corruption will occur.
The following code shows how to make each form even more self-contained:
|
This last iteration has now made each form completely self-contained. This example could be extended to include non-modal menus, choice lists used as stand-alone menus, or windows used to view a memory file or memory screen.