Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento :Inserito controllo max numero pagine e max lunghezza git-svn-id: svn://10.65.10.50/trunk@13051 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
35eac83b4d
commit
d3f3c31928
@ -170,16 +170,28 @@ void TConfigurazioneIndustriale_app::file_to_sheet()
|
||||
void TConfigurazioneIndustriale_app::sheet_to_file()
|
||||
{
|
||||
TConfig configfile(CONFIG_DITTA, "ci");
|
||||
int totlen = 0;
|
||||
int items;
|
||||
|
||||
items = mask().items();
|
||||
configfile.remove_all();
|
||||
|
||||
if (items>_maxelem)
|
||||
{
|
||||
message_box("Il massimo numero di filtri gestibili è pari a %d, pertanto verranno considerate solamente le prime %d righe", _maxelem, _maxelem);
|
||||
items=16;
|
||||
}
|
||||
|
||||
for (int i=0;i<items;i++)
|
||||
{
|
||||
TString currdesc(mask().row(i).get(1));
|
||||
configfile.set("Filter", mask().row(i).get(0), NULL, true, i);
|
||||
configfile.set("Descr", mask().row(i).get(1), NULL, true, i);
|
||||
configfile.set("Descr", currdesc, NULL, true, i);
|
||||
totlen+=currdesc.len();
|
||||
}
|
||||
|
||||
if (totlen>_maxlen)
|
||||
message_box("E' probabile che la lunghezza delle descrizioni inserite ne impedisca la totale visualizzazione sullo schermo");
|
||||
|
||||
}
|
||||
|
||||
|
12
ci/ci0300.h
12
ci/ci0300.h
@ -9,9 +9,6 @@
|
||||
|
||||
class TConfigurazioneIndustriale_mask : public TAutomask
|
||||
{
|
||||
private:
|
||||
int _maxelem;
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
@ -29,7 +26,7 @@ public:
|
||||
TToken_string& row(int i) { return sheet().row(i); }
|
||||
|
||||
public:
|
||||
TConfigurazioneIndustriale_mask(int maxelem = 16) : TAutomask("ci0300a"), _maxelem(maxelem) {}
|
||||
TConfigurazioneIndustriale_mask() : TAutomask("ci0300a") {}
|
||||
};
|
||||
|
||||
|
||||
@ -39,8 +36,11 @@ public:
|
||||
|
||||
class TConfigurazioneIndustriale_app: public TSkeleton_application
|
||||
{
|
||||
private:
|
||||
TConfigurazioneIndustriale_mask* _mask;
|
||||
|
||||
int _maxelem;
|
||||
int _maxlen;
|
||||
|
||||
private:
|
||||
void file_to_sheet();
|
||||
void sheet_to_file();
|
||||
@ -54,7 +54,7 @@ public:
|
||||
TConfigurazioneIndustriale_mask& mask() const {return *_mask; }
|
||||
|
||||
public:
|
||||
TConfigurazioneIndustriale_app() {}
|
||||
TConfigurazioneIndustriale_app(int maxelem = 16, int maxlen = 100) : _maxelem(maxelem), _maxlen(maxlen) {}
|
||||
virtual ~TConfigurazioneIndustriale_app() {}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user