Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 patch 1262 git-svn-id: svn://10.65.10.50/trunk@17631 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			123 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			123 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include <varmask.h>       
 | 
						|
              
 | 
						|
const TString& TVariable_mask::get(short fld_id) const
 | 
						|
{
 | 
						|
   if (present( fld_id ))
 | 
						|
     return TMask::get( fld_id );
 | 
						|
   else     
 | 
						|
     return EMPTY_STRING;
 | 
						|
}
 | 
						|
 | 
						|
void TVariable_mask::set_handler(short fld_id, CONTROL_HANDLER handler)
 | 
						|
{
 | 
						|
  if(present( fld_id ))
 | 
						|
    TMask::set_handler( fld_id, handler );
 | 
						|
}               
 | 
						|
 | 
						|
void TVariable_mask::set(short fld_id, const char* str, byte hit)
 | 
						|
{
 | 
						|
  if(present( fld_id ))
 | 
						|
    TMask::set( fld_id, str, hit );
 | 
						|
}
 | 
						|
 | 
						|
void TVariable_mask::show(short fld_id, bool on )
 | 
						|
{
 | 
						|
  if(fld_id < 0 || present( fld_id ) )
 | 
						|
    TMask::show( fld_id, on );
 | 
						|
}
 | 
						|
 
 | 
						|
void TVariable_mask::reset(short fld_id)
 | 
						|
{
 | 
						|
  if(fld_id <= 0 || present( fld_id ) )
 | 
						|
    TMask::reset( fld_id);
 | 
						|
}
 | 
						|
 
 | 
						|
void TVariable_mask::enable(short fld_id, bool on )
 | 
						|
{
 | 
						|
  if(fld_id < 0 ||present( fld_id ))
 | 
						|
    TMask::enable( fld_id, on );
 | 
						|
}
 | 
						|
 | 
						|
void TVariable_mask::check_field( short fld_id )
 | 
						|
{
 | 
						|
  if (present( fld_id ))
 | 
						|
    TMask::check_field(fld_id);
 | 
						|
}
 | 
						|
 | 
						|
TMask_field* TVariable_mask::parse_field(TScanner& scanner)
 | 
						|
{
 | 
						|
  if (scanner.key() == "SP")
 | 
						|
    return new TVariable_sheet_field(this);
 | 
						|
 | 
						|
  return TMask::parse_field(scanner);
 | 
						|
}
 | 
						|
 | 
						|
TVariable_mask::TVariable_mask(const char* name, int num, int max) : TMask()
 | 
						|
{
 | 
						|
  if (name && *name)
 | 
						|
    read_mask(name, num, max);
 | 
						|
}
 | 
						|
 | 
						|
TVariable_mask::TVariable_mask() : TMask()
 | 
						|
{
 | 
						|
}
 | 
						|
 | 
						|
TMask& TVariable_sheet_field::sheet_mask() const
 | 
						|
{ 
 | 
						|
	return sheet_row_mask(selected());
 | 
						|
}                                  
 | 
						|
 
 | 
						|
TMask& TVariable_sheet_field::sheet_row_mask(int row) const
 | 
						|
{ 
 | 
						|
  TMask & m = TSheet_field::sheet_mask();
 | 
						|
 | 
						|
  if (_getmask != NULL && row >= 0 && row < items())
 | 
						|
  {
 | 
						|
    TMask & vm = *_getmask(row, m);
 | 
						|
    
 | 
						|
    vm.set_sheet((TSheet_field *) this);
 | 
						|
    return vm;
 | 
						|
  }
 | 
						|
  return m;
 | 
						|
} 
 | 
						|
 | 
						|
void TVariable_sheet_field::post_insert(int r)
 | 
						|
{ 
 | 
						|
  if (!active() || _getmask == NULL || r < 0 || r >= items())
 | 
						|
    return;
 | 
						|
  const TMask& m =  *_getmask(r, TSheet_field::sheet_mask());
 | 
						|
 | 
						|
  for (short id = FIRST_FIELD; id <= _last_column_id ; id++)
 | 
						|
  {                                 
 | 
						|
    const int col = cid2index(id);
 | 
						|
    if (column_enabled(col))
 | 
						|
    {
 | 
						|
      int pos = m.id2pos(id);
 | 
						|
                   
 | 
						|
      if (pos >= 0)
 | 
						|
      {  
 | 
						|
        for(int dlg = id; pos >= 0; pos = m.id2pos(dlg += 100))
 | 
						|
        {
 | 
						|
          const TMask_field& f = m.fld(pos);
 | 
						|
          if (f.shown() || f.ghost())
 | 
						|
          {       
 | 
						|
            const bool on = f.enabled();
 | 
						|
            enable_cell(r, col, on);
 | 
						|
          }  
 | 
						|
          break;
 | 
						|
        }  
 | 
						|
      }
 | 
						|
      else
 | 
						|
        disable_cell(r, col);
 | 
						|
    }
 | 
						|
  }
 | 
						|
}                                  
 | 
						|
 
 | 
						|
TVariable_sheet_field::~TVariable_sheet_field()
 | 
						|
{ 
 | 
						|
  TSheet_field::sheet_mask();
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
 |