Se dobbiamo utilizzare un particolare tipo di Fast-Part formattata alla stessa maniera in più di un programma, bisogna creare una reusable-part che esegua le istruzioni di formattazione ed utilizzare questa nei programmi.
Template relativa EDVLFWFFP
Esempi pratici.
Fast-Part Radio Button per la selezione di I/E/S
======================== Definizione della Reusable-Part ================================
BEGIN_COM Role(*EXTENDS £PRIM_OBJT) Help('Formattazione FP Radio Button per I/E/S')
MTHROUTINE Name(um_FormattaFP) Help('Formattazione FP Radio Button per I/E/S')
DEFINE_MAP For(*INPUT) Class(£FP_IN001) Name(£pFastPartObj) Help('Oggetto Fast Part') Pass(*BY_REFERENCE)
DEFINE_MAP For(*INPUT) Class(£PRIM_ALPH) Name(£pNomeFastPart) Help('Nome della Fast Part da Formattare')
DEFINE_MAP For(*INPUT) Class(£PRIM_ALPH) Name(£pCaptionFastPart) MANDATORY('') Help('Camption da assegnare alla Fast Part')
**********
********** Formattazione della Fast-Part
**********
£pFastPartObj.uSingName := £pNomeFastPart
IF (£pCaptionFastPart <> *BLANK)
£pFastPartobj.uCaptionPosition := LEFT
£pFastPartobj.uCaption := £pCaptionFastPart
Else
£pFastPartobj.uCaptionPosition := NONE
Endif
£pFastPartobj.uItemCount := 3
£pFastPartobj.UsingInstance := 1
£pFastPartobj.uShowValue := "Inclusi"
£pFastPartobj.uHiddenKey1 := 'I'
£pFastPartobj.UsingInstance := 2
£pFastPartobj.uShowValue := "Esclusi"
£pFastPartobj.uHiddenKey1 := 'E'
£pFastPartobj.UsingInstance := 3
£pFastPartobj.uShowValue := "Solo"
£pFastPartobj.uHiddenKey1 := 'S'
ENDROUTINE
END_COM
======================== Utilizzo della Reusable-Part ================================
Define_com Class(£<Nome della Reusable-Part>) Name(£Vi_Obj01) Reference(*Deferred)
Evtroutine Handling(£avFrameworkManager.uExecute) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
£Vi_Obj01.um_FormattaFP pFastPartObj(£FastPart) pNomeFastPart(FP_RRAD01) pCaptionFastPart(*MTXTEDnnnnn)
EndRoutine
Evtroutine Handling(£avFrameworkManager.uWAMEvent_1) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
£FastPart.UsingName := FP_RRAD01
£<CAMPODICONTROLLO> := £FastPart.uSelectHiddenKey1
EndRoutine
=========================================================================
Fast-Part Combo Box per Linee + Voce "Tutte le Linee"
======================== Definizione della Reusable-Part ================================
BEGIN_COM Role(*EXTENDS £PRIM_OBJT) Help('Formattazione FP Combo Box per Linee')
MTHROUTINE Name(um_FormattaFP) Help('Formattazione FP Combo Box per Linee')
DEFINE_MAP For(*INPUT) Class(£FP_IN001) Name(£pFastPartObj) Help('Oggetto Fast Part') Pass(*BY_REFERENCE)
DEFINE_MAP For(*INPUT) Class(£PRIM_ALPH) Name(£pNomeFastPart) Help('Nome della Fast Part da Formattare')
DEFINE_MAP For(*INPUT) Class(£PRIM_ALPH) Name(£pCaptionFastPart) MANDATORY('') Help('Camption da assegnare alla Fast Part')
DEFINE_MAP *INPUT Class(£PRIM_BOLN) Name(£pIncludiVoceTutti) MANDATORY(FALSE) Help('TRUE per Includere la voce "Tutte le linee"')
Define_con Class(£TBEDnnnn) Name(£Vi_PRTBLN)
**********
********** Formattazione della Fast-Part
**********
£pFastPartObj.uSingName := £pNomeFastPart
IF (£pCaptionFastPart <> *BLANK)
£pFastPartobj.uCaptionPosition := LEFT
£pFastPartobj.uCaption := £pCaptionFastPart
Else
£pFastPartobj.uCaptionPosition := NONE
Endif
£pFastPartObj.uItemCount := £Vi_PRTBLN.up_Lista
If (£pIncludiVociTutti)
£pFastPartObj.uItemCount += 1
£pFastPartObj.uSignInstance := 1
£pFastPartObj.uShowValue := "Tutte le linee" // Utilizzare le Variabili Multilingua
£pFastPartObj.uHiddenKey := "**"
Endif
£std_num := 1
For Each(£item) In(£Vi_PRTBLN.up_Lista)
£std_num += 1
£pFastPartObj.UsingInstance := £std_num
£pFastPartObj.uShowValue := £item.up_<CampoDescrizione>
£pFastPartObj.uHiddenKey := £item.up_<CampoCodice>
EndFor
ENDROUTINE
END_COM
======================== Utilizzo della Reusable-Part ================================
Define_com Class(£<Nome della Reusable-Part>) Name(£Vi_Obj01) Reference(*Deferred)
Evtroutine Handling(£avFrameworkManager.uExecute) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
£Vi_Obj01.um_FormattaFP pFastPartObj(£FastPart) pNomeFastPart(FP_RCBX01) pCaptionFastPart(*MTXTEDnnnnn)
EndRoutine
Evtroutine Handling(£avFrameworkManager.uWAMEvent_1) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
£FastPart.UsingName := FP_RCBX01
£<CAMPODICONTROLLO> := £FastPart.uSelectHiddenKey1
EndRoutine
=========================================================================
SE AVETE DUBBI O DOMANDE POSTATELO NEL FORUM PRIMA DI INIZIARE A SCRIVERE!