Form VL_SAM032: Multi-Form Essentials 2
Name: VL_SAM032
Description: The following RDMLX form demonstrates the essential details of multi-form communications. It should be used in conjunction with forms VL_SAM031 and VL_SAM033.
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) HEIGHT(205) LEFT(322) TOP(285) WIDTH(416);
* ;
* Form Layout ;
* ;
DEFINE_COM CLASS(#EMPNO.Visual) NAME(#EMPNO) DISPLAYPOSITION(1) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(1) TOP(40) WIDTH(209);
DEFINE_COM CLASS(#SURNAME.Visual) NAME(#SURNAME) DISPLAYPOSITION(2) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(2) TOP(72) WIDTH(324);
DEFINE_COM CLASS(#SALARY.Visual) NAME(#SALARY) DISPLAYPOSITION(3) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(3) TOP(104) WIDTH(278);
DEFINE_COM CLASS(#DATE.Visual) NAME(#DATE) DISPLAYPOSITION(4) HEIGHT(19) LEFT(16) MARGINLEFT(169) PARENT(#COM_OWNER) TABPOSITION(4) TOP(140) WIDTH(236);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('Details entered on this form should be immediately reflected onto the other 2 forms ') DISPLAYPOSITION(5) HEIGHT(25) LEFT(17) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(8) WIDTH(401);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_CLEAR) CAPTION('Clear Fields') DISPLAYPOSITION(6) LEFT(320) PARENT(#COM_OWNER) TABPOSITION(6) TOP(144);
* ;
* Define Properties (all sets and gets done by specific event routines);
* ;
define_pty name(CurrEmpno) set(SetEmpno) get(GetEmpno);
define_pty name(CurrSurname) set(SetSurname) get(GetSurname);
define_pty name(CurrSalary) set(SetSalary) get(GetSalary);
define_pty name(CurrDate) set(SetDate) get(GetDate);
* ;
* Define Events;
* ;
define_evt name(EmpnoChanged);
define_evt name(SurnameChanged);
define_evt name(SalaryChanged);
define_evt name(DateChanged);
* ;
* Form Initialization;
* ;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption('Form 2');
ENDROUTINE ;
* ;
* Property set and get routines (as previously defined) ;
* ;
ptyroutine SetEMPNO;
DEFINE_MAP FOR(*INPUT) CLASS(#empno) NAME(#pEMPNO) ;
change #empno #pempno;
endroutine ;
ptyroutine GetEMPNO;
DEFINE_MAP FOR(*output) CLASS(#empno) NAME(#pEmpno) ;
set #pEMPNO value(#EMPNO) ;
endroutine ;
ptyroutine SetSurname;
DEFINE_MAP FOR(*INPUT) CLASS(#surname) NAME(#psurname) ;
change #surname #psurname;
endroutine ;
ptyroutine Getsurname;
DEFINE_MAP FOR(*output) CLASS(#surname) NAME(#psurname) ;
set #psurname value(#surname) ;
endroutine ;
ptyroutine SetSalary;
DEFINE_MAP FOR(*INPUT) CLASS(#Salary) NAME(#pSalary) ;
change #Salary #pSalary;
endroutine ;
ptyroutine GetSalary;
DEFINE_MAP FOR(*output) CLASS(#Salary) NAME(#pSalary) ;
set #pSalary value(#Salary) ;
endroutine ;
ptyroutine SetDate;
DEFINE_MAP FOR(*INPUT) CLASS(#Date) NAME(#pDate) ;
change #Date #pDate;
endroutine ;
ptyroutine GetDate;
DEFINE_MAP FOR(*output) CLASS(#Date) NAME(#pDate) ;
set #pDate value(#Date) ;
endroutine ;
* ;
* On change of value on form signal event to other forms;
* ;
evtroutine (#empno.changed);
signal empnochanged;
endroutine ;
evtroutine (#surname.changed);
signal surnamechanged;
endroutine ;
evtroutine (#salary.changed);
signal salarychanged;
endroutine ;
evtroutine (#date.changed);
signal datechanged;
endroutine ;
* ;
* Handle the clear fields button;
* ;
EVTROUTINE HANDLING(#BTN_CLEAR.Click);
change (#empno #surname #salary #date) *null;
signal empnochanged;
signal surnamechanged;
signal salarychanged;
signal datechanged;
ENDROUTINE ;
END_COM ;
Name: VL_SAM032
Description: The following RDMLX form demonstrates the essential details of multi-form communications. It should be used in conjunction with forms VL_SAM031 and VL_SAM033.
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) HEIGHT(205) LEFT(322) TOP(285) WIDTH(416);
* ;
* Form Layout ;
* ;
DEFINE_COM CLASS(#EMPNO.Visual) NAME(#EMPNO) DISPLAYPOSITION(1) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(1) TOP(40) WIDTH(209);
DEFINE_COM CLASS(#SURNAME.Visual) NAME(#SURNAME) DISPLAYPOSITION(2) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(2) TOP(72) WIDTH(324);
DEFINE_COM CLASS(#SALARY.Visual) NAME(#SALARY) DISPLAYPOSITION(3) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(3) TOP(104) WIDTH(278);
DEFINE_COM CLASS(#DATE.Visual) NAME(#DATE) DISPLAYPOSITION(4) HEIGHT(19) LEFT(16) MARGINLEFT(169) PARENT(#COM_OWNER) TABPOSITION(4) TOP(140) WIDTH(236);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('Details entered on this form should be immediately reflected onto the other 2 forms ') DISPLAYPOSITION(5) HEIGHT(25) LEFT(17) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(8) WIDTH(401);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_CLEAR) CAPTION('Clear Fields') DISPLAYPOSITION(6) LEFT(320) PARENT(#COM_OWNER) TABPOSITION(6) TOP(144);
* ;
* Define Properties (all sets and gets done by specific event routines);
* ;
define_pty name(CurrEmpno) set(SetEmpno) get(GetEmpno);
define_pty name(CurrSurname) set(SetSurname) get(GetSurname);
define_pty name(CurrSalary) set(SetSalary) get(GetSalary);
define_pty name(CurrDate) set(SetDate) get(GetDate);
* ;
* Define Events;
* ;
define_evt name(EmpnoChanged);
define_evt name(SurnameChanged);
define_evt name(SalaryChanged);
define_evt name(DateChanged);
* ;
* Form Initialization;
* ;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption('Form 2');
ENDROUTINE ;
* ;
* Property set and get routines (as previously defined) ;
* ;
ptyroutine SetEMPNO;
DEFINE_MAP FOR(*INPUT) CLASS(#empno) NAME(#pEMPNO) ;
change #empno #pempno;
endroutine ;
ptyroutine GetEMPNO;
DEFINE_MAP FOR(*output) CLASS(#empno) NAME(#pEmpno) ;
set #pEMPNO value(#EMPNO) ;
endroutine ;
ptyroutine SetSurname;
DEFINE_MAP FOR(*INPUT) CLASS(#surname) NAME(#psurname) ;
change #surname #psurname;
endroutine ;
ptyroutine Getsurname;
DEFINE_MAP FOR(*output) CLASS(#surname) NAME(#psurname) ;
set #psurname value(#surname) ;
endroutine ;
ptyroutine SetSalary;
DEFINE_MAP FOR(*INPUT) CLASS(#Salary) NAME(#pSalary) ;
change #Salary #pSalary;
endroutine ;
ptyroutine GetSalary;
DEFINE_MAP FOR(*output) CLASS(#Salary) NAME(#pSalary) ;
set #pSalary value(#Salary) ;
endroutine ;
ptyroutine SetDate;
DEFINE_MAP FOR(*INPUT) CLASS(#Date) NAME(#pDate) ;
change #Date #pDate;
endroutine ;
ptyroutine GetDate;
DEFINE_MAP FOR(*output) CLASS(#Date) NAME(#pDate) ;
set #pDate value(#Date) ;
endroutine ;
* ;
* On change of value on form signal event to other forms;
* ;
evtroutine (#empno.changed);
signal empnochanged;
endroutine ;
evtroutine (#surname.changed);
signal surnamechanged;
endroutine ;
evtroutine (#salary.changed);
signal salarychanged;
endroutine ;
evtroutine (#date.changed);
signal datechanged;
endroutine ;
* ;
* Handle the clear fields button;
* ;
EVTROUTINE HANDLING(#BTN_CLEAR.Click);
change (#empno #surname #salary #date) *null;
signal empnochanged;
signal surnamechanged;
signal salarychanged;
signal datechanged;
ENDROUTINE ;
END_COM ;