4df65915b0
git-svn-id: svn://10.65.10.50/trunk@2900 c028cbd2-c16b-5b4b-a496-9718f37d4682
80 lines
1.6 KiB
C++
Executable File
80 lines
1.6 KiB
C++
Executable File
#include <varmask.h>
|
|
#include <utility.h>
|
|
|
|
const TString& TVariable_mask::get(short fld_id) const
|
|
{
|
|
if (present( fld_id ))
|
|
return TMask::get( fld_id );
|
|
else
|
|
return "";
|
|
}
|
|
|
|
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, bool hit )
|
|
{
|
|
if(present( fld_id ))
|
|
TMask::set( fld_id, str, hit );
|
|
}
|
|
|
|
void TVariable_mask::show(short fld_id, bool on )
|
|
{
|
|
if(present( fld_id ) )
|
|
TMask::show( fld_id, on );
|
|
}
|
|
|
|
void TVariable_mask::enable(short fld_id, bool on )
|
|
{
|
|
if(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")
|
|
{
|
|
_sheets++;
|
|
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);
|
|
}
|
|
|
|
|
|
TMask& TVariable_sheet_field::sheet_mask() const
|
|
{
|
|
TMask& m = TSheet_field::sheet_mask();
|
|
const int current = selected();
|
|
|
|
if (_getmask != NULL && current >= 0 && current < items())
|
|
return *_getmask(current, m, FALSE);
|
|
return m;
|
|
}
|
|
|
|
TVariable_sheet_field::~TVariable_sheet_field()
|
|
{
|
|
TMask & m = TSheet_field::sheet_mask();
|
|
if (_getmask != NULL)
|
|
_getmask(0, m, TRUE); // Distrugge la maschera customizzata
|
|
}
|
|
|
|
|
|
|