From 3359cbd12952746a1fc4cfc3fca983e0dae0a13c Mon Sep 17 00:00:00 2001 From: matteo Date: Thu, 31 Aug 1995 17:32:05 +0000 Subject: [PATCH] Lavoro di matteo git-svn-id: svn://10.65.10.50/trunk@1770 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ve/batbnum.h | 60 +-- ve/batbnum.uml | 314 +++++++------ ve/batbtip.uml | 130 +++--- ve/batbtri.uml | 108 ++--- ve/ve0100.cpp | 664 ++++++++++++++------------ ve/ve0100c.cpp | 28 +- ve/ve0100c.h | 8 +- ve/ve0300.cpp | 1210 +++++++++++++++++++++++++++++++++--------------- ve/veuml.h | 8 +- 9 files changed, 1528 insertions(+), 1002 deletions(-) diff --git a/ve/batbnum.h b/ve/batbnum.h index 1e931e199..fe1832092 100755 --- a/ve/batbnum.h +++ b/ve/batbnum.h @@ -1,28 +1,32 @@ -#define F_CODTAB 101 -#define F_DESNUM 102 -#define F_ULTNUM 103 -#define F_ULTNUMPROV 104 -#define F_PREFISSO 105 -#define F_SUFFISSO 106 -#define F_ULTDATA 107 -#define F_ANNO 108 -#define F_TIPODOC1 110 -#define F_DESDOC1 111 -#define F_TIPODOC2 112 -#define F_DESDOC2 113 -#define F_TIPODOC3 114 -#define F_DESDOC3 115 -#define F_TIPODOC4 116 -#define F_DESDOC4 117 -#define F_TIPODOC5 118 -#define F_DESDOC5 119 -#define F_TIPODOC6 120 -#define F_DESDOC6 121 -#define F_TIPODOC7 122 -#define F_DESDOC7 123 -#define F_TIPODOC8 124 -#define F_DESDOC8 125 -#define F_TIPODOC9 126 -#define F_DESDOC9 127 -#define F_TIPODOC10 128 -#define F_DESDOC10 129 +#define F_CODTAB 101 +#define F_DESNUM 102 +#define F_ULTNUM 103 +#define F_ULTNUMPROV 104 +#define F_PREFISSO 105 +#define F_SUFFISSO 106 +#define F_ULTDATA 107 +#define F_ANNO 108 +#define F_TIPODOC1 110 +#define F_DESDOC1 111 +#define F_TIPODOC2 112 +#define F_DESDOC2 113 +#define F_TIPODOC3 114 +#define F_DESDOC3 115 +#define F_TIPODOC4 116 +#define F_DESDOC4 117 +#define F_TIPODOC5 118 +#define F_DESDOC5 119 +#define F_TIPODOC6 120 +#define F_DESDOC6 121 +#define F_TIPODOC7 122 +#define F_DESDOC7 123 +#define F_TIPODOC8 124 +#define F_DESDOC8 125 +#define F_TIPODOC9 126 +#define F_DESDOC9 127 +#define F_TIPODOC10 128 +#define F_DESDOC10 129 +#define F_NUMPROVV 130 +#define F_NUMAUTO 131 +#define F_ULTDATAPROV 132 + \ No newline at end of file diff --git a/ve/batbnum.uml b/ve/batbnum.uml index 40192be77..23f5d3a7f 100755 --- a/ve/batbnum.uml +++ b/ve/batbnum.uml @@ -2,11 +2,11 @@ TOOLBAR "" 0 20 60 2 -#include "toolbar.h" + #include "toolbar.h" ENDPAGE -PAGE "Tabella numerazioni Pagina 1/2" -1 -1 60 14 +PAGE "Numerazione documenti" -1 -1 60 14 GROUPBOX DLG_NULL 75 7 BEGIN @@ -14,12 +14,18 @@ PAGE "Tabella numerazioni Pagina 1/2" -1 -1 60 14 FLAG "R" END +// GROUPBOX DLG_NULL 84 13 +// BEGIN +// PROMPT 1 5 "" + // FLAG "R" +// END + STRING F_CODTAB 4 BEGIN - PROMPT 2 2 "Cod. numerazione " + PROMPT 2 2 "Cod. numerazione " FIELD CODTAB - HELP "Codice numerazione" - USE NUM + HELP "Codice numerazione" + USE NUM CHECKTYPE REQUIRED INPUT CODTAB F_CODTAB DISPLAY "Codice" CODTAB @@ -32,10 +38,10 @@ PAGE "Tabella numerazioni Pagina 1/2" -1 -1 60 14 STRING F_DESNUM 50 BEGIN - PROMPT 2 4 "Descrizione " + PROMPT 2 4 "Descrizione " FIELD S0 - HELP "Descrizione numerazione" - USE NUM + HELP "Descrizione numerazione" + USE NUM KEY 2 CHECKTYPE REQUIRED INPUT S0 F_DESNUM DISPLAY "Codice" CODTAB @@ -45,251 +51,243 @@ PAGE "Tabella numerazioni Pagina 1/2" -1 -1 60 14 KEY 2 END - NUMBER F_ULTNUM 7 0 - BEGIN - PROMPT 2 7 "Numero ultimo documento emesso " - FIELD I0 - FLAG "R" - END - - NUMBER F_ULTNUMPROV 7 0 - BEGIN - PROMPT 2 8 "Numero ultimo documento creato " - FIELD I1 - FLAG "R" - END - - DATE F_ULTDATA - BEGIN - PROMPT 2 10 "Data emissione ultimo documento " - FIELD D0 - END - STRING F_PREFISSO 7 BEGIN - PROMPT 2 12 "Prefisso numerazione " + PROMPT 2 8 "Prefisso per la numerazione " FIELD S6 END STRING F_SUFFISSO 7 BEGIN - PROMPT 2 13 "Suffisso numerazione " + PROMPT 2 10 "Suffisso per la numerazione " FIELD S7 END - STRING F_ANNO 4 + BOOLEAN F_NUMPROVV BEGIN - PROMPT 2 15 "Anno d'esercizio " - FIELD S8 + PROMPT 2 12 "Utilizzo della numerazione provvisoria" + FIELD B0 + END + + BOOLEAN F_NUMAUTO + BEGIN + PROMPT 2 14 "Utilizzo della numerazione automatica" + FIELD B1 END ENDPAGE -PAGE "Tabella numerazioni Pagina 2/2" -1 -1 60 14 - - TEXT DLG_NULL - BEGIN - PROMPT 2 2 "Tipi di documento validi per la numerazione" - END - +PAGE "Numerazioni documenti pag.2" -1 -1 60 14 + + GROUPBOX DLG_NULL 64 15 + BEGIN + PROMPT 1 1 "" + // FLAG "R" + END + + TEXT DLG_NULL + BEGIN + PROMPT 2 2 "Tipi di documento validi per la numerazione" + END + STRING F_TIPODOC1 4 BEGIN PROMPT 2 4 "" - USE TIP - INPUT CODTAB F_TIPODOC1 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC1 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC1 TIP->CODTAB - OUTPUT F_DESDOC1 TIP->S0 - HELP "Tipo di documento 1" + OUTPUT F_TIPODOC1 CODTAB + OUTPUT F_DESDOC1 S0 + HELP "Tipo di documento 1" FIELD S2[1,4] CHECKTYPE NORMAL END - STRING F_DESDOC1 50 - BEGIN - PROMPT 10 4 "" - FLAG "D" - END + STRING F_DESDOC1 40 + BEGIN + PROMPT 12 4 "" + FLAG "D" + END STRING F_TIPODOC2 4 BEGIN PROMPT 2 5 "" - USE TIP - INPUT CODTAB F_TIPODOC2 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC2 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC2 TIP->CODTAB - OUTPUT F_DESDOC2 TIP->S0 - HELP "Tipo di documento 2" + OUTPUT F_TIPODOC2 CODTAB + OUTPUT F_DESDOC2 S0 + HELP "Tipo di documento 2" FIELD S2[5,8] CHECKTYPE NORMAL END - STRING F_DESDOC2 50 - BEGIN - PROMPT 10 5 "" - FLAG "D" - END - + STRING F_DESDOC2 40 + BEGIN + PROMPT 12 5 "" + FLAG "D" + END + STRING F_TIPODOC3 4 BEGIN PROMPT 2 6 "" - USE TIP - INPUT CODTAB F_TIPODOC3 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC3 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC3 TIP->CODTAB - OUTPUT F_DESDOC3 TIP->S0 - HELP "Tipo di documento 3" + OUTPUT F_TIPODOC3 CODTAB + OUTPUT F_DESDOC3 S0 + HELP "Tipo di documento 3" FIELD S2[9,12] CHECKTYPE NORMAL END - STRING F_DESDOC3 50 - BEGIN - PROMPT 10 6 "" - FLAG "D" - END - + STRING F_DESDOC3 40 + BEGIN + PROMPT 12 6 "" + FLAG "D" + END + STRING F_TIPODOC4 4 BEGIN PROMPT 2 7 "" - USE TIP - INPUT CODTAB F_TIPODOC4 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC4 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC4 TIP->CODTAB - OUTPUT F_DESDOC4 TIP->S0 - HELP "Tipo di documento 4" + OUTPUT F_TIPODOC4 CODTAB + OUTPUT F_DESDOC4 S0 + HELP "Tipo di documento 4" FIELD S2[13,16] CHECKTYPE NORMAL END - STRING F_DESDOC4 50 - BEGIN - PROMPT 10 7 "" - FLAG "D" - END - + STRING F_DESDOC4 40 + BEGIN + PROMPT 12 7 "" + FLAG "D" + END + STRING F_TIPODOC5 4 BEGIN PROMPT 2 8 "" - USE TIP - INPUT CODTAB F_TIPODOC5 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC5 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC5 TIP->CODTAB - OUTPUT F_DESDOC5 TIP->S0 - HELP "Tipo di documento 5" + OUTPUT F_TIPODOC5 CODTAB + OUTPUT F_DESDOC5 S0 + HELP "Tipo di documento 5" FIELD S2[17,20] CHECKTYPE NORMAL END - STRING F_DESDOC5 50 - BEGIN - PROMPT 10 8 "" - FLAG "D" - END - + STRING F_DESDOC5 40 + BEGIN + PROMPT 12 8 "" + FLAG "D" + END + STRING F_TIPODOC6 4 BEGIN PROMPT 2 9 "" - USE TIP - INPUT CODTAB F_TIPODOC6 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC6 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC6 TIP->CODTAB - OUTPUT F_DESDOC6 TIP->S0 - HELP "Tipo di documento 6" + OUTPUT F_TIPODOC6 CODTAB + OUTPUT F_DESDOC6 S0 + HELP "Tipo di documento 6" FIELD S2[21,24] CHECKTYPE NORMAL END - STRING F_DESDOC6 50 - BEGIN - PROMPT 10 9 "" - FLAG "D" - END - + STRING F_DESDOC6 40 + BEGIN + PROMPT 12 9 "" + FLAG "D" + END + STRING F_TIPODOC7 4 BEGIN PROMPT 2 10 "" - USE TIP - INPUT CODTAB F_TIPODOC7 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC7 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC7 TIP->CODTAB - OUTPUT F_DESDOC7 TIP->S0 - HELP "Tipo di documento 7" + OUTPUT F_TIPODOC7 CODTAB + OUTPUT F_DESDOC7 S0 + HELP "Tipo di documento 7" FIELD S2[25,28] CHECKTYPE NORMAL END - STRING F_DESDOC7 50 - BEGIN - PROMPT 10 10 "" - FLAG "D" - END - + STRING F_DESDOC7 40 + BEGIN + PROMPT 12 10 "" + FLAG "D" + END + STRING F_TIPODOC8 4 BEGIN PROMPT 2 11 "" - USE TIP - INPUT CODTAB F_TIPODOC8 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC8 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC8 TIP->CODTAB - OUTPUT F_DESDOC8 TIP->S0 - HELP "Tipo di documento 8" + OUTPUT F_TIPODOC8 CODTAB + OUTPUT F_DESDOC8 S0 + HELP "Tipo di documento 8" FIELD S2[29,32] CHECKTYPE NORMAL END - STRING F_DESDOC8 50 - BEGIN - PROMPT 10 11 "" - FLAG "D" - END - + STRING F_DESDOC8 40 + BEGIN + PROMPT 12 11 "" + FLAG "D" + END + STRING F_TIPODOC9 4 BEGIN PROMPT 2 12 "" - USE TIP - INPUT CODTAB F_TIPODOC9 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC9 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC9 TIP->CODTAB - OUTPUT F_DESDOC9 TIP->S0 - HELP "Tipo di documento 9" + OUTPUT F_TIPODOC9 CODTAB + OUTPUT F_DESDOC9 S0 + HELP "Tipo di documento 9" FIELD S2[32,36] CHECKTYPE NORMAL END - STRING F_DESDOC9 50 - BEGIN - PROMPT 10 12 "" - FLAG "D" - END - + STRING F_DESDOC9 40 + BEGIN + PROMPT 12 12 "" + FLAG "D" + END + STRING F_TIPODOC10 4 BEGIN PROMPT 2 13 "" - USE TIP - INPUT CODTAB F_TIPODOC10 - DISPLAY "Codice" CODTAB + USE %TIP + INPUT CODTAB F_TIPODOC10 + DISPLAY "Codice" CODTAB DISPLAY "Descrizione@50" S0 - OUTPUT F_TIPODOC10 TIP->CODTAB - OUTPUT F_DESDOC10 TIP->S0 - HELP "Tipo di documento 10" + OUTPUT F_TIPODOC10 CODTAB + OUTPUT F_DESDOC10 S0 + HELP "Tipo di documento 10" FIELD S2[37,40] CHECKTYPE NORMAL END - STRING F_DESDOC10 50 - BEGIN - PROMPT 10 13 "" - FLAG "D" - END + STRING F_DESDOC10 40 + BEGIN + PROMPT 12 13 "" + FLAG "D" + END ENDMASK diff --git a/ve/batbtip.uml b/ve/batbtip.uml index b34ca5803..902234d56 100755 --- a/ve/batbtip.uml +++ b/ve/batbtip.uml @@ -1,65 +1,65 @@ -#include "ve4.h" - -TOOLBAR "" 0 20 60 2 - - #include "toolbar.h" - -ENDPAGE - -PAGE "Tabella tipi di documento" -1 -1 60 14 - - GROUPBOX DLG_NULL 75 7 - BEGIN - PROMPT 1 0 "" - FLAG "R" - END - - STRING F_CODTAB 4 - BEGIN - PROMPT 2 2 "Cod. tipo docum. " - FIELD CODTAB - HELP "Codice tipo documento" - USE %TIP - CHECKTYPE REQUIRED - INPUT CODTAB F_CODTAB - DISPLAY "Codice" CODTAB - DISPLAY "Descrizione@50" S0 - OUTPUT F_CODTAB CODTAB - OUTPUT F_DESNUM S0 - KEY 1 - FLAG "UZ" - END - - STRING F_DESNUM 50 - BEGIN - PROMPT 2 4 "Descrizione " - FIELD S0 - HELP "Descrizione tipo documento" - USE %TIP KEY 2 - CHECKTYPE REQUIRED - INPUT S0 F_DESNUM - DISPLAY "Codice" CODTAB - DISPLAY "Descrizione@40" S0 - OUTPUT F_CODTAB CODTAB - OUTPUT F_DESNUM S0 - KEY 2 - END - - STRING F_PROFILO 8 - BEGIN - PROMPT 2 8 "Profilo documento " - FIELD S4 - FLAG "U" - END - - STRING F_PSTAMPA 8 - BEGIN - PROMPT 2 10 "Profilo stampa documento " - FIELD S5 - FLAG "U" - END - -ENDPAGE - -ENDMASK - +#include "ve4.h" + +TOOLBAR "" 0 20 60 2 + + #include "toolbar.h" + +ENDPAGE + +PAGE "Tabella tipi di documento" -1 -1 60 14 + + GROUPBOX DLG_NULL 75 7 + BEGIN + PROMPT 1 0 "" + FLAG "R" + END + + STRING F_CODTAB 4 + BEGIN + PROMPT 2 2 "Cod. tipo docum. " + FIELD CODTAB + HELP "Codice tipo documento" + USE %TIP + CHECKTYPE REQUIRED + INPUT CODTAB F_CODTAB + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_CODTAB CODTAB + OUTPUT F_DESNUM S0 + KEY 1 + FLAG "UZ" + END + + STRING F_DESNUM 50 + BEGIN + PROMPT 2 4 "Descrizione " + FIELD S0 + HELP "Descrizione tipo documento" + USE %TIP KEY 2 + CHECKTYPE REQUIRED + INPUT S0 F_DESNUM + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@40" S0 + OUTPUT F_CODTAB CODTAB + OUTPUT F_DESNUM S0 + KEY 2 + END + + STRING F_PROFILO 8 + BEGIN + PROMPT 2 8 "Profilo documento " + FIELD S4 + FLAG "U" + END + + STRING F_PSTAMPA 8 + BEGIN + PROMPT 2 10 "Profilo stampa documento " + FIELD S5 + FLAG "U" + END + +ENDPAGE + +ENDMASK + diff --git a/ve/batbtri.uml b/ve/batbtri.uml index dcf147a33..589079a14 100755 --- a/ve/batbtri.uml +++ b/ve/batbtri.uml @@ -1,54 +1,54 @@ -TOOLBAR "" 0 20 60 2 - - #include "toolbar.h" - -ENDPAGE - -#define F_CODICE 101 -#define F_DESCR 102 -#define F_PROFILO 103 - -PAGE "Tipo di riga" -1 -1 60 14 - - GROUPBOX DLG_NULL 75 7 - BEGIN - PROMPT 1 0 "" - FLAGS "R" - END - - STRING F_CODICE 4 - BEGIN - PROMPT 2 2 "Codice " - FIELD CODTAB - FLAGS "U" - USE %TRI - INPUT CODTAB F_CODICE - DISPLAY "Codice" CODTAB - DISPLAY "Descrizione@50" S0 - OUTPUT F_CODICE CODTAB - OUTPUT F_DESCR S0 - CHECKTYPE REQUIRED - KEY 1 - END - - STRING F_DESCR 50 - BEGIN - PROMPT 2 4 "Descrizione " - FIELD S0 - USE %TRI KEY 2 - INPUT S0 F_DESCR - COPY DISPLAY F_CODICE - COPY OUTPUT F_CODICE - CHECKTYPE REQUIRED - KEY 2 - END - - STRING f_PROFILO 8 - BEGIN - PROMPT 2 8 "Profilo " - CHECKTYPE REQUIRED - FIELD S4 - END - -END -ENDMASK +TOOLBAR "" 0 20 60 2 + + #include "toolbar.h" + +ENDPAGE + +#define F_CODICE 101 +#define F_DESCR 102 +#define F_PROFILO 103 + +PAGE "Tipo di riga" -1 -1 60 14 + + GROUPBOX DLG_NULL 75 7 + BEGIN + PROMPT 1 0 "" + FLAGS "R" + END + + STRING F_CODICE 4 + BEGIN + PROMPT 2 2 "Codice " + FIELD CODTAB + FLAGS "U" + USE %TRI + INPUT CODTAB F_CODICE + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_CODICE CODTAB + OUTPUT F_DESCR S0 + CHECKTYPE REQUIRED + KEY 1 + END + + STRING F_DESCR 50 + BEGIN + PROMPT 2 4 "Descrizione " + FIELD S0 + USE %TRI KEY 2 + INPUT S0 F_DESCR + COPY DISPLAY F_CODICE + COPY OUTPUT F_CODICE + CHECKTYPE REQUIRED + KEY 2 + END + + STRING f_PROFILO 8 + BEGIN + PROMPT 2 8 "Profilo " + CHECKTYPE REQUIRED + FIELD S4 + END + +END +ENDMASK diff --git a/ve/ve0100.cpp b/ve/ve0100.cpp index 3e9545e48..e73c8c74b 100755 --- a/ve/ve0100.cpp +++ b/ve/ve0100.cpp @@ -29,7 +29,7 @@ #endif #ifndef __VEUML_H -#include "f:\u\alex\p.due\ve\VEUML.H" +#include "VEUML.H" #endif #ifndef __SHEET_H @@ -56,17 +56,10 @@ #include "VE0100D.H" #endif -// Handlers per i campi delle bolle - -extern bool ora_hndl(TMask_field& field, KEY key); -extern bool codcli_hndl(TMask_field& field, KEY key); -extern bool dummy_hndl(TMask_field& field, KEY key); - // Numero di colonne presenti sullo sheet totale #define MAX_COLUMNS 22 #define F_LBTIPORIGA 175 -#define F_TIPIDOCS 172 // Definizione della classe dell'applicazione motore class TMotore_application : public TRelation_application @@ -95,9 +88,13 @@ class TMotore_application : public TRelation_application // Puntatore allo sheet delle righe documento TSheet_field* _sheet; + + // Posizione delle colonne nello sheet + int _pos_cols[ MAX_COLUMNS ]; + // Numero di colonne realmente presenti sullo sheet + int _realcols; - // Ridefinizione dei metodi virtuali - + // Ridefinizione dei metodi virtuali virtual bool user_create( ); virtual bool user_destroy( ); virtual TMask* get_mask(int mode); @@ -108,7 +105,6 @@ class TMotore_application : public TRelation_application virtual bool remove( void ); virtual int write(const TMask& m); virtual int rewrite(const TMask& m); - virtual void init_query_mode(TMask&); // Punti di ingresso per le funzioni utente @@ -157,7 +153,7 @@ protected: static TMask * ss_getmask( int numriga, TMask& fullmask, bool destroy ); // Handler che gestisce la richiesta del tipo riga in inserimento - static bool ss_handler( int r, KEY key ); + static bool ss_handler( TSheet_field& ss, int r, KEY key ); // Handler per la maschera di ricerca static bool ndoc_handler(TMask_field& f, KEY key); @@ -187,6 +183,9 @@ public: TMotore_application( ) { _pro = NULL; } virtual ~TMotore_application( ) { if ( _pro ) delete _pro; } virtual const char* get_next_key( ); + + int numero_colonne( ){ return _realcols; } + int posizione_colonna( int index ){ return _pos_cols[ index ]; } }; HIDDEN TMotore_application& app( ) { return (TMotore_application&) main_app( ); } @@ -195,7 +194,8 @@ HIDDEN TMotore_application& app( ) { return (TMotore_application&) main_app( ); int TMotore_application::user_function( int index ) { switch( index ) - { case 1: + { + case 1: break; default: yesnofatal_box( "Chiamata ad una procedura utente non definita: %d", index ); @@ -210,34 +210,50 @@ int TMotore_application::user_function( int index ) // Da migliorare, mettendo una cache TMask *TMotore_application::ss_getmask( int numriga, TMask& fullmask, bool destroy ) -{ static TMask* m; - - if ( destroy ) - { delete m; - return( NULL ); } - else - { TFilename nome_proriga( fullmask.get( 103 ) ); - nome_proriga.ext( "ini" ); - TConfig proriga( nome_proriga ); - m = new TMask( proriga.get( "MSK", "MAIN" ) ); - return( m ); } - } +{ + static TMask* m; + + if ( destroy ) + { + delete m; + return( NULL ); + } + else + { + TFilename nome_proriga( fullmask.get( 103 ) ); + nome_proriga.ext( "ini" ); + TConfig proriga( nome_proriga ); + m = new TMask( proriga.get( "MSK", "MAIN" ) ); + int numhandler = proriga.get_int( "NHANDLER", "HANDLERS" ); + for( int i = 1; i <= numhandler; i ++ ) + { + TString chiave; + chiave.format( "%d", i ); + TToken_string riga = proriga.get( chiave, "HANDLERS" ); + app().user_set_handler( riga.get_int( 0 ), riga.get_int( 1 ) ); + }; + return( m ); + } +} real TMotore_application::user_row_calculate( TRectype& r, int index ) -{ switch( index ) - { case 100 : - return ( f100( r ) ); - break; - default: - CHECK( FALSE, "Tentativo di chiamare una funzione di calcolo riga inesistente!" ); - return 0.0; - } - }; +{ + switch( index ) + { + case 100 : + return ( f100( r ) ); + break; + default: + CHECK( FALSE, "Tentativo di chiamare una funzione di calcolo riga inesistente!" ); + return 0.0; + } +}; void TMotore_application::user_set_handler( int fieldid, int index ) { switch( index ) - { case 1: + { + case 1: edit_mask( ).set_handler( fieldid, ora_hndl ); break; case 2: @@ -247,56 +263,125 @@ void TMotore_application::user_set_handler( int fieldid, int index ) edit_mask( ).set_handler( fieldid, dummy_hndl ); break; default: - CHECK( FALSE, "tentativo di installare un handler non definito" ); + CHECK( FALSE, "Tentativo di installare un handler non definito" ); break; } }; -bool TMotore_application::ss_handler( int r, KEY key ) +bool TMotore_application::ss_handler( TSheet_field& ss, int r, KEY key ) { if ( key == K_INS ) { - TMask m( "ve1000b" ); - TList_field& listbox = ( TList_field& ) m.field( F_LBTIPORIGA ); - const int numtr = app( ).pro( ).get_int( "NTIPIRIGA", "RIGHE" ); - TTable tabtr( "TRI" ); - TToken_string keys( "" ), descrs( "" ); - for ( int i = 1; i <= numtr; i ++ ) - { TString chiave; - TToken_string item; - chiave.format( "%d", i ); - tabtr.zero( ); - tabtr.put( "CODTAB", app( ).pro( ).get( chiave, "RIGHE" ) ); - tabtr.read( ); - keys.add( tabtr.get( "CODTAB" ) ); - descrs.add( tabtr.get( "S0" ) ); - } - listbox.replace_items( keys, descrs ); - if( m.run( ) == K_ESC ) return FALSE; + TMask& m = *app( )._msk1; + TTable tabtr( "%TRI" ); + tabtr.zero( ); tabtr.put( "CODTAB", m.get( F_LBTIPORIGA ) ); tabtr.read( ); - TToken_string& riga = app( ).sheet( ).row( r ); + TToken_string& riga = ss.row( r ); riga.add( 1, 0 ); riga.add( m.get( F_LBTIPORIGA ), 1 ); - riga.add( tabtr.get( "S4" ), 2 ); - app( ).sheet( ).force_update( ); - return TRUE; - } + TFilename nome_proriga( tabtr.get( "S4" ) ); + riga.add( nome_proriga, 2 ); + nome_proriga.ext( "ini" ); + TConfig pro( nome_proriga ); + int ncols = pro.get_int( "NCOLS", "COLUMNS" ); + // Disabilita tutte le colonne + for( int i = 1; i < app( ).numero_colonne( ); i ++ ) + ss.disable_cell ( ss.items( ) - 1, i ); + for( i = 1; i < ncols; i ++ ) + { + TString16 chiave; + chiave.format( "%d", i ); + int coltoenable = pro.get_int( chiave, "COLUMNS" ); + ss.enable_cell ( ss.items( ) - 1, app().posizione_colonna( coltoenable ) ); + }; + ss.force_update( ); + app( ).curr_mask( ).send_key( K_ROWEDIT, F_SHEET ); + // ss.on_key( K_SPACE ); + // ss.edit( ss.items( ) ); + /* + nome_proriga.ext( "ini" ); + TConfig proriga( nome_proriga ); + TMask *sm = new TMask( proriga.get( "MSK", "MAIN" ) ); + // int numhandler = proriga.get_int( "NHANDLER", "HANDLERS" ); + // for( int i = 1; i <= numhandler; i ++ ) + // { + // TString chiave; + // chiave.format( "%d", i ); + // TToken_string riga = proriga.get( chiave, "HANDLERS" ); + // app().user_set_handler( riga.get_int( 0 ), riga.get_int( 1 ) ); + // }; + sm->disable( DLG_DELREC ); + if ( sm->run( ) == K_ENTER ) + { + // Riga inserita, vai col disabilitare le colonne + delete sm; + ss.force_update( ); */ + return TRUE; + }; return TRUE; }; bool TMotore_application::num_handler( TMask_field& f, KEY key ) { + // Ottengo la maschera TMask& m = f.mask( ); + if (key == K_TAB && m.is_running( ) ) { + // Se la numerazione non è specificata, + const TString16 value( m.get( F_CODNUM ) ); + if ( value.blank( ) ) + { + // Pulisce la descrizione + m.set(F_DESNUM, "" ); + // Pulisce i tipi di documento consentiti + m.set(F_TIPIDOCS, "" ); + // Pulisce il tipo di documento + m.set(F_TIPODOC, "" ); + return TRUE; + } + // Apro la tabella numerazioni TTable tabnum( "NUM" ); - - tabnum.read( ); - m.set(F_DESNUM, tabnum.get("S0") ); - m.set(F_TIPIDOCS, tabnum.get("S2") ); - } + tabnum.zero( ); + tabnum.put( "CODTAB", value ); + if( tabnum.read( ) == NOERR ) + { + // Copio la descriozione della numerazione + m.set(F_DESNUM, tabnum.get("S0") ); + // Copio i tipi di documento validi per la numerazione + m.set(F_TIPIDOCS, tabnum.get("S2") ); + // Se per questa numerazione è abilitata le numerazione provvisoria + if ( tabnum.get_bool ( "B0" ) ) + { + // Setta di default la numerazione provvisoria + m.set( F_PROVV, "P" ); + // Abilita il campo per la selezione della numerazione + m.enable( F_PROVV ); + } + else // Altrimenti ... + { + // Setta la numerazione a definitiva + m.set( F_PROVV, "D" ); + // Disabilita il campo per la selezione della numerazione + m.disable( F_PROVV ); + }; + return TRUE; + } + message_box( "Numerazione non valida!" ); + return FALSE; + } + if (key == K_ENTER && m.is_running( ) ) + { // Se la numerazione non è specificata, + const TString16 value( m.get( F_CODNUM ) ); + if ( value.blank( ) ) + { + message_box( "Occorre una numerazione per inserire un documento!" ); + m.first_focus( F_NDOC ); + return FALSE; + } + } return TRUE; } @@ -305,27 +390,36 @@ bool TMotore_application::tip_handler(TMask_field& f, KEY key) TMask& m = f.mask( ); if (key == K_TAB && m.is_running( ) ) { + const TString16 value( m.get( F_TIPODOC ) ); + if ( value.blank( ) ) + { + // Pulisce il profilo + m.set(F_PROFILO, "" ); + return TRUE; + } TString tipi_consentiti( m.get( F_TIPIDOCS ) ); TString tipo( f.get( ) ); if( tipi_consentiti.find( tipo ) % 4 ) { message_box( "Tipo non valido per la numerazione selezionata!" ); f.set( "" ); return FALSE; } - TTable tabtip( "TIP" ); + TTable tabtip( "%TIP" ); tabtip.read( ); + m.set(F_DESTIPODOC, tabtip.get("S0") ); m.set(F_PROFILO, tabtip.get("S4") ); }; if (key == K_ENTER && m.is_running( ) ) { TString tipo( f.get( ) ); if ( ! tipo.blank( ) ) - { TTable tabtip( "TIP" ); + { TTable tabtip( "%TIP" ); tabtip.read( ); m.set(F_PROFILO, tabtip.get("S4") ); } else { message_box( "Occorre un tipo documento per inserire un documento!" ); m.first_focus( F_TIPODOC ); - return FALSE; } + return FALSE; + } } return TRUE; } @@ -341,28 +435,14 @@ bool TMotore_application::ndoc_handler(TMask_field& f, KEY key) doc.put("ANNO", m.get( F_ANNO ) ); doc.put("NDOC", f.get( ) ); if ( doc.read( ) == NOERR ) - { m.set(F_TIPODOC, doc.get( "TIPODOC" ) ); - TTable tabtip( "TIP" ); - tabtip.put( "CODTAB", doc.get( "TIPODOC" ) ); - tabtip.read( ); - m.set(F_PROFILO, tabtip.get("S4") ); - m.stop_run( K_AUTO_ENTER ); - } + { m.set(F_TIPODOC, doc.get( "TIPODOC" ) ); + TTable tabtip( "%TIP" ); + tabtip.put( "CODTAB", doc.get( "TIPODOC" ) ); + tabtip.read( ); + m.set(F_PROFILO, tabtip.get("S4") ); + m.stop_run( K_AUTO_ENTER ); + } } - /* m.set( F_TIPODOC, doc.get( "TIPODOC" ); - TTable tabtip( "TIP" ); - tabtip.read( ); - m.set(F_PROFILO, tabtip.get("S4") ); - } - else - { TString tipodoc = m.get( F_TIPODOC ); - if ( ! f.blank( ) ) - { message_box( "Per inserire un nuovo documento occorre\nspecificare il tipo documento!" ); - m.first_focus( F_TIPODOC ); - return FALSE; - } - } - } */ return TRUE; } @@ -383,34 +463,39 @@ bool TMotore_application::changing_mask(int mode) } void TMotore_application::configura_sheet( TSheet_field& sheet, TConfig& config ) -{ int i; - const int ncols = config.get_int( "NCOLS", "SHEET" ); - for( i = 1; i <= ncols; i ++ ) - { TString col; - col.format( "%d", i ); - TToken_string sheet_col( config.get( col, "SHEET" ) ); - TString descr( sheet_col.get( 1 ) ); - if ( ! descr.blank( ) ) - sheet.set_column_header( i, descr ); - TString size( sheet_col.get( 2 ) ); - if ( ! size.blank( ) ) - sheet.set_column_width( i, sheet_col.get_int( 2 ) ); - sheet.move_column( sheet_col.get_int( 0 ) - 1, i ); - } - for ( int j = MAX_COLUMNS; j >= i - 1; j -- ) - sheet.delete_column( j ); +{ + _realcols = config.get_int( "NCOLS", "SHEET" ); + for( int i = 1; i <= _realcols; i ++ ) + { + TString col; + col.format( "%d", i ); + TToken_string sheet_col( config.get( col, "SHEET" ) ); + const TString descr( sheet_col.get( 1 ) ); + if ( ! descr.blank( ) ) + sheet.set_column_header( i, descr ); + TString size( sheet_col.get( 2 ) ); + if ( ! size.blank( ) ) + sheet.set_column_width( i, sheet_col.get_int( 2 ) ); + int coltomove = sheet_col.get_int( 0 ) - 1; + sheet.move_column( coltomove, i ); + _pos_cols[ coltomove ] = i; }; + for ( int j = MAX_COLUMNS; j >= i - 1; j -- ) + sheet.delete_column( j ); +}; void TMotore_application::get_edit_mask( void ) { TFilename fn; fn = query_mask( ).get( F_PROFILO ); - query_mask( ).enable(DLG_NEWREC); + // query_mask( ).enable(DLG_NEWREC); fn.ext( "ini" ); fn.upper( ); if ( _pro ) - { if( (*_proname) == fn ) return; + { + if( (*_proname) == fn ) + return; delete _pro; }; _pro = new TConfig( fn ); @@ -418,15 +503,39 @@ void TMotore_application::get_edit_mask( void ) _proname->upper( ); if ( _msk1 ) delete _msk1; _msk1 = new TMask( pro( ).get( "MSKFILE", "MAIN" ) ); - edit_mask( ).set( F_PROFILO, query_mask( ).get( F_PROFILO ) ); + // edit_mask( ).set( F_PROFILO, query_mask( ).get( F_PROFILO ) ); edit_mask( ).set( F_DESNUM, query_mask( ).get( F_DESNUM ) ); _sheet = &(TSheet_field &)edit_mask( ).field(F_SHEET); sheet( ).set_notify( ss_handler ); configura_sheet( *_sheet, *_pro ); + TList_field& listbox = ( TList_field& ) _msk1->field( F_LBTIPORIGA ); + const int numtr = app( ).pro( ).get_int( "NTIPIRIGA", "RIGHE" ); + TTable tabtr( "%TRI" ); + TToken_string keys( "" ), descrs( "" ); + for ( int i = 1; i <= numtr; i ++ ) + { + TString chiave; + TToken_string item; + chiave.format( "%d", i ); + tabtr.zero( ); + TString tiporiga( app( ).pro( ).get( chiave, "RIGHE" ) ); + tabtr.put( "CODTAB", tiporiga ); + if ( tabtr.read( ) == NOERR ) + { + keys.add( tabtr.get( "CODTAB" ) ); + descrs.add( tabtr.get( "S0" ) ); + } + else + { + yesnofatal_box( "Inserito un tipo di riga non valido (%s)", (const char *)tiporiga ); + } + } + listbox.replace_items( keys, descrs ); sheet( ).set_getmask( ss_getmask ); int numhandler = pro( ).get_int( "NHANDLER", "HANDLERS" ); - for( int i = 1; i <= numhandler; i ++ ) - { TString chiave; + for( i = 1; i <= numhandler; i ++ ) + { + TString chiave; chiave.format( "%d", i ); TToken_string riga = pro( ).get( chiave, "HANDLERS" ); user_set_handler( riga.get_int( 0 ), riga.get_int( 1 ) ); @@ -460,28 +569,50 @@ void TMotore_application::carica_righe_libere(int from) { if (from < 0) from = ss( ).items( ); for (int i = from; i < 20; i++) - set_descr(i, ""); + set_descr( i, "" ); ss( ).force_update( ); } -void TMotore_application::init_query_mode(TMask& _mask) -{ - _mask.disable( DLG_NEWREC ); -} - const char* TMotore_application::get_next_key( ) -{ - TToken_string _t; +{ + TToken_string key; + TMask& m = curr_mask( ); - _t.add( F_CODNUM ); - _t.add( query_mask( ).get( F_CODNUM ) ); - _t.add( F_ANNO ); - _t.add( query_mask( ).get( F_ANNO ) ); - _t.add( F_PROVV ); - _t.add( query_mask( ).get( F_PROVV ) ); - _t.add( F_NDOC ); - _t.add( prossimo_numero( query_mask( ).get( F_PROVV ) == "P" ) ); - return( _t ); + TString value = m.get( F_CODNUM ); + if ( value.blank( ) ) + return NULL; + TTable tabnum( "NUM" ); + tabnum.zero( ); + tabnum.put( "CODTAB", value ); + if( tabnum.read( ) == NOERR ) + { + // Se per questa numerazione è abilitata le numerazione automatica + if( tabnum.get_bool ( "B1" ) ) + { + TLocalisamfile doc( LF_DOC ); + doc.zero( ); + doc.put( "CODNUM", value ); + doc.put( "ANNO", m.get( F_ANNO ) ); + doc.put( "NDOC", 9999999L ); + // Se per questa numerazione è abilitata le numerazione provvisoria + if( tabnum.get_bool ( "B0" ) ) + { + doc.put( "PROVV", "P" ); + } + else // Altrimenti ... + { + doc.put( "PROVV", "D" ); + }; + if( doc.read( _isgteq ) == NOERR ) + { + doc.prev( ); + } + long num = ( value == doc.get( "CODNUM" ) ) ? doc.get_long( "NDOC" ) : 0; + key.format( "%d|%d", F_NDOC, num + 1 ); + return key; + } + }; + return NULL; } int TMotore_application::read(TMask& m) @@ -489,7 +620,8 @@ int TMotore_application::read(TMask& m) azzera_piedi( ); int err = TRelation_application::read( m ); if ( err == NOERR ) - { TLocalisamfile& rdoc = rel( ).lfile(LF_RIGHEDOC); + { + TLocalisamfile& rdoc = rel( ).lfile(LF_RIGHEDOC); TRectype r = rdoc.curr( ); r.zero( ); r.put( "CODNUM", m.get( F_CODNUM ) ); @@ -502,19 +634,21 @@ int TMotore_application::read(TMask& m) f.destroy( ); int last = _righe_rec->last_row( ); for( int i = 1; i <= last; i ++ ) - { TRectype &rec = _righe_rec->row( i, TRUE ); - load_riga( f, i - 1, rec ); - calcola_riga( rec ); - } + { + TRectype &rec = _righe_rec->row( i, TRUE ); + load_riga( f, i - 1, rec ); + calcola_riga( rec ); + } TToken_string s( pro( ).get( "PROGPIEDE", "MAIN" ) ); i = s.get_int( ); int j = 0; while( i != 0 ) - { real strpiede( _piedi[ i ] ); - m.set( BASE_PIEDE + ( ++j ), strpiede.stringa( 15 ) ); - i = s.get_int( ); - } + { + real strpiede( _piedi[ i ] ); + m.set( BASE_PIEDE + ( ++j ), strpiede.stringa( 15 ) ); + i = s.get_int( ); + } } return err; } @@ -527,79 +661,52 @@ bool TMotore_application::check_key( TLocalisamfile& rdoc, TString16 codnum, boo ( rdoc.get_bool( "PROVV" ) == provv ) ); } -/* - void TMotore_application::read_rdoc(TMask& m) - { - - TLocalisamfile& rdoc = rel( ).lfile(LF_RIGHEDOC); - - TString16 _cod_num = rel( ).lfile( ).get( "CODNUM" ); - bool _provv(query_mask( ).get_bool(F_PROVV)); - TString16 _anno(query_mask( ).get(F_ANNO)); - TString16 _ndoc(query_mask( ).get(F_NDOC)); - rdoc.zero( ); - rdoc.put("CODNUM", _cod_num); - rdoc.put("PROVV", _provv); - rdoc.put("ANNO", _anno); - rdoc.put("NDOC", _ndoc); - // loop per il caricamento delle righe - for ( int err = rdoc.read(_isgteq); err == NOERR && check_key(rdoc,_cod_num,_provv, _anno, _ndoc ); err = rdoc.next( ) ) - { const numrig = rdoc.get_int( "NRIGA" ); - CHECK(numrig > 0, "Documento con numero di riga nullo!!"); - const int TipoRiga = rdoc.get_int( "TIPORIGA" ); - const TString16 Codart = rdoc.get( "CODART" ); - const TString Descr = rdoc.get( "DESCR" ); - const TString16 UmQta = rdoc.get( "UMQTA" ); - const real Qta = rdoc.get_real( "QTA" ); - // add_riga(numrig-1, TipoRiga, (TString &)Codart, (TString &)Descr, (TString &)UmQta, Qta); - // calcola_riga( rdoc ); - } - } - */ - int TMotore_application::write(const TMask& m) -{ int err; - if ( esegui_procedura( OP_NUOVO ) != NOERR ) - return FALSE; - err = NOERR; // avanza_numero( m.get_bool( F_PROVV ) ); - if ( err == NOERR ) - { err = TRelation_application::write( m ); - if ( err == NOERR ) - { TSheet_field& f = ss( ); - _righe_rec->destroy_rows( ); - if ( m.insert_mode( ) ) - _righe_rec->renum_key( "NRIGA", 1 ); - for ( int i = 0; i < f.items( ); i ++ ) - { - TToken_string& t = f.row( i ); - TRectype& rec = _righe_rec->row(i + 1, TRUE); - store_riga( f, i, rec ); - } - err = _righe_rec->write( ); - } +{ + int err; + if ( esegui_procedura( OP_NUOVO ) != NOERR ) + return FALSE; + err = NOERR; // avanza_numero( m.get_bool( F_PROVV ) ); + if ( err == NOERR ) + { + err = TRelation_application::write( m ); + if ( err == NOERR ) + { + TSheet_field& f = ss( ); + _righe_rec->destroy_rows( ); + if ( m.insert_mode( ) ) + _righe_rec->renum_key( "NRIGA", 1 ); + for ( int i = 0; i < f.items( ); i ++ ) + { + TToken_string& t = f.row( i ); + TRectype& rec = _righe_rec->row(i + 1, TRUE); + store_riga( f, i, rec ); + } + err = _righe_rec->write( ); } - return err; - }; + } + return err; +}; int TMotore_application::rewrite(const TMask& m) { - if ( ! valida_operazione( OP_MODIFICA ) ) return FALSE; int err = TRelation_application::rewrite( m ); if ( err == NOERR ) - { TSheet_field& f = ss( ); - _righe_rec->destroy_rows( ); - if ( m.insert_mode( ) ) - _righe_rec->renum_key( "NRIGA", 1 ); - for ( int i = 0; i < f.items( ); i ++ ) - { - TToken_string& t = f.row( i ); - TRectype& rec = _righe_rec->row(i + 1, TRUE); - store_riga( f, i, rec ); - } - err = _righe_rec->rewrite( ); - } + { + TSheet_field& f = ss( ); + _righe_rec->destroy_rows( ); + if ( m.insert_mode( ) ) + _righe_rec->renum_key( "NRIGA", 1 ); + for ( int i = 0; i < f.items( ); i ++ ) + { + TToken_string& t = f.row( i ); + TRectype& rec = _righe_rec->row(i + 1, TRUE); + store_riga( f, i, rec ); + } + err = _righe_rec->rewrite( ); + } return err; }; @@ -625,37 +732,16 @@ int TMotore_application::avanza_numero( bool provv ) int err = tabnum.read( ); if ( err == NOERR ) - { if ( provv ) - tabnum.put( "I0", tabnum.get_long( "I0" ) + 1 ); - else - tabnum.put( "I1", tabnum.get_long( "I1" ) + 1 ); - err = tabnum.rewrite( ); - } + { + if ( provv ) + tabnum.put( "I0", tabnum.get_long( "I0" ) + 1 ); + else + tabnum.put( "I1", tabnum.get_long( "I1" ) + 1 ); + err = tabnum.rewrite( ); + } return err; }; -// int TMotore_application::nuovo_documento( ) -// { -// -// }; - -/*int TMotore_application::modifica_documento( ) - { - KEY k; - - edit_mask( ).autoload( _rel ); - k = edit_mask( ).run( ); - if ( k == K_SAVE ) - { - if ( esegui_procedura( pro( ).indice_procedura( OP_MODIFICA ) ) != NOERR ) - return FALSE; - edit_mask( ).autosave( _rel ); - rel( ).rewrite( ); - }; - modify_mode( ); - return NOERR; - };*/ - bool TMotore_application::remove( void ) { if ( ! valida_operazione( OP_CANCELLA ) ) @@ -666,21 +752,8 @@ bool TMotore_application::remove( void ) void TMotore_application::load_riga( TSheet_field& f, int numrig, TRectype& r ) { TToken_string& riga = f.row(numrig); - - // riga= ""; - // riga.add( r.get( "NRIGA" ) ); riga = r.get( "STATORIGA" ); riga.add( r.get( "TIPORIGA" ) ); - - /* - switch(r.get_int( "TIPORIGA" ) ) - { case 1: riga.add("Merce"); break; - case 2: riga.add("Articolo Merce"); break; - case 3: riga.add("Spese"); break; - case 4: riga.add("Commento"); break; - case 5: riga.add("Omaggio"); break; - default: riga.add("Tipo Errato"); break; - }*/ riga.add( r.get( "PROFRIGA" ) ); riga.add( r.get( "CODMAG" ) ); riga.add( r.get( "CODART" ) ); @@ -702,7 +775,6 @@ void TMotore_application::store_riga( TSheet_field& f, int numrig, TRectype& r ) r.put( "ANNO", edit_mask( ).get( F_ANNO ) ); r.put( "PROVV", edit_mask( ).get( F_PROVV ) ); r.put( "NDOC", edit_mask( ).get_long( F_NDOC ) ); - // r.put( "NRIGA", riga.get( 0 ) ); r.put( "STATORIGA", riga.get( 0 ) ); r.put( "TIPORIGA", riga.get( 1 ) ); r.put( "PROFRIGA", riga.get( 2 ) ); @@ -727,32 +799,36 @@ void TMotore_application::calcola_riga( TRectype& r ) TToken_string s(proriga.get("PROGPIEDE", "MAIN")); int func = s.get_int( ); while( func ) - { _piedi[ s.get_int( ) ] += user_row_calculate( r, func ); - func = s.get_int( ); - } + { + _piedi[ s.get_int( ) ] += user_row_calculate( r, func ); + func = s.get_int( ); + } } bool TMotore_application::user_create( ) -{ azzera_piedi( ); - // Carico la maschera di ricerca dei documenti - _msk = new TMask("VE1000A"); - query_mask( ).set_handler( F_NDOC, ndoc_handler ); - query_mask( ).set_handler( F_CODNUM, num_handler ); - query_mask( ).set_handler( F_TIPODOC, tip_handler ); - // La maschera di inserimento/modifica per ora non la so! - // Viene letta dal profilo non appena trovato il record - _msk1 = NULL; +{ + azzera_piedi( ); + _msk = new TMask("VE1000A"); + query_mask( ).set_handler( F_NDOC, ndoc_handler ); + query_mask( ).set_handler( F_CODNUM, num_handler ); + query_mask( ).set_handler( F_TIPODOC, tip_handler ); + // La maschera di inserimento/modifica per ora non la so! + // Viene letta dal profilo non appena trovato il record + _msk1 = NULL; - // Metto in relazione testata e righe - _rel = new TRelation(LF_DOC); - rel( ).add( LF_RIGHEDOC,"CODNUM=CODNUM;ANNO=ANNO;PROVV=PROVV;NDOC=NDOC" ); + // Metto in relazione testata e righe + _rel = new TRelation(LF_DOC); + rel( ).add( LF_RIGHEDOC,"CODNUM=CODNUM;ANNO=ANNO;PROVV=PROVV;NDOC=NDOC" ); - // Inizializzo il Record_array - _righe_rec = new TRecord_array( LF_RIGHEDOC, "NRIGA", 1 ); - - return TRUE; - } + // Inizializzo il Record_array + _righe_rec = new TRecord_array( LF_RIGHEDOC, "NRIGA", 1 ); + + // Inizializzo l'array con la posizione delle colonne + for( int i = 0; i <= MAX_COLUMNS; i ++ ) + _pos_cols[ i ] = -1; + return TRUE; +} bool TMotore_application::user_destroy( ) { @@ -784,43 +860,47 @@ int TMotore_application::esegui_procedura( int operazione ) bool TMotore_application::valida_operazione( int operazione ) { if ( operazione != OP_NUOVO ) - { if ( !stato_valido( stato_corrente( ), operazione ) ) - { segnala_stato_non_valido( operazione ); - return FALSE; - }; - }; + { + if ( !stato_valido( stato_corrente( ), operazione ) ) + { + segnala_stato_non_valido( operazione ); + return FALSE; + } + }; if ( esegui_procedura( operazione ) == NOERR ) return FALSE; return TRUE; } const char * TMotore_application::nome_sezione( int op ) -{ switch( op ) - { case OP_NUOVO: - return "INSERIMENTO"; - break; - case OP_MODIFICA: - return "MODIFICA"; - break; - case OP_CANCELLA: - return "CANCELLAZIONE"; - break; - case OP_STAMPA: - return "STAMPA"; - break; - case OP_RAGGRUPPA: - return "RAGGRUPPA"; - break; - case OP_USER: - return "SPECIALE"; - break; - default: - CHECK( FALSE, "tentativo di ottenere il nome di una operazione inesistente!" ); - // Per evitare la warning - return ""; - break; - }; - } +{ + switch( op ) + { + case OP_NUOVO: + return "INSERIMENTO"; + break; + case OP_MODIFICA: + return "MODIFICA"; + break; + case OP_CANCELLA: + return "CANCELLAZIONE"; + break; + case OP_STAMPA: + return "STAMPA"; + break; + case OP_RAGGRUPPA: + return "RAGGRUPPA"; + break; + case OP_USER: + return "SPECIALE"; + break; + default: + CHECK( FALSE, "tentativo di ottenere il nome di una operazione inesistente!" ); + // Per evitare la warning + return ""; + break; + } +} int TMotore_application::stato_finale( int operazione ) { diff --git a/ve/ve0100c.cpp b/ve/ve0100c.cpp index 2975f8616..78e5e0f21 100755 --- a/ve/ve0100c.cpp +++ b/ve/ve0100c.cpp @@ -1,16 +1,4 @@ // Handler di marco sui campi delle maschere -#ifndef __VE0100C_H -#include "ve0100c.h" -#endif - -#ifndef __VEUML_H -#include "f:\u\alex\p.due\ve\VeUML.h" -#endif - -#ifndef __VEUML1_H -#include "f:\u\alex\p.due\ve\VeUML1.h" -#endif - #ifndef __CHECKS_H #include #endif @@ -31,9 +19,17 @@ #include #endif -extern bool ora_hndl(TMask_field& field, KEY key); -extern bool codcli_hndl(TMask_field& field, KEY key); -extern bool dummy_hndl(TMask_field& field, KEY key); +#ifndef __VEUML_H +#include "VeUML.h" +#endif + +#ifndef __VEUML1_H +#include "VeUML1.h" +#endif + +#ifndef __VE0100C_H +#include "ve0100c.h" +#endif bool ora_hndl(TMask_field& field, KEY key) { @@ -94,6 +90,6 @@ bool codcli_hndl(TMask_field& field, KEY key) bool dummy_hndl(TMask_field& field, KEY key) { - warning_box("Al campo %d + arrivato un KEY %d",field.dlg(),key); + warning_box("Al campo %d è arrivato un KEY %d",field.dlg(),key); return TRUE; } diff --git a/ve/ve0100c.h b/ve/ve0100c.h index 3af75ee7f..af9808da8 100755 --- a/ve/ve0100c.h +++ b/ve/ve0100c.h @@ -1 +1,7 @@ -#define __VE0100C_H \ No newline at end of file +#define __VE0100C_H + +// Handlers per i campi delle bolle + +extern bool ora_hndl(TMask_field& field, KEY key); +extern bool codcli_hndl(TMask_field& field, KEY key); +extern bool dummy_hndl(TMask_field& field, KEY key); diff --git a/ve/ve0300.cpp b/ve/ve0300.cpp index 69d6b795f..c20648162 100755 --- a/ve/ve0300.cpp +++ b/ve/ve0300.cpp @@ -11,12 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef XVT_INCL_DEFS -#include -#endif - -#include "veuml.h" - #ifndef __CHECKS_H #include #endif @@ -49,6 +43,10 @@ #include "ve0100.h" #endif +#ifndef __VEUML_H +#include "veuml.h" +#endif + // Costanti simboliche per i tipi di campo #define T_DATE 1 @@ -57,6 +55,7 @@ #define T_BOOLEAN 4 #define T_LISTBOX 5 #define T_MEMO 6 +#define T_GROUPBOX 7 // Costanti simboliche per flags del campo @@ -65,97 +64,54 @@ #define FS_NORMAL 2 #define FS_REQUIRED 3 -// Significato delle colonne nella tabella _tab0300a - -#define A_NOME 0 -#define A_FILEFLD 1 -#define A_MSKFLD 2 -#define A_MSKTYPE 3 -#define A_DESCR 4 -#define A_MSKSIZE 5 -#define A_FLAG 6 -#define A_USE 7 -#define A_INPUT 8 -#define A_DISPLAY 9 -#define A_OUTPUT 10 -#define A_SPECIAL 11 -#define A_ITEMS 12 - // Significato delle colonne nella tabella _tab0300b #define B_NOME 0 #define B_MSKTYPE 1 #define B_MSKSIZE 2 #define B_DESCR 3 -#define B_WIDTH 4 +#define B_WIDTH 4 + +// Significato dei campi nel profilo del documento +#define P_STATO 0 +#define P_PROMPT 1 +#define P_HELP 2 +#define P_WARNING 3 + // Numero massimo di linee per pagina -#define MAX_LINES_PER_PAGE 14 +#define MAX_LINES_PER_PAGE 17 +#define MASK_FIRST_LINE 6 - -class TMask_generator +class TMaschera : public TObject { private: - - // Identificatore corrente per lo sheet - int _curid; - + // Linea corrente int _curline; // Pagina corrente int _curpage; - - // Vero se la pagina è aperta - bool _pageopen; - - // nome del file di .INI di input - TFilename _proname; - - // File .INI di input - TConfig* _pro; - - // File .MSK di output - ofstream* _out; - - // Ultima linea letta - TToken_string _line; - // Tabelle per la generazione - - // Campi dei documenti - TString_array _tab0300a; - - // Campi dello sheet - TString_array _tab0300b; +public: -protected: - - // Carica un file di tabella in un TString array - void carica_tabella( const TFilename& fn, TString_array& tabella ); + void advance_line( ){ _curline ++; }; - // Scrive sul file di output una serie di righe uguali per funzione ( DISPLAY, ecc. ) + // Genera una serie di righe uguali per funzione ( DISPLAY, ecc. ) void outline( const TString& s = "", const TString& prefix = "", const char sep = '~' ); - // Crea un controllo del tipo specificato void control( const int type, const int id = DLG_NULL, const int size = -1 ); - // Ritorna vero se una componente della maschera è presente - int present( const int i, TToken_string line ){ const TString s = line.get( i ); return !(s.blank( )); }; - - // Funzioni per generare la maschera - // --------------------------------- - // CHECKTYPE void check( const int i ); // PAGE - void pagina( const int i ){ (*_out) << "PA \"Pagina " << i << "\" 11 60 14\n"; }; + void pagina( const int i ){ _out << "PA \"Pagina " << i << "\" 11 60 14\n"; }; // PROMPT - void prompt( const int x, const int y, const TString& s = "" ){ (*_out) << "PR " << x << " " << y << " \"" << s << "\"\n"; }; + void prompt( const int x, const int y, const TString& s = "" ){ _out << "PR " << x << " " << y << " \"" << s << "\"\n"; }; // BEGIN void begin( void ) { outline ( "BE" ); }; @@ -167,10 +123,16 @@ protected: void endmask( void ) { outline ( "ENDMASK" ); }; // FLAG - void flag( const TString& s ) { (*_out) << "FLAG \"" << s << "\"\n"; }; + void flag( const TString& s ) { _out << "FLAG \"" << s << "\"\n"; }; + + // HELP + void help( const TString& s ) { _out << "HE \"" << s << "\"\n"; }; + + // WARNING + void warning( const TString& s ) { _out << "WA \"" << s << "\"\n"; }; // GROUP - void group( const int g ) { (*_out) << "GR " << g << "\n"; }; + void group( const int g ) { _out << "GR " << g << "\n"; }; // FIELD void field( const TString& s ) { outline( s, "FI "); }; @@ -193,13 +155,6 @@ protected: // OUTPUT void output( const TString& s ){ outline( s, "OU " ); }; - // Funzioni di accesso alle variabili private - // ------------------------------------------ - - // Funzioni per la lettura/scrittura di ID. Si incrementa da solo. - int id ( ) { return( _curid++ ); }; - void id( const int i ){ _curid = i; }; - // Funzioni per la lettura/scrittura di CURPAGE int page( ) { return _curpage; }; void page( const int i ){ _curpage = i; }; @@ -208,6 +163,386 @@ protected: int line( ) { return _curline; }; void line( const int i ){ _curline = i; }; + // Costruttore, vuole il nome del file .INI + TMaschera( const TFilename outfile ); + + // Vero se la pagina è aperta + bool _pageopen; + + // File .MSK di output + ofstream _out; + + +}; + + +TMaschera::TMaschera( const TFilename outfile ) : _out( outfile ) +{ + _curline = 1; + _curpage = 1; + _pageopen = FALSE; + bool _groupopen = FALSE; +} + +void TMaschera::outline( const TString& s, const TString& prefix, const char sep ) +{ + if ( s.left( 1 ) == "@" ) + _out << "CO " << prefix << s.mid( 1 ) << "\n"; + else + { TToken_string u( s, sep ); + for ( int i = 0; i < u.items(); i ++ ) + _out << prefix << u.get( i ) << "\n"; + } +} + +void TMaschera::check( const int i ) +{ + switch( i ) + { + case FS_REQUIRED: + outline ( "CH REQUIRED" ); + break; + default: + outline ( "CH NORMAL" ); + break; + } +} + +void TMaschera::control( const int type, const int id, const int size ) +{ + switch ( type ) + { case T_DATE : _out << "DA"; break; + case T_STRING : _out << "ST"; break; + case T_BOOLEAN : _out << "BO"; break; + case T_NUMBER : _out << "NU"; break; + case T_LISTBOX : _out << "LI"; break; + case T_MEMO : _out << "ME"; break; + case T_GROUPBOX : _out << "GR"; break; + }; + _out << " " << id; + if ( size > 0 ) + { if ( size > 100 ) + _out << " " << ( int )( size / 100 ) << " " << ( size % 100 ); + else + _out << " " << size; + }; + _out << "\n"; +} + +void TMaschera::item( const TString& str ) +{ int i, j; + TToken_string u( str, '@' ); + TToken_string s; + + for( i = 0; i < u.items(); i ++ ) + { _out << "IT \"" << s[ 0 ] << "\"\n"; + for( j = 1; j < s.items(); j ++ ) + _out << "ME " << s[ j ] << "\n"; + } + } + +class TGruppo : public TObject +{ +protected: + + int _id; + int _height; + bool _present; + +public: + + void id( int id ){ _id = id; } + int id( ){ return _id; } + void height( int h ){ _height = h; } + int height( ){ return _height; } + void present( bool p ){ _present = p; } + bool present( ){ return _present; } + + TGruppo ( int i ); + TGruppo ( int i, TConfig& pro ); +}; + +TGruppo::TGruppo( int i ) +{ + TConfig pro( "ve0300c.ini" ); + _id = i; + _height = pro.get_int( "HEIGHT", format( "%d", i ) ); +}; + +TGruppo::TGruppo( int i, TConfig& pro ) +{ + _id = i; + _height = pro.get_int( "HEIGHT", format( "%d", i ) ); +}; + +class TField : public TObject +{ +protected: + + TString _nome; + int _gruppo; + int _id; + int _type; + int _size; + int _stato; + int _x, _y; + TString _prompt, _flag, _help, _warning, _fieldname; + TToken_string _use, _input, _display, _output, _special, _items, _configs; + +public: + + TField( TString& campo, TConfig& pro ); + TField( ); + + void genera( TMaschera& _m ); + void configura( TConfig& pro ); + + void x( int x ){ _x = x; } + void y( int y ){ _y = y; } + void gruppo( int gruppo ){ _gruppo = gruppo; } + void id( int id ){ _id = id; } + void type( int type ){ _type = type; } + void size( int size ){ _size = size; } + void stato( int stato ){ _stato = stato; } + int x( ){ return _x; } + int y( ){ return _y; } + int gruppo( ){ return _gruppo; } + int id( ){ return _id; } + int type( ){ return _type; } + int size( ){ return _size; } + int stato( ){ return _stato; } + + + void nome( TString& nome ){ _nome = nome; } + void prompt( TString& prompt ){ _prompt = prompt; } + void flag( TString& flag ){ _flag = flag; } + void help( TString& help ){ _help = help; } + void warning( TString& warning ){ _warning = warning; } + void fieldname( TString& fieldname ){ _fieldname = fieldname; } + TString& nome( ){ return _nome; } + TString& prompt( ){ return _prompt; } + TString& flag( ){ return _flag; } + TString& help( ){ return _help; } + TString& warning( ){ return _warning; } + TString& fieldname( ){ return _fieldname; } + + void use( TToken_string& use ){ _use = use; } + void input( TToken_string& input ){ _input = input; } + void display( TToken_string& display ){ _display = display; } + void output( TToken_string& output ){ _output = output; } + void special( TToken_string& special ){ _special = special; } + void items( TToken_string& items ){ _items = items; } + void configs( TToken_string& configs ){ _configs = configs; } + TToken_string& use( ){ return _use; } + TToken_string& input( ){ return _input; } + TToken_string& display( ){ return _display; } + TToken_string& output( ){ return _output; } + TToken_string& special( ){ return _special; } + TToken_string& items( ){ return _items; } + TToken_string& configs( ){ return _configs; } + + + friend int sort_by_group(const TObject** o1, const TObject** o2 ); + // friend int TMask_generator::group( const TField& f1 ); +}; + +int sort_by_group(const TObject** o1, const TObject** o2 ) +{ + int g1 = ((TField * )( *o1 ))->_gruppo; + int g2 = ((TField * )( *o2 ))->_gruppo; + return ( g1 < g2 ) ? -1 : ( ( g1 = g2 ) ? 0 : 1 ); +}; + +TField::TField( TString& campo, TConfig& pro ) : _nome( campo ) +{ + _nome.trim( ); + _fieldname = pro.get( "FIELDNAME", campo ); + _x = _gruppo = pro.get_int( "X", campo ); + _y = _gruppo = pro.get_int( "Y", campo ); + _gruppo = pro.get_int( "GROUP", campo ); + CHECK( _gruppo != 0, "Gruppo uguale a 0" ); + _id = pro.get_int( "MSKID", campo ); + _type = pro.get_int( "TYPE", campo ); + _size = pro.get_int( "SIZE", campo ); + _prompt = pro.get( "PROMPT", campo ); + if( _prompt[ 0 ] == '\"' ) + { + _prompt.ltrim( 1 ); + _prompt.rtrim( 1 ); + }; + _flag = pro.get( "FLAG", campo ); + _help = pro.get( "FLAG", campo ); + _warning = pro.get( "FLAG", campo ); + _use = pro.get( "USE", campo ); + _use.separator( '~' ); + _input = pro.get( "INPUT", campo ); + _input.separator( '~' ); + _display = pro.get( "DISPLAY", campo ); + _display.separator( '~' ); + _output = pro.get( "OUTPUT", campo ); + _output.separator( '~' ); + _special = pro.get( "SPECIAL", campo ); + _special.separator( '~' ); + _configs = pro.get( "CONFIGS", campo ); + _configs.separator( '~' ); + _items = ""; + int last = pro.get_int( "NITEMS", campo ); + for( int i = 1; i <= last; i ++ ) + _items.add( pro.get( "ITEM", campo, i ) ); +}; + +TField::TField( ) +{ + _nome = ""; + _fieldname = ""; + _x = 0; + _y = 0; + _gruppo = 0; + _id = 0; + _type = 0; + _size = 0; + _prompt = ""; + _flag = ""; + _help = ""; + _warning = ""; + _use = ""; + _use.separator( '~' ); + _input = ""; + _input.separator( '~' ); + _display = ""; + _display.separator( '~' ); + _output = ""; + _output.separator( '~' ); + _special = ""; + _special.separator( '~' ); + _configs = ""; + _configs.separator( '~' ); + _items = ""; + _items.separator( '@' ); +}; + +void TField::configura( TConfig& pro ) +{ + TToken_string riga_profilo( pro.get( _nome, "PROFILO" ) ); + TString newprompt( riga_profilo.get( P_PROMPT ) ) ; + TString newhelp( riga_profilo.get( P_HELP ) ) ; + TString newwarning( riga_profilo.get( P_WARNING ) ) ; + if ( ! newprompt.blank( ) ) + _prompt = newprompt; + if ( ! newhelp.blank( ) ) + _help = newhelp; + if ( ! newwarning.blank( ) ) + _warning = newwarning; +} + +void TField::genera( TMaschera& m ) +{ + TString s; + + if ( _size != 0 ) + m.control( _type, _id, _size ); + else + m.control( _type, _id ); + m.begin(); + switch( _stato ) + { case FS_HIDDEN: + m.prompt( 2, 2 ); + s = "H"; + s << _flag; + m.flag( s ) ; + break; + case FS_DISABLED : + m.prompt( _x, _y + m.line( ), _prompt ); + s = "D"; + s << _flag; + m.flag( s ) ; + // m.advance_line( ); + break; + case FS_NORMAL : + case FS_REQUIRED : + m.prompt( _x, _y + m.line( ), _prompt ); + m.flag( _flag ); + // m.advance_line( ); + break; + } + m.check( _stato ); + if ( !_fieldname.blank( ) ) m.field( _fieldname ); + if ( !_items.blank( ) ) m.item( _items ); + if ( !_use.blank( ) ) m.use( _use ); + if ( !_input.blank( ) ) m.input( _input ); + if ( !_display.blank( ) ) m.display( _display ); + if ( !_output.blank( ) ) m.output( _output ); + if ( !_help.blank( ) ) m.help( _help ); + if ( !_warning.blank( ) ) m.warning( _warning ); + if ( !_special.blank( ) ) m.outline( _special ); + m.end(); + if ( ( m.line() > MAX_LINES_PER_PAGE ) && ( m._pageopen == TRUE)) + { m.end(); + m._pageopen = FALSE; + m.line( MASK_FIRST_LINE ); + }; +} + + +class TMask_generator +{ + +private: + + // Identificatore corrente per lo sheet + int _curid; + + // vero se il gruppo è aperto + bool _groupopen; + + // nome del file di .INI di input + TFilename _proname; + + // File .INI di riferimento per i campi + TConfig _fieldsini; + + // File .INI di riferimento per i gruppi + TConfig _groupsini; + + // File .INI di input + TConfig* _pro; + + TConfig _ditta; + + // Tabelle per la generazione + + // Campi dei documenti + TString_array _fields; + + // Campi dello sheet + TString_array _tab0300b; + +protected: + + // Carica un file di tabella in un TString array + void carica_tabella( const TFilename& fn, TString_array& tabella ); + + // Scrive sul file di output una serie di righe uguali per funzione ( DISPLAY, ecc. ) + void outline( const TString& s = "", const TString& prefix = "", const char sep = '~' ); + + + // Crea un controllo del tipo specificato + void control( const int type, const int id = DLG_NULL, const int size = -1 ); + + // Ritorna vero se una componente della maschera è presente + int present( const int i, TToken_string line ){ const TString s = line.get( i ); return !(s.blank( )); }; + + // Carica dati dei campi + void carica_dati_campi( const TFilename& fn, TArray& a ); + + // Funzioni di accesso alle variabili private + // ------------------------------------------ + + // Funzioni per la lettura/scrittura di ID. Si incrementa da solo. + int id ( ) { return( _curid++ ); }; + void id( const int i ){ _curid = i; }; + + // Funzioni di generazione ad alto livello // --------------------------------------- @@ -223,9 +558,14 @@ protected: // Genera l'intestazione di una pagina ( non la prima ) void intestazione_pagina( ); + + // Ritorna lo stato che dovrà avere il campo sulla maschera da generare + int stato_del_campo( TString campo ); public: - + + TMaschera * _m; + // Costruttore, vuole il nome del file .INI TMask_generator( const TString& profilo ); @@ -240,36 +580,121 @@ public: // Definizione dei metodi di TMask_generator // ----------------------------------------- -TMask_generator::TMask_generator( const TString& profilo ) : _proname( profilo ) -{ - // All'inizio la pagina è 'chiusa' - _pageopen = FALSE; - - // La pagina iniziale è la 1 - _curpage = 1; - - // La linea iniziale è la 8 - _curline = 8; +TMask_generator::TMask_generator( const TString& profilo ) : _proname( profilo ), _fieldsini( "ve0300a.ini" ), _groupsini( "ve0300c.ini" ), _ditta( CONFIG_DITTA ) +{ + // All'inizio il gruppo è 'chiuso' + _groupopen = FALSE; // Forza l'estensione al profilo _proname.ext( "ini" ); // Se il file di profilo non esiste, esci con un errore fatale if ( !fexist( _proname ) ) - fatal_box( "Il file %s non esiste!", _proname ); + fatal_box( "Il file %s non esiste!", ( const char * )_proname ); - CHECK( fexist( "ve0300a.dat" ), "Il file ve0300a.dat non esiste!" ); - carica_tabella( "ve0300a.dat", _tab0300a ); + CHECK( fexist( "ve0300a.ini" ), "Il file ve0300a.ini non esiste!" ); + _fieldsini.list_paragraphs( _fields ); CHECK( fexist( "ve0300b.dat" ), "Il file ve0300b.dat non esiste!" ); carica_tabella( "ve0300b.dat", _tab0300b ); + _pro = new TConfig( _proname ); + + TFilename _mskname( _pro->get( "MSKFILE", "MAIN") ); + _mskname.ext( "msk" ); + + + _m = new TMaschera( _mskname ); + }; TMask_generator::~TMask_generator( ) { - delete _out; + delete _m; + delete _pro; }; + +void TMask_generator::carica_dati_campi( const TFilename& fn, TArray& a ) +{ + TScanner infile( fn ); + TString line; + TField *campo = NULL; + + while ( infile.ok( ) ) + { line = infile.line( ); + while ( ( line.empty() || line[ 0 ] == '#' ) && infile.ok( ) ) + { line = infile.line( ); + line.trim(); } + if( infile.ok( ) ) + { if ( line[ 0 ] == '[' ) // Carica un un campo + { line.strip( "[]" ); + if ( campo ) + { a.add( campo ); + // delete campo; + }; + campo = new TField(); + campo->nome( line ); + } + else + { int pos; + if( ( pos = line.find( '=' ) ) == 0 ) + yesnofatal_box( "Linea errata nel file.INI: %s", (const char *) line ); + else + { + TString key = line.sub( 0, pos ); + key.trim(); + TString value = line.mid( pos + 1 ); + value.trim(); + if( key == "X" ) + { campo->x( atoi( value ) ); } + else if( key == "Y" ) + { campo->y( atoi( value ) ); } + else if( key == "GROUP" ) + { campo->gruppo( atoi( value ) ); } + else if( key == "FIELDNAME" ) + { campo->fieldname( value ); } + else if( key == "MSKID" ) + { campo->id( atoi( value ) ); } + else if( key == "TYPE" ) + { campo->type( atoi( value ) ); } + else if( key == "SIZE" ) + { campo->size( atoi( value ) ); } + else if( key == "PROMPT" ) + { if( value[ 0 ] == '"' ) + { value.rtrim( 1 ); + value.ltrim( 1 ); }; + campo->prompt( value ); } + else if( key == "FLAG" ) + { campo->flag( value ); } + else if( key == "USE" ) + { campo->use( (TToken_string & ) value ); } + else if( key == "INPUT" ) + { campo->input( (TToken_string & )value ); } + else if( key == "DISPLAY" ) + { campo->display( (TToken_string & )value ); } + else if( key == "OUTPUT" ) + { campo->output( (TToken_string & )value ); } + else if( key == "WARNING" ) + { campo->warning( value ); } + else if( key == "HELP" ) + { campo->help( value ); } + else if( key == "SPECIAL" ) + { campo->special( (TToken_string & )value ); } + else if( key == "ITEMS" ) + { campo->items( (TToken_string & )value ); } + else if( key == "CONFIGS" ) + { campo->configs( (TToken_string & )value ); } + else yesnofatal_box( "Chiave non trovata(%s)", (const char *) key ); + } + } + } + } + if ( campo ) + { a.add( campo ); + // delete campo; + }; +} + void TMask_generator::carica_tabella( const TFilename& fn, TString_array& tabella ) { TScanner in( fn ); TToken_string line = in.line(); @@ -284,201 +709,143 @@ void TMask_generator::carica_tabella( const TFilename& fn, TString_array& tabell } }; -void TMask_generator::outline( const TString& s, const TString& prefix, const char sep ) -{ - if ( s.left( 1 ) == "§" ) - (*_out) << "CO " << prefix << s.mid( 1 ) << "\n"; - else - { TToken_string u( s, sep ); - for ( int i = 0; i < u.items(); i ++ ) - (*_out) << prefix << u.get( i ) << "\n"; - } -}; - -void TMask_generator::check( const int i ) -{ - switch( i ) - { - case FS_REQUIRED: - outline ( "CH REQUIRED" ); - break; - default: - outline ( "CH NORMAL" ); - break; - } -}; - -void TMask_generator::control( const int type, const int id, const int size ) -{ - switch ( type ) - { case T_DATE : (*_out) << "DA"; break; - case T_STRING : (*_out) << "ST"; break; - case T_BOOLEAN : (*_out) << "BO"; break; - case T_NUMBER : (*_out) << "NU"; break; - case T_LISTBOX : (*_out) << "LI"; break; - }; - (*_out) << " " << id; - if ( size > 0 ) - if ( size > 100 ) - (*_out) << " " << ( int )( size / 100 ) << " " << ( size % 100 ); - else - (*_out) << " " << size; - (*_out) << "\n"; -}; - -void TMask_generator::item( const TString& str ) -{ int i, j; - TToken_string u( str, '~' ); - TString s, mess; - - for( i = 0; i < u.items(); i ++ ) - { s = u.get( i ); - if ( ( j = s.find( "£" ) ) != -1 ) - { mess = s.mid( j + 1 ); - s = s.left( j ); - }; - if ( ( j = s.find ( "§" ) ) != -1 ) - s[ j ] = '|'; - (*_out) << "IT \"" << s << "\"\n"; - if ( mess.not_empty( ) ) - (*_out) << "ME " << mess << "\n"; - } - } +int TMask_generator::stato_del_campo( TString campo ) +{ + // Strategia al 28/08/95 + // Se il campo, nel file .INI di definizione dei campi, è legato a qualche voce in + // configurazione, legge il suo stato, altrimenti assume il massimo. + // Va poi a verificare nel .INI da compilare, e verifica li' la impostazione. + // Controlla poi la impostazione per il gruppo, come impostato nel file .INI + // e nella sezione CONFIGS nel .INI di defiunizione dei gruppi. + // Utilizza poi la minore delle due. + TToken_string config( _fieldsini.get( "CONFIGS", campo ) ); + int items = config.items( ); + int stato = FS_REQUIRED; + for ( int i = 0; i < items; i += 3 ) + { TString chiave = config[ i ]; + TString valore = config[ i + 1 ]; + TString reale = _ditta.get( chiave, "VE" ); + if ( reale == valore ) + stato = atoi( ( char * ) config[ i + 2 ] ); + }; + TToken_string riga_profilo( _pro->get( campo, "PROFILO" ) ); + int stato_profilo = riga_profilo.get_int( P_STATO ); + stato = ( stato < stato_profilo )? stato : stato_profilo; + TString gruppo ( _fieldsini.get( "GROUP", campo ) ); + gruppo.trim( ); + config = ( _groupsini.get( "CONFIGS", gruppo ) ); + int stato_gruppo = FS_REQUIRED; + for ( i = 0; i < items; i += 3 ) + { TString chiave = config[ i ]; + TString valore = config[ i + 1 ]; + TString reale = _ditta.get( chiave, "VE" ); + if ( reale == valore ) + stato_gruppo = atoi( ( char * ) config[ i + 2 ] ); + }; + stato = ( stato < stato_gruppo )? stato : stato_gruppo; + int stato_gruppo_profilo = _pro->get_int( gruppo, "PROFILOGRUPPO" ); + stato = ( stato < stato_gruppo_profilo )? stato : stato_gruppo_profilo; + return stato; + +} void TMask_generator::genera_campo_sheet( TToken_string _line ) { const int type( _line.get_int( B_MSKTYPE ) ); - control( type, id( ), _line.get_int( B_MSKSIZE ) ); - begin( ); - prompt( 2, 2 ); - end( ); + _m->control( type, id( ), _line.get_int( B_MSKSIZE ) ); + _m->begin( ); + _m->prompt( 2, 2 ); + _m->end( ); } void TMask_generator::genera_item_sheet( TToken_string _line ) { - (*_out) << "IT \"" << _line.get( B_DESCR ); - (*_out) << "@" << _line.get_int( B_WIDTH ) << "\"\n"; + _m->_out << "IT \"" << _line.get( B_DESCR ); + _m->_out << "@" << _line.get_int( B_WIDTH ) << "\"\n"; } -void TMask_generator::genera_campo( TToken_string _line ) -{ - TString s; - - const int type( _line.get_int( A_MSKTYPE ) ); - const int size( _line.get_int( A_MSKSIZE ) ); - if ( present( A_MSKSIZE, _line ) ) - control( type, _line.get_int( A_MSKFLD ), size ); - else - control( type, _line.get_int( A_MSKFLD ) ); - begin(); - - TString name( _line.get( A_NOME ) ); - name.trim(); - int value = _pro->get_int( name, "PROFILO" ); - switch( value ) - { case FS_HIDDEN: - prompt( 2, 2 ); - s = "H"; - s << _line.get( A_FLAG ); - flag( s ) ; - break; - case FS_DISABLED : - prompt( 2, line( ), _line.get( A_DESCR ) ); - s = "D"; - s << _line.get( A_FLAG ); - flag( s ) ; - line( line( ) + 1 ); - break; - case FS_NORMAL : - case FS_REQUIRED : - prompt( 2, line( ), _line.get( A_DESCR ) ); - flag( _line.get( A_FLAG ) ); - line( line( ) + 1 ); - break; - } - const TString chiave( _line.get( A_NOME ) ); - check( _pro->get_int( chiave, "PROFILO" ) ); - if ( present( A_FILEFLD, _line ) ) field( _line.get( A_FILEFLD ) ); - if ( present( A_ITEMS, _line ) ) item( _line.get( A_ITEMS ) ); - if ( present( A_USE, _line ) ) use( _line.get( A_USE ) ); - if ( present( A_INPUT, _line ) ) input( _line.get( A_INPUT ) ); - if ( present( A_DISPLAY, _line ) ) display( _line.get( A_DISPLAY ) ); - if ( present( A_OUTPUT, _line ) ) output( _line.get( A_OUTPUT ) ); - if ( present( A_SPECIAL, _line ) ) outline( _line.get( A_SPECIAL ) ); - end(); - if ( ( line() > MAX_LINES_PER_PAGE ) && ( _pageopen == TRUE)) - { end(); - _pageopen = FALSE; - line( 8 ); - }; -} - void TMask_generator::intestazione_pagina( ) { - page( page( ) + 1 ); - pagina( page( ) ); - (*_out) << "GR " << DLG_NULL << " 77 4\n"; - begin(); - prompt( 1, 1 ); - end(); + _m->page( _m->page( ) + 1 ); + _m->pagina( _m->page( ) ); - control( T_STRING, DLG_NULL, 4 ); - begin(); - prompt( 2, 2, "Codice numerazione " ); - group( 2 ); - flag( "DUZ" ); - end(); + _m->control( T_GROUPBOX, DLG_NULL, 7806 ); + _m->begin( ); + _m->prompt( 1, 0, "" ); + _m->end( ); - control( T_STRING, DLG_NULL, 40 ); - begin(); - prompt( 32, 2 ); - flag( "DU" ); - group( 3 ); - end(); + _m->control( T_STRING, DLG_NULL, 4 ); + _m->begin(); + _m->prompt( 2, 1, "Cod. num. " ); + _m->group( 2 ); + _m->flag( "DUZ" ); + _m->end(); + + _m->control( T_STRING, DLG_NULL, 50 ); + _m->begin(); + _m->prompt( 24, 1 ); + _m->flag( "DU" ); + _m->group( 3 ); + _m->end(); - control( T_STRING, DLG_NULL, 12 ); - begin(); - prompt( 32, 3, "Profilo :" ); - flag( "DU" ); - group( 4 ); - end(); + _m->control( T_STRING, DLG_NULL, 4 ); + _m->begin(); + _m->prompt( 2, 2, "Tipo doc. " ); + _m->flag( "DU" ); + _m->group( 4 ); + _m->end(); - control( T_STRING, DLG_NULL, 4 ); - begin(); - prompt( 2, 3, "Esercizio " ); - flag( "D" ); - group( 5 ); - end(); + _m->control( T_STRING, DLG_NULL, 50 ); + _m->begin(); + _m->prompt( 24, 2 ); + _m->flag( "DU" ); + _m->group( 5 ); + _m->end(); - control( T_LISTBOX, DLG_NULL, 14 ); - begin(); - prompt( 32, 5, "Numerazione " ); - item( "P§Provvisoria" ); - item( "D§Definitiva " ); - flag( "D" ); - group( 6 ); - end(); + _m->control( T_NUMBER, DLG_NULL, 6 ); + _m->begin(); + _m->prompt( 2, 3, "Doc.: nr. " ); + _m->group( 6 ); + _m->flag( "D" ); + _m->end(); - control( T_NUMBER, DLG_NULL, 7 ); - begin(); - prompt( 2, 5, "Numero documento " ); - group( 7 ); - flag( "DZ" ); - end(); + _m->control( T_DATE ); + _m->begin(); + _m->prompt( 24, 3, "Data " ); + _m->group( 7 ); + _m->flag( "D" ); + _m->end(); - control( T_NUMBER, DLG_NULL, 1 ); - begin(); - prompt( 2, 6, "Stato corrente " ); - group( 8 ); - flag( "D" ); - end(); + _m->control( T_NUMBER, DLG_NULL, 1 ); + _m->begin(); + _m->prompt( 50, 3, "Stato " ); + _m->group( 8 ); + _m->flag( "D" ); + _m->end(); - control( T_DATE ); - begin(); - prompt( 51, 6, "Data documento " ); - group( 9 ); - flag( "D" ); - end(); + _m->control( T_STRING, DLG_NULL, 4 ); + _m->begin(); + _m->prompt( 66, 3, "Es. " ); + _m->flag( "D" ); + _m->group( 9 ); + _m->end(); + + _m->control( T_STRING, DLG_NULL, 6 ); + _m->begin(); + if ( _pro->get( "TIPOCF", "MAIN" ) == "C" ) + _m->prompt( 2, 4, "Cliente " ); + else + _m->prompt( 2, 4, "Fornitore " ); + _m->flag( "D" ); + _m->group( 10 ); + _m->end(); + + _m->control( T_STRING, DLG_NULL, 50 ); + _m->begin(); + _m->prompt( 24, 4, "" ); + _m->flag( "D" ); + _m->group( 11 ); + _m->end(); } @@ -486,178 +853,249 @@ void TMask_generator::genera( ) { int i; - _pro = new TConfig( _proname ); - - TFilename _mskname( _pro->get( "MSKFILE", "MAIN") ); - _mskname.ext( "msk" ); - _out = new ofstream( _mskname ); - // Definizione della toolbar - outline( "TOOLBAR \"\" 0 20 0 2" ); - outline( "BU 18 8 2" ); - begin(); - prompt( -15, -1, "~Registra" ); - message( "EXIT,20082" ); - end(); + _m->outline( "TOOLBAR \"\" 0 20 0 2" ); + _m->outline( "BU 18 8 2" ); + _m->begin(); + _m->prompt( -15, -1, "~Registra" ); + _m->message( "EXIT,20082" ); + _m->end(); - outline( "BU 17 8 2" ); - begin(); - prompt( -25, -1, "~Elimina" ); - message( "EXIT,127" ); - end(); + _m->outline( "BU 17 8 2" ); + _m->begin(); + _m->prompt( -25, -1, "~Elimina" ); + _m->message( "EXIT,127" ); + _m->end(); - outline( "BU 99 8 2" ); - begin(); - prompt( -35, -1, "E~labora" ); - message( "EXIT,345" ); - end(); + _m->outline( "BU 99 8 2" ); + _m->begin(); + _m->prompt( -35, -1, "E~labora" ); + _m->message( "EXIT,345" ); + _m->end(); - outline( "BU 24 8 2" ); - begin(); - prompt( -45, -1 ); - message( "EXIT,346" ); - end(); + _m->outline( "BU 24 8 2" ); + _m->begin(); + _m->prompt( -45, -1 ); + _m->message( "EXIT,346" ); + _m->end(); - outline( "BU 2 8 2" ); - begin(); - prompt( -55, -1 ); - message( "EXIT,27" ); - end(); + _m->outline( "BU 2 8 2" ); + _m->begin(); + _m->prompt( -55, -1 ); + _m->message( "EXIT,27" ); + _m->end(); // End della toolbar - end(); + _m->end(); // Header della prima pagina - outline( "PA \"Pagina \" 11 60 14" ); - (*_out) << "GR " << DLG_NULL << " 77 4\n"; - begin(); - prompt( 1, 1 ); - end(); + _m->outline( "PA \"Pagina \" 11 60 14" ); - control( T_STRING, F_CODNUM, 4 ); - begin(); - prompt( 2, 2, "Codice numerazione " ); - field( "CODNUM" ); - flag( "GDUZ" ); - message( "CO,2@" ); - end(); + _m->control( T_GROUPBOX, DLG_NULL, 7806 ); + _m->begin( ); + _m->prompt( 1, 0, "" ); + _m->end( ); - control( T_STRING, F_DESNUM, 40 ); - begin(); - prompt( 32, 2 ); - flag( "GDU" ); - message( "CO,3@" ); - end(); + _m->control( T_STRING, F_CODNUM, 4 ); + _m->begin(); + _m->prompt( 2, 1, "Cod. num. " ); + _m->field( "CODNUM" ); + _m->flag( "GDUZ" ); + _m->message( "CO,2@" ); + _m->end(); + + _m->control( T_STRING, F_DESNUM, 50 ); + _m->begin(); + _m->prompt( 24, 1 ); + _m->flag( "GDU" ); + _m->message( "CO,3@" ); + _m->end(); - control( T_STRING, F_PROFILO, 12 ); - begin(); - prompt( 32, 3, "Profilo :" ); - flag( "GDU" ); - message( "CO,4@" ); - end(); + _m->control( T_STRING, F_TIPODOC, 4 ); + _m->begin(); + _m->prompt( 2, 2, "Tipo doc. " ); + _m->flag( "GDU" ); + _m->message( "CO,4@" ); + _m->end(); - control( T_STRING, F_ANNO, 4 ); - begin(); - prompt( 2, 3, "Esercizio " ); - field( "ANNO" ); - flag( "GD" ); - message( "CO,5@" ); - end(); + _m->control( T_STRING, F_DESTIPODOC, 50 ); + _m->begin(); + _m->prompt( 24, 2 ); + _m->flag( "GDU" ); + _m->message( "CO,5@" ); + _m->end(); - control( T_LISTBOX, F_PROVV, 14 ); - begin(); - prompt( 32, 5, "Numerazione " ); - field( "PROVV" ); - item( "P§Provvisoria£CO,6@" ); - item( "D§Definitiva £CO,6@" ); - end(); + _m->control( T_NUMBER, F_NDOC, 6 ); + _m->begin(); + _m->prompt( 2, 3, "Doc.: nr. " ); + _m->message( "CO,6@" ); + _m->flag( "GDR" ); + _m->end(); - control( T_NUMBER, F_NDOC, 7 ); - begin(); - prompt( 2, 5, "Numero documento " ); - field( "NDOC" ); - message( "CO, 7@" ); - flag( "Z" ); - end(); + _m->control( T_DATE, F_DATADOC ); + _m->begin(); + _m->prompt( 24, 3, "Data " ); + _m->message( "CO,7@" ); + _m->flag( "" ); + _m->end(); - control( T_NUMBER, F_STATO, 1 ); - begin(); - prompt( 2, 6, "Stato corrente " ); - field( "STATO" ); - message( "CO,8@" ); - flag( "GD" ); - end(); + _m->control( T_NUMBER, F_STATO, 1 ); + _m->begin(); + _m->prompt( 50, 3, "Stato " ); + _m->message( "CO,8@" ); + _m->flag( "D" ); + _m->end(); - control( T_DATE, F_DATADOC ); - begin(); - prompt( 51, 6, "Data documento " ); - message( "CO,9@" ); - field( "DATADOC" ); - end(); + _m->control( T_STRING, F_ANNO, 4 ); + _m->begin(); + _m->prompt( 66, 3, "Es. " ); + _m->flag( "GD" ); + _m->message( "CO,9@" ); + _m->end(); + + _m->control( T_STRING, F_CODCF, 6 ); + _m->begin(); + if ( _pro->get( "TIPOCF", "MAIN" ) == "C" ) + _m->prompt( 2, 4, "Cliente " ); + else + _m->prompt( 2, 4, "Fornitore " ); + _m->flag( "" ); + _m->message( "CO,10@" ); + _m->end(); + + _m->control( T_STRING, F_DESCF, 50 ); + _m->begin( ); + _m->prompt( 24, 4, "" ); + _m->flag( "" ); + _m->message( "CO,11@" ); + _m->end(); + + _m->line( MASK_FIRST_LINE ); // Generazione - _pageopen = TRUE; - for( i = 0; i < _tab0300a.items( ); i ++ ) - { if (_pageopen == FALSE) - { intestazione_pagina( ); - _pageopen = TRUE; + // Scorro l'array dei campi, per vedere gli stati ed i gruppi + + TArray campi; + TAssoc_array gruppi; + + carica_dati_campi( "ve0300a.ini", campi ); + int last = campi.items( ); + for( i = 0; i < last; i ++ ) + { + TString nome = (( TField & )campi[ i ]).nome( ); + int stato = stato_del_campo( nome ); + if( stato != FS_HIDDEN ) + { + const int addgruppo = (( TField & )campi[ i ]).gruppo( ); + TString16 chiave; + chiave.format( "%5d", addgruppo ); + if ( !gruppi.is_key( chiave ) ) + gruppi.add( chiave, new TGruppo( addgruppo, _groupsini ) ); } - genera_campo( _tab0300a.row( i ) ); + (( TField & )campi[ i ]).stato( stato ); + }; + campi.sort( sort_by_group ); + + // Generazione vera e propria + _m->_pageopen = TRUE; + last = campi.items( ); + int curgruppo = 0; + for( i = 0; i < last; i ++ ) + { + if ( _m->_pageopen == FALSE) + { + intestazione_pagina( ); + _m->_pageopen = TRUE; + } + TField& campo = ( TField& ) campi[ i ]; + if ( campo.gruppo( ) != curgruppo ) + { + TString16 chiave; + chiave.format( "%5d", campo.gruppo( ) ); + if ( gruppi.is_key( chiave ) ) + { + TGruppo& gruppo = ( TGruppo& ) gruppi[ chiave ]; + if ( _m->line( ) + gruppo.height( ) > MAX_LINES_PER_PAGE ) + { + _m->end( ); + intestazione_pagina( ); + _m->line( MASK_FIRST_LINE ); + } + else + { + TString16 vecchiachiave; + vecchiachiave.format( "%5d", curgruppo ); + if ( gruppi.is_key( vecchiachiave ) ) + { + _m->line( _m->line( ) + ( ( TGruppo& ) gruppi[ vecchiachiave ]).height( ) ); + } + } + }; + curgruppo = campo.gruppo( ); + }; + campo.configura( *_pro ); + campo.genera( *_m ); } - if ( _pageopen == TRUE ) end( ); + if ( _m->_pageopen == TRUE ) _m->end( ); intestazione_pagina( ); + // Generazione del listbox per i tipi di riga da aggiungere nello sheet + _m->control ( T_LISTBOX, F_LBTIPORIGA, 30 ); + _m->begin(); + _m->prompt( 2, 7, "Tipo riga da aggiungere " ); + _m->end( ); + // Generazione dello sheet : vedi il profilo TScanner sheet_in( "ve0300b.dat" ); - (*_out) << "SPREADSHEET " << F_SHEET << "\n"; - begin(); - prompt( 2, 7 ); + _m->_out << "SPREADSHEET " << F_SHEET << "\n"; + _m->begin(); + _m->prompt( 2, 8 ); for( i = 0; i < _tab0300b.items( ); i ++ ) genera_item_sheet( _tab0300b.row( i ) ); - end(); - end(); + _m->end(); + _m->end(); // Generazione pagina dei piedi TToken_string s(_pro->get( "PROGPIEDE", "MAIN" ) ); if ( s.not_empty() ) - { intestazione_pagina( ); - TConfig ditta(CONFIG_DITTA); + { + intestazione_pagina( ); int cp = 1; int piede = s.get_int();; while ( piede != 0 ) - { control( T_NUMBER, BASE_PIEDE + cp, 1805 ); - begin(); - TString header = ditta.get( "PIEDE", "ve", piede ); + { + _m->control( T_NUMBER, BASE_PIEDE + cp, 1805 ); + _m->begin(); + TString header = _ditta.get( "PIEDE", "ve", piede ); while( header.len() < 40 ) header << " "; - prompt( 2, 7 + cp, header ); - flag( "D" ); - end(); + _m->prompt( 2, 7 + cp, header ); + _m->flag( "D" ); + _m->end(); cp ++; piede = s.get_int(); } - end(); + _m->end(); }; - endmask( ); + _m->endmask( ); + // Stategia al 30/06/95 // Creo una maschera con tutte le colonne, poi, a RUNTIME, // dal motore, nascondo e adatto le colonne. // Generazione maschera dello sheet - (*_out) << "PA \"Pagina 1\" 8 5 64 13\n"; + _m->_out << "PA \"Pagina 1\" 8 5 64 13\n"; id( 101 ); for( i = 0; i < _tab0300b.items( ); i ++ ) genera_campo_sheet( _tab0300b.row( i ) ); - end(); - end(); - endmask( ); - delete _pro; - delete _out; + _m->end(); + _m->end(); + _m->endmask( ); } @@ -669,12 +1107,12 @@ class TGenMask_application : public TApplication protected: virtual bool create( ); - virtual bool menu( MENU_TAG m ); + virtual bool menu( MENU_TAG _m ); }; -bool TGenMask_application::menu(MENU_TAG m) +bool TGenMask_application::menu(MENU_TAG _m) { TMask_generator a( argv( 2 ) ); a.genera( ); diff --git a/ve/veuml.h b/ve/veuml.h index 06c0a3730..4057c7b74 100755 --- a/ve/veuml.h +++ b/ve/veuml.h @@ -74,6 +74,10 @@ #define F_PROFILO 171 // GESTITO DAL MOTORE #define F_TIPODOC 172 // GESTITO DAL MOTORE #define F_DESNUM 173 // GESTITO DAL MOTORE -#define F_TIPIDOCS 174 - +#define F_TIPIDOCS 174 // GESTITO DAL MOTORE +#define F_LBTIPORIGA 175 // GESTITO DAL MOTORE +#define F_DESTIPODOC 176 // GESTITO DAL MOTORE +#define F_DESCF 177 // GESTITO DAL MOTORE +#define DLG_ELABORA 178 // GESTITO DAL MOTORE: bottone Elabora +#define F_ATTIVAANNO 179 // GESTITO DAL MOTORE #endif // veuml.h