Hi,
I hope someone can help me please.
I am trying to make a Template with various options.
What I am trying to do is the following:
- When I add the Global Template it must Automatically add the Extension Template to the FRAME Procedure if it exists and %AddMyTemplateTagToFrameProcedure is Ticked.
- When I add the Global Template it must Automatically add the Extension Template to all the Windows Procedures if %AddMyTemplateTagWindows is Ticked.
- If %AddMyTemplateTagWindows is not Ticked then it should not Automatically add the Extentions Template to all the Windows, I will then add it myself only to the Windows where I need it.
The problem at this stage is that when I add the Global Template:
- it does not Automatically add the Extension Template to the FRAME Procedure
- it Automatically add the Extension Template to all the Windows Procedures
- I am not sure how to use/implement the %AddMyTemplateTagToFrameProcedure and %AddMyTemplateTagWindows options
Another problem I can’t get sorted is how to use the %MyTemplateTagTPLVersion on the Extension Templates Descriptions to display the Version.
At this stage I have to manually change the version text on the Descriptions of the Extension Templates
Any help, guidance, advice would be appreciated.
Regards
Johan de Klerk
#! My Template
#!------------------------------------------------------------------------------
#TEMPLATE(MyTemplateTag,‘Template that applies My Template to every window’),FAMILY(‘abc’)
#!------------------------------------------------------------------------------
#System
#EQUATE(%MyTemplateTagTPLVersion,‘1.00’)
#!------------------------------------------------------------------------------
#Extension(ActivateMyTemplateTag,‘Activate My Template - Global 1.00’),Application(LocalMyTemplateTag(MyTemplateTag))
#SHEET
#TAB(‘Functions’)
#BOXED(’’)
#DISPLAY(‘My Template Version ‘& %MyTemplateTagTPLVersion)
#DISPLAY(’’)
#Prompt(‘Disable My Template in this application.’,Check),%GloDisableMyTemplateTag,At(10)
#Display(‘No My Template code will be generated.’)
#Display(’’)
#Prompt(‘Automatically Add Extension Template to Frame.’,Check),%AddMyTemplateTagToFrameProcedure,DEFAULT(%True),At(10)
#Prompt(‘Automatically Add Extension Template to all Windows’,Check),%AddMyTemplateTagWindows,DEFAULT(%False),At(10)
#Display(’’)
#ENDBOXED
#ENDTAB
#TAB(‘About’)
#BOXED(’’)
#DISPLAY(‘My Template Version ‘& %MyTemplateTagTPLVersion)
#DISPLAY(‘32 Bit only’)
#DISPLAY(’’)
#ENDBOXED
#ENDTAB
#ENDSHEET
#!#################################################################################################
#! End of GLOBAL EXTENSION
#!#################################################################################################
#AT(%GlobalData),Where(%GloDisableMyTemplateTag=0 and %ProgramExtension=‘EXE’ and %AppTemplateFamily=‘ABC’),DESCRIPTION(‘Declare My Template Global Variables’)
#INSERT(%MyTemplateTagGlobalData)
#ENDAT
#!------------------------------------------------------------------------------
#Extension(LocalFrameMyTemplateTag,‘My Template Frame Object - Local 1.00’),Procedure,req(ActivateMyTemplateTag(MyTemplateTag))
#RESTRICT,WHERE(UPPER(%ProcedureTemplate)=‘FRAME’)
#ENDRESTRICT
#BOXED(’’)
#DISPLAY(‘My Template Version ‘& %MyTemplateTagTPLVersion),At(10,4)
#DISPLAY(’’)
#Prompt(‘Disable My Template in this Procedure.’,Check),%DisableMyTemplateTagLocalFrame,At(10,16)
#DISPLAY(’’)
#ENDBOXED
#AT(%WindowManagerMethodCodeSection, ‘Init’, ‘(),BYTE’),LAST,WHERE(%GloDisableMyTemplateTag=0 and %DisableMyTemplateTagLocalFrame=0 and %ProgramExtension=‘EXE’ and %AppTemplateFamily=‘ABC’),DESCRIPTION(‘Declare My Template Init’),Priority(8001)
#INSERT(%MyTemplateTagFrameAfterOpenWindow)
#ENDAT
#!------------------------------------------------------------------------------
#Extension(LocalMyTemplateTag,‘My Template Object - Local 1.00’),Procedure,req(ActivateMyTemplateTag(MyTemplateTag))
#RESTRICT,WHERE(~EXTRACT(%WindowStatement,‘MDI’))
#ENDRESTRICT
#RESTRICT,WHERE(UPPER(%ProcedureTemplate)<>‘FRAME’)
#ENDRESTRICT
#RESTRICT,WHERE(UPPER(%ProcedureTemplate)<>‘SOURCE’)
#ENDRESTRICT
#RESTRICT,WHERE(UPPER(%ProcedureTemplate)<>‘REPORT’)
#ENDRESTRICT
#RESTRICT,WHERE(UPPER(%ProcedureTemplate)<>‘EXTERNAL’)
#ENDRESTRICT
#RESTRICT,WHERE(UPPER(%ProcedureTemplate)<>‘MENU’)
#ENDRESTRICT
#BOXED(’’)
#DISPLAY(‘My Template Version ‘& %MyTemplateTagTPLVersion),At(10,4)
#DISPLAY(’’)
#Prompt(‘Disable My Template in this Procedure.’,Check),%DisableMyTemplateTagLocal,At(10,16)
#DISPLAY(’’)
#ENDBOXED
#AT(%WindowManagerMethodCodeSection, ‘Init’, ‘(),BYTE’),LAST,WHERE(%GloDisableMyTemplateTag=0 and %DisableMyTemplateTagLocal=0 and %AppTemplateFamily=‘ABC’),DESCRIPTION(‘Declare My Template Init’),Priority(8001)
#INSERT(%MyTemplateTagAfterOpenWindow)
#ENDAT
#AT(%ProcedureRoutines,’()’),LAST,WHERE(%GloDisableMyTemplateTag=0 and %DisableMyTemplateTagLocal=0 and %AppTemplateFamily=‘ABC’),DESCRIPTION(‘Declare My Template Routine’),Priority(8001)
#INSERT(%MyTemplateTagProcedureRoutines)
#ENDAT
#!------------------------------------------------------------------------------
#GROUP(%MyTemplateTagGlobalData)
!Start My Template - Global Data
!Insert Global Variables here
!End My Template - Global Data
#!------------------------------------------------------------------------------
#GROUP(%MyTemplateTagFrameAfterOpenWindow)
!Start My Template - Frame WindowManagerMethodCodeSection Init
!Insert Local Variables here
!End My Template - Frame WindowManagerMethodCodeSection Init
#!------------------------------------------------------------------------------
#GROUP(%MyTemplateTagAfterOpenWindow)
!Start My Template - Window WindowManagerMethodCodeSection Init
DO MyTemplateTag
!End My Template - Window WindowManagerMethodCodeSection Init
#!------------------------------------------------------------------------------
#GROUP(%MyTemplateTagProcedureRoutines)
!Start My Template - Procedure Routines
MyTemplateTag ROUTINE
!Insert Code Here
!End My Template - Window Procedure Routines