* =============================================================================** Component : UF_QRY02* 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 general Framework 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(336) Layoutmanager(#BUTTON_FLOW) Left(464) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(0) Width(88)Define_Com Class(#PRIM_PANL) Name(#BODY_HEAD) Displayposition(1) Height(336) Layoutmanager(#ATLM_1) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) 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 componentDefine_Com Class(#UF_TRVRS) Name(#UF_TRVRS)Define_Com Class(#PRIM_GRID) Name(#LTVW_1) Displayposition(1) Height(332) Left(2) Parent(#BODY_HEAD) Rowresize(True) Showsortarrow(True) Tabposition(1) Top(2) Width(460)Define_Com Class(#PRIM_GDCL) Name(#LVCL_1) Caption('Parent Framework') Captiontype(Caption) Displayposition(1) Parent(#LTVW_1) Source(#FP_EKEY1) Width(12)Define_Com Class(#PRIM_GDCL) Name(#LVCL_2) Caption('Parent Application') Captiontype(Caption) Displayposition(2) Parent(#LTVW_1) Source(#FP_EKEY2) Width(12)Define_Com Class(#PRIM_GDCL) Name(#LVCL_3) Caption('Parent Business Object') Captiontype(Caption) Displayposition(3) Parent(#LTVW_1) Source(#FP_EKEY3) Width(17)Define_Com Class(#PRIM_GDCL) Name(#LVCL_4) Displayposition(4) Parent(#LTVW_1) Source(#DF_ELTXTL) 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)
* 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 #Ret_Code reffld(#IO$STS)Def_cond Name(*RetOkay) Cond('#Ret_Code = OK')
* Do any execution logic defined in the ancestor
Invoke #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 #LTVW_1invoke #UF_TRVRS.uTraverseFramework
ENDROUTINE
* Listen for a Framework Object
EVTROUTINE HANDLING(#UF_TRVRS.Framework) Reference(#TempVF_FP001)
* Output generic detailsInvoke #Com_Owner.uOutputGeneric uLevel(1) uType('Framework') uObject(#TempVF_FP001)
add_entry #LTVW_1
* Store a reference to the object against the list lineSet Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FP001)
ENDROUTINE
* Listen for an Application Object
EVTROUTINE HANDLING(#UF_TRVRS.Application) Reference(#TempVF_FP002) VisParent1(#TempVF_FP001)
* Output generic detailsInvoke #Com_Owner.uOutputGeneric uLevel(2) uType('Application') uObject(#TempVF_FP002) VisParent1(#TempVF_FP001)
* For more details of the application object, click on #TempVF_FP002 above and press F2, and look at the properties of class VF_FP002
add_entry #LTVW_1
* Store a reference to the object against the list lineSet Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FP002)
ENDROUTINE
* Listen for a Business Object Object
EVTROUTINE HANDLING(#UF_TRVRS.BusinessObject) Reference(#TempVF_FP003) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002)
* Output generic detailsInvoke #Com_Owner.uOutputGeneric uLevel(3) uType('Business Object') uObject(#TempVF_FP003) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002)
* For more details of the business object object, click on #TempVF_FP003 above and press F2, and look at the properties of class VF_FP003
add_entry #LTVW_1
* Store a reference to the object against the list lineSet Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FP003)
ENDROUTINE
* Listen for a Filter Object
EVTROUTINE HANDLING(#UF_TRVRS.Filter) Reference(#TempVF_FPM14) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002) VisParent3(#TempVF_FP003)
* Output generic detailsInvoke #Com_Owner.uOutputGeneric uLevel(3) uType('Business Object') uObject(#TempVF_FP003) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002) VisParent3(#TempVF_FP003)
* Specific details* For more details of the filter object, click on #TempVF_FPM14 above and press F2, and look at the properties of class VF_FPM14
#DF_ELTXTL := 'Filter ' + #TempVF_FPM14.uCaption.AsNativeString + 'Snap-in windows filter ' + #TempVF_FPM14.uFilterName + ' Snap-in Web function ' + #TempVF_FPM14.uWebFilterFunction + ' ' + 'Snap-in wam filter ' + #TempVF_FPM14.uWAMComponent
add_entry #LTVW_1
* Store a reference to the object against the list lineSet Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FPM14)
ENDROUTINE
* Listen for a Command Usage (Command Reference) Object
EVTROUTINE HANDLING(#UF_TRVRS.CommandReference) Reference(#TempVF_FPM10) CommandDefinition(#TempVF_FPM09) VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002) VisParent3(#TempVF_FP003)
* Output generic detailsInvoke #Com_Owner.uOutputGeneric uLevel(3) uType('Command Reference') VisParent1(#TempVF_FP001) VisParent2(#TempVF_FP002) VisParent3(#TempVF_FP003)
* Specific details
* Some of the details are on the Command Object (VF_FPM09)* Most of the details are on the Command Reference Object (VF_FPM10)
* For more details of the Command and command reference objects, click on #TempVF_FPM09 or #TempVF_FPM10 above and press F2, and look at the properties of classes VF_FPM09 and VF_FPM10
#DF_ELTXTL := 'Command ' + #TempVF_FPM09.uCaption.AsNativeString + ' Snap-in windows handler ' + #TempVF_FPM10.uHandlerName + ' Snap-in Web function ' + #TempVF_FPM10.uWebHandlerFunction + ' ' + ' Snap-in wam handler ' + #TempVF_FPM10.uWAMComponent + ' uWAM' + #TempVF_FPM10.uWAM
add_entry #LTVW_1
* Store a reference to the object against the list lineSet Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FPM10)
ENDROUTINE
* Output a line of description of the object
mthroutine uOutputGenericdefine_map *input #std_num #uLeveldefine_map *input #df_elmsg #uTypeDefine_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)
* Parent DetailsChange (#FP_EKEY1 #FP_EKEY2 #FP_EKEY3) *null
* Parent 1 detailsif_ref #VisParent1 is_not(*null)Change #FP_EKEY1 #VisParent1.uUserObjectTypeendif
* Parent 2 detailsif_ref #VisParent2 is_not(*null)Change #FP_EKEY2 #VisParent2.uUserObjectTypeendif
* Parent 3 detailsif_ref #VisParent3 is_not(*null)Change #FP_EKEY3 #VisParent3.uUserObjectTypeendif
* Object detailsif_ref #uObject is_not(*null)#DF_ELTXTL := #uType + ' ' + #uObject.uCaption.AsNativeString + ' ' + #uObject.uIdentifier + ' ' + #uObject.uUserObjectTypeendif
endroutine
End_Com