22acefebe8
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@17362 c028cbd2-c16b-5b4b-a496-9718f37d4682
105 lines
2.0 KiB
C++
Executable File
105 lines
2.0 KiB
C++
Executable File
#include <confapp.h>
|
|
#include <msksheet.h>
|
|
#include <relation.h>
|
|
|
|
#include "lv0300a.h"
|
|
|
|
class TConf_Lavanderie : public TConfig_application
|
|
{
|
|
protected:
|
|
virtual void load_mask();
|
|
virtual void save_mask(bool tosave) ;
|
|
virtual bool user_create( );
|
|
|
|
public:
|
|
TConf_Lavanderie() : TConfig_application( CONFIG_DITTA ){ }
|
|
virtual ~TConf_Lavanderie( ){ }
|
|
};
|
|
|
|
bool TConf_Lavanderie::user_create( )
|
|
{
|
|
TConfig conf(CONFIG_DITTA );
|
|
conf.set( "EdMask", "lv0300a", "lv" );
|
|
return true;
|
|
}
|
|
|
|
void TConf_Lavanderie::load_mask()
|
|
{
|
|
TMask* m=get_mask();
|
|
if (m==NULL)
|
|
return;
|
|
|
|
TConfig_application::load_mask();
|
|
FOR_EACH_MASK_SHEET((*m), i, s)
|
|
{
|
|
s->destroy();
|
|
TMask& sm=s->sheet_mask();
|
|
|
|
bool found=true;
|
|
for (int r=0; found ;r++)
|
|
{
|
|
FOR_EACH_MASK_FIELD(sm,j,f)
|
|
{
|
|
const TFieldref* fr=f->field();
|
|
if(fr!=NULL)
|
|
{
|
|
const TString& value=get_config()->get(fr->name(),NULL,r);
|
|
if (value.empty() && f->dlg()==101 )
|
|
{
|
|
found=false;
|
|
break;
|
|
}
|
|
s->row(r).add(value,s->cid2index(f->dlg()));
|
|
}
|
|
}
|
|
if (found)
|
|
s->check_row(r, 1);
|
|
}
|
|
s->force_update();
|
|
}
|
|
}
|
|
|
|
void TConf_Lavanderie::save_mask(bool tosave)
|
|
{
|
|
TConfig* cnf = get_config();
|
|
if (!tosave || cnf==NULL)
|
|
return;
|
|
|
|
TAssoc_array& v = cnf->list_variables("lv");
|
|
|
|
TConfig_application::save_mask(tosave);
|
|
|
|
FOR_EACH_ASSOC_STRING(v, h, k, str)
|
|
{
|
|
const TFixed_string name = k;
|
|
if (name.find('(') > 0)
|
|
v.remove(name);
|
|
}
|
|
|
|
TMask& m=*get_mask();
|
|
FOR_EACH_MASK_SHEET(m, i, s)
|
|
{
|
|
TMask& sm=s->sheet_mask();
|
|
FOR_EACH_SHEET_ROW(*s,j,row)
|
|
{
|
|
FOR_EACH_MASK_FIELD(sm,k,f)
|
|
{
|
|
const TFieldref* fr = f->field();
|
|
if (fr!=NULL)
|
|
{
|
|
const char* value=row->get(s->cid2index(f->dlg()));
|
|
cnf->set(fr->name(),value, NULL,true,j);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
int lv0300(int argc, char* argv[])
|
|
{
|
|
TConf_Lavanderie appc;
|
|
appc.run(argc, argv, TR("Parametri Lavanderie industriali"));
|
|
return 0;
|
|
} |