Unit Ape |
Andre's Program Engine (APE) Components Autor: Demidov Andre (E-mail: andre@lion.tu-chel.ac.ru) Version 1.02 (c) 1997 This unit make easy a programming of DB-apps, based on table-form conception (a-la Clarion and others). This unit contain three components 1. TApeMainForm, what transform main form in MDI Form and keep names of MDI Child. 2. TApeForm, what transform current form in MDI Child with new possibilities. 3. TApeDialog, what permit to execute other MDI Child with TApeForm component in pseudo-Modal mode. The owner must contain TApeForm xor TApeMainForm component too. At start program (project source is the best place for this) you must register your form classes (use RegisterClass or RegisterClasses). Each of ApeDialogs of the main form correspond to a process. This process may be run once only. If the process already ran then the last active form of process will select. Also each of ApeDialogs of the child form can give birth to one form. If form already exists then it will select. If ExecuteMode of the new form is NextLevel or SelectValue then all forms of this process with smaller level will disable. But, when this form closed, they will enable and the parent form will select. --TApeMainForm must be sole in project and placed on main form of program --TApeForm must be sole in the form Properties: FormMode:ApeFormMode; can use in design time only to indicate form style FormWindow - for editing one DB record the form can't change its sizes BrowseWindow - for browsing the list of records the form can change its sizes SelectResult:string; to return selected value after selection Metods: function GetParentForm:TForm; to get parent form Events: onFirstShow(Sender:TObject; PMode:ApeActivateFormMode; PObject:TObject; PValue, PSelect:string); run at first show event for this form PMode can has one from two values SelectObject (if need selection object) and CreateObject (in other cases) PObject can be TTable or TStringList with many parameters PValue use for transfering work mode: 'E' - edit 'I' - insert 'F1' - use the filter N1 etc. PSelect is ID selected record --TApeDialog Properties: property FormClassName:string; class of form what must run property withValue:string; additional parameter for transfering work mode 'E' - edit 'I' - insert 'F1' - use the filter N1 etc. property withSelect:string; ID selected record property withObject:TComponent; nil or TTable or TStringList with many parameters property ExecuteMode:ApeCreateFormMode; execution mode can be one from three: ThisLevel enable selection this form NextLevel disable selection this form while child run SelectValue is same but allow transfer selected value property ProcessID:integer,readonly; Metods: function GetChildForm:TForm; to get child form, return nil if not running procedure Execute; execute form with FormClassName Events: OnSelect(Sender:TObject; SelectedValue:string); run when child form closed and SelectResult be set in any new value changes from 1.0 1. test out with D2.0 (D3.0?) 2. old onActivate don't call 3. enabled multiple TApeDialog with one Form 4. add global var CurrentPID for connection with other VCLs
Classes |
TApeDialog -
TApeForm -
TApeMainForm -
Functions |
ApeCloseForm -
ApeCreateForm -
ApeCreateForm2 -
ApeCreateProcess -
ApeGetChild -
ApeGetChild2 -
ApeGetMode -
ApeGetParent -
ApeGetProcessChild -
ApeInit -
ApeProcessRunning -
ApeSelectForm - Разблокировать окна того же уровня
ApeSelectProcess -
ApeSetSelect -
Types |
ApeActivateFormMode
ApeCreateFormMode
ApeFormMode
TApeSelectProc
TApeShowProc
Constants |
Variables |
Functions |
Types |
ApeActivateFormMode=(NoneAction, SelectObject, WaitObject, CreateObject);
ApeCreateFormMode=(ThisLevel, NextLevel, SelectValue);
ApeFormMode=(FormWindow, BrowseWindow);
TApeSelectProc=procedure(Sender:TObject; SelectedValue:string) of object
TApeShowProc=procedure(Sender:TObject; PMode:ApeActivateFormMode; PObject:TObject; PValue,PSelect:string) of object
Constants |
Variables |