Form S_199FA

LANSA

Form S_199FA
* ===================================================================;
*;
* Component : S_199FA;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Simple Grids;
*;
* Full Description; This is a simple form with three grids.;
* 1) A grid filled up with all the records from the DEPTAB file (Departments);
* 2) A grid filled up with all the records from the SECTAB file (Sections);
* 3) A grid filled up with all the records from the PSLMST file (Employees);
*;
* Disclaimer : The following material is supplied as example material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
Function Options(*DIRECT);
Begin_Com Caption('S_199FA') Formposition(ScreenCenter) Height(589) Left(46) Top(116) Width(910);
;
* Department Grid and columns;
;
Define_Com Class(#PRIM_GRID) Name(#DEPT_GRID) Columnbuttonheight(32) Displayposition(1) Height(145) Left(16) Parent(#COM_OWNER) Tabposition(1) Top(24) Width(337);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_1) Caption('Department Code') Captiontype(Caption) Displayposition(1) Parent(#DEPT_GRID) Sortposition(2) Source(#DEPTMENT) Width(30) Widthtype(Fixed);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_2) Caption('DEPT DESC') Captiontype(Caption) Displayposition(2) Parent(#DEPT_GRID) Sortdirection(Descending) Sortposition(1) Source(#DEPTDESC) Width(71);
;
* Section Grid and columns;
;
Define_Com Class(#PRIM_GRID) Name(#EMP_GRID) Columnbuttonheight(31) Displayposition(2) Height(145) Left(16) Parent(#COM_OWNER) Tabposition(2) Top(360) Width(881);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_5) Caption('Section Description') Captiontype(Caption) Displayposition(2) Parent(#SECT_GRID) Sortposition(1) Source(#SECDESC) Width(21);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_6) Caption('Suburb or Town') Captiontype(Caption) Displayposition(3) Parent(#SECT_GRID) Sortposition(2) Source(#SECADDR2) Width(23);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_7) Caption('Street Name and Number') Captiontype(Caption) Displayposition(1) Parent(#SECT_GRID) Sortposition(3) Source(#SECADDR1) Width(23);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_8) Caption('State and Country') Captiontype(Caption) Displayposition(4) Parent(#SECT_GRID) Sortposition(4) Source(#SECADDR3) Width(33);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_9) Caption('Employee Name') Captiontype(Caption) Displayposition(1) Parent(#EMP_GRID) Sortposition(1) Source(#FULLNAME) Width(16);
;
* Employee Grid and columns;
;
Define_Com Class(#PRIM_GRID) Name(#SECT_GRID) Columnbuttonheight(33) Displayposition(3) Height(145) Left(16) Parent(#COM_OWNER) Rowheight(17) Tabposition(3) Top(192) Width(745);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_10) Caption('Street Number and Name') Captiontype(Caption) Displayposition(2) Parent(#EMP_GRID) Sortposition(2) Source(#ADDRESS1) Width(15);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_11) Caption('Suburb or Town') Captiontype(Caption) Displayposition(3) Parent(#EMP_GRID) Sortposition(3) Source(#ADDRESS2) Width(15);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_12) Caption('State and Country') Captiontype(Caption) Displayposition(4) Parent(#EMP_GRID) Sortposition(4) Source(#ADDRESS3) Width(16);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_13) Caption('Post Code') Captiontype(Caption) Displayposition(5) Parent(#EMP_GRID) Sortposition(5) Source(#POSTCODE) Width(7);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_14) Caption('Home Number') Captiontype(Caption) Displayposition(6) Parent(#EMP_GRID) Sortposition(6) Source(#PHONEHME) Width(10);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_15) Caption('Business Number') Captiontype(Caption) Displayposition(7) Parent(#EMP_GRID) Sortposition(7) Source(#PHONEBUS) Width(14);
Define_Com Class(#PRIM_GDCL) Name(#GDCL_16) Caption('Salary') Captiontype(Caption) Displayposition(8) Parent(#EMP_GRID) Source(#SALARY) Width(20);
Define_Com Class(#PRIM_GPBX) Name(#GPBX_1) Caption('Form S_199FA') Displayposition(4) Height(153) Layoutmanager(#ATLM_1) Left(384) Parent(#COM_OWNER) Tabposition(4) Tabstop(False) Top(16) Width(385);
Define_Com Class(#PRIM_LABL) Name(#LABL_1) Caption('There are three simple grids shown on this form. The control you have over these grids is restricted by the properties set by the developer of this program. For example, you can not sort the data in the grid columns because the SortOnClick property was not set to True by the developer. Form S_199FB shows a more dynamic way of changing (and remembering) grid properties.') Displayposition(1) Height(105) Left(8) Parent(#GPBX_1) Tabposition(1) Tabstop(False) Top(16) Visualstyle(#VS_EMPH) Width(369);
Define_Com Class(#PRIM_ATLM) Name(#ATLM_1);
Define_Com Class(#PRIM_ATLI) Name(#ATLI_1) Manage(#LABL_1) Parent(#ATLM_1);
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) Caption('Click here to invoke Form S_199FB') Displayposition(2) Left(4) Parent(#GPBX_1) Tabposition(2) Top(124) Width(377);
Define_Com Class(#PRIM_ATLI) Name(#ATLI_2) Attachment(Bottom) Manage(#PHBN_1) Parent(#ATLM_1);
Define_Com Class(#S_199FB) Name(#S_199FB);
;
* ===================================================================;
* Initialize the form by filling all 3 grids from the database;
* ===================================================================;
;
Evtroutine Handling(#com_owner.Initialize);
Set Com(#com_owner) Caption(*component_desc);
;
Group_By Name(#DEPT_FLDS) Fields(#DEPTMENT #DEPTDESC);
* Read Departments and add to the Department grid.;
Select Fields(#DEPT_FLDS) From_File(DEPTAB);
Add_Entry To_List(#DEPT_GRID);
Endselect;
;
Group_By Name(#SECT_FLDS) Fields(#SECDESC #SECADDR1 #SECADDR2 #SECADDR3);
* Read Sections and add to the Section grid.;
Select Fields(#SECT_FLDS) From_File(SECTAB);
Add_Entry To_List(#SECT_GRID);
Endselect;
;
Group_By Name(#EMPN_FLDS) Fields(#SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #PHONEHME #PHONEBUS);
* Read Employees and add to the Employee grid.;
Select Fields(*ALL) From_File(PSLMST);
Use Builtin(TCONCAT) With_Args(#SURNAME ', ' #GIVENAME) To_Get(#FULLNAME);
Add_Entry To_List(#EMP_GRID);
Endselect;
Endroutine;
;
* ===================================================================;
* Handle a request to invoke form S_199FB;
* ===================================================================;
;
Evtroutine Handling(#PHBN_1.Click);
Invoke Method(#s_199fb.ShowForm);
Endroutine;
;
End_Com