Form S_185RRY - Get Reply

LANSA

Form S_185RRY - Get Reply
* ===================================================================;
*;
* Component : S_185RRY;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Reusable display of a single message queue;
*;
* 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 FORMPOSITION(ScreenCenter) FORMSTYLE(Owned) FRAMESTYLE(Dialog) HEIGHT(174) LAYOUTMANAGER(#ATLM_1) LEFT(272) TOP(201) VISUALSTYLE(#VS_NORM) WIDTH(404);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) ALIGNMENT(Center) CAPTION('<text>') DISPLAYPOSITION(1) HEIGHT(101) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(0) VISUALSTYLE(#VS_NORM) WIDTH(396);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#REPLY_BUTTON) BUTTONDEFAULT(True) CAPTION('Reply') DISPLAYPOSITION(1) ENABLED(False) LEFT(224) PARENT(#PANL_1) TABPOSITION(1) TOP(1) WIDTH(81);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#CANCEL_BUTTON) BUTTONCANCEL(True) CAPTION('Cancel') DISPLAYPOSITION(2) LEFT(315) PARENT(#PANL_1) TABPOSITION(2) TOP(1) WIDTH(81);
DEFINE_COM CLASS(#S_185LVL1) NAME(#REPLY);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(3) HEIGHT(27) LAYOUTMANAGER(#FWLM_1) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(120) WIDTH(396);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#LABL_1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Bottom) MANAGE(#S_185LVL1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_3) ATTACHMENT(Bottom) MANAGE(#PANL_1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) FLOWOPERATION(Center) FLOWOPERATIONHOR(Decrease);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#REPLY_BUTTON) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#CANCEL_BUTTON) PARENT(#FWLM_1);
DEFINE_COM CLASS(#S_185LVL1.Visual) NAME(#S_185LVL1) CAPTION('Reply') DISPLAYPOSITION(2) HEIGHT(19) LABELTYPE(Caption) MARGINLEFT(30) PARENT(#COM_OWNER) TABPOSITION(3) TOP(101) WIDTH(396);
;
Define_Pty uReply Get(*auto #Reply) ;
Define_Pty uMessage Set(SetMessage);
;
* ===============================================================================;
* Handle label property set;
* ===============================================================================;
;
PtyRoutine SetMessage;
Define_Map *Input #SysVar$av #Pty_001;
Set #Labl_1 Caption(#Pty_001.Value);
EndRoutine;
;
* ===============================================================================;
* Handle Initialisation;
* ===============================================================================;
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
ENDROUTINE;
;
* ===============================================================================;
* Get a reply;
* ===============================================================================;
;
MthRoutine uGetReply;
Set (#Reply #S_185LVL1) Value(' ');
Set #Reply_Button Enabled(False);
Invoke #Com_Owner.RestoreForm;
Invoke #Com_Owner.ActivateForm;
Invoke #Com_Owner.ShowModalForm;
EndRoutine;
;
* ===============================================================================;
* Handle reply button clicked;
* ===============================================================================;
;
EVTROUTINE HANDLING(#REPLY_BUTTON.Click);
Set #Reply Value(#S_185LVL1);
Invoke #Com_Owner.Closeform;
ENDROUTINE;
;
* ===============================================================================;
* Handle Cancel button clicked;
* ===============================================================================;
;
EVTROUTINE HANDLING(#CANCEL_BUTTON.Click);
Invoke #Com_Owner.Closeform;
ENDROUTINE;
;
* ===============================================================================;
* Handle change of reply so that reply button can only be clicked when a reply exists;
* ===============================================================================;
;
EVTROUTINE HANDLING(#S_185LVL1.Changed) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS);
If_Null #S_185LVL1;
Set #Reply_Button Enabled(False);
Else;
Set #Reply_Button Enabled(True);
Endif;
ENDROUTINE;
;
END_COM