* =============================================================================
*
* Component : UF_QRY03
* Type : Reusable Component
* Ancestor : VF_AC010 (Command Handler)
*
* PLEASE NOTE: This UF_ (User Framework) component is the shipped version. You
* may choose to modify it. You should do this by copying the source
* code of this component into your own component and then change
* the copied version. This will prevent the accidental loss of your
* changes if you upgrade your Visual LANSA Framework version. Refer
* to the end of this component for more details about making your
* own version of this component.
*
* This is example code only - No warranty is expressed or implied.
* Neither this program, nor any derivative of it, should be ever be used in
* production or end-user environments.
*
* =============================================================================
*
* This demonstrates how to listen for RAMP objects and view their properties
* =============================================================================
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #VF_AC010) Height(336) Layoutmanager(#ATLM_2) Width(552)
* ================================================================================
* Simple Field and Group Definitions
* ================================================================================
* ================================================================================
* Component definitions
* ================================================================================
* Body and Button arrangement panels
Define_Com Class(#PRIM_PANL) Name(#BUTTON_PANEL) Displayposition(2) Height(311) Layoutmanager(#BUTTON_FLOW) Left(464) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(25) Width(88)
Define_Com Class(#PRIM_PANL) Name(#BODY_HEAD) Displayposition(1) Height(311) Layoutmanager(#ATLM_1) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(25) Verticalscroll(True) Width(464)
* Attachment and flow layout managers
Define_Com Class(#PRIM_ATLM) Name(#MAIN_LAYOUT)
Define_Com Class(#PRIM_ATLI) Name(#BUTTON_ATTACH) Attachment(Right) Manage(#BUTTON_PANEL) Parent(#MAIN_LAYOUT)
Define_Com Class(#PRIM_FWLM) Name(#BUTTON_FLOW) Direction(TopToBottom) Flowoperation(Center) Marginbottom(4) Marginleft(4) Marginright(4) Margintop(4) Spacing(4) Spacingitems(4)
Define_Com Class(#PRIM_ATLI) Name(#BODY_ATTACH) Attachment(Center) Manage(#BODY_HEAD) Parent(#MAIN_LAYOUT)
* The report button
Define_Com Class(#PRIM_PHBN) Name(#PHBN_REPORT) Buttondefault(True) Caption('Report') Displayposition(1) Left(4) Parent(#BUTTON_PANEL) Tabposition(1) Top(4)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_SAVE_BUTTON) Manage(#PHBN_REPORT) Parent(#BUTTON_FLOW)
* The Traverse component
Define_Com Class(#UF_TRVRS) Name(#UF_TRVRS)
* The Output List
Define_Com Class(#PRIM_GRID) Name(#LTVW_1) Displayposition(1) Height(142) Left(2) Parent(#BODY_HEAD) Rowresize(True) Showselection(True) Showsortarrow(True) Tabposition(1) Top(2) Width(460)
Define_Com Class(#PRIM_GDCL) Name(#LVCL_4) Displayposition(1) Parent(#LTVW_1) Source(#DF_ELTXTL) Width(100) Widthtype(Remainder)
Define_Com Class(#PRIM_ATLM) Name(#ATLM_1) Marginbottom(2) Marginleft(2) Marginright(2) Margintop(2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_1) Attachment(Center) Parent(#ATLM_1)
Define_Com Class(#PRIM_ATLM) Name(#ATLM_2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_2) Attachment(Center) Manage(#BODY_HEAD) Parent(#ATLM_2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_3) Attachment(Right) Manage(#BUTTON_PANEL) Parent(#ATLM_2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_4) Attachment(Center) Manage(#LTVW_1) Parent(#ATLM_1)
* The Script List
Define_Com Class(#PRIM_MEMO) Name(#SCRIPT) Componentversion(1) Currentline(1) Displayposition(2) Height(165) Left(2) Maximumlinelength(200) Parent(#BODY_HEAD) Showselectionhilight(False) Tabposition(2) Top(144) Width(460)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_5) Attachment(Bottom) Manage(#SCRIPT) Parent(#ATLM_1)
Define_Com Class(#PRIM_MECL) Name(#MECL_1) Columnrole(Data) Displayposition(1) Parent(#SCRIPT) Source(#VF_ELTXTB)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_1) Caption('Member ID') Captiontype(Caption) Displayposition(2) Parent(#LTVW_1) Source(#VF_ELIDN)
* Show Script push button
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) Displayposition(3) Left(0) Parent(#COM_OWNER) Tabposition(3) Top(0) Width(552)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_6) Attachment(Top) Manage(#PHBN_1) Parent(#ATLM_2)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_SCRIPT) Caption('Show Script') Displayposition(2) Left(4) Parent(#BUTTON_PANEL) Tabposition(2) Top(33)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_1) Manage(#PHBN_SCRIPT) Parent(#BUTTON_FLOW)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_FKEY) Caption('Show FKeys') Displayposition(3) Left(4) Parent(#BUTTON_PANEL) Tabposition(3) Top(62)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_2) Manage(#PHBN_FKEY) Parent(#BUTTON_FLOW)
* Framework - class #VF_FP001 #TempVF_FP001 Reference(*Dynamic)
* Application - class #VF_FP002 #TempVF_FP002 Reference(*Dynamic)
* Business Object - class #VF_FP003 #TempVF_FP003 Reference(*Dynamic)
* Command - class #VF_FPM09 #TempVF_FPM09 Reference(*Dynamic)
* Command Usage - class #VF_FPM10 #TempVF_FPM10 Reference(*Dynamic)
* Filter - class #VF_FPM14 #TempVF_FPM14 Reference(*Dynamic)
* ================================================================================
* Events Definitions
* ================================================================================
* ================================================================================
* Property Definitions
* ================================================================================
* ================================================================================
* Method Definitions
* ================================================================================
* --------------------------------------------------------------------------------
* Handle Command Execution
* --------------------------------------------------------------------------------
Mthroutine Name(uExecute) Options(*REDEFINE)
* The return code field and testing condition
Define Field(#Ret_Code) Reffld(#IO$STS)
Def_Cond Name(*RetOkay) Cond('#Ret_Code = OK')
* Do any execution logic defined in the ancestor
Invoke Method(#Com_Ancestor.uExecute)
Endroutine
* ================================================================================
* Subroutines
* ================================================================================
* ================================================================================
* Event Handlers
* ================================================================================
* --------------------------------------------------------------------------------
* Handle the save button
* --------------------------------------------------------------------------------
Evtroutine Handling(#PHBN_REPORT.Click)
* Tell the Traverse reusable part to read through the entire system in no particular order
* This program listens for the signals for each new object,
Clr_List Named(#LTVW_1)
Invoke Method(#UF_TRVRS.uTraverseFramework)
Endroutine
* Listen for the RAMP Container
Evtroutine Handling(#UF_TRVRS.RAMPContainer) Reference(#TempVF_FP025)
* Output generic details
Invoke Method(#Com_Owner.uOutputGeneric) Ulevel(1) Utype('RAMP Session') Uobject(#TempVF_FP025)
* For more details of the RAMP Session object, click on #TempVF_FP025 above and press F2, and look at the properties of class VF_FP025
Add_Entry To_List(#LTVW_1)
* Store a reference to the object against the list line
Set Com(#LTVW_1.currentitem) Relatedreference(#TempVF_FP025)
Endroutine
* Listen for a RAMP Session
Evtroutine Handling(#UF_TRVRS.RAMPSession) Reference(#TempVF_FP026)
* Output generic details
Invoke Method(#Com_Owner.uOutputGeneric) Ulevel(1) Utype('RAMP Group') Uobject(#TempVF_FP026)
* For more details of the RAMP Group object, click on #TempVF_FP026 above and press F2, and look at the properties of class VF_FP026
Add_Entry To_List(#LTVW_1)
* Store a reference to the object against the list line
Set Com(#LTVW_1.currentitem) Relatedreference(#TempVF_FP026)
Endroutine
* Listen for a RAMP Destination
Evtroutine Handling(#UF_TRVRS.RAMPDestination) Reference(#TempVF_FPM27)
* Output generic details
Invoke Method(#Com_Owner.uOutputGeneric) Ulevel(1) Utype('RAMP Destination')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM27 above and press F2, and look at the properties of class VF_FPM27
* Store the member Identifier for this destination
Change Field(#VF_ELIDN) To(#TempVF_FPM27.CurrentMemberGUID)
#DF_ELTXTL := 'Destination ' + #TempVF_FPM27.uCaption.AsNativeString + ' Technical Caption ' + #TempVF_FPM27.uTechnicalCaption.AsNativeString + ' Navigate Script ID ' + #TempVF_FPM27.uNavigateScriptIDN + ' Return Script ID ' + #TempVF_FPM27.uReturnScriptIDN
Add_Entry To_List(#LTVW_1)
* Store a reference to the object against the list line
Set Com(#LTVW_1.currentitem) Relatedreference(#TempVF_FPM27)
Endroutine
* Listen for a RAMP Junction
Evtroutine Handling(#UF_TRVRS.RAMPJunction) Reference(#TempVF_FPM28)
* Output generic details
Invoke Method(#Com_Owner.uOutputGeneric) Ulevel(1) Utype('RAMP Destination')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM28 above and press F2, and look at the properties of class VF_FPM28
* Store the member Identifier for this junction
Change Field(#VF_ELIDN) To(#TempVF_FPM28.CurrentMemberGUID)
#DF_ELTXTL := 'Junction ' + #TempVF_FPM28.uCaption.AsNativeString + ' Technical Caption ' + #TempVF_FPM28.uTechnicalCaption.AsNativeString + ' Script ID ' + #TempVF_FPM28.uIdentifier + ' Screen Name ' + #TempVF_FPM28.uScreenName
Add_Entry To_List(#LTVW_1)
Endroutine
* Listen for a RAMP Special
Evtroutine Handling(#UF_TRVRS.RAMPSpecial) Reference(#TempVF_FPM29)
* Output generic details
Invoke Method(#Com_Owner.uOutputGeneric) Ulevel(1) Utype('RAMP Special')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM29 above and press F2, and look at the properties of class VF_FPM29
* Store the member Identifier for this special
Change Field(#VF_ELIDN) To(#TempVF_FPM29.CurrentMemberGUID)
#DF_ELTXTL := 'Special ' + #TempVF_FPM29.uCaption.AsNativeString + ' Technical Caption ' + #TempVF_FPM29.uTechnicalCaption.AsNativeString
Add_Entry To_List(#LTVW_1)
Endroutine
* Listen for a RAMP Script
Evtroutine Handling(#UF_TRVRS.RAMPScript) Reference(#TempVF_FPM30)
* Output generic details
Invoke Method(#Com_Owner.uOutputGeneric) Ulevel(1) Utype('RAMP Script')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM30 above and press F2, and look at the properties of class VF_FPM30
* Store the member Identifier for this script
Change Field(#VF_ELIDN) To(#TempVF_FPM30.CurrentMemberGUID)
#DF_ELTXTL := 'Script ' + #TempVF_FPM30.uCaption.AsNativeString + ' Technical Caption ' + #TempVF_FPM30.uTechnicalCaption.AsNativeString
Add_Entry To_List(#LTVW_1)
* Store a reference to the object against the list line
Set Com(#LTVW_1.currentitem) Relatedreference(#TempVF_FPM30)
Endroutine
* Output a line of description of the object
Mthroutine Name(uOutputGeneric)
Define_Map For(*input) Class(#std_num) Name(#uLevel)
Define_Map For(*input) Class(#df_elmsg) Name(#uType)
Define_Map For(*input) Class(#vf_fp001) Name(#VisParent1) Mandatory(*NULL) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#vf_fp002) Name(#VisParent2) Mandatory(*NULL) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#vf_fp003) Name(#VisParent3) Mandatory(*NULL) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#vf_ac001) Name(#uObject) Mandatory(*NULL) Pass(*BY_REFERENCE)
Change Field(#vf_elidn) To(*blanks)
* Object details
If_Ref Com(#uObject) Is_Not(*null)
#DF_ELTXTL := #uType + ' ' + #uObject.uCaption.AsNativeString + ' ' + #uObject.uIdentifier + ' ' + #uObject.uUserObjectType
Endif
Endroutine
* Button press - Show the lines of script for a script
Evtroutine Handling(#PHBN_SCRIPT.Click)
Define_Com Class(#VF_FPM30) Name(#TempVF_FPM30) Reference(*DYNAMIC)
Selectlist Named(#LTVW_1)
If (#LTVW_1.CurrentItem.Selected)
If_Ref Com(#LTVW_1.CurrentItem.RelatedReference) Is(*INSTANCE_OF #VF_FPM30)
Set_Ref Com(#TempVF_FPM30) To(*Dynamic #LTVW_1.CurrentItem.RelatedReference)
Invoke Method(#Com_Owner.uShowScript) Uscriptmanager(#TempVF_FPM30) Usescriptguid(#VF_ELIDN)
Endif
Endif
Endselect
Endroutine
* Show a script
Mthroutine Name(uShowScript)
Define_Map For(*input) Class(#VF_FPM30) Name(#uScriptManager) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#VF_ELMBRi) Name(#UseScriptGUID)
Define Field(#First) Reffld(#vf_elbool)
Define_Com Class(#vf_elindx) Name(#LoopLimit)
Clr_List Named(#SCRIPT)
* When working with any VF_FPM objects you have to set the CurrentMemberGUID before reading or writing to them.
* This is stored in field #VF_ELIDN in list #LTVW_1
* set #VF_FPM30 to the correct member
#uScriptManager.CurrentMemberGUID := #UseScriptGUID
Change Field(#LoopLimit) To(#uScriptManager.uSLMax)
Change Field(#VF_ELLICT) To(0)
Change Field(#First) To(TRUE)
Begin_Loop To(#LoopLimit)
* Read each script line into field #vf_eltxtb
Invoke Method(#uSystem.uRestorePropertySet) Ucursor('0') Ufirst(#First) Uname(uSL) Ualphavalue(#vf_eltxtb) Udefaultalphavalue('*NONE') Ac0x1object(#uScriptManager.SetMember( #UseScriptGUID ))
Add_Entry To_List(#SCRIPT)
Change Field(#First) To(FALSE)
End_Loop
Endroutine
* Button press - Show the function keys for a destination
Evtroutine Handling(#PHBN_FKEY.Click)
Define_Com Class(#VF_FPM27) Name(#TempVF_FPM27) Reference(*DYNAMIC)
Selectlist Named(#LTVW_1)
If (#LTVW_1.CurrentItem.Selected)
If_Ref Com(#LTVW_1.CurrentItem.RelatedReference) Is(*INSTANCE_OF #VF_FPM27)
Set_Ref Com(#TempVF_FPM27) To(*Dynamic #LTVW_1.CurrentItem.RelatedReference)
Invoke Method(#Com_Owner.uShowFKeys) Udestinationmanager(#TempVF_FPM27) Usedestguid(#VF_ELIDN)
Endif
Endif
Endselect
Endroutine
* Show the function keys for a destination
Mthroutine Name(uShowFkeys)
Define_Map For(*input) Class(#VF_FPM27) Name(#uDestinationManager) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#VF_ELMBRi) Name(#UseDestGUID)
Define_Com Class(#vf_elindx) Name(#LoopLimit)
Define_Com Class(#vf_elindx) Name(#LoopIndex)
Define_Com Class(#vf_elindx) Name(#KeyTotal)
Clr_List Named(#SCRIPT)
* When working with any VF_FPM objects you have to set the CurrentMemberGUID before reading or writing to them.
* This is stored in field #VF_ELIDN in list #LTVW_1
Set_Ref Com(#uDestinationManager) To(#uFramework.VF_FP027Manager)
#uDestinationManager.CurrentMemberGUID := #UseDestGUID
Change Field(#LoopLimit) To(#uDestinationManager.uKeyTotal)
* Load cherry function keys
Begin_Loop Using(#LoopIndex) To(#LoopLimit)
Change Field(#vf_elindx) To(#LoopIndex)
#vf_eltxtb := ' Caption: ' + #uDestinationManager.uKeyCaption<#LoopIndex>
#vf_eltxtb += ' , '
#vf_eltxtb += ' Enabled in Newlook: ' + #uDestinationManager.uKeyEnabledNL<#LoopIndex>
#vf_eltxtb += ' , '
#vf_eltxtb += ' Enabled in VLF: ' + #uDestinationManager.uKeyEnabledVLF<#LoopIndex>
#vf_eltxtb += ' , '
#vf_eltxtb += ' Key to Send: ' + #uDestinationManager.uKeytoSend<#LoopIndex>
Add_Entry To_List(#SCRIPT)
End_Loop
Endroutine
End_Com