Lavoro di matteo

git-svn-id: svn://10.65.10.50/trunk@2665 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
matteo 1996-03-05 16:48:04 +00:00
parent 7713a41a74
commit e91a2fc217
3 changed files with 48 additions and 22 deletions

View File

@ -138,7 +138,7 @@ void TRiga::carica_maschera( )
TToken_string riga = _pro->get( chiave, "HANDLERS" );
row_set_handler( *_mask, riga.get_int( 0 ), riga.get_int( 1 ) );
}
_mask->set_handler( FS_CODART, riga_art_handler );
// _mask->set_handler( FS_CODART, riga_art_handler );
}
void TRiga::load( const TRectype& rec )

View File

@ -246,6 +246,30 @@ bool TMotore_application::val_handler( TMask_field& f, KEY key )
return TRUE;
}
bool TMotore_application::elabora_handler( TMask_field& f, KEY key )
{
// Ottengo la maschera
// TMask& m = f.mask( );
// Registra il record corrente
// m.send_key( K_INS, 99 );
// TString commandline("ve4 ");
// commandline << m.get( F_CODNUM );
// commandline << " ";
// commandline << m.get( F_ANNO );
// commandline << " ";
// commandline << m.get( F_PROVV );
// commandline << " ";
// commandline << m.get( F_NDOC );
// TExternal_app interattivo( commandline );
// interattivo.run( );
// ricarica il documento dopo che l'interattivo lo ha modificato
// app( ).read( m );
return TRUE;
}
bool TMotore_application::occas_handler( TMask_field& f, KEY key )
{
@ -300,13 +324,7 @@ bool TMotore_application::tip_handler( TMask_field& f, KEY key )
}
if ( key == K_ENTER && m.is_running( ) )
{ TString tipo( f.get( ) );
if ( ! tipo.blank( ) )
{
TTable tabtip( "%TIP" );
tabtip.read( );
m.set( F_PROFILO, tabtip.get( "S4" ) );
}
else
if ( tipo.blank( ) )
{
message_box( "Occorre un tipo documento per inserire un documento!" );
m.first_focus( F_TIPODOC );
@ -343,7 +361,7 @@ bool TMotore_application::ndoc_handler( TMask_field& f, KEY key )
bool TMotore_application::clifo_handler( TMask_field& f, KEY key )
{
if ( key == K_TAB && f.active( ) )
if ( key == K_TAB && f.active( ) )
{
TMask& m = f.mask( );
@ -438,8 +456,10 @@ bool TMotore_application::changing_mask( int mode )
void TMotore_application::configura_sheet( TSheet_field& sheet, TConfig& config )
{
int marker[MAX_COLUMNS + 1];
int ncols = config.get_int( "NCOLS", "SHEET" );
for ( int i = 1; i <= ncols; i ++ )
for ( int i = 1; i <= MAX_COLUMNS; i ++ ) marker[ i ] = 0;
for ( i = 1; i <= ncols; i ++ )
{
TString col;
col.format( "%d", i );
@ -451,10 +471,11 @@ void TMotore_application::configura_sheet( TSheet_field& sheet, TConfig& config
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 );
marker[coltomove] = 1;
// sheet.move_column( coltomove, i );
}
for ( int j = MAX_COLUMNS; j >= i - 1; j -- )
sheet.delete_column( j );
for ( i = 1; i <= MAX_COLUMNS; i ++ )
if( !marker[ i ] ) sheet.delete_column( i );
}
void TMotore_application::get_edit_mask( const char * profilo )
@ -534,6 +555,7 @@ TMask* TMotore_application::get_mask( int mode )
edit_mask( ).set_handler( F_CODCF, clifo_handler );
edit_mask( ).set_handler( F_CODPAG, condpag_hndl );
edit_mask( ).set_handler( F_DATAINSC, condpag_hndl );
// edit_mask( ).set_handler( 99, elabora_handler );
return( _msk1 );
break;
default:
@ -647,9 +669,9 @@ int TMotore_application::read( TMask& m )
bool TMotore_application::check_key( TLocalisamfile& rdoc, TString16 codnum, bool provv, TString16 anno, TString16 ndoc )
{
return ( ( rdoc.get( "CODNUM" ) == codnum ) &&
( rdoc.get( "NDOC" ) == ndoc ) &&
( rdoc.get( "ANNO" ) == anno ) &&
( rdoc.get_bool( "PROVV" ) == provv ) );
( rdoc.get( "NDOC" ) == ndoc ) &&
( rdoc.get( "ANNO" ) == anno ) &&
( rdoc.get_bool( "PROVV" ) == provv ) );
}
int TMotore_application::write( const TMask& m )
@ -831,12 +853,14 @@ bool TMotore_application::user_create( )
{
query_mask( ).set( F_CODNUM, codnum );
query_mask( ).set( F_DESNUM, utente.get( "DESNUM", "ve" ) );
}
TString16 tipodoc( utente.get( "TIPODOC", "ve" ) );
if ( !tipodoc.blank( ) )
{
query_mask( ).set( F_TIPODOC, tipodoc );
// }
// TString16 tipodoc( utente.get( "TIPODOC", "ve" ) );
// if ( !tipodoc.blank( ) )
// {
TString16 profilo( utente.get( "PROFILO", "ve" ) );
query_mask( ).set( F_TIPODOC, utente.get( "TIPODOC", "ve" ) );
query_mask( ).set( F_DESTIPODOC, utente.get( "DESTIPODOC", "ve" ) );
query_mask( ).set( F_PROFILO, profilo );
}
// La maschera di inserimento/modifica per ora non la so!
// Viene letta dal profilo non appena trovato il record
@ -859,7 +883,8 @@ bool TMotore_application::user_destroy( )
utente.set( "CODNUM", query_mask( ).get( F_CODNUM ), "ve" );
utente.set( "TIPODOC", query_mask( ).get( F_TIPODOC ), "ve" );
utente.set( "DESNUM", query_mask( ).get( F_DESNUM ), "ve" );
utente.set( "DESTIPODOC", query_mask( ).get( F_DESTIPODOC ), "ve" );
utente.set( "DESTIPODOC", query_mask( ).get( F_DESTIPODOC ), "ve" );
utente.set( "PROFILO", query_mask( ).get( F_PROFILO ), "ve" );
// Se è ancora allocata, distruggo la maschera di modifica
if ( _msk1 ) delete _msk1;

View File

@ -228,6 +228,7 @@ protected:
static bool clifo_handler( TMask_field& f, KEY key );
static bool occas_handler( TMask_field& f, KEY key );
static bool val_handler( TMask_field& f, KEY key );
static bool elabora_handler( TMask_field& f, KEY key );
// Configurazione dello sheet dato il profilo
void configura_sheet( TSheet_field& sheet, TConfig& config );