Form S_200FB
*
*===================================================================;
*;
* Component : S_200FB;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Create/edit a note for an employee;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM FORMSTYLE(Owned) HEIGHT(271) LEFT(710) TOP(109) VISUALSTYLE(#VS_NORM) WIDTH(272);
DEFINE_COM CLASS(#PRIM_MEMO) NAME(#MEMO_1) ADDENTRYMODE(MultiplePerLine) CURRENTLINE(1) DISPLAYPOSITION(1) HEIGHT(153) LEFT(8) MAXIMUMLINELENGTH(10000) PARENT(#COM_OWNER) POPUPMENU(#PMNU_1) TABPOSITION(1) TOP(48) WIDTH(249) WORDWRAP(True);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_1) COLUMNROLE(Data) DISPLAYPOSITION(1) PARENT(#MEMO_1) SOURCE(#S_LINETXT) WIDTH(20);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_CUT) CAPTION('Cut') DISPLAYPOSITION(3) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(3) TOP(208) WIDTH(49);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_COPY) CAPTION('Copy') DISPLAYPOSITION(4) LEFT(64) PARENT(#COM_OWNER) TABPOSITION(4) TOP(208) WIDTH(49);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_PASTE) CAPTION('Paste') DISPLAYPOSITION(5) LEFT(120) PARENT(#COM_OWNER) TABPOSITION(5) TOP(208) WIDTH(49);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_2) COLUMNROLE(LineNumber) DISPLAYPOSITION(2) PARENT(#MEMO_1) SOURCE(#S_LINENO) WIDTH(20);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_3) COLUMNROLE(LineContinuation) DISPLAYPOSITION(3) PARENT(#MEMO_1) SOURCE(#S_LINECTN) WIDTH(20);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#S_200ID.Visual) NAME(#S_200ID) DISPLAYPOSITION(6) HEIGHT(19) LEFT(8) MARGINLEFT(70) PARENT(#COM_OWNER) TABPOSITION(6) TOP(14) VISIBLE(False) WIDTH(433);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_SAVE) CAPTION('Save ') DISPLAYPOSITION(2) LEFT(184) PARENT(#COM_OWNER) TABPOSITION(2) TOP(208) WIDTH(73);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_2) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#PHBN_SAVE) PARENT(#FWLM_2);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_3) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_4) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_CUT) CAPTION('Cut') DISPLAYPOSITION(1) PARENT(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_COPY) CAPTION('Copy') DISPLAYPOSITION(2) PARENT(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_PASTE) CAPTION('Paste') DISPLAYPOSITION(3) PARENT(#PMNU_1);
;
;
GROUP_BY NAME(#S_GRPNTE) FIELDS(#S_200ID #S_LINENO #S_LINECTN #S_LINETXT);
DEFINE #S_200NLIN reffld(#S_LINENO) desc('New line number');
DEFINE #S_200PLIN reffld(#S_LINENO) desc('Previous line number');
DEFINE #S_200NCTN reffld(#S_LINECTN) desc('New continuation number');
DEFINE #S_200NTXT reffld(#S_LINETXT) desc('New text');
;
* ==============================================================================;
*;
* Method : uEditNote;
* Description : Edit or create a note belonging to an identifier;
*;
* ===============================================================================;
;
MthRoutine uEditNote;
;
* Parameters and arguments;
Define_Map *Input #S_200ID #mS_200ID Desc('Note identifier') ;
;
CHANGE #S_200ID #mS_200ID.value;
;
* Get the note from the file if it exists;
;
* Start writing to a multi-line memo edit box;
clr_list #MEMO_1;
* note that the character position must be reset for new memos;
set #MEMO_1 CharacterPosition(0);
;
SELECT #S_GRPNTE S200NTE with_key(#S_200ID);
ADD_ENTRY #MEMO_1;
ENDSELECT;
INVOKE METHOD(#MEMO_1.SetFocus);
;
invoke #MEMO_1.setfocus;
invoke #Com_Owner.ShowForm;
;
Return;
;
Endroutine;
;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
ENDROUTINE;
;
EVTROUTINE HANDLING(#PHBN_CUT.Click #MITM_CUT.Click);
invoke #MEMO_1.Cut;
ENDROUTINE;
EVTROUTINE HANDLING(#PHBN_COPY.Click #MITM_COPY.Click);
invoke #MEMO_1.Copy;
ENDROUTINE;
EVTROUTINE HANDLING(#PHBN_PASTE.Click #MITM_PASTE.Click);
invoke #MEMO_1.Paste;
ENDROUTINE;
;
*;
* Save the note to file;
*;
EVTROUTINE HANDLING(#PHBN_SAVE.Click);
DELETE S200NTE with_key(#S_200ID);
SELECTLIST #MEMO_1;
INSERT #S_GRPNTE S200NTE;
ENDSELECT;
ENDROUTINE;
END_COM;
*
*===================================================================;
*;
* Component : S_200FB;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Create/edit a note for an employee;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM FORMSTYLE(Owned) HEIGHT(271) LEFT(710) TOP(109) VISUALSTYLE(#VS_NORM) WIDTH(272);
DEFINE_COM CLASS(#PRIM_MEMO) NAME(#MEMO_1) ADDENTRYMODE(MultiplePerLine) CURRENTLINE(1) DISPLAYPOSITION(1) HEIGHT(153) LEFT(8) MAXIMUMLINELENGTH(10000) PARENT(#COM_OWNER) POPUPMENU(#PMNU_1) TABPOSITION(1) TOP(48) WIDTH(249) WORDWRAP(True);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_1) COLUMNROLE(Data) DISPLAYPOSITION(1) PARENT(#MEMO_1) SOURCE(#S_LINETXT) WIDTH(20);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_CUT) CAPTION('Cut') DISPLAYPOSITION(3) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(3) TOP(208) WIDTH(49);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_COPY) CAPTION('Copy') DISPLAYPOSITION(4) LEFT(64) PARENT(#COM_OWNER) TABPOSITION(4) TOP(208) WIDTH(49);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_PASTE) CAPTION('Paste') DISPLAYPOSITION(5) LEFT(120) PARENT(#COM_OWNER) TABPOSITION(5) TOP(208) WIDTH(49);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_2) COLUMNROLE(LineNumber) DISPLAYPOSITION(2) PARENT(#MEMO_1) SOURCE(#S_LINENO) WIDTH(20);
DEFINE_COM CLASS(#PRIM_MECL) NAME(#MECL_3) COLUMNROLE(LineContinuation) DISPLAYPOSITION(3) PARENT(#MEMO_1) SOURCE(#S_LINECTN) WIDTH(20);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#S_200ID.Visual) NAME(#S_200ID) DISPLAYPOSITION(6) HEIGHT(19) LEFT(8) MARGINLEFT(70) PARENT(#COM_OWNER) TABPOSITION(6) TOP(14) VISIBLE(False) WIDTH(433);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_SAVE) CAPTION('Save ') DISPLAYPOSITION(2) LEFT(184) PARENT(#COM_OWNER) TABPOSITION(2) TOP(208) WIDTH(73);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_2) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#PHBN_SAVE) PARENT(#FWLM_2);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_3) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_4) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_CUT) CAPTION('Cut') DISPLAYPOSITION(1) PARENT(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_COPY) CAPTION('Copy') DISPLAYPOSITION(2) PARENT(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#MITM_PASTE) CAPTION('Paste') DISPLAYPOSITION(3) PARENT(#PMNU_1);
;
;
GROUP_BY NAME(#S_GRPNTE) FIELDS(#S_200ID #S_LINENO #S_LINECTN #S_LINETXT);
DEFINE #S_200NLIN reffld(#S_LINENO) desc('New line number');
DEFINE #S_200PLIN reffld(#S_LINENO) desc('Previous line number');
DEFINE #S_200NCTN reffld(#S_LINECTN) desc('New continuation number');
DEFINE #S_200NTXT reffld(#S_LINETXT) desc('New text');
;
* ==============================================================================;
*;
* Method : uEditNote;
* Description : Edit or create a note belonging to an identifier;
*;
* ===============================================================================;
;
MthRoutine uEditNote;
;
* Parameters and arguments;
Define_Map *Input #S_200ID #mS_200ID Desc('Note identifier') ;
;
CHANGE #S_200ID #mS_200ID.value;
;
* Get the note from the file if it exists;
;
* Start writing to a multi-line memo edit box;
clr_list #MEMO_1;
* note that the character position must be reset for new memos;
set #MEMO_1 CharacterPosition(0);
;
SELECT #S_GRPNTE S200NTE with_key(#S_200ID);
ADD_ENTRY #MEMO_1;
ENDSELECT;
INVOKE METHOD(#MEMO_1.SetFocus);
;
invoke #MEMO_1.setfocus;
invoke #Com_Owner.ShowForm;
;
Return;
;
Endroutine;
;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
ENDROUTINE;
;
EVTROUTINE HANDLING(#PHBN_CUT.Click #MITM_CUT.Click);
invoke #MEMO_1.Cut;
ENDROUTINE;
EVTROUTINE HANDLING(#PHBN_COPY.Click #MITM_COPY.Click);
invoke #MEMO_1.Copy;
ENDROUTINE;
EVTROUTINE HANDLING(#PHBN_PASTE.Click #MITM_PASTE.Click);
invoke #MEMO_1.Paste;
ENDROUTINE;
;
*;
* Save the note to file;
*;
EVTROUTINE HANDLING(#PHBN_SAVE.Click);
DELETE S200NTE with_key(#S_200ID);
SELECTLIST #MEMO_1;
INSERT #S_GRPNTE S200NTE;
ENDSELECT;
ENDROUTINE;
END_COM;