Files correlati : f90100.cpp f90100d.uml f90104.sql Commento: Aggiornamenti sostanziali al programma di Archiviazione Passiva. Il funzionamento è rimasto lo stesso della versione precedente ma il giro interno del programma è stato rivisto e migliorato (si spera)
108 lines
3.6 KiB
C++
Executable File
108 lines
3.6 KiB
C++
Executable File
#ifndef __AUTOMASK_H
|
|
#define __AUTOMASK_H
|
|
|
|
#ifndef __DEFMASK_H
|
|
#include <defmask.h>
|
|
#endif
|
|
|
|
#ifndef __MSKSHEET_H
|
|
#include <msksheet.h>
|
|
#endif
|
|
|
|
#ifndef __VARMASK_H
|
|
#include <varmask.h>
|
|
#endif
|
|
|
|
|
|
enum TField_event { fe_null = 0,
|
|
fe_init, fe_modify, fe_button, fe_close,
|
|
fe_magic, fe_info, fe_edit,
|
|
se_enter = 10, se_leave,
|
|
se_query_modify, se_notify_modify,
|
|
se_query_add, se_notify_add,
|
|
se_query_del, se_notify_del };
|
|
|
|
class TAutomask : public TMask
|
|
{
|
|
private:
|
|
static bool universal_handler(TMask_field& f, KEY k);
|
|
static bool insheet_universal_handler(TMask_field& f, KEY k);
|
|
static bool universal_notifier(TSheet_field& f, int row, KEY k);
|
|
|
|
protected:
|
|
TField_event key2event(TMask_field& f, KEY key) const;
|
|
|
|
public:
|
|
void set_handlers();
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) pure;
|
|
bool error_box(const char* fmt, ...); // No more f.error_box
|
|
void set_universal_handler(const short id) { set_handler(id, universal_handler);}
|
|
void set_insheet_universal_handler(const short sid, const short id) { sfield(sid).sheet_mask().set_handler(id, insheet_universal_handler);}
|
|
|
|
TAutomask() { }
|
|
TAutomask(const char* name, int num = 0);
|
|
TAutomask(const char* title, int pages, int cols, int rows, int xpos = -1, int ypos = -1);
|
|
virtual ~TAutomask() { }
|
|
};
|
|
|
|
class TVariable_automask : public TVariable_mask
|
|
{
|
|
private:
|
|
static bool universal_handler(TMask_field& f, KEY k);
|
|
static bool insheet_universal_handler(TMask_field& f, KEY k);
|
|
static bool universal_notifier(TSheet_field& f, int row, KEY k);
|
|
|
|
protected:
|
|
void set_handlers();
|
|
TField_event key2event(TMask_field& f, KEY key) const;
|
|
|
|
public:
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) pure;
|
|
bool error_box(const char* fmt, ...); // No more f.error_box
|
|
void set_universal_handler(const short id) { set_handler(id, universal_handler);}
|
|
void set_insheet_universal_handler(const short sid, const short id) { sfield(sid).sheet_mask().set_handler(id, insheet_universal_handler);}
|
|
|
|
TVariable_automask() { }
|
|
TVariable_automask(const char* name, int num = 0);
|
|
virtual ~TVariable_automask() { }
|
|
};
|
|
|
|
class TSimpleAutomask : public TAutomask
|
|
{
|
|
public:
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) {return true;}
|
|
TSimpleAutomask() { }
|
|
TSimpleAutomask(const char* name, int num = 0) : TAutomask(name, num) { }
|
|
virtual ~TSimpleAutomask() { }
|
|
};
|
|
|
|
class TSimpleVariableAutomask : public TVariable_automask
|
|
{
|
|
public:
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) { return true; }
|
|
TSimpleVariableAutomask() { }
|
|
TSimpleVariableAutomask(const char* name, int num = 0) : TVariable_automask(name, num) { }
|
|
virtual ~TSimpleVariableAutomask() { }
|
|
};
|
|
|
|
class TIBAN_mask : public TAutomask
|
|
{
|
|
TString _last_iso;
|
|
short _stato, _check, _cin, _abi, _cab, _conto, _iban, _bban, _desban;
|
|
int _pres;
|
|
|
|
protected:
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
|
|
|
public:
|
|
|
|
TIBAN_mask(const char *name, short stato, short check, short cin, short abi,
|
|
short cab, short conto, short iban, short bban = -1,
|
|
short desban = -1, int pres = 0)
|
|
: TAutomask(name), _stato(stato), _check(check), _cin(cin), _abi(abi),
|
|
_cab(cab), _conto(conto), _iban(iban), _bban(bban), _desban(desban),
|
|
_pres(pres) {}
|
|
};
|
|
|
|
#endif
|