Aggiunta documentazione in linea
git-svn-id: svn://10.65.10.50/trunk@2546 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a17eaa542a
commit
41a0596be2
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#define BITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
|
#define BITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Metodi di accesso globali all'applicazione corrente
|
// Metodi di accesso globali all'applicazione corrente
|
||||||
@ -33,13 +34,23 @@
|
|||||||
|
|
||||||
HIDDEN TApplication* _application = NULL;
|
HIDDEN TApplication* _application = NULL;
|
||||||
|
|
||||||
|
// @func Ritorna l'applicazione in corso
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna il reference all'applicazione in corso
|
||||||
TApplication& main_app()
|
TApplication& main_app()
|
||||||
{
|
{
|
||||||
CHECK(_application, "NULL application!");
|
CHECK(_application, "NULL application!");
|
||||||
return *_application;
|
return *_application;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool xvt_running() { return _application != NULL; }
|
// @func Controlla se si sta eseguendo xvt
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna i seguenti valori:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Se se e' stata definita una <c TApplication>
|
||||||
|
// @flag FALSE | Se se non e' stata definita una <c TApplication>
|
||||||
|
bool xvt_running()
|
||||||
|
{ return _application != NULL; }
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Gestione dello sfondo della finestra principale
|
// Gestione dello sfondo della finestra principale
|
||||||
@ -379,7 +390,14 @@ void TApplication::set_perms()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TApplication::check_parameters(int & argc, char* argv[])
|
// @mfunc Legge il parametro /uUTENTE e lo toglie dalla lista
|
||||||
|
void TApplication::check_parameters(
|
||||||
|
int & argc, // @parm Numero del parametro da controllare
|
||||||
|
char* argv[]) // @parm Array di paramentri da passare all'applicazione
|
||||||
|
|
||||||
|
// @comm Nel caso si identifichi che il paramentro <p argc> sia il nome dell'utente
|
||||||
|
// si setta la variabile col nome dell'utente, altrimenti l'utente diventa PRASSI,
|
||||||
|
// e si diminuisce di uno il numero di argomenti da passare.
|
||||||
{
|
{
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
@ -401,7 +419,13 @@ void TApplication::check_parameters(int & argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TApplication::run(int argc, char* argv[], const char* title)
|
// @mfunc Fa partire l'applicazione
|
||||||
|
void TApplication::run(
|
||||||
|
int argc, // @parm Numero deglia argomenti da passara all'applicazione
|
||||||
|
char* argv[], // @parm Argomenti da passare all'applicazione
|
||||||
|
const char* title) // @parm Titolo dell'applicazione
|
||||||
|
|
||||||
|
// @comm E' in questa fase che si controlla se esiste la chiave e' attaccata
|
||||||
{
|
{
|
||||||
TFilename base(argv[0]);
|
TFilename base(argv[0]);
|
||||||
base.ext(""); base.lower();
|
base.ext(""); base.lower();
|
||||||
@ -489,7 +513,14 @@ void TApplication::uncheck_menu_item(MENU_TAG item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TApplication::enable_menu_item(MENU_TAG item, bool on)
|
// @mfunc Permette di abilitare/disabilitare una voce di menu'
|
||||||
|
void TApplication::enable_menu_item(
|
||||||
|
MENU_TAG item, // @parm Voce del menu' da abilitare/disabilitare
|
||||||
|
bool on) // @parm Operazione da svolgere sulla voce del menu':
|
||||||
|
//
|
||||||
|
// @flag TRUE | Viene abilitata la voce del menu'
|
||||||
|
// @flag FALSE | Viene disabilitata la voce del menu'
|
||||||
|
|
||||||
{
|
{
|
||||||
xvt_menu_set_item_enabled(TASK_WIN, item, on);
|
xvt_menu_set_item_enabled(TASK_WIN, item, on);
|
||||||
xvt_menu_update(TASK_WIN);
|
xvt_menu_update(TASK_WIN);
|
||||||
@ -585,13 +616,16 @@ bool TApplication::set_firm(long newfirm)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @mfunc Gestisce le voci di configurazione
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna TRUE se sono state cambiate delle voci
|
||||||
bool TApplication::config()
|
bool TApplication::config()
|
||||||
// gestisce le voci di configurazione
|
|
||||||
// le si passa il file in cui cercare il proprio
|
// @comm Le si passa il file in cui cercare il proprio paragrafo (comunque relativo
|
||||||
// paragrafo (comunque relativo alla ditta)
|
// alla ditta) se non c'e', viene creato copiando il default la variabile EdMask
|
||||||
// se non c'e', viene creato copiando il default
|
// di quel paragrafo specifica la maschera da usare.
|
||||||
// la variabile EdMask di quel paragrafo specifica
|
|
||||||
// la maschera da usare
|
|
||||||
{
|
{
|
||||||
TConfig cnf(CONFIG_DITTA);
|
TConfig cnf(CONFIG_DITTA);
|
||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
@ -642,7 +676,12 @@ bool TApplication::config()
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TApplication::set_cursor(bool w)
|
// @mfunc Cambia il cursore del mouse
|
||||||
|
void TApplication::set_cursor(
|
||||||
|
bool w) // @parm Indica il tipo di cursore da utilizzare:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Cursore a clessidra per le wait
|
||||||
|
// @flag FALSE | Cursore a frecca normale
|
||||||
{
|
{
|
||||||
static int _count = 0;
|
static int _count = 0;
|
||||||
|
|
||||||
@ -661,9 +700,15 @@ void TApplication::set_cursor(bool w)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ritorna TRUE se al programma corrente e' concesso cambiare ditta da menu.
|
// @mfunc Controlla se al programma corrente e' concesso cambiare ditta da menu.
|
||||||
// Praticamente controlla se e' stato lanciato da ba0 o dal program manager
|
//
|
||||||
|
// @rdesc Ritoran i seguenti valori:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Se e' abilitata la voce di menu' per il cambio della ditta
|
||||||
|
// @flag FALSE | Se non e' possibile cambiare ditta da menu'
|
||||||
bool TApplication::firm_change_enabled() const
|
bool TApplication::firm_change_enabled() const
|
||||||
|
|
||||||
|
// @comm Praticamente controlla se e' stato lanciato da ba0 o dal program manager
|
||||||
{
|
{
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
static bool can = 2;
|
static bool can = 2;
|
||||||
|
@ -9,9 +9,7 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @C
|
// @doc EXTERNAL
|
||||||
// Classe TApplication
|
|
||||||
// @END
|
|
||||||
|
|
||||||
#define MSG_AI "AI" // message auto_insert (relapp)
|
#define MSG_AI "AI" // message auto_insert (relapp)
|
||||||
#define MSG_FS "FS" // message filtered start (relapp)
|
#define MSG_FS "FS" // message filtered start (relapp)
|
||||||
@ -20,97 +18,181 @@
|
|||||||
#define CHK_DONGLE 0 // dongle authorization checks
|
#define CHK_DONGLE 0 // dongle authorization checks
|
||||||
#define CHK_USER 1 // user authorization checks
|
#define CHK_USER 1 // user authorization checks
|
||||||
|
|
||||||
|
|
||||||
|
// @class TApplication | Classe per la gestione di tutte le applicazioni PRASSI
|
||||||
class TApplication
|
class TApplication
|
||||||
|
|
||||||
|
// @author:(INTERNAL) Guido
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @cmember Identificatore del menu' legato all'applicazione
|
||||||
int _bar;
|
int _bar;
|
||||||
|
// @cmember Numero di argomenti passati all'applicazione
|
||||||
int __argc;
|
int __argc;
|
||||||
|
// @cmember Array di argomenti passati all'applicazione
|
||||||
const char** __argv;
|
const char** __argv;
|
||||||
|
// @cmember Array di autorizzazione concessa della chiavi
|
||||||
TBit_array _dongle_aut;
|
TBit_array _dongle_aut;
|
||||||
|
// @cmember Array di autorizzazione concessa all'utente
|
||||||
TBit_array _user_aut;
|
TBit_array _user_aut;
|
||||||
|
|
||||||
TString80 _name, _title;
|
// @cmember Nome dell'applicazione
|
||||||
|
TString80 _name;
|
||||||
|
// @cmember Titolo della finestra
|
||||||
|
TString80 _title;
|
||||||
|
|
||||||
|
// @cmember Codice della ditta
|
||||||
long _savefirm;
|
long _savefirm;
|
||||||
bool _create_ok; // Succesfully created
|
// @cmember Indica se e' stata creata con successo
|
||||||
|
bool _create_ok;
|
||||||
|
// @cmember Handle del modulo del programma di cui si sta attendendo la fine
|
||||||
word _waiting;
|
word _waiting;
|
||||||
|
|
||||||
void terminate(); // End of application
|
// @cmember Termine dell'applicazione
|
||||||
void set_cursor(bool w); // Change mouse cursor
|
void terminate();
|
||||||
bool config(); // Change parameters
|
// @cmember Cambia il cursore del mouse
|
||||||
void about() const; // About box
|
void set_cursor(bool w);
|
||||||
|
// @cmember Gestisce le voci di configurazione
|
||||||
|
bool config();
|
||||||
|
// @cmember About box: risposta alla opzione Informazioni del menu File
|
||||||
|
void about() const;
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember Ritorna il nome del modulo dell'applicazione
|
||||||
const char* get_module_name() const;
|
const char* get_module_name() const;
|
||||||
|
// @cmember Event handler della finestra principale del programma
|
||||||
static long XVT_CALLCONV1 task_eh(WINDOW win, EVENT* ep);
|
static long XVT_CALLCONV1 task_eh(WINDOW win, EVENT* ep);
|
||||||
|
|
||||||
|
// @cmember Handler degli eventi della finestra principale, chiamato da <mf TApplication::task_eh>
|
||||||
virtual long handler(WINDOW win, EVENT* ep);
|
virtual long handler(WINDOW win, EVENT* ep);
|
||||||
virtual bool extended_firm() const { return FALSE; } // Extended set_firm dialog box
|
// @cmember Estende il dialog box della set_firm
|
||||||
virtual bool use_files() const { return TRUE; }
|
virtual bool extended_firm() const
|
||||||
|
{ return FALSE; }
|
||||||
|
// @cmember Indica se si intendono usare i files DBF
|
||||||
|
virtual bool use_files() const
|
||||||
|
{ return TRUE; }
|
||||||
|
|
||||||
virtual bool create(); // Crea la finestra principale
|
// @cmember Crea la finestra principale
|
||||||
virtual bool menu(MENU_TAG) { return TRUE; } // Controlla il menu
|
virtual bool create();
|
||||||
virtual bool build_firm_data(long cod, bool flagcom = FALSE) { return TRUE;}
|
// @cmember Controlla il menu
|
||||||
virtual bool destroy(); // Rimuove l'applicazione
|
virtual bool menu(MENU_TAG)
|
||||||
|
{ return TRUE; }
|
||||||
|
// @cmember Chiamata ogni volta che viene cambiata una ditta
|
||||||
|
virtual bool build_firm_data(long cod, bool flagcom = FALSE)
|
||||||
|
{ return TRUE;}
|
||||||
|
// @cmember Rimuove l'applicazione
|
||||||
|
virtual bool destroy();
|
||||||
|
|
||||||
|
// @cmember Chiamata ogni volta che l'utente usa il menu Cambia Parametri
|
||||||
virtual void on_config_change();
|
virtual void on_config_change();
|
||||||
|
// @cmember Chiamata ogni volta che l'utente cambia ditta
|
||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
|
|
||||||
|
// @cmember Setta i permessi di utilizzo dei moduli
|
||||||
void set_perms();
|
void set_perms();
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @cmember Modifca la barra dei menu' inserendo la <p menubar>
|
||||||
|
void setbar(int menubar)
|
||||||
void setbar(int menubar) { _bar = menubar;} // Modifica la menu-bar
|
{ _bar = menubar;}
|
||||||
|
// @cmember Fa partire l'applicazione
|
||||||
void run(int argc, char* argv[], const char* name);
|
void run(int argc, char* argv[], const char* name);
|
||||||
|
|
||||||
// @DES Queste funzioni possono essere ridefinite da ogni applicazione
|
// @comm Queste funzioni possono essere ridefinite da ogni applicazione
|
||||||
// @FPUB
|
//
|
||||||
virtual word class_id() const { return CLASS_APPLICATION; }
|
// @cmember Ritorna l'identificatore della classe
|
||||||
virtual bool ok() const { return _create_ok; }
|
virtual word class_id() const
|
||||||
|
{ return CLASS_APPLICATION; }
|
||||||
|
// @cmember Controlla se si tratta di una applicazione valida
|
||||||
|
virtual bool ok() const
|
||||||
|
{ return _create_ok; }
|
||||||
|
// @cmember Risposta alla selezione Stampa del menu File
|
||||||
virtual void print();
|
virtual void print();
|
||||||
|
// @cmember Controlla se al programma corrente e' concesso cambiare ditta da menu.
|
||||||
virtual bool firm_change_enabled() const;
|
virtual bool firm_change_enabled() const;
|
||||||
virtual const char * extra_modules() const {return "";}
|
// @cmember Ritorna la <c TToken_string> con la lista dei moduli cui appartiene il programma
|
||||||
|
virtual const char * extra_modules() const
|
||||||
|
{return "";}
|
||||||
|
|
||||||
void stop_run(); // Forza chiusura applicazione
|
// @cmember Forza la chiusura dell'applicazione
|
||||||
|
void stop_run();
|
||||||
|
|
||||||
void check_menu_item(MENU_TAG item); // Check menu
|
// @cmember Mette il segno Check a fianco di una voce di menu
|
||||||
void uncheck_menu_item(MENU_TAG item); // Uncheck
|
void check_menu_item(MENU_TAG item);
|
||||||
|
// @cmember Toglie il segno Check a fianco di una voce di menu
|
||||||
|
void uncheck_menu_item(MENU_TAG item);
|
||||||
|
// @cmember Permette di abilitare/disabilitare una voce di menu'
|
||||||
void enable_menu_item(MENU_TAG item, bool on = TRUE);
|
void enable_menu_item(MENU_TAG item, bool on = TRUE);
|
||||||
void disable_menu_item(MENU_TAG item) { enable_menu_item(item, FALSE); }
|
// @cmember Permette di disabilitare una voce di menu' (chiama <mf TApplication::enable_menu_item>)
|
||||||
|
void disable_menu_item(MENU_TAG item)
|
||||||
|
{ enable_menu_item(item, FALSE); }
|
||||||
|
// @cmember Simula la selezione di una voce di menu
|
||||||
void dispatch_e_menu(MENU_TAG item);
|
void dispatch_e_menu(MENU_TAG item);
|
||||||
|
|
||||||
const TString& name() const { return _name; }
|
// @cmember Ritorna il nome dell'applicazione
|
||||||
const char** argv() const { return __argv; }
|
const TString& name() const
|
||||||
|
{ return _name; }
|
||||||
|
// @cmember Ritorna l'array di paramentri da passara all'applicazione
|
||||||
|
const char** argv() const
|
||||||
|
{ return __argv; }
|
||||||
|
// @cmember Ritroan il paramentro <p i>-esimo da passare all'applicazione
|
||||||
const char* argv(int i) const { return __argv[i]; }
|
const char* argv(int i) const { return __argv[i]; }
|
||||||
int argc() const { return __argc; }
|
// @cmember Ritorna il numero di paramentri da passare all'applicazione
|
||||||
|
int argc() const
|
||||||
|
{ return __argc; }
|
||||||
|
|
||||||
void set_title(const char* t) { _title = t; }
|
// @cmember Setta il titolo da assegnare all'applicazione
|
||||||
const TString& title() const { return _title; }
|
void set_title(const char* t)
|
||||||
|
{ _title = t; }
|
||||||
|
// @cmember Ritorna il titolo da assegnare all'applicazione
|
||||||
|
const TString& title() const
|
||||||
|
{ return _title; }
|
||||||
|
|
||||||
|
// @cmember static void | check_parameters | int & argc, char *argv[] |
|
||||||
|
// Legge il parametro /uUTENTE e lo toglie dalla lista
|
||||||
static void check_parameters(int& argc, char *argv[]);
|
static void check_parameters(int& argc, char *argv[]);
|
||||||
|
|
||||||
|
// @cmember Controlla se il modulo <p module> ha l'autorizzazione all'esecuzione
|
||||||
bool has_module(int module, int checktype = CHK_ALL) const;
|
bool has_module(int module, int checktype = CHK_ALL) const;
|
||||||
|
// @cmember Setta la ditta corrente (Ritorna se ce l'ha fatta)
|
||||||
bool set_firm(long cod = -1);
|
bool set_firm(long cod = -1);
|
||||||
|
// @cmember Ritorna la ditta corrente
|
||||||
long get_firm() const;
|
long get_firm() const;
|
||||||
|
// @cmember Ritorna la directory in cui si trovano i dati della ditta corrente
|
||||||
const char* get_firm_dir() const;
|
const char* get_firm_dir() const;
|
||||||
|
|
||||||
void wait_for(word taskid) { _waiting = taskid; }
|
// @cmember Attende la fine del modulo con handle <p taskid>
|
||||||
void wake_up() { _waiting = 0xFFFF; }
|
void wait_for(word taskid)
|
||||||
word waiting() const { return _waiting; }
|
{ _waiting = taskid; }
|
||||||
|
// @cmember Interrompe lo stato di attesa
|
||||||
|
void wake_up()
|
||||||
|
{ _waiting = 0xFFFF; }
|
||||||
|
// @cmember Ritorna l'handle del task di cui l'applicazione e' in attesa
|
||||||
|
word waiting() const
|
||||||
|
{ return _waiting; }
|
||||||
|
|
||||||
void begin_wait() { set_cursor(TRUE); } // Set CURSOR_WAIT
|
// @cmember Setta il cursore a clessidra
|
||||||
void end_wait() { set_cursor(FALSE); } // Set CURSOR_ARROW
|
void begin_wait()
|
||||||
|
{ set_cursor(TRUE); }
|
||||||
|
// @cmember Setta il cursore standard
|
||||||
|
void end_wait()
|
||||||
|
{ set_cursor(FALSE); }
|
||||||
|
|
||||||
// Main window menu runtime interface
|
// @cmember Interfaccia runtime del menu' della finestra principale???
|
||||||
bool add_menu(TString_array& menu, MENU_TAG id = 0);
|
bool add_menu(TString_array& menu, MENU_TAG id = 0);
|
||||||
|
// @cmember Elimina il menu' <p id> (Ritorna se ce l'ha fatta???)
|
||||||
bool remove_menu(MENU_TAG id);
|
bool remove_menu(MENU_TAG id);
|
||||||
|
|
||||||
|
// @cmember Costruttore
|
||||||
TApplication();
|
TApplication();
|
||||||
|
// @cmember Distruttore
|
||||||
virtual ~TApplication();
|
virtual ~TApplication();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool xvt_running(); // xvt is running?
|
bool xvt_running();
|
||||||
TApplication& main_app();
|
TApplication& main_app();
|
||||||
|
|
||||||
#endif /* __APPLICATION_H */
|
#endif /* __APPLICATION_H */
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
//
|
//
|
||||||
// @type COMPARE_FUNCTION | Prototipo funzione di confronto tra elementi della
|
// @type COMPARE_FUNCTION | Prototipo funzione di confronto tra elementi della
|
||||||
// clsse <c TObject> da passare al metodo sort dei <c TArray>
|
// classe <c TObject> da passare al metodo sort dei <c TArray>
|
||||||
typedef (*COMPARE_FUNCTION)(const TObject**, const TObject**);
|
typedef (*COMPARE_FUNCTION)(const TObject**, const TObject**);
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
@ -17,6 +17,8 @@ extern "C"
|
|||||||
#define STRICT
|
#define STRICT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
// @doc INTERNAL
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TPicture_array
|
// TPicture_array
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -136,10 +138,17 @@ void xvt_draw_rect(WINDOW win, const RCT& rect, COLOR lt, COLOR rb, short depth)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Crea il controllo
|
||||||
void TControl::create(
|
void TControl::create(
|
||||||
short left, short top, short right, short bottom, const char* title,
|
short left, // @parm Coordinata X di posizionamento (in pixel)
|
||||||
WINDOW parent, long flags, long app_data, short id)
|
short top, // @parm Coordinata Y di posizionamento (in pixel)
|
||||||
|
short right, // @parm Larghezza (in pixel)
|
||||||
|
short bottom, // @parm Altezza (in pixel)
|
||||||
|
const char* title, // @parm Prompt
|
||||||
|
WINDOW parent, // @parm Handle della finestra a cui apprtiene il controllo
|
||||||
|
long flags, // @parm Flags di configurazione
|
||||||
|
long app_data, // @parm Puntatore all'oggetto <c TControl>
|
||||||
|
short id) // @parm Identificatore assegnato
|
||||||
{
|
{
|
||||||
bool bold = FALSE;
|
bool bold = FALSE;
|
||||||
_color = NORMAL_COLOR;
|
_color = NORMAL_COLOR;
|
||||||
@ -294,7 +303,11 @@ long XVT_CALLCONV1 TControl::handler(WINDOW win, EVENT* ep)
|
|||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TControl::enable(bool on)
|
// @mfunc Abilita/disabilita il controllo
|
||||||
|
void TControl::enable(
|
||||||
|
bool on) // @parm Operazione da svolgere sul controllo:
|
||||||
|
// @flag TRUE | Il controllo viene abilitato
|
||||||
|
// @flag FALSE | Il controllo viene disabilitato
|
||||||
{
|
{
|
||||||
if (on == disabled())
|
if (on == disabled())
|
||||||
{
|
{
|
||||||
@ -304,7 +317,11 @@ void TControl::enable(bool on)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TControl::check(bool on)
|
// @mfunc Setta se il controllo debba avere un check
|
||||||
|
void TControl::check(
|
||||||
|
bool on) // @parm Puo' assumere i seguenti valori:
|
||||||
|
// @flag TRUE | Se il controllo deve avere un check
|
||||||
|
// @flag FALSE | Se il controllo non deve avere un check
|
||||||
{
|
{
|
||||||
_checked = on;
|
_checked = on;
|
||||||
}
|
}
|
||||||
@ -958,13 +975,21 @@ void TCheckbox::update() const
|
|||||||
// User functions
|
// User functions
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// @func Permette di creare un Checkbox
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'handle del controllo creato
|
||||||
WINDOW xvt_create_checkbox(
|
WINDOW xvt_create_checkbox(
|
||||||
short left, short top, short right, short bottom,
|
short left, // @parm Coordinata X di posizionamento (in pixel)
|
||||||
const char* caption,
|
short top, // @parm Coordinata Y di posizionamento (in pixel)
|
||||||
WINDOW parent,
|
short right, // @parm Larghezza (in pixel)
|
||||||
long flags,
|
short bottom, // @parm Altezza (in pixel)
|
||||||
long app_data,
|
const char* caption, // @parm Prompt
|
||||||
int id)
|
WINDOW parent, // @parm Handle della finestra a cui apprtiene il controllo
|
||||||
|
long flags, // @parm Flags di configurazione
|
||||||
|
long app_data, // @parm Puntatore all'oggetto <c TControl>
|
||||||
|
int id) // @parm Identificatore assegnato
|
||||||
|
|
||||||
|
// @comm Il controllo si ditruggera' automagicamente alla fine della sua vita.
|
||||||
{
|
{
|
||||||
TCheckbox* cb = new TCheckbox(left, top, right, bottom,
|
TCheckbox* cb = new TCheckbox(left, top, right, bottom,
|
||||||
caption, parent,
|
caption, parent,
|
||||||
@ -975,13 +1000,21 @@ WINDOW xvt_create_checkbox(
|
|||||||
return cb->win();
|
return cb->win();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @func Permette di creare un Radiobutton
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'handle del controllo creato
|
||||||
WINDOW xvt_create_radiobutton(
|
WINDOW xvt_create_radiobutton(
|
||||||
short left, short top, short right, short bottom,
|
short left, // @parm Coordinata X di posizionamento (in pixel)
|
||||||
const char* caption,
|
short top, // @parm Coordinata Y di posizionamento (in pixel)
|
||||||
WINDOW parent,
|
short right, // @parm Larghezza (in pixel)
|
||||||
long flags,
|
short bottom, // @parm Altezza (in pixel)
|
||||||
long app_data,
|
const char* caption, // @parm Prompt
|
||||||
int id)
|
WINDOW parent, // @parm Handle della finestra a cui apprtiene il controllo
|
||||||
|
long flags, // @parm Flags di configurazione
|
||||||
|
long app_data, // @parm Puntatore all'oggetto <c TControl>
|
||||||
|
int id) // @parm Identificatore assegnato
|
||||||
|
|
||||||
|
// @comm Il controllo si ditruggera' automagicamente alla fine della sua vita.
|
||||||
{
|
{
|
||||||
flags |= CTL_FLAG_MULTIPLE;
|
flags |= CTL_FLAG_MULTIPLE;
|
||||||
TCheckbox* cb = new TCheckbox(left, top, right, bottom,
|
TCheckbox* cb = new TCheckbox(left, top, right, bottom,
|
||||||
@ -993,13 +1026,21 @@ WINDOW xvt_create_radiobutton(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @func Permette di creare un qualsiasi Bottone premibile
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'handle del controllo creato
|
||||||
WINDOW xvt_create_pushbutton(
|
WINDOW xvt_create_pushbutton(
|
||||||
short left, short top, short right, short bottom,
|
short left, // @parm Coordinata X di posizionamento (in pixel)
|
||||||
const char* caption,
|
short top, // @parm Coordinata Y di posizionamento (in pixel)
|
||||||
WINDOW parent,
|
short right, // @parm Larghezza (in pixel)
|
||||||
long flags,
|
short bottom, // @parm Altezza (in pixel)
|
||||||
long app_data,
|
const char* caption, // @parm Prompt
|
||||||
int id)
|
WINDOW parent, // @parm Handle della finestra a cui apprtiene il controllo
|
||||||
|
long flags, // @parm Flags di configurazione
|
||||||
|
long app_data, // @parm Puntatore all'oggetto <c TControl>
|
||||||
|
int id) // @parm Identificatore assegnato
|
||||||
|
|
||||||
|
// @comm Il controllo si ditruggera' automagicamente alla fine della sua vita.
|
||||||
{
|
{
|
||||||
TControl* pb;
|
TControl* pb;
|
||||||
|
|
||||||
@ -1027,13 +1068,21 @@ WINDOW xvt_create_pushbutton(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @func Permette di creare un campo di solo Testo
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'handle del controllo creato
|
||||||
WINDOW xvt_create_text(
|
WINDOW xvt_create_text(
|
||||||
short left, short top, short right, short bottom,
|
short left, // @parm Coordinata X di posizionamento (in pixel)
|
||||||
const char* caption,
|
short top, // @parm Coordinata Y di posizionamento (in pixel)
|
||||||
WINDOW parent,
|
short right, // @parm Larghezza (in pixel)
|
||||||
long flags,
|
short bottom, // @parm Altezza (in pixel)
|
||||||
long app_data,
|
const char* caption, // @parm Prompt
|
||||||
int id)
|
WINDOW parent, // @parm Handle della finestra a cui apprtiene il controllo
|
||||||
|
long flags, // @parm Flags di configurazione
|
||||||
|
long app_data, // @parm Puntatore all'oggetto <c TControl>
|
||||||
|
int id) // @parm Identificatore assegnato
|
||||||
|
|
||||||
|
// @comm Il controllo si ditruggera' automagicamente alla fine della sua vita.
|
||||||
{
|
{
|
||||||
TText* cb = new TText(left, top, right, bottom,
|
TText* cb = new TText(left, top, right, bottom,
|
||||||
caption, parent,
|
caption, parent,
|
||||||
@ -1043,13 +1092,21 @@ WINDOW xvt_create_text(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @func Permette di creare un Groupbox
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'handle del controllo creato
|
||||||
WINDOW xvt_create_groupbox(
|
WINDOW xvt_create_groupbox(
|
||||||
short left, short top, short right, short bottom,
|
short left, // @parm Coordinata X di posizionamento (in pixel)
|
||||||
const char* caption,
|
short top, // @parm Coordinata Y di posizionamento (in pixel)
|
||||||
WINDOW parent,
|
short right, // @parm Larghezza (in pixel)
|
||||||
long flags,
|
short bottom, // @parm Altezza (in pixel)
|
||||||
long app_data,
|
const char* caption, // @parm Prompt
|
||||||
int id)
|
WINDOW parent, // @parm Handle della finestra a cui apprtiene il controllo
|
||||||
|
long flags, // @parm Flags di configurazione
|
||||||
|
long app_data, // @parm Puntatore all'oggetto <c TControl>
|
||||||
|
int id) // @parm Identificatore assegnato
|
||||||
|
|
||||||
|
// @comm Il controllo si ditruggera' automagicamente alla fine della sua vita.
|
||||||
{
|
{
|
||||||
TGroup* cb = new TGroup(left, top, right, bottom,
|
TGroup* cb = new TGroup(left, top, right, bottom,
|
||||||
caption, parent,
|
caption, parent,
|
||||||
@ -1058,7 +1115,7 @@ WINDOW xvt_create_groupbox(
|
|||||||
return cb->win();
|
return cb->win();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @func Dealloca le bitmab utilizzate per i controlli
|
||||||
void free_controls_bmp()
|
void free_controls_bmp()
|
||||||
{
|
{
|
||||||
cpb.destroy();
|
cpb.destroy();
|
||||||
|
@ -11,8 +11,7 @@ WINDOW xvt_create_checkbox(
|
|||||||
WINDOW parent,
|
WINDOW parent,
|
||||||
long flags,
|
long flags,
|
||||||
long app_data,
|
long app_data,
|
||||||
int id
|
int id);
|
||||||
);
|
|
||||||
|
|
||||||
WINDOW xvt_create_radiobutton(
|
WINDOW xvt_create_radiobutton(
|
||||||
short left, short top, short right, short bottom,
|
short left, short top, short right, short bottom,
|
||||||
@ -20,8 +19,7 @@ WINDOW xvt_create_checkbox(
|
|||||||
WINDOW parent,
|
WINDOW parent,
|
||||||
long flags,
|
long flags,
|
||||||
long app_data,
|
long app_data,
|
||||||
int id
|
int id);
|
||||||
);
|
|
||||||
|
|
||||||
WINDOW xvt_create_pushbutton(
|
WINDOW xvt_create_pushbutton(
|
||||||
short left, short top, short right, short bottom,
|
short left, short top, short right, short bottom,
|
||||||
@ -29,8 +27,7 @@ WINDOW xvt_create_checkbox(
|
|||||||
WINDOW parent,
|
WINDOW parent,
|
||||||
long flags,
|
long flags,
|
||||||
long app_data,
|
long app_data,
|
||||||
int id
|
int id);
|
||||||
);
|
|
||||||
|
|
||||||
WINDOW xvt_create_text(
|
WINDOW xvt_create_text(
|
||||||
short left, short top, short right, short bottom,
|
short left, short top, short right, short bottom,
|
||||||
@ -38,8 +35,7 @@ WINDOW xvt_create_checkbox(
|
|||||||
WINDOW parent,
|
WINDOW parent,
|
||||||
long flags,
|
long flags,
|
||||||
long app_data,
|
long app_data,
|
||||||
int id
|
int id);
|
||||||
);
|
|
||||||
|
|
||||||
WINDOW xvt_create_groupbox(
|
WINDOW xvt_create_groupbox(
|
||||||
short left, short top, short right, short bottom,
|
short left, short top, short right, short bottom,
|
||||||
@ -47,8 +43,7 @@ WINDOW xvt_create_checkbox(
|
|||||||
WINDOW parent,
|
WINDOW parent,
|
||||||
long flags,
|
long flags,
|
||||||
long app_data,
|
long app_data,
|
||||||
int id
|
int id);
|
||||||
);
|
|
||||||
|
|
||||||
void free_controls_bmp();
|
void free_controls_bmp();
|
||||||
|
|
||||||
@ -56,55 +51,109 @@ WINDOW xvt_create_checkbox(
|
|||||||
// Custom control
|
// Custom control
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TControl
|
// @doc INTERNAL
|
||||||
{
|
|
||||||
WINDOW _win;
|
|
||||||
short _id;
|
|
||||||
TString _caption;
|
|
||||||
COLOR _color, _backcolor;
|
|
||||||
|
|
||||||
|
// @class TControl | Classe per la creazione di controlli personalizzati
|
||||||
|
class TControl
|
||||||
|
// @author:(INTERNAL) Guido
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
|
{
|
||||||
|
// @cmember Handle del controllo creato
|
||||||
|
WINDOW _win;
|
||||||
|
// @cmember Iedntificatore assegnato al cotrollo
|
||||||
|
short _id;
|
||||||
|
// @cmember Prompt del controllo
|
||||||
|
TString _caption;
|
||||||
|
// @cmember Colore di foreground del controllo
|
||||||
|
COLOR _color;
|
||||||
|
// @cmember Colore di background del controllo
|
||||||
|
COLOR _backcolor;
|
||||||
|
|
||||||
|
// @cmember Indica se il controllo e' disabilitato
|
||||||
bool _disabled : 1;
|
bool _disabled : 1;
|
||||||
|
// @cmember Indica se il controllo ha un check
|
||||||
bool _checked : 1;
|
bool _checked : 1;
|
||||||
|
// @cmember Indica se il controllo ha il focus
|
||||||
bool _focused : 1;
|
bool _focused : 1;
|
||||||
|
// @cmember Indica varie cose a seconda del tipo di controllo she si sta utilizzando
|
||||||
bool _multiple : 1;
|
bool _multiple : 1;
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember E' l'handler del controllo
|
||||||
static long XVT_CALLCONV1 handler(WINDOW win, EVENT* ep);
|
static long XVT_CALLCONV1 handler(WINDOW win, EVENT* ep);
|
||||||
|
|
||||||
void create(short left, short top, short right, short bottom,
|
// @cmember Crea il controllo
|
||||||
const char* caption,
|
void create(short left, short top, short right, short bottom, const char* caption, WINDOW parent, long flags, long app_data, short id);
|
||||||
WINDOW parent, long flags, long app_data, short id);
|
|
||||||
|
|
||||||
|
// @cmember Ridisegna il controllo a video
|
||||||
virtual void update() const pure;
|
virtual void update() const pure;
|
||||||
virtual void mouse_down(PNT) {};
|
// @cmember Chiamate ogni volta che viene premuto il mouse sul controllo
|
||||||
virtual void mouse_up() {};
|
virtual void mouse_down(PNT)
|
||||||
virtual WIN_TYPE type() const { return W_NO_BORDER; }
|
{};
|
||||||
|
// @cmember Chiamate ogni volta che viene rialsciato il mouse sul controllo
|
||||||
|
virtual void mouse_up()
|
||||||
|
{};
|
||||||
|
// @cmember Ritorna il tipo di finestra su cui si trova il controllo
|
||||||
|
virtual WIN_TYPE type() const
|
||||||
|
{ return W_NO_BORDER; }
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
// @cmember Ritorna il TControl dalla finestra del controllo
|
||||||
static TControl* WINDOW2TControl(WINDOW win);
|
static TControl* WINDOW2TControl(WINDOW win);
|
||||||
|
// @cmember Distruttore. Necessariamente virtuale per derivare altri distruttori
|
||||||
virtual ~TControl();
|
virtual ~TControl();
|
||||||
|
|
||||||
WINDOW win() const { return _win; }
|
// @cmember Ritorna l'handle del controllo
|
||||||
short id() const { return _id; }
|
WINDOW win() const
|
||||||
const char* caption() const { return _caption; }
|
{ return _win; }
|
||||||
|
// @cmember Ritorna l'identificatore assegnato al controllo
|
||||||
|
short id() const
|
||||||
|
{ return _id; }
|
||||||
|
// @cmember Ritorna il prompt del controllo
|
||||||
|
const char* caption() const
|
||||||
|
{ return _caption; }
|
||||||
|
// @cmember Setta il prompt del controllo
|
||||||
void set_caption(const char* c);
|
void set_caption(const char* c);
|
||||||
|
|
||||||
COLOR color() const { return _color; }
|
// @cmember Ritorna il colore di forground del controllo
|
||||||
void set_color(COLOR c) { _color = c; }
|
COLOR color() const
|
||||||
|
{ return _color; }
|
||||||
|
// @cmember Setta il colore di forground del controllo
|
||||||
|
void set_color(COLOR c)
|
||||||
|
{ _color = c; }
|
||||||
|
|
||||||
COLOR back_color() const { return _backcolor; }
|
// @cmember Ritorna il colore di background del controllo
|
||||||
void set_back_color(COLOR c) { _backcolor = c; }
|
COLOR back_color() const
|
||||||
|
{ return _backcolor; }
|
||||||
|
// @cmember Setta il colore di background del controllo
|
||||||
|
void set_back_color(COLOR c)
|
||||||
|
{ _backcolor = c; }
|
||||||
|
|
||||||
bool checked() const { return _checked; }
|
// @cmember Ritorna se il controllo possiede un check
|
||||||
|
bool checked() const
|
||||||
|
{ return _checked; }
|
||||||
|
// @cmember Setta se il controllo debba avere un check
|
||||||
virtual void check(bool on);
|
virtual void check(bool on);
|
||||||
|
|
||||||
bool disabled() const { return _disabled; }
|
// @cmember Ritorna se il controllo e' disabilitato
|
||||||
|
bool disabled() const
|
||||||
|
{ return _disabled; }
|
||||||
|
// @cmember Abilita/disabilita il controllo
|
||||||
void enable(bool on);
|
void enable(bool on);
|
||||||
|
|
||||||
bool focused() const { return _focused; }
|
// @cmember Ritorna se il controllo ha il focus
|
||||||
void focus(bool on) { _focused = on; }
|
bool focused() const
|
||||||
|
{ return _focused; }
|
||||||
|
// @cmember Setta il focus sul cursore (stessa sintassi di <mf TCursor::enable>)
|
||||||
|
void focus(bool on)
|
||||||
|
{ _focused = on; }
|
||||||
|
|
||||||
bool multiple() const { return _multiple; }
|
// @cmember Ritorna il contenuto della variabile <md TControl::_multiple>
|
||||||
|
bool multiple() const
|
||||||
|
{ return _multiple; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
279
include/form.cpp
279
include/form.cpp
@ -39,6 +39,8 @@ HIDDEN const int frm_id = 113;
|
|||||||
// Utility functions
|
// Utility functions
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// Current form (edit, print)
|
// Current form (edit, print)
|
||||||
HIDDEN TForm* _cur_form = NULL;
|
HIDDEN TForm* _cur_form = NULL;
|
||||||
HIDDEN TPrint_section* _cur_sect = NULL;
|
HIDDEN TPrint_section* _cur_sect = NULL;
|
||||||
@ -62,8 +64,12 @@ HIDDEN TMask& special_mask()
|
|||||||
return *_special_mask;
|
return *_special_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translate char to pagetype (visible outside here, no more HIDDEN)
|
// @func Funzione che converte dalla notazione carattere al corrispondente
|
||||||
pagetype char2page(char c)
|
// enum <t pagetype>
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna il <t pagetype> corrispondente
|
||||||
|
pagetype char2page(
|
||||||
|
char c) // @parm Notazione carattere del tipo di pagina
|
||||||
{
|
{
|
||||||
pagetype pt;
|
pagetype pt;
|
||||||
switch(c)
|
switch(c)
|
||||||
@ -577,7 +583,13 @@ void TForm_item::print_on(TRectype& prof)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TForm_item::enable(bool on)
|
// @mfunc Abilita/Disabilita il campo
|
||||||
|
void TForm_item::enable(
|
||||||
|
bool on) // @parm Operazione da svolgere sul campo:
|
||||||
|
// @flag TRUE | Il campo viene abiliato
|
||||||
|
// @flag FALSE | Il campo viene disabiliato
|
||||||
|
|
||||||
|
// @comm Viene automaticamente setta se il campo diventi visibile o nascosto (chaiam <mf TForm_item::show>)
|
||||||
{
|
{
|
||||||
_flag.enabled = on;
|
_flag.enabled = on;
|
||||||
show(on);
|
show(on);
|
||||||
@ -612,8 +624,10 @@ TToken_string& TForm_item::message(int m)
|
|||||||
return *t;
|
return *t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Manda il messaggio al campo <p dest>
|
||||||
void TForm_item::send_message(const TString& cmd, TForm_item& des) const
|
void TForm_item::send_message(
|
||||||
|
const TString& cmd, // @parm Messaggio di comando
|
||||||
|
TForm_item& des) const // @parm Campo a cui destinare il messaggio
|
||||||
{
|
{
|
||||||
if (cmd == "ADD" || cmd == "INC")
|
if (cmd == "ADD" || cmd == "INC")
|
||||||
{
|
{
|
||||||
@ -2171,7 +2185,13 @@ bool TPrint_section::update()
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrint_section::read_from(const TRectype& prof)
|
// @mfunc Legge dal record <p rec> altezza e offset prima colonna della sezione
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna se i valori letti hanno modificato quelli attuali
|
||||||
|
bool TPrint_section::read_from(
|
||||||
|
const TRectype& prof) // @parm Record dal quela leggere i valori
|
||||||
|
|
||||||
|
// @comm Nel caso il record non sia LF_RFORM viene dato un messaggio di <f CHECK>.
|
||||||
{
|
{
|
||||||
CHECK(prof.num() == LF_RFORM, "Il record deve essere del file LF_RFORM");
|
CHECK(prof.num() == LF_RFORM, "Il record deve essere del file LF_RFORM");
|
||||||
|
|
||||||
@ -2517,7 +2537,11 @@ bool TPrint_section::detail_field_notify (TSheet_field& s, int r, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrint_section::edit(const char* title)
|
// @mfunc Esegue l'edit della sezione di stampa
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna TRUE se e' stata modificata effettivamente
|
||||||
|
bool TPrint_section::edit(
|
||||||
|
const char* title) // @parm Titolo della maschera di edit
|
||||||
{
|
{
|
||||||
const bool is_ba_editor = TString(_form->section_mask()).left(2) == "ba";
|
const bool is_ba_editor = TString(_form->section_mask()).left(2) == "ba";
|
||||||
bool nstd_dirty = FALSE;
|
bool nstd_dirty = FALSE;
|
||||||
@ -2972,7 +2996,18 @@ void TForm::print_general(ostream& out) const
|
|||||||
out << "END\n" << endl;
|
out << "END\n" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
TPrint_section* TForm::exist(char s, pagetype t, bool create)
|
// @mfunc Controlla se esiste una sezione di stampa
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna la <c TPrint_section> trovata o creata
|
||||||
|
TPrint_section* TForm::exist(
|
||||||
|
char s, // @parm Indica in quale parte deve cercare:
|
||||||
|
//
|
||||||
|
// @flag F | Tra i footers
|
||||||
|
// @flag G | Tra gli sfondi
|
||||||
|
// @flag H | Tra gli headers
|
||||||
|
// @flag B | Tra i bodies (default)
|
||||||
|
pagetype t, // @parm Tipo di pagina (vedi <t pagetype>)
|
||||||
|
bool create) // @parm Indica se creare la sezione nel caso non esista
|
||||||
{
|
{
|
||||||
TArray* a;
|
TArray* a;
|
||||||
switch (toupper(s))
|
switch (toupper(s))
|
||||||
@ -3023,7 +3058,13 @@ TPrint_section& TForm::section(char s, word pagenum)
|
|||||||
return section(s, pt);
|
return section(s, pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TForm::reread(char sec, pagetype p, bool force)
|
// @mfunc Rilegge la sezione specificata
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna se ce l'ha fatta
|
||||||
|
bool TForm::reread(
|
||||||
|
char sec, // @parm Sezione da rileggere
|
||||||
|
pagetype p, // @parm Posizione della pagina
|
||||||
|
bool force) // @parm Forza rilettura anche se nessun campo e' cambiato
|
||||||
{
|
{
|
||||||
TPrint_section* s = exist(sec,p);
|
TPrint_section* s = exist(sec,p);
|
||||||
bool ok = force;
|
bool ok = force;
|
||||||
@ -3087,7 +3128,16 @@ bool TForm::reread(char sec, pagetype p, bool force)
|
|||||||
// TForm
|
// TForm
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool TForm::ps_change_date_format(TPrint_section& s, const char* f)
|
// @mfunc Cambia il formato di tutte le date nel form
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna sempre TRUE
|
||||||
|
bool TForm::ps_change_date_format(
|
||||||
|
TPrint_section& s, // @parm Sezione nella quale modificare le date
|
||||||
|
const char* f) // @parm Nuovo formato delle date
|
||||||
|
|
||||||
|
// @comm Ha le stesse funzioni di <mf TForm::change_date_format>, ma per <c TPrint_section>,
|
||||||
|
// all'uopo di chiamarla con ricorsiva insistenza
|
||||||
|
|
||||||
{
|
{
|
||||||
for (word i = 0; i < s.fields(); i++)
|
for (word i = 0; i < s.fields(); i++)
|
||||||
{
|
{
|
||||||
@ -3107,7 +3157,17 @@ bool TForm::ps_change_date_format(TPrint_section& s, const char* f)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TForm::ps_change_number_format(TPrint_section& s, int w, int dec, const char* p)
|
// @mfunc Cambia il formato di tutti i numeri nel form
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna sempre TRUE
|
||||||
|
bool TForm::ps_change_number_format(
|
||||||
|
TPrint_section& s, // @parm Sezione nella quale modificare i numeri
|
||||||
|
int w, // @parm Dimensione massima del fomato numerico
|
||||||
|
int dec, // @parm Numero di decimali
|
||||||
|
const char* p) // @parm Picture del nuovo formato
|
||||||
|
|
||||||
|
// @comm Ha le stesse funzioni di <mf TForm::change_number_format>, ma per <c TPrint_section>,
|
||||||
|
// all'uopo di chiamarla con ricorsiva insistenza
|
||||||
{
|
{
|
||||||
for (word i = 0; i < s.fields(); i++)
|
for (word i = 0; i < s.fields(); i++)
|
||||||
{
|
{
|
||||||
@ -3155,7 +3215,14 @@ void TForm::change_number_format(int w, int dec, const char* p)
|
|||||||
ps_change_number_format(*ps, w, dec, p);
|
ps_change_number_format(*ps, w, dec, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
word TForm::set_background(word p, bool u)
|
// @mfunc Effettua l'update della sezione grafica background
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna la lunghezza della pagina da stampare
|
||||||
|
word TForm::set_background(
|
||||||
|
word p, // @parm Numero pagina
|
||||||
|
bool u) // @parm Indica se aggiornare lo sfondo nella stampante corrente
|
||||||
|
|
||||||
|
// @xref <mf TForm::set_header> <mf TForm::set_body> <mf TForm::set_footer>
|
||||||
{
|
{
|
||||||
word len = 0;
|
word len = 0;
|
||||||
|
|
||||||
@ -3169,7 +3236,14 @@ word TForm::set_background(word p, bool u)
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
word TForm::set_header(word p, bool u)
|
// @mfunc Effettua l'update della sezione header
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'altezza dell'header settato
|
||||||
|
word TForm::set_header(
|
||||||
|
word p, // @parm !!!
|
||||||
|
bool u) // @parm Indica se cambiare l'eventuale header corrente!!!
|
||||||
|
|
||||||
|
// @xref <mf TForm::set_background> <mf TForm::set_body> <mf TForm::set_footer>
|
||||||
{
|
{
|
||||||
TPrinter& pr = printer();
|
TPrinter& pr = printer();
|
||||||
pr.resetheader();
|
pr.resetheader();
|
||||||
@ -3189,7 +3263,15 @@ word TForm::set_header(word p, bool u)
|
|||||||
return head.height();
|
return head.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
word TForm::set_body(word p, bool u)
|
// @mfunc Effettua l'update della sezione body
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'altezza del body settato
|
||||||
|
word TForm::set_body(
|
||||||
|
word p, // @parm !!!
|
||||||
|
bool u) // @parm Indica se cambiare l'eventuale body corrente!!!
|
||||||
|
|
||||||
|
// @xref <mf TForm::set_background> <mf TForm::set_header> <mf TForm::set_footer>
|
||||||
|
|
||||||
{
|
{
|
||||||
TPrint_section& body = section('B', p);
|
TPrint_section& body = section('B', p);
|
||||||
|
|
||||||
@ -3206,7 +3288,15 @@ word TForm::set_body(word p, bool u)
|
|||||||
return body.height();
|
return body.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
word TForm::set_footer(word p, bool u)
|
// @mfunc Effettua l'update della sezione footer
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna l'altezza del footer settato
|
||||||
|
word TForm::set_footer(
|
||||||
|
word p, // @parm !!!
|
||||||
|
bool u) // @parm Indica se cambiare l'eventuale footer corrente!!!
|
||||||
|
|
||||||
|
// @xref <mf TForm::set_background> <mf TForm::set_header> <mf TForm::set_body>
|
||||||
|
|
||||||
{
|
{
|
||||||
TPrinter& pr = printer();
|
TPrinter& pr = printer();
|
||||||
pr.resetfooter();
|
pr.resetfooter();
|
||||||
@ -3243,12 +3333,35 @@ void TForm::footer_handler(TPrinter& p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
word TForm::page(const TPrinter& p) const
|
// @mfunc Ritorna il numero di pagina correntemente in stampa
|
||||||
|
//
|
||||||
|
// @rdesc Se <md _TForm::lastpage> e' TRUE (sta stampando l'ultima pagina)
|
||||||
|
// ritorna 0, altrimenti ritorna il numero della pagian corrente da stampare
|
||||||
|
// (chiam <mf TPrinter::getcurrentepage>).
|
||||||
|
word TForm::page(
|
||||||
|
const TPrinter& p) const // @parm Operazione corrente di stampa
|
||||||
{
|
{
|
||||||
return _lastpage ? 0 : p.getcurrentpage();
|
return _lastpage ? 0 : p.getcurrentpage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Effettua il posizionamento manuale del modulo
|
||||||
void TForm::arrange_form()
|
void TForm::arrange_form()
|
||||||
|
|
||||||
|
// @comm Nota: siccome si scrive direttamente sulla porta, sarebbe necessario
|
||||||
|
// mandare una stringa di reset alla stampante, o per lo meno far si' che
|
||||||
|
// ogni volta che si fa il posizionamento il font col quale scrive sia sempre
|
||||||
|
// lo stesso. Tutto cio' non e' possibile con la generica solo testo, o meglio
|
||||||
|
// ad ogni stampa col posizionamento e' necessario che la stampante sia resettata.
|
||||||
|
// <nl>Riassumendo, come regola generale, i posizionamenti devono essere fatti con il
|
||||||
|
// font di default della stampante (tipicamente 10 cpi). Accade pero' (con la generica
|
||||||
|
// solo testo) che rimanga settato l'ultimo font, di conseguenza quando si effettua una
|
||||||
|
// seconda stampa con posizionamento, stampera' tali caratteri in 17"! Per questo
|
||||||
|
// motivo e' necessario settare a 17 cpi, almeno la prima volta, la stampante!.
|
||||||
|
// <nl>Quindi, per ovviare a tutto cio, visto che <mf TForm::arange_form> ha senso solo su
|
||||||
|
// stampanti ad aghi, che le stampanti ad aghi possono andare in emulazione EPSON o IBM,
|
||||||
|
// che il codice per settare il font draft 17cpi e' lo stesso sia per EPSON che IBM
|
||||||
|
// CHR(15), allora prima del posizionamento scrivo il chr(15) sulla stampante!
|
||||||
|
|
||||||
{
|
{
|
||||||
TString device;
|
TString device;
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
@ -3264,20 +3377,7 @@ void TForm::arrange_form()
|
|||||||
device = device.left(4); //Legge solo LPTx...
|
device = device.left(4); //Legge solo LPTx...
|
||||||
#endif
|
#endif
|
||||||
FILE* lpt = fopen(device,"w");
|
FILE* lpt = fopen(device,"w");
|
||||||
// Nota: siccome si scrive direttamente sulla porta, sarebbe necessario
|
|
||||||
// mandare una stringa di reset alla stampante, o per lo meno far si' che
|
|
||||||
// ogni volta che si fa il posizionamento il font col quale scrive sia sempre
|
|
||||||
// lo stesso. Tutto cio' non e' possibile con la generica solo testo, o meglio
|
|
||||||
// ad ogni stampa col posizionamento e' necessario che la stampante sia resettata.
|
|
||||||
// Riassumendo, come regola generale, i posizionamenti devono essere fatti con il
|
|
||||||
// font di default della stampante (tipicamente 10 cpi). Accade pero' (con la generica
|
|
||||||
// solo testo) che rimanga settato l'ultimo font, di conseguenza quando si effettua una
|
|
||||||
// seconda stampa con posizionamento, stampera' tali caratteri in 17"!!!! Per questo
|
|
||||||
// motivo e' necessario settare a 17 cpi, almeno la prima volta, la stampante!.
|
|
||||||
// Quindi, per ovviare a tutto cio, visto che TForm::arange_form() ha senso solo su
|
|
||||||
// stampanti ad aghi, che le stampanti ad aghi possono andare in emulazione EPSON o IBM,
|
|
||||||
// che il codice per settare il font draft 17cpi e' lo stesso sia per EPSON che IBM
|
|
||||||
// CHR(15), allora prima del posizionamento scrivo il chr(15) sulla stampante!
|
|
||||||
int i, x;
|
int i, x;
|
||||||
TString str_pos;
|
TString str_pos;
|
||||||
if (lpt == NULL) fatal_box("Non rieso ad aprire il device %s.",device);
|
if (lpt == NULL) fatal_box("Non rieso ad aprire il device %s.",device);
|
||||||
@ -3325,7 +3425,16 @@ long TForm::records() const
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TForm::genera_fincatura(pagetype p, int y1, int y2, const int* rows)
|
// @mfunc Genera automaticamente la sezione grafica con colonne fincate
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna FALSE se non c'e' il body per quella pagina
|
||||||
|
bool TForm::genera_fincatura(
|
||||||
|
pagetype p, // @parm Posizione della pagina (vedi <t pagetype>)
|
||||||
|
int y1, // @parm Prima y per le righe verticali
|
||||||
|
int y2, // @parm Ultima y per le righe verticali
|
||||||
|
const int* rows) // @parm Array di posizioni riga con 0 per finire
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
TPrint_section* body = exist('B', p);
|
TPrint_section* body = exist('B', p);
|
||||||
if (body == NULL) return FALSE;
|
if (body == NULL) return FALSE;
|
||||||
@ -3405,7 +3514,15 @@ bool TForm::genera_fincatura(pagetype p, int y1, int y2, const int* rows)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TForm::genera_intestazioni(pagetype p, short y)
|
// @mfunc Genera le righe di intestazione colonna alla riga indicata, vale per COLUMNWISE
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna FALSE se non esiste body (o non e' COLUMNWISE) o se non esiste l'header
|
||||||
|
bool TForm::genera_intestazioni(
|
||||||
|
pagetype p, // @parm Posizione della pgaina (vedi <t pagetype>)
|
||||||
|
short y) // @parm Riga dell'header in cui vanno inserite
|
||||||
|
|
||||||
|
// @comm I form_items di intestazione vengono aggiunti alla sezione header di tipo <p p> con ID -1
|
||||||
|
|
||||||
{
|
{
|
||||||
TPrint_section* body = exist('B', p);
|
TPrint_section* body = exist('B', p);
|
||||||
if (body == NULL || !body->columnwise()) return FALSE;
|
if (body == NULL || !body->columnwise()) return FALSE;
|
||||||
@ -3430,10 +3547,87 @@ bool TForm::genera_intestazioni(pagetype p, short y)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stampa gli items dal from a to
|
/*
|
||||||
// se to < 0 stampa fino alla fine del file
|
void TForm::remove_temp_items(char sec, pagetype p)
|
||||||
|
{
|
||||||
|
TPrint_section* s = exist(sec,p);
|
||||||
|
if (s!=NULL)
|
||||||
|
{
|
||||||
|
const word items = s->fields();
|
||||||
|
for (word j=0;j<items; j++)
|
||||||
|
{
|
||||||
|
if (s->field(j).temp())
|
||||||
|
s->destroy_field(j,FALSE);
|
||||||
|
}
|
||||||
|
s->field_array().pack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool TForm::print(long from, long to)
|
|
||||||
|
void TForm::put_examples(char sez, pagetype p)
|
||||||
|
{
|
||||||
|
TPrint_section* s = exist(sez,p);
|
||||||
|
if (s!=NULL)
|
||||||
|
{
|
||||||
|
const word items = s->fields();
|
||||||
|
for (word i=0;i<items;i++)
|
||||||
|
{
|
||||||
|
TForm_item& fi = s->field(i);
|
||||||
|
if (fi.fields()!=0) continue;
|
||||||
|
if (fi.memo())
|
||||||
|
fi.set(fi.memo_info());
|
||||||
|
else
|
||||||
|
if (fi.prompt().empty())
|
||||||
|
{
|
||||||
|
if (fi.class_name() == "DATA")
|
||||||
|
{
|
||||||
|
const TDate d(TODAY);
|
||||||
|
fi.set(d);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (fi.class_name() == "NUMERO")
|
||||||
|
{
|
||||||
|
fi.set_prompt(fi.example());
|
||||||
|
fi.temp() = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fi.set(fi.key());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TForm::remove_examples(char sez, pagetype p)
|
||||||
|
{
|
||||||
|
TPrint_section* s = exist(sez,p);
|
||||||
|
if (s!=NULL)
|
||||||
|
{
|
||||||
|
const word items = s->fields();
|
||||||
|
for (word i=0;i<items;i++)
|
||||||
|
{
|
||||||
|
TForm_item& fi = s->field(i);
|
||||||
|
if (fi.fields()!=0) continue;
|
||||||
|
if (fi.memo())
|
||||||
|
fi.set("");
|
||||||
|
else
|
||||||
|
if (fi.class_name() == "NUMERO" && fi.temp())
|
||||||
|
{
|
||||||
|
fi.set_prompt("");
|
||||||
|
fi.temp() = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// @mfunc Stampa gli items da <p form> a <p to>
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna se ha effettuato correttamente la stampa
|
||||||
|
bool TForm::print(
|
||||||
|
long from, // @parm Primo item da stampare (default 0l)
|
||||||
|
long to) // @parm Ultimo da stampare (se <lt>0 stampa fino alla fine del file, default -1l)
|
||||||
|
|
||||||
|
// @comm Se i parametri di posizionamento sono settati e cosi' pure gli offset genera un <f error_box>.
|
||||||
{
|
{
|
||||||
_cur_form = this;
|
_cur_form = this;
|
||||||
|
|
||||||
@ -3607,8 +3801,14 @@ word TForm::height(word page)
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Legge un profilo
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna se e' riuscito nell'operazione:
|
||||||
|
// @flag TRUE | E' riuscito a leggere il prfilo
|
||||||
|
// @flag FALSE | Non ha letto il profilo
|
||||||
bool TForm::read_profile()
|
bool TForm::read_profile()
|
||||||
|
// @comm Per la lettura del profilo procede leggendo prima la definizione del
|
||||||
|
// profilo base e successivamente le modifiche relative.
|
||||||
{
|
{
|
||||||
TLocalisamfile prof(LF_FORM);
|
TLocalisamfile prof(LF_FORM);
|
||||||
TLocalisamfile rprof(LF_RFORM);
|
TLocalisamfile rprof(LF_RFORM);
|
||||||
@ -3759,7 +3959,12 @@ void TForm::init()
|
|||||||
_background_mode = printer().isgraphics() ? graphics : testo;
|
_background_mode = printer().isgraphics() ? graphics : testo;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TForm::read(const char* name, const char* code, int lev, const char* desc)
|
// @mfunc Carica il form dal file specificato
|
||||||
|
void TForm::read(
|
||||||
|
const char* name, // @parm Nome del profilo di stampa da leggere
|
||||||
|
const char* code, // @parm Codice del profilo di stampa da leggere
|
||||||
|
int lev, // @parm Permessi di stampa
|
||||||
|
const char* desc) // @parm Descrizione del formato da leggere
|
||||||
{
|
{
|
||||||
_name= name;
|
_name= name;
|
||||||
_code= code;
|
_code= code;
|
||||||
|
779
include/form.h
779
include/form.h
@ -28,9 +28,22 @@ class TCursor;
|
|||||||
#include <assoc.h>
|
#include <assoc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum pagetype { odd_page, even_page, first_page, last_page };
|
// @doc EXTERNAL
|
||||||
enum bkg_mode { none, testo, graphics } ;
|
|
||||||
pagetype char2page(char); // prototipo della funzione che converte dalla notazione carattere al corrispondente enum pagetype
|
// @enum pagetype | Posizione della pagina da stampare
|
||||||
|
enum pagetype {
|
||||||
|
odd_page, // @emem Pagine dispari
|
||||||
|
even_page, // @emem Pagine pari
|
||||||
|
first_page, // @emem Prima pagina
|
||||||
|
last_page }; // @emem Ultima pagina
|
||||||
|
|
||||||
|
// @enum bkg_mode | Tipo di background presente nella stampa
|
||||||
|
enum bkg_mode {
|
||||||
|
none, // @emem Nessuno sfondo
|
||||||
|
testo, // @emem Sfondo di tipo testo
|
||||||
|
graphics } ; // @emem Sfondo grafico
|
||||||
|
|
||||||
|
pagetype char2page(char);
|
||||||
|
|
||||||
class TForm;
|
class TForm;
|
||||||
class TMask_field;
|
class TMask_field;
|
||||||
@ -40,391 +53,793 @@ class TPrint_section;
|
|||||||
|
|
||||||
const int MAXCOLUMNS = 32;
|
const int MAXCOLUMNS = 32;
|
||||||
|
|
||||||
|
// @class TForm | Classe per la descrizione dei formati di stampa
|
||||||
|
//
|
||||||
|
// @base public | TObject
|
||||||
class TForm : public TObject
|
class TForm : public TObject
|
||||||
|
|
||||||
|
// @author:(INTERNAL) Guido, Angelo, Villa
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
// @cfriend TForm_editor
|
||||||
friend class TForm_editor;
|
friend class TForm_editor;
|
||||||
|
// @cfriend TForm_EC_editor
|
||||||
friend class TForm_EC_editor;
|
friend class TForm_EC_editor;
|
||||||
|
// @cfriend TPrint_section
|
||||||
friend class TPrint_section;
|
friend class TPrint_section;
|
||||||
|
|
||||||
|
// @cmember Tipo di sfondo da applicare alla stampa (vedi <t bkg_mode>)
|
||||||
bkg_mode _background_mode;
|
bkg_mode _background_mode;
|
||||||
|
|
||||||
TString _name; // Profile name
|
// @cmember Nome del profilo di stampa
|
||||||
TString _code; // Profile code
|
TString _name;
|
||||||
TString _fontname; // Font name
|
// @cmember Codice del profilo di stampa
|
||||||
int _fontsize; // Font size
|
TString _code;
|
||||||
int _x, _y; // Offset validi per tutte le sezioni
|
// @cmember Nome del font da utilizzare
|
||||||
char _char_to_pos; // Carattere utilizzato per il posizionamento dei moduli
|
TString _fontname;
|
||||||
int _ipx, _ipy; // Coordinate del posizionamento iniziale
|
// @cmember Domensione del font da utilizzare
|
||||||
int _fpx; // Coordinata del posizionamento finale (la riga e' la stessa)
|
int _fontsize;
|
||||||
bool _dirty; // Flag per ragistrare i parametri(font ed offset)
|
// @cmember Maschera per la sezione
|
||||||
|
TString _section_mask;
|
||||||
|
//@cmember Offset X valido per tutte le sezioni
|
||||||
|
int _x;
|
||||||
|
//@cmember Offset Y valido per tutte le sezioni
|
||||||
|
int _y;
|
||||||
|
// @cmember Carattere utilizzato per il posizionamento dei moduli
|
||||||
|
char _char_to_pos;
|
||||||
|
// @cmember Coordinata X del posizionamento iniziale
|
||||||
|
int _ipx;
|
||||||
|
// @cmember Coordinata Y del posizionamento iniziale
|
||||||
|
int _ipy;
|
||||||
|
// @cmember Coordinata X del posizionamento finale (la riga e' la stessa)
|
||||||
|
int _fpx;
|
||||||
|
// @cmember Flag per ragistrare i parametri (font ed offset)
|
||||||
|
bool _dirty;
|
||||||
|
|
||||||
TRelation* _relation; // Can be NULL
|
// @cmember Relazione corrente (puo' essere NULL), vedi <c TRelation>
|
||||||
TCursor* _cursor; // Can be NULL
|
TRelation* _relation;
|
||||||
TRelation_description* _rel_desc; // Can be NULL
|
// @cmember Cursore corrente (puo' essere NULL), vedi <c Tcursor>
|
||||||
|
TCursor* _cursor;
|
||||||
|
// @cmember <c TRelation_description> per la gestione della relazione corrente
|
||||||
|
TRelation_description* _rel_desc;
|
||||||
|
|
||||||
TArray _head; // Headers
|
// @cmember Array di headers
|
||||||
TArray _body; // Bodies
|
TArray _head;
|
||||||
TArray _foot; // Footers
|
// @cmember Array di bodies
|
||||||
TArray _back; // Graphic backgrounds
|
TArray _body;
|
||||||
|
// @cmember Array di footers
|
||||||
|
TArray _foot;
|
||||||
|
// @cmember Array di sfondi grafici
|
||||||
|
TArray _back;
|
||||||
|
|
||||||
bool _lastpage; // I am about to print the last page?
|
// @cmember Indica se si sta stampando l'ultima pagina
|
||||||
|
bool _lastpage;
|
||||||
bool _isnew; // new form
|
|
||||||
bool _isbase; // base form (.frm file)
|
|
||||||
bool _arrange; // if TRUE perform arranging every time
|
|
||||||
int _editlevel; // Edit permission
|
|
||||||
TString _desc; // form description
|
|
||||||
char _fink[11]; // finkatur characters
|
|
||||||
|
|
||||||
|
// @cmember Indica se si tratta di un nuovo form
|
||||||
|
bool _isnew;
|
||||||
|
// @cmember Indica se si tratta di form di base (.frm file)
|
||||||
|
bool _isbase;
|
||||||
|
// @cmember Indica se effettuare il posizionamento manuale dei moduli
|
||||||
|
bool _arrange;
|
||||||
|
// @cmember Permessi di Edit
|
||||||
|
int _editlevel;
|
||||||
|
// @cmember Descrizione del formato
|
||||||
|
TString _desc;
|
||||||
|
// @cmember Array di caratteri di fincatura
|
||||||
|
char _fink[11];
|
||||||
|
|
||||||
|
// @cmember Handler di default della testata di stampa
|
||||||
static void header_handler(TPrinter& p);
|
static void header_handler(TPrinter& p);
|
||||||
|
// @cmember Handler di default del piede di stampa
|
||||||
static void footer_handler(TPrinter& p);
|
static void footer_handler(TPrinter& p);
|
||||||
|
|
||||||
const char* get_fincatura() { return _fink; }
|
// @cmember Ritorna l'array di caratteri di fincatura
|
||||||
|
const char* get_fincatura()
|
||||||
|
{ return _fink; }
|
||||||
|
// @cmember Setta l'array di caratteri di fincatura
|
||||||
void set_fincatura(const char* s);
|
void set_fincatura(const char* s);
|
||||||
|
|
||||||
// come sotto ma per printsection, all'uopo di chiamarle
|
// @access Protected Member
|
||||||
// con ricorsiva insistenza
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
// @cmember Cambia il formato di tutte le date nel form
|
||||||
bool ps_change_date_format(TPrint_section& s, const char* f);
|
bool ps_change_date_format(TPrint_section& s, const char* f);
|
||||||
|
// @cmember Cambia il formato di tutti i numeri nel form
|
||||||
bool ps_change_number_format(TPrint_section& s, int w, int dec, const char* p);
|
bool ps_change_number_format(TPrint_section& s, int w, int dec, const char* p);
|
||||||
TPrint_section* exist(char s, pagetype t, bool create = FALSE); // Can be NULL
|
// @cmember Controlla se esiste una sezione di stampa
|
||||||
void init(); // inizializza il form
|
TPrint_section* exist(char s, pagetype t, bool create = FALSE);
|
||||||
void read(const char* form, const char* code = "", int editlevel = 0, const char* desc = ""); // carica il form dal file specificato
|
// @cmember Inizializza il form
|
||||||
|
void init();
|
||||||
|
// @cmember Carica il form dal file specificato
|
||||||
|
void read(const char* form, const char* code = "", int editlevel = 0, const char* desc = "");
|
||||||
|
|
||||||
// H = Header, B = Body, F = Footer, R = Relation
|
// @cmember Ritorna una sezione di stampa, la crea se non esiste (chiama <mf TForm::exist>)
|
||||||
TPrint_section& section(char s, pagetype pos); // La crea se non esiste
|
TPrint_section& section(char s, pagetype pos);
|
||||||
TPrint_section& section(char s, word page = 3); // La crea se non esiste (3 e' una pagina dispari qualsiasi)
|
// @cmember Ritorna una sezione di stampa, la crea se non esiste (chiama <mf TForm::exist>)
|
||||||
|
// (3 e' una pagina dispari qualsiasi)
|
||||||
|
TPrint_section& section(char s, word page = 3);
|
||||||
|
|
||||||
word height(word page = 1); // Height of a page (the first by default)
|
// @cmember Ritorna l'altezaa della pagina <p page> la prima di default
|
||||||
|
word height(word page = 1);
|
||||||
|
|
||||||
|
// @cmember Stampa la sezione <p s>
|
||||||
void print_section(ostream& out, char s) const;
|
void print_section(ostream& out, char s) const;
|
||||||
|
// @cmember Stampa il sorgente del form su file di testo
|
||||||
virtual void print_on(ostream& out) const;
|
virtual void print_on(ostream& out) const;
|
||||||
|
|
||||||
|
// @cmember Legge una use e setta la relazione (ritorna sempre TRUE)
|
||||||
bool parse_use(TScanner&);
|
bool parse_use(TScanner&);
|
||||||
|
// @cmember Legge una join e setta la relazione (ritorna sempre TRUE)
|
||||||
bool parse_join(TScanner&);
|
bool parse_join(TScanner&);
|
||||||
|
|
||||||
|
// @cmember Legge una <c TRelation_description> e setta la relazione
|
||||||
bool parse_description(TScanner&);
|
bool parse_description(TScanner&);
|
||||||
|
// @cmember Scrive una <c TRelation_description> su <p out>
|
||||||
void print_description(ostream& out) const;
|
void print_description(ostream& out) const;
|
||||||
|
|
||||||
|
// @cmember Legge dal file le caratteristiche generali del form (identificate da GE)
|
||||||
bool parse_general(TScanner&);
|
bool parse_general(TScanner&);
|
||||||
|
// @cmember Scrive le caratteristiche generali del form su <p out>
|
||||||
void print_general(ostream& out) const;
|
void print_general(ostream& out) const;
|
||||||
virtual void extended_parse_general(TScanner&) {} // Used to parse non-standard items in general section
|
// @cmember Usata per leggere voci non-standard nella sezione generale
|
||||||
// Queste due funzioni vengono chiamate per controlli non standard nell'edit della sezione
|
virtual void extended_parse_general(TScanner&)
|
||||||
virtual void pre_edit_checks(TMask&m, TPrint_section* sec) {}
|
{}
|
||||||
virtual bool post_edit_checks(TMask& m, TPrint_section* sec) {return FALSE;}
|
|
||||||
|
|
||||||
|
// @cmember Chiamata per effettuare controlli non standard nell'edit della sezione
|
||||||
|
// <p sec> (prima dell'esecuzione della maschera di edit <p m>)
|
||||||
|
virtual void pre_edit_checks(TMask&m, TPrint_section* sec)
|
||||||
|
{}
|
||||||
|
// @cmember Chiamata per effettuare controlli non standard nell'edit della sezione
|
||||||
|
// <p sec> (dopo l'esecuzione della maschera di edit <p m>)
|
||||||
|
virtual bool post_edit_checks(TMask& m, TPrint_section* sec)
|
||||||
|
{return FALSE;}
|
||||||
|
|
||||||
|
// @cmember Legge un profilo
|
||||||
bool read_profile();
|
bool read_profile();
|
||||||
|
// @cmember Scrive un profilo su file (vedi <mf TForm::read_profile>)
|
||||||
bool write_profile();
|
bool write_profile();
|
||||||
|
|
||||||
|
// @cmember Ritorna il numero di pagina correntemente in stampa
|
||||||
word page(const TPrinter& p) const;
|
word page(const TPrinter& p) const;
|
||||||
|
// @cmember Effettua il posizionamento manuale del modulo
|
||||||
void arrange_form();
|
void arrange_form();
|
||||||
|
|
||||||
|
// @cmember Ritorna il numero di record presenti nella <c TCursor>
|
||||||
virtual long records() const;
|
virtual long records() const;
|
||||||
|
// @cmember Effettua l'update della sezione grafica background
|
||||||
virtual word set_background(word p, bool u);
|
virtual word set_background(word p, bool u);
|
||||||
|
// @cmember Effettua l'update della sezione header
|
||||||
virtual word set_header(word p, bool u);
|
virtual word set_header(word p, bool u);
|
||||||
|
// @cmember Effettua l'update della sezione body
|
||||||
virtual word set_body(word p, bool u);
|
virtual word set_body(word p, bool u);
|
||||||
|
// @cmember Effettua l'update della sezione footer
|
||||||
virtual word set_footer(word p, bool u);
|
virtual word set_footer(word p, bool u);
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// genera automaticamente la sezione grafica con colonne fincate
|
// @cmember Genera automaticamente la sezione grafica con colonne fincate
|
||||||
// parametri: posizione pagina, prima e ultima Y per le righe
|
|
||||||
// verticali, array di posizioni riga con 0 per finire
|
|
||||||
// ritorna FALSE se non c'e' il body per quella pagina
|
|
||||||
bool genera_fincatura(pagetype p, int y1, int y2, const int* rows);
|
bool genera_fincatura(pagetype p, int y1, int y2, const int* rows);
|
||||||
|
|
||||||
// Genera le righe di intestazione colonna alla riga indicata, vale per COLUMNWISE
|
// @cmember Genera le righe di intestazione colonna alla riga indicata, vale per COLUMNWISE
|
||||||
// I form_items di intestazione vengono aggiunti alla sezione header di tipo p con ID -1
|
|
||||||
bool genera_intestazioni(pagetype p, short y);
|
bool genera_intestazioni(pagetype p, short y);
|
||||||
|
|
||||||
|
// @cmember Stampa gli items da <p form> a <p to>
|
||||||
bool print(long from = 0L, long to = -1L);
|
bool print(long from = 0L, long to = -1L);
|
||||||
|
|
||||||
TArray& body() { return _body; }
|
// @cmember Ritorna l'array di item del body
|
||||||
TArray& head() { return _head; }
|
TArray& body()
|
||||||
TArray& foot() { return _foot; }
|
{ return _body; }
|
||||||
|
// @cmember Ritorna l'array di item dell'header
|
||||||
|
TArray& head()
|
||||||
|
{ return _head; }
|
||||||
|
// @cmember Ritorna l'array di item del footer
|
||||||
|
TArray& foot()
|
||||||
|
{ return _foot; }
|
||||||
|
// @cmember Ritorna l'array di item dello sfondo
|
||||||
TArray& back() { return _back; }
|
TArray& back() { return _back; }
|
||||||
|
|
||||||
const TString& name() const { return _name; }
|
// @cmember Ritorna il nome del profilo di stampa
|
||||||
const TString& code() const { return _code; }
|
const TString& name() const
|
||||||
|
{ return _name; }
|
||||||
|
// @cmember Ritorna il codice del profilo di stampa
|
||||||
|
const TString& code() const
|
||||||
|
{ return _code; }
|
||||||
|
|
||||||
virtual const char* section_mask() { return "ba2100s"; }
|
// @cmember Ritorna il nome della mschera per la sezione
|
||||||
bool edit_level() const { return _editlevel; }
|
virtual const char* section_mask()
|
||||||
void set_edit_level(int n) { _editlevel = n; }
|
{ return "ba2100s"; }
|
||||||
void set_description(const char* s) { _desc = s; }
|
// @cmember Ritorna i permessi di Edit (<md TForm::_editlevel> assume solo i valori 0 e non 0)
|
||||||
|
bool edit_level() const
|
||||||
|
{ return _editlevel; }
|
||||||
|
// @cmember Setta i permessi di edit
|
||||||
|
void set_edit_level(int n)
|
||||||
|
{ _editlevel = n; }
|
||||||
|
// @cmember Setta la descrizione del formato
|
||||||
|
void set_description(const char* s)
|
||||||
|
{ _desc = s; }
|
||||||
|
|
||||||
virtual TRelation* relation() const { return _relation; }
|
// @cmember Ritorna la relazione corrente
|
||||||
virtual TCursor* cursor() const { return _cursor; }
|
virtual TRelation* relation() const
|
||||||
|
{ return _relation; }
|
||||||
|
// @cmember Ritorna la <c TCursor> corrente
|
||||||
|
virtual TCursor* cursor() const
|
||||||
|
{ return _cursor; }
|
||||||
|
// @cmember Ritorna la <c TRelation_description> corrente
|
||||||
TRelation_description& rel_desc() const;
|
TRelation_description& rel_desc() const;
|
||||||
|
// @cmember Effettua operazioni personalizzate dall'applicazione sul <c TForm_item>
|
||||||
virtual bool validate(TForm_item& fld, TToken_string& val);
|
virtual bool validate(TForm_item& fld, TToken_string& val);
|
||||||
|
|
||||||
|
// @cmember Ritorna il campo <p id>-esimo della sezione <p sec>
|
||||||
TForm_item& find_field(char sec, pagetype pag, short id) const;
|
TForm_item& find_field(char sec, pagetype pag, short id) const;
|
||||||
int& offset_x() { return _x; }
|
// @cmember Ritorna l'offset x valido per tutte le sezioni
|
||||||
int& offset_y() { return _y; }
|
int& offset_x()
|
||||||
TString& fontname() { return _fontname; }
|
{ return _x; }
|
||||||
int& fontsize() { return _fontsize; }
|
// @cmember Ritorna l'offset x valido per tutte le sezioni
|
||||||
char& char_to_pos(){ return _char_to_pos; }
|
int& offset_y()
|
||||||
int& ipx() { return _ipx; }
|
{ return _y; }
|
||||||
int& ipy() { return _ipy; }
|
// @cmember Ritorna il nome del font in uso
|
||||||
int& fpx() { return _fpx; }
|
TString& fontname()
|
||||||
bool dirty() const { return _dirty; }
|
{ return _fontname; }
|
||||||
void set_dirty(bool d = TRUE) { _dirty = d; }
|
// @cmember Ritorna la dimensione del font in uso
|
||||||
void set_arrange(bool arng = TRUE) { _arrange = arng ; }
|
int& fontsize()
|
||||||
|
{ return _fontsize; }
|
||||||
|
// @cmember Ritorna il carattere utilizzato per il posizionamento dei moduli
|
||||||
|
char& char_to_pos()
|
||||||
|
{ return _char_to_pos; }
|
||||||
|
// @cmember Ritorna la coordinata X del posizionamento iniziale
|
||||||
|
int& ipx()
|
||||||
|
{ return _ipx; }
|
||||||
|
// @cmember Ritorna la coordinata Y del posizionamento iniziale
|
||||||
|
int& ipy()
|
||||||
|
{ return _ipy; }
|
||||||
|
// @cmember Ritorna la coordinata X del posizionamento finale
|
||||||
|
int& fpx()
|
||||||
|
{ return _fpx; }
|
||||||
|
// @cmember Ritorna il flag per registrare i parametri
|
||||||
|
bool dirty() const
|
||||||
|
{ return _dirty; }
|
||||||
|
// @cmember Setta il flag per registrare i parametri
|
||||||
|
void set_dirty(bool d = TRUE)
|
||||||
|
{ _dirty = d; }
|
||||||
|
// @cmember Setta se effettuare il posizionamento manuale dei moduli
|
||||||
|
void set_arrange(bool arng = TRUE)
|
||||||
|
{ _arrange = arng ; }
|
||||||
|
|
||||||
// cambia il formato di tutte le date nel form
|
// @cmember Cambia il formato di tutte le date nel form (vedi <mf TForm::ps_change_date_format>)
|
||||||
void change_date_format(const char* f);
|
void change_date_format(const char* f);
|
||||||
// cambia il formato di tutti i numeri nel form
|
// @cmember Cambia il formato di tutti i numeri nel form (vedi <mf TForm::ps_change_number_format>)
|
||||||
virtual void change_number_format(int w, int dec, const char* p);
|
virtual void change_number_format(int w, int dec, const char* p);
|
||||||
// Rilegge la sezione specificata
|
// @cmember Rilegge la sezione specificata
|
||||||
bool reread(char sec, pagetype p, bool force=FALSE);
|
bool reread(char sec, pagetype p, bool force=FALSE);
|
||||||
// editor interface
|
// @cmember Editor interface (vedi <c TForm_editor>)
|
||||||
TForm_editor& editor() const;
|
TForm_editor& editor() const;
|
||||||
|
|
||||||
// Notifica l'inizio di stampa dell'ultima pagina
|
// @cmember Setta l'inizio di stampa dell'ultima pagina
|
||||||
void set_last_page(bool lp) { _lastpage = lp; }
|
void set_last_page(bool lp)
|
||||||
|
{ _lastpage = lp; }
|
||||||
|
|
||||||
// Setta il modo di sfondo (fincatura)
|
|
||||||
|
// @cmember Setta il modo di sfondo (fincatura)
|
||||||
void set_mode(bkg_mode b);
|
void set_mode(bkg_mode b);
|
||||||
bkg_mode mode() { return _background_mode;}
|
// @cmember Ritorna il modo di sfondo (fincatura)
|
||||||
// if code == NULL it's a base form
|
bkg_mode mode()
|
||||||
// otherwise it's integrated by a file definition
|
{ return _background_mode;}
|
||||||
|
|
||||||
|
// @cmember Costruttore
|
||||||
TForm();
|
TForm();
|
||||||
|
// @cmember Costruttore (se <p code> == NULL si tratta in form di base, diversamente e'
|
||||||
|
// integrato by a file definition)
|
||||||
TForm(const char* form, const char * code = "", int editlevel = 0, const char* desc = "");
|
TForm(const char* form, const char * code = "", int editlevel = 0, const char* desc = "");
|
||||||
|
// @cmember Distruttore
|
||||||
virtual ~TForm();
|
virtual ~TForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TForm_flags : public TObject
|
|
||||||
|
// @class TForm_flags | Classe per la gestione dei flag di una <c TForm>
|
||||||
|
//
|
||||||
|
// @base public | TObject
|
||||||
|
class TForm_flags : public TObject
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
// @cmember Indica se il campo e' automagico (determina da solo il suo valore
|
||||||
|
// alla partenza della maschera)
|
||||||
bool automagic : 1;
|
bool automagic : 1;
|
||||||
|
// @cmember Indica se il campo e' abilitato
|
||||||
bool enabled : 1;
|
bool enabled : 1;
|
||||||
|
// @cmember Indica se il campo e' visibile
|
||||||
bool shown : 1;
|
bool shown : 1;
|
||||||
|
// @cmember Indica se il campo e' stato modificato
|
||||||
bool dirty : 1;
|
bool dirty : 1;
|
||||||
|
// @cmember Indica se il campo possiede un carattere di fincatura sinistro
|
||||||
bool finkl : 1;
|
bool finkl : 1;
|
||||||
|
// @cmember Indica se il campo possiede un carattere di fincatura destro
|
||||||
bool finkr : 1;
|
bool finkr : 1;
|
||||||
|
// @cmember Indica se si tratta di un campo memo
|
||||||
bool memo : 1;
|
bool memo : 1;
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember Permette di stampare i flags su file di testo
|
||||||
void print_on(ostream& out) const;
|
void print_on(ostream& out) const;
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
// @cmember Costruttore
|
||||||
TForm_flags();
|
TForm_flags();
|
||||||
|
|
||||||
void set_shown(bool b) { shown = b; }
|
// @cmember Setta il flag di visibile
|
||||||
void set_finkl(bool b) { finkl = b; }
|
void set_shown(bool b)
|
||||||
void set_finkr(bool b) { finkr = b; }
|
{ shown = b; }
|
||||||
void set_memo (bool b) { memo = b; }
|
// @cmember Setta il flag di fincatura sinistra
|
||||||
|
void set_finkl(bool b)
|
||||||
|
{ finkl = b; }
|
||||||
|
// @cmember Setta il flag di fincatura destra
|
||||||
|
void set_finkr(bool b)
|
||||||
|
{ finkr = b; }
|
||||||
|
// @cmember Setta il flag di campo memo
|
||||||
|
void set_memo (bool b)
|
||||||
|
{ memo = b; }
|
||||||
|
// @cmember Permette di stampare i flags sulla maschera di editing <p m>
|
||||||
void print_on(TMask& m);
|
void print_on(TMask& m);
|
||||||
|
// @cmember Legge i flgs dalla maschera <p m>
|
||||||
void read_from(const TMask& m);
|
void read_from(const TMask& m);
|
||||||
|
|
||||||
|
// @cmember Aggiorna i flags con la stringa <p s>
|
||||||
bool update(const char* s);
|
bool update(const char* s);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @class TPrint_section | Classe per la gestione della stampa di una sezione di <c TForm>
|
||||||
|
//
|
||||||
|
// @base public | TArray
|
||||||
class TPrint_section : public TArray
|
class TPrint_section : public TArray
|
||||||
|
|
||||||
|
// @author:(INTERNAL) Guido, Angelo, Villa
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
// @cmember Maschera di edit della sezione corrente
|
||||||
static TMask* _msk;
|
static TMask* _msk;
|
||||||
|
|
||||||
word _height; // Altezza della sezione
|
// @cmember Altezza della sezione
|
||||||
word _ofspc; // Offset prima colonna
|
word _height;
|
||||||
word _ofsvr; // Offset verticale intestazione colonna
|
// @cmember Offset prima colonna
|
||||||
word _nfld; // number of columns if columnwise
|
word _ofspc;
|
||||||
bool _dirty; // Flag di modifica parametri
|
// @cmember Offset verticale intestazione colonna
|
||||||
bool _columnwise; // Columnwise field specification
|
word _ofsvr;
|
||||||
bool _temp; // temporanea (da non salvare)
|
// @cmember Numero di colonne se COLUMNWISE
|
||||||
|
word _nfld;
|
||||||
|
// @cmember Flag di modifica parametri
|
||||||
|
bool _dirty;
|
||||||
|
// @cmember Specifica la sezione COLUMNWISE
|
||||||
|
bool _columnwise;
|
||||||
|
// @cmember Indica se si tratta di una sezione temporanea (da non salvare)
|
||||||
|
bool _temp;
|
||||||
|
|
||||||
TForm* _form; // Form cui appartiene alla sezione
|
// @cmember <c TForm> a cui appartiene la sezione
|
||||||
char _sec_type; // H, B, F, G
|
TForm* _form;
|
||||||
pagetype _page_type; // Tipo della pagina
|
// @cmember Tipo della sezione da stampare (<p H>=header, <p B>=body
|
||||||
bool _subsection; // e' una sottosezione
|
// <p F>=footer, <p G>=background)
|
||||||
|
char _sec_type;
|
||||||
|
// @cmember Posizione della pagina da stampare (vedi <t pagetype>)
|
||||||
|
pagetype _page_type;
|
||||||
|
// @cmember Indica se si tratta di una sottosezione
|
||||||
|
bool _subsection;
|
||||||
|
|
||||||
TArray _item; // Lista dei campi da stampare
|
// @cmember Lista dei campi da stampare
|
||||||
int _repeat_count; // n. ripetizioni eseguite
|
TArray _item;
|
||||||
|
// @cmember Numero di ripetizione eseguite
|
||||||
|
int _repeat_count;
|
||||||
|
|
||||||
int _tab[MAXCOLUMNS]; // columns offset if columnwise
|
// @cmember Offset delle colonne se COLUMNWISE
|
||||||
|
int _tab[MAXCOLUMNS];
|
||||||
|
|
||||||
|
// @cmember Fa una copia della print_section
|
||||||
const TPrint_section& copy(const TPrint_section& ps);
|
const TPrint_section& copy(const TPrint_section& ps);
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember Stampa la sezione su file di testo
|
||||||
virtual void print_on(ostream& out) const;
|
virtual void print_on(ostream& out) const;
|
||||||
|
// @cmember Crea un nuovo <c TForm_item> di formato <p key> ritornandone un puntatore
|
||||||
virtual TForm_item* parse_item(const TString& key);
|
virtual TForm_item* parse_item(const TString& key);
|
||||||
|
// @cmember Crea un nuovo <c TForm_item> ritornandone un puntatore (chiama <mf TForm_item::parse_item>)
|
||||||
TForm_item* parse_item(TScanner& scanner);
|
TForm_item* parse_item(TScanner& scanner);
|
||||||
|
|
||||||
// handlers for section editing
|
// @cmember Handler del bottone per editare in modo dettagliato un <c TForm_item>
|
||||||
static bool detail_field_handler(TMask_field&, KEY);
|
static bool detail_field_handler(TMask_field&, KEY);
|
||||||
|
// @cmember Handler del bottone per editare gli specials di un <c TForm_item>
|
||||||
static bool special_field_handler(TMask_field&, KEY);
|
static bool special_field_handler(TMask_field&, KEY);
|
||||||
|
// @cmember Handler dello sheet presente nella maschera di edit della sezione
|
||||||
static bool detail_field_notify (TSheet_field&, int, KEY);
|
static bool detail_field_notify (TSheet_field&, int, KEY);
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
// @cmember Ritorna la <c TPrintrow> della riga <p num>
|
||||||
TPrintrow& row(int num);
|
TPrintrow& row(int num);
|
||||||
TForm& form() const { return *_form; }
|
// @cmember Ritorna il <c TForm> a cui appartiene la sezione
|
||||||
|
TForm& form() const
|
||||||
|
{ return *_form; }
|
||||||
|
|
||||||
TArray& field_array() { return _item; }
|
// @cmember Ritorna la lista dei campi da stampare
|
||||||
TForm_item& field(int n) const { return (TForm_item&)_item[n]; }
|
TArray& field_array()
|
||||||
|
{ return _item; }
|
||||||
|
// @cmember Ritorna l'<p n>-esimo campo da stampare
|
||||||
|
TForm_item& field(int n) const
|
||||||
|
{ return (TForm_item&)_item[n]; }
|
||||||
|
// @cmember Cerca e ritorna l'<p id>-esimo campo da stampare
|
||||||
TForm_item& find_field(short id) const;
|
TForm_item& find_field(short id) const;
|
||||||
void destroy_field(int n, bool c = TRUE) { _item.destroy(n, c); }
|
// @cmember Rimuove uno o tutti i campi da stampare (chiama <mf TArray::destroy>)
|
||||||
void destroy_fields() { _item.destroy(); }
|
void destroy_field(int n, bool c = TRUE)
|
||||||
|
{ _item.destroy(n, c); }
|
||||||
|
// @cmember Ritmuove tutti i campi da stampare (chiama <mf TArray::destroy>)
|
||||||
|
void destroy_fields()
|
||||||
|
{ _item.destroy(); }
|
||||||
|
// @cmember Viene sostiuito il campo di posizione <p n> col campo <p f> (chiama <mf TArray::add>)
|
||||||
void change_field(int n, TForm_item* f);
|
void change_field(int n, TForm_item* f);
|
||||||
|
// @cmember Viene inserito il campo di posizione <p n> col campo <p f> (chiama <mf TArray::insert>)
|
||||||
void insert_field(int n, TForm_item* f);
|
void insert_field(int n, TForm_item* f);
|
||||||
|
// @cmember Viene aggiunto i coda alla'array il campo <p f> (chiama <mf TArray::add>)
|
||||||
void add_field(TForm_item* f);
|
void add_field(TForm_item* f);
|
||||||
|
|
||||||
virtual bool& temp() { return _temp; };
|
// @cmember Ritorna se si tratta di una sezione temporanea
|
||||||
virtual bool temp() const { return _temp; };
|
virtual bool& temp()
|
||||||
|
{ return _temp; };
|
||||||
|
// @cmember Ritorna se si tratta di una sezione temporanea
|
||||||
|
virtual bool temp() const
|
||||||
|
{ return _temp; };
|
||||||
|
|
||||||
word fields() const { return _item.items(); }
|
// @cmember Ritorna il numero di campi da stampare
|
||||||
// returns 0 if not columnwise; means n. of printable fields
|
word fields() const
|
||||||
word columns() { tab(0); return _nfld; }
|
{ return _item.items(); }
|
||||||
word height() const { return _height; }
|
// @cmember Ritorna il numero di campi stampabili (0 se non e' COLUMNWISE)
|
||||||
word ofspc() const { return _ofspc; }
|
word columns()
|
||||||
word ofsvr() const { return _ofsvr; }
|
{ tab(0); return _nfld; }
|
||||||
|
// @cmember Ritorna l'altezza della sezione
|
||||||
|
word height() const
|
||||||
|
{ return _height; }
|
||||||
|
// @cmember Ritorna l'offset della prima colonna
|
||||||
|
word ofspc() const
|
||||||
|
{ return _ofspc; }
|
||||||
|
// @cmember Ritorna l'offset verticale intestazione colonna
|
||||||
|
word ofsvr() const
|
||||||
|
{ return _ofsvr; }
|
||||||
|
// @cmember Modifica i parametri di offset <p x> e <p y> del foglio
|
||||||
void offset(int& x, int& y);
|
void offset(int& x, int& y);
|
||||||
void set_repeat_count(int x) { _repeat_count = x; }
|
// @cmember Setta il numero di ripetizioni eseguite
|
||||||
|
void set_repeat_count(int x)
|
||||||
|
{ _repeat_count = x; }
|
||||||
|
|
||||||
virtual bool ok() const { return height() > 0 || fields() > 0; }
|
// @cmember Controlla che si tratti di una sezione vaida (altezza e numero di campi diversi da 0)
|
||||||
|
virtual bool ok() const
|
||||||
|
{ return height() > 0 || fields() > 0; }
|
||||||
|
|
||||||
|
// @cmember Azzera tutte le righe della sezione di stampa
|
||||||
void reset();
|
void reset();
|
||||||
|
// @cmember Aggiorna tutti i campi e li stampa
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
|
// @cmember Legge i campi dal file di testo (vedi <c TScanner>)
|
||||||
bool parse(TScanner& scanner);
|
bool parse(TScanner& scanner);
|
||||||
|
|
||||||
|
// @cmember Legge dal record <p rec> altezza e offset prima colonna della sezione
|
||||||
bool read_from(const TRectype& rec);
|
bool read_from(const TRectype& rec);
|
||||||
|
// @cmember Settano il record <p rec> con i valori attuali della sezione
|
||||||
void print_on(TRectype& rec);
|
void print_on(TRectype& rec);
|
||||||
|
|
||||||
|
// @cmember Esegue l'edit della sezione di stampa
|
||||||
bool edit(const char* title);
|
bool edit(const char* title);
|
||||||
char section_type() const { return _sec_type; }
|
// @cmember Ritorna il tipo della sezione da stampare (vedi <md TPrint_section::_sec_type>)
|
||||||
pagetype page_type() const { return _page_type; }
|
char section_type() const
|
||||||
|
{ return _sec_type; }
|
||||||
|
// @cmember Ritorna il tipo di pagina da stampare (vedi <t pagetype>)
|
||||||
|
pagetype page_type() const
|
||||||
|
{ return _page_type; }
|
||||||
|
|
||||||
bool dirty() const { return _dirty; }
|
// @cmember Ritorna TRUE se sono stati modificati i parametri
|
||||||
void set_dirty(bool d = TRUE) { _dirty = d; }
|
bool dirty() const
|
||||||
bool columnwise() const { return _columnwise; }
|
{ return _dirty; }
|
||||||
// ritorna l'offset della colonna corrispondente se columnwise
|
// @cmember Setta il flag di modifica parametri
|
||||||
|
void set_dirty(bool d = TRUE)
|
||||||
|
{ _dirty = d; }
|
||||||
|
// @cmember Ritorna TRUE se si tratta di una campo COLUMNWISE
|
||||||
|
bool columnwise() const
|
||||||
|
{ return _columnwise; }
|
||||||
|
// @cmember Ritorna l'offset della colonna <p col> se COLUMNWISE
|
||||||
int tab(int col);
|
int tab(int col);
|
||||||
|
// @cmember Annulla (setta a -1) l'offset delle colonne se COLUMNWISE
|
||||||
void reset_tabs();
|
void reset_tabs();
|
||||||
|
|
||||||
const TPrint_section& operator=(const TPrint_section& ps) { return copy(ps); }
|
// @cmember Opertatore di assegnamento
|
||||||
|
const TPrint_section& operator=(const TPrint_section& ps)
|
||||||
|
{ return copy(ps); }
|
||||||
|
// @cmember Costruttore
|
||||||
TPrint_section(TForm* parent, char st, pagetype pt, bool subsection = FALSE);
|
TPrint_section(TForm* parent, char st, pagetype pt, bool subsection = FALSE);
|
||||||
TPrint_section(const TPrint_section& ps) { copy(ps); }
|
// @cmember Costruttore
|
||||||
|
TPrint_section(const TPrint_section& ps)
|
||||||
|
{ copy(ps); }
|
||||||
|
// @cmember Distruttore
|
||||||
virtual ~TPrint_section();
|
virtual ~TPrint_section();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @class TForm_item | Classe per la definizione per ogni campo del <c TForm>
|
||||||
|
//
|
||||||
|
// @base public | TObject
|
||||||
class TForm_item : public TObject
|
class TForm_item : public TObject
|
||||||
|
|
||||||
|
// @author:(INTERNAL) Guido, Angelo, Villa
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
// @cfriend TPrint_section
|
||||||
friend class TPrint_section;
|
friend class TPrint_section;
|
||||||
|
|
||||||
|
// @cmember Sezione da stampare (vedi <c TPrint_section>)
|
||||||
TPrint_section* _section;
|
TPrint_section* _section;
|
||||||
|
// @cmember Flag del campo (vedi <c TForm_flags>)
|
||||||
TForm_flags _flag;
|
TForm_flags _flag;
|
||||||
|
// @cmember Gruppi a cui appartiene il campo
|
||||||
TBit_array _group;
|
TBit_array _group;
|
||||||
|
// @cmember Special attribuiti al campo (vedi <c TAssoc_array>)
|
||||||
TAssoc_array _special;
|
TAssoc_array _special;
|
||||||
|
// @cmember Indica se si tratta di un campo temporaneo (da non salvare)
|
||||||
bool _temp;
|
bool _temp;
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember Identificatore del campo
|
||||||
short _id, _x, _y, _width, _height, _effective_height, _ofs;
|
short _id;
|
||||||
|
// @cmember Coordinata X (in caratteri) del campo
|
||||||
|
short _x;
|
||||||
|
// @cmember Coordinata Y (in caratteri) del campo
|
||||||
|
short _y;
|
||||||
|
// @cmember Larghezza del campo (in caratteri)
|
||||||
|
short _width;
|
||||||
|
// @cmember Altezza del campo (in caratteri)
|
||||||
|
short _height;
|
||||||
|
// @cmember Altezza effettiva del campo
|
||||||
|
short _effective_height;
|
||||||
|
// @cmember Offset del campo rispetto l'inizio della colonna (usato per campi
|
||||||
|
// appartenenti a sezioni COLUMNWISE)
|
||||||
|
short _ofs;
|
||||||
|
// @cmember Prompt del campo
|
||||||
TString _prompt;
|
TString _prompt;
|
||||||
TString _desc, _col_head;
|
// @cmember Descrizione del campo
|
||||||
|
TString _desc;
|
||||||
|
// @cmember Intestazione della colonna (usato per campi appartenenti a sezioni COLUMNWISE)
|
||||||
|
TString _col_head;
|
||||||
|
// @cmember Array di message che manda il campo
|
||||||
TString_array _message;
|
TString_array _message;
|
||||||
|
|
||||||
|
// @cmember Stampa sullo stream <p out> le caratteristiche del campo
|
||||||
virtual void print_on(ostream& out) const;
|
virtual void print_on(ostream& out) const;
|
||||||
|
// @cmember Stampa sullo stream <p out> il corpo del campo
|
||||||
virtual void print_body(ostream& out) const;
|
virtual void print_body(ostream& out) const;
|
||||||
|
|
||||||
|
// @cmember Legge dal file di testo identificatore, altezza e larghezza del campo
|
||||||
virtual bool parse_head(TScanner&);
|
virtual bool parse_head(TScanner&);
|
||||||
|
// @cmember Legge dal file di testo il tipo di campo (prima riga)
|
||||||
virtual bool parse_item(TScanner&);
|
virtual bool parse_item(TScanner&);
|
||||||
|
|
||||||
|
// @cmember Ritorna il messaggio <p m>-esimo del campo
|
||||||
TToken_string& message(int m = 0);
|
TToken_string& message(int m = 0);
|
||||||
|
// @cmember Manda il messaggio al campo <p dest>
|
||||||
void send_message(const TString& cmd, TForm_item& dest) const;
|
void send_message(const TString& cmd, TForm_item& dest) const;
|
||||||
|
// @cmember Esegue il messaggio <p m>
|
||||||
bool do_message(int m = 0);
|
bool do_message(int m = 0);
|
||||||
|
|
||||||
|
// @cmember Stampa una stringa alla posizione indicata
|
||||||
void string_at(int x, int y, const char* s);
|
void string_at(int x, int y, const char* s);
|
||||||
|
|
||||||
|
// @cmember Cerca la stringa <p s> tra gli item e ne ritorna l'<p n>-esimo elemnto (NON IMPLEMENTATA)
|
||||||
const char* get_special_item(const char* s, int n) const;
|
const char* get_special_item(const char* s, int n) const;
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
// @cmember Ritorna il numero identificatore del campo
|
||||||
|
short id() const
|
||||||
|
{ return _id; }
|
||||||
|
// @cmember Ritorna il reference del numero identificatore del campo
|
||||||
|
virtual short& id()
|
||||||
|
{ return _id; };
|
||||||
|
// @cmember Ritorna la larghezza del campo (in caratteri)
|
||||||
|
virtual int width() const
|
||||||
|
{ return _width; }
|
||||||
|
// @cmember Ritorna il reference della larghezza del campo (in caratteri)
|
||||||
|
virtual short& width()
|
||||||
|
{ return _width; }
|
||||||
|
// @cmember Ritorna l'altezza del campo (in caratteri)
|
||||||
|
virtual int height() const
|
||||||
|
{ return _height; }
|
||||||
|
// @cmember Ritorna il reference dell'altezza del campo (in caratteri)
|
||||||
|
virtual short& height()
|
||||||
|
{ return _height; }
|
||||||
|
// @cmember Ritorna l'offset del campo rispetto l'inizio della colonna
|
||||||
|
virtual short& ofs()
|
||||||
|
{ return _ofs; }
|
||||||
|
// @cmember Ritorna l'altezza effettiva del campo
|
||||||
|
virtual int effective_height() const
|
||||||
|
{ return _effective_height; }
|
||||||
|
|
||||||
short id() const { return _id; }
|
// @cmember Ritorna se si tratta di una campo temporaneo (reference)
|
||||||
virtual short& id() { return _id; };
|
virtual bool& temp()
|
||||||
virtual int width() const { return _width; }
|
{ return _temp; };
|
||||||
virtual short& width() { return _width; }
|
// @cmember Ritorna se si tratta di una campo temporaneo
|
||||||
virtual int height() const { return _height; }
|
virtual bool temp() const
|
||||||
virtual short& height() { return _height; }
|
{ return _temp; };
|
||||||
virtual short& ofs() { return _ofs; }
|
// @cmember Ritorna se il campo e' memo
|
||||||
virtual int effective_height() const { return _effective_height; }
|
bool has_memo() const
|
||||||
|
{ return _flag.memo; }
|
||||||
virtual bool& temp() { return _temp; };
|
|
||||||
virtual bool temp() const { return _temp; };
|
|
||||||
bool has_memo() const { return _flag.memo; }
|
|
||||||
|
|
||||||
// virtual short& x() { return _x; };
|
// virtual short& x() { return _x; };
|
||||||
virtual void set_x(short x) {_x=x;}
|
// @cmember Setta la ccordinata X (in caratteri) del campo
|
||||||
|
virtual void set_x(short x)
|
||||||
|
{_x=x;}
|
||||||
|
// @cmember Ritorna la coordinata X del campo
|
||||||
virtual short x();
|
virtual short x();
|
||||||
virtual short& y() { return _y; }
|
// @cmember Ritorna il reference della coordinata Y del campo
|
||||||
virtual short y() const { return _y; }
|
virtual short& y()
|
||||||
virtual short get_column() { CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); return _x; }
|
{ return _y; }
|
||||||
virtual void set_column(short c) { CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); _x = c;}
|
// @cmember Ritorna la coordinata Y del campo
|
||||||
virtual const int fields() { return 0;}
|
virtual short y() const
|
||||||
|
{ return _y; }
|
||||||
|
// @cmember Ritorna la coordinata X del campo se e' COLUMNWISE (altrimenti <f CHECK>)
|
||||||
|
virtual short get_column()
|
||||||
|
{ CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); return _x; }
|
||||||
|
// @cmember Setta la coordinata X del campo se e' COLUMNWISE (altrimenti <f CHECK>)
|
||||||
|
virtual void set_column(short c)
|
||||||
|
{ CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); _x = c;}
|
||||||
|
// @cmember Ritorna il numero di campi da stampare
|
||||||
|
virtual const int fields()
|
||||||
|
{ return 0;}
|
||||||
|
|
||||||
bool shown() const { return _flag.shown; }
|
// @cmember Ritorna se si tratta di un campo visibile
|
||||||
bool hidden() const { return !_flag.shown; }
|
bool shown() const
|
||||||
bool enabled() const { return _flag.enabled; }
|
{ return _flag.shown; }
|
||||||
bool disabled() const { return !_flag.enabled; }
|
// @cmember Ritorna se si tratta di un campo nascosto
|
||||||
bool automagic() const { return _flag.automagic; }
|
bool hidden() const
|
||||||
bool finkl() const { return _flag.finkl; }
|
{ return !_flag.shown; }
|
||||||
bool finkr() const { return _flag.finkr; }
|
// @cmember Ritorna se si tratta di un campo abilitato
|
||||||
bool memo() const { return _flag.memo; }
|
bool enabled() const
|
||||||
|
{ return _flag.enabled; }
|
||||||
|
// @cmember Ritorna se si tratta di un campo disabilitato
|
||||||
|
bool disabled() const
|
||||||
|
{ return !_flag.enabled; }
|
||||||
|
// @cmember Ritorna se si tratta di un campo automagic (vedi <md TForm_flags::automagic>)
|
||||||
|
bool automagic() const
|
||||||
|
{ return _flag.automagic; }
|
||||||
|
// @cmember Ritorna se il campo possiede un carattere si fincatura sinistra
|
||||||
|
bool finkl() const
|
||||||
|
{ return _flag.finkl; }
|
||||||
|
// @cmember Ritorna se il campo possiede un carattere si fincatura destra
|
||||||
|
bool finkr() const
|
||||||
|
{ return _flag.finkr; }
|
||||||
|
// @cmember Ritorna se si tratta di campo memo
|
||||||
|
bool memo() const
|
||||||
|
{ return _flag.memo; }
|
||||||
|
|
||||||
|
// @cmember Legge da file di testo le caratteristiche del campo
|
||||||
virtual bool parse(TScanner&);
|
virtual bool parse(TScanner&);
|
||||||
|
// @cmember Aggiorna il contenuto del campo e lo mette nella riga di stampa
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
|
|
||||||
|
// @cmember Compila la maschera coi dati del campo
|
||||||
virtual void print_on(TMask& m);
|
virtual void print_on(TMask& m);
|
||||||
|
// @cmember Registra sul record i dati del campo
|
||||||
virtual void print_on(TRectype& rform);
|
virtual void print_on(TRectype& rform);
|
||||||
|
// @cmember Compila la <c TToken_string> <p t> coi dati editabili del campo
|
||||||
virtual void print_on_sheet_row(TToken_string& t) const;
|
virtual void print_on_sheet_row(TToken_string& t) const;
|
||||||
|
|
||||||
|
// @cmember Legge le caratteristiche di un campo da una <c TMask>
|
||||||
virtual void read_from(const TMask& m);
|
virtual void read_from(const TMask& m);
|
||||||
|
// @cmember Legge le caratteristiche di un campo da un <c TRectype>
|
||||||
virtual bool read_from(const TRectype& rform);
|
virtual bool read_from(const TRectype& rform);
|
||||||
|
// @cmember Legge le caratteristiche di un campo da una <c TToken_string>
|
||||||
virtual void read_from(TToken_string& s);
|
virtual void read_from(TToken_string& s);
|
||||||
|
|
||||||
|
// @cmember Edita il campo usando la maschera <p m>
|
||||||
virtual bool edit(TMask& m);
|
virtual bool edit(TMask& m);
|
||||||
|
|
||||||
virtual const char* get() const { return _prompt; }
|
// @cmember Ritorna il prompt del campo
|
||||||
virtual bool set(const char* s) { _prompt = s; return TRUE; }
|
virtual const char* get() const
|
||||||
|
{ return _prompt; }
|
||||||
|
// @cmember Setta il prompt del campo
|
||||||
|
virtual bool set(const char* s)
|
||||||
|
{ _prompt = s; return TRUE; }
|
||||||
|
|
||||||
// example() ritorna un esempio del formato corrente
|
// @cmember Ritorna un esempio del formato corrente
|
||||||
virtual const char* example() const { return ""; }
|
virtual const char* example() const
|
||||||
|
{ return ""; }
|
||||||
|
|
||||||
const TString& col_head() const {CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); return _col_head;}
|
// @cmember Ritorna se si tratta di un campo appartenente ad una sezione
|
||||||
void set_col_head(const char* s) {CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); _col_head = s;}
|
// COLUMNWISE (<f CKECK> se non e' COLUNMNWISE)
|
||||||
const TString& prompt() const { return _prompt; }
|
const TString& col_head() const
|
||||||
void set_prompt(const char* s) { _prompt = s; }
|
{CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); return _col_head;}
|
||||||
|
// @cmember Setta se si tratta di un campo appartenente ad una sezione
|
||||||
|
// COLUMNWISE (<f CKECK> se non e' COLUNMNWISE)
|
||||||
|
void set_col_head(const char* s)
|
||||||
|
{CHECK(_section->columnwise(),"La sezione non e' COLUMNWISE"); _col_head = s;}
|
||||||
|
|
||||||
virtual TToken_string& memo_info(); // Da' CHECK
|
// @cmember Ritorna il prompt del campo
|
||||||
virtual const TString& picture() const; // Da' CHECK
|
const TString& prompt() const
|
||||||
virtual void set_picture(const char*); // Da' CHECK
|
{ return _prompt; }
|
||||||
|
// @cmember Setta il prompt del campo
|
||||||
|
void set_prompt(const char* s)
|
||||||
|
{ _prompt = s; }
|
||||||
|
|
||||||
TPrint_section& section() const { return *_section; }
|
// @cmember Ritorna il memo associato al campo. (<f CHECK> per un generico item)
|
||||||
TForm& form() const { return _section->form(); }
|
virtual TToken_string& memo_info();
|
||||||
|
// @cmember Ritorna la picture del campo. (<f CHECK> per un generico item)
|
||||||
|
virtual const TString& picture() const;
|
||||||
|
// @cmember Setta la picture del campo. (<f CHECK> per un generico item)
|
||||||
|
virtual void set_picture(const char*);
|
||||||
|
|
||||||
|
// @cmember Ritorna la <c TPrint_section> del campo
|
||||||
|
TPrint_section& section() const
|
||||||
|
{ return *_section; }
|
||||||
|
// @cmember Ritorna la <c TForm> della sezione del campo
|
||||||
|
TForm& form() const
|
||||||
|
{ return _section->form(); }
|
||||||
|
// @cmember Cerca il campo identificato da <p id> !!!
|
||||||
TForm_item& find_field(const TString& id) const;
|
TForm_item& find_field(const TString& id) const;
|
||||||
|
|
||||||
void set_dirty(bool d = TRUE) { _flag.dirty = d; }
|
// @cmember Setta il flag di campo modificato
|
||||||
bool dirty() const { return _flag.dirty; }
|
void set_dirty(bool d = TRUE)
|
||||||
|
{ _flag.dirty = d; }
|
||||||
|
// @cmember Ritorna il flag di campo modificato
|
||||||
|
bool dirty() const
|
||||||
|
{ return _flag.dirty; }
|
||||||
|
|
||||||
bool in_group(byte g) const { return g == 0 || _group[g]; }
|
// @cmember Ritorna se il campo appartiene al gruppo <p g>
|
||||||
const TString& key() const { return _desc; }
|
bool in_group(byte g) const
|
||||||
|
{ return g == 0 || _group[g]; }
|
||||||
|
// @cmember Ritorna la descrizione del campo
|
||||||
|
const TString& key() const
|
||||||
|
{ return _desc; }
|
||||||
|
// @cmember Riempie la <c TToken_string> <p row> coi dati del campo
|
||||||
virtual void print_on(TToken_string& row) const;
|
virtual void print_on(TToken_string& row) const;
|
||||||
|
|
||||||
virtual void show(bool on = TRUE) { _flag.shown = on; }
|
// @cmember Setta il flag di campo visibile
|
||||||
void hide() { show(FALSE); }
|
virtual void show(bool on = TRUE)
|
||||||
|
{ _flag.shown = on; }
|
||||||
|
// @cmember Nasconde il campo
|
||||||
|
void hide()
|
||||||
|
{ show(FALSE); }
|
||||||
|
// @cmember Abilita/Disabilita il campo
|
||||||
virtual void enable(bool on = TRUE);
|
virtual void enable(bool on = TRUE);
|
||||||
void disable() { enable(FALSE); }
|
// @cmember Disabilita il campo (chiama <mf TForm_item::enable>)
|
||||||
|
void disable()
|
||||||
|
{ enable(FALSE); }
|
||||||
|
|
||||||
// variabili personalizzate low-level
|
// @cmember Ritorna il numero di specials del campo
|
||||||
int special_items() const { return _special.items(); }
|
int special_items() const
|
||||||
TAssoc_array& specials() const { return (TAssoc_array&)_special; }
|
{ return _special.items(); }
|
||||||
|
// @cmember Ritorna gli specials del campo
|
||||||
|
TAssoc_array& specials() const
|
||||||
|
{ return (TAssoc_array&)_special; }
|
||||||
|
|
||||||
// high-level
|
// @cmember NON IMPLEMENTATA
|
||||||
int get_special_names(TString_array& r);
|
int get_special_names(TString_array& r);
|
||||||
const char* get_special_value(const char* s) const { return get_special_item(s, 1); }
|
// @cmember Ritorna il secondo elemento dell'item corrispondente alla stringa <p s>
|
||||||
const char* get_special_type (const char* s) const { return get_special_item(s, 0); }
|
// (chiama <mf TForm_item::get_special_item> che NON E' IMPLEMENTATA)
|
||||||
const char* get_special_desc (const char* s) const { return get_special_item(s, 2); }
|
const char* get_special_value(const char* s) const
|
||||||
|
{ return get_special_item(s, 1); }
|
||||||
|
// @cmember Ritorna il primo elemento dell'item corrispondente alla stringa <p s>
|
||||||
|
// (chiama <mf TForm_item::get_special_item> che NON E' IMPLEMENTATA)
|
||||||
|
const char* get_special_type (const char* s) const
|
||||||
|
{ return get_special_item(s, 0); }
|
||||||
|
// @cmember Ritorna il terzo elemento dell'item corrispondente alla stringa <p s>
|
||||||
|
// (chiama <mf TForm_item::get_special_item> che NON E' IMPLEMENTATA)
|
||||||
|
const char* get_special_desc (const char* s) const
|
||||||
|
{ return get_special_item(s, 2); }
|
||||||
|
|
||||||
|
// @cmember Costruttore
|
||||||
TForm_item(TPrint_section* section);
|
TForm_item(TPrint_section* section);
|
||||||
virtual ~TForm_item() {}
|
// @cmember Distruttore
|
||||||
|
virtual ~TForm_item()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// @class TMessagge | Classe per il passaggio dei messeggi base tra applicazioni
|
// @class TMessage | Classe per il passaggio dei messeggi base tra applicazioni
|
||||||
// e linea di comando
|
// e linea di comando
|
||||||
//
|
//
|
||||||
// @base public | TObject
|
// @base public | TObject
|
||||||
|
@ -1592,7 +1592,9 @@ WINDOW TMask::add_list (
|
|||||||
return f->win();
|
return f->win();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @cmember Aggiunge runtime un campo boolean alla maschera
|
// @mfunc Aggiunge runtime un campo boolean alla maschera
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna il descrittore del campo aggiunto
|
||||||
WINDOW TMask::add_boolean (
|
WINDOW TMask::add_boolean (
|
||||||
short id, // @parm Numero identificatore del campo da aggiungere
|
short id, // @parm Numero identificatore del campo da aggiungere
|
||||||
int page, // @parm Pagina nel quale aggiungere il campo
|
int page, // @parm Pagina nel quale aggiungere il campo
|
||||||
|
@ -1306,7 +1306,7 @@ void TSpreadsheet::on_idle()
|
|||||||
|
|
||||||
// @mfunc Cerca la colonna col
|
// @mfunc Cerca la colonna col
|
||||||
XI_OBJ* TSpreadsheet::find_column(
|
XI_OBJ* TSpreadsheet::find_column(
|
||||||
int col) const // @param Indice o identificatore colonna
|
int col) const // @parm Indice o identificatore colonna
|
||||||
{
|
{
|
||||||
CHECKD(col >= 0, "Bad column ", col);
|
CHECKD(col >= 0, "Bad column ", col);
|
||||||
if (col < FIRST_FIELD) // Se e' un indice trasformalo in identificatore
|
if (col < FIRST_FIELD) // Se e' un indice trasformalo in identificatore
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// $Id: relapp.cpp,v 1.70 1995-11-07 11:38:23 villa Exp $
|
|
||||||
#include <mailbox.h>
|
#include <mailbox.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -14,18 +13,38 @@
|
|||||||
// Array delle chiavi della maschera di ricerca
|
// Array delle chiavi della maschera di ricerca
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// @doc INTERNAL
|
||||||
|
|
||||||
|
// @class TChiave | Array delle chiavi della maschera di ricerca
|
||||||
|
// @base public | TObject
|
||||||
class TChiave : public TObject
|
class TChiave : public TObject
|
||||||
|
// @author:(INTERNAL) Guido
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
// @ccost MAX | 16 | Numero massimo di chiavi della maschera di ricerca
|
||||||
enum { MAX = 16 };
|
enum { MAX = 16 };
|
||||||
|
// @cmember Posizione delle chiavi nella msachera di ricerca
|
||||||
int _pos[MAX];
|
int _pos[MAX];
|
||||||
|
// @cmember Numero di chiavi presenti nella maschera di ricerca
|
||||||
byte _num;
|
byte _num;
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
// @cmember Aggiunge una nuova chiave alla posizione <p p>
|
||||||
void add(int p);
|
void add(int p);
|
||||||
int pos(byte n) const { return (n >= _num) ? -1 : _pos[n]; }
|
// @cmember Ritorna la posizione della chiave <p n>-esima (-1 se non esiste)
|
||||||
byte items() const { return _num; }
|
int pos(byte n) const
|
||||||
TChiave() : _num(0) {}
|
{ return (n >= _num) ? -1 : _pos[n]; }
|
||||||
virtual ~TChiave() {}
|
// @cmember Ritorna il numero di chiavi attualmente presente nella maschera
|
||||||
|
byte items() const
|
||||||
|
{ return _num; }
|
||||||
|
// @cmember Costruttore
|
||||||
|
TChiave() : _num(0)
|
||||||
|
{}
|
||||||
|
// @cmember Distruttore
|
||||||
|
virtual ~TChiave()
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
void TChiave::add(int p)
|
void TChiave::add(int p)
|
||||||
@ -70,6 +89,8 @@ TKey_array::TKey_array(const TMask* m) : _mask(m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TRelation_application
|
// TRelation_application
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -96,12 +117,15 @@ void TRelation_application::setkey()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// what - meaning
|
// @mfunc Setta i limiti
|
||||||
// 0 - nop
|
void TRelation_application::set_limits(
|
||||||
// 1 - first
|
byte what) // @parm tipo di limite da assegnare al record
|
||||||
// 2 - last
|
|
||||||
// 3 - both
|
// @comm I limiti possibili sono:
|
||||||
void TRelation_application::set_limits(byte what)
|
// @flag 0 | Nessuna operazione
|
||||||
|
// @flag 1 | Primo record
|
||||||
|
// @flag 2 | Ultimo record
|
||||||
|
// @flag 3 | Entrambi
|
||||||
{
|
{
|
||||||
if (has_filtered_cursor())
|
if (has_filtered_cursor())
|
||||||
{
|
{
|
||||||
@ -298,8 +322,15 @@ int TRelation_application::set_mode(int mode)
|
|||||||
return _mode;
|
return _mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Permette di autonumerare un record
|
||||||
bool TRelation_application::autonum(TMask* m, bool rec)
|
//
|
||||||
|
// @rdesc Ritorna se e' riuscito a creare una nuova autonumerazione:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Il campo chiave non e' vuoto
|
||||||
|
// @flag FALSE | Non e' riuscii ad autonumerare il campo chiave
|
||||||
|
bool TRelation_application::autonum(
|
||||||
|
TMask* m, // @parm Maschera a cui applicare l'autonumerazione
|
||||||
|
bool rec) // @parm Indica se registrare il record corrente
|
||||||
{
|
{
|
||||||
TToken_string k(get_next_key());
|
TToken_string k(get_next_key());
|
||||||
|
|
||||||
@ -321,8 +352,12 @@ bool TRelation_application::autonum(TMask* m, bool rec)
|
|||||||
return k.not_empty();
|
return k.not_empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Entra in modo di ricerca
|
||||||
void TRelation_application::query_mode(bool pre_ins)
|
void TRelation_application::query_mode(
|
||||||
|
bool pre_ins) // @parm Indica in quale modo andare:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Entra in modo MODE_QUERY_INSERT
|
||||||
|
// @flag FALSE | Entra in modo MODE_QUERY (default)
|
||||||
{
|
{
|
||||||
TMask* old = _mask;
|
TMask* old = _mask;
|
||||||
const bool was_open = old != NULL && old->is_open();
|
const bool was_open = old != NULL && old->is_open();
|
||||||
@ -479,8 +514,12 @@ bool TRelation_application::search_mode()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Controlla se una chiave e' completa ed esiste su file
|
||||||
bool TRelation_application::test_key(byte k, bool err)
|
//
|
||||||
|
// @rdesc Ritorna se la chave esiste sul file
|
||||||
|
bool TRelation_application::test_key(
|
||||||
|
byte k, // @parm Chiave da ricercare
|
||||||
|
bool err) // @parm Indica se visualizzare eventuali errori occorsi
|
||||||
{
|
{
|
||||||
const TChiave& chiave = _maskeys->key(k);
|
const TChiave& chiave = _maskeys->key(k);
|
||||||
bool onereq = FALSE, onefill = FALSE;
|
bool onereq = FALSE, onefill = FALSE;
|
||||||
@ -712,8 +751,12 @@ int TRelation_application::rewrite(const TMask& m)
|
|||||||
return r->status();
|
return r->status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc Cancella il record corrente
|
||||||
|
// @rdesc Ritorna se il record e' stato eliminato
|
||||||
bool TRelation_application::relation_remove()
|
bool TRelation_application::relation_remove()
|
||||||
|
|
||||||
|
// @comm Se la maschera e' in MODE_MOD non e' possibile cancellare il record e viene
|
||||||
|
// emesso un <f CHECK> di errore.
|
||||||
{
|
{
|
||||||
CHECK(_mask->mode() == MODE_MOD, "You can call remove in MODE_MOD only");
|
CHECK(_mask->mode() == MODE_MOD, "You can call remove in MODE_MOD only");
|
||||||
TRelation *r = get_relation();
|
TRelation *r = get_relation();
|
||||||
|
193
include/relapp.h
193
include/relapp.h
@ -13,108 +13,205 @@
|
|||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
class TKey_array;
|
class TKey_array;
|
||||||
|
|
||||||
|
// @class TRelation_application | Classe per la gestione di una apllicazione di manutenzione di uno
|
||||||
|
// o piu' archivi utilizzando una relazione
|
||||||
|
//
|
||||||
|
// @base public | TApplication
|
||||||
class TRelation_application : public TApplication
|
class TRelation_application : public TApplication
|
||||||
|
|
||||||
|
// @author:(INTERNAL) Guido
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
// @cmember Maschera corrente dell'applicazione
|
||||||
TMask* _mask;
|
TMask* _mask;
|
||||||
|
// @cmember Array di chiavi della maschera
|
||||||
TKey_array* _maskeys;
|
TKey_array* _maskeys;
|
||||||
TRecnotype _first, _last;
|
// @cmember Primo record
|
||||||
|
TRecnotype _first;
|
||||||
|
// @cmember Ultimo record
|
||||||
|
TRecnotype _last;
|
||||||
|
// @cmember Campo da utilizzare col bottone Ricerca
|
||||||
int _search_id;
|
int _search_id;
|
||||||
|
|
||||||
|
// @cmember Nome del programma chiamante
|
||||||
TString16 _autoins_caller;
|
TString16 _autoins_caller;
|
||||||
|
// @cmember Numero del record nuovo/editato
|
||||||
long _recins;
|
long _recins;
|
||||||
|
|
||||||
|
// @cmember Indica se e' stato chiamato col messaggio di link
|
||||||
bool _lnflag;
|
bool _lnflag;
|
||||||
|
// @cmember Contiene il codice del campo e il valore fisso
|
||||||
TToken_string _fixed;
|
TToken_string _fixed;
|
||||||
|
// @cmember Messaggio da passare all'utente per inidicare che e' stata fatta la rinumerazione
|
||||||
TString _renum_message;
|
TString _renum_message;
|
||||||
|
|
||||||
|
// @cmember Setta i campi fissati da <md TRelation_application::_fixed>
|
||||||
bool filter();
|
bool filter();
|
||||||
|
// @cmember Controlla se una chiave e' completa ed esiste su file
|
||||||
bool test_key(byte k, bool err);
|
bool test_key(byte k, bool err);
|
||||||
|
// @cmember Salva i contenuti della maschera su file
|
||||||
bool save(bool check_dirty);
|
bool save(bool check_dirty);
|
||||||
|
// @cmember Abilita la ricerca sulla maschera
|
||||||
void enable_query();
|
void enable_query();
|
||||||
|
// @cmember UNUSED
|
||||||
void set_toolbar(bool all);
|
void set_toolbar(bool all);
|
||||||
|
|
||||||
int set_mode(int mode); // Seleziona il nuovo modo e ritorna il vecchio
|
// @cmember Seleziona il nuovo modo e ritorna il vecchio
|
||||||
|
int set_mode(int mode);
|
||||||
|
// @cmember Setta i limiti
|
||||||
void set_limits(byte what = 0x3);
|
void set_limits(byte what = 0x3);
|
||||||
void query_insert_mode() { query_mode(TRUE); }
|
// @cmember Posiziona l'applicazione in modo richiesta/inserimento (chaima <mf TRelation_application::query_mode>)
|
||||||
void insert_mode(); // Entra in modo inserimento
|
void query_insert_mode()
|
||||||
bool relation_remove(); // Cancella il record corrente
|
{ query_mode(TRUE); }
|
||||||
|
// @cmember Entra in modo inserimento
|
||||||
|
void insert_mode();
|
||||||
|
// @cmember Cancella il record corrente
|
||||||
|
bool relation_remove();
|
||||||
|
// @cmember Ritorna il campo di ricerca della maschera
|
||||||
TMask_field* get_search_field() const;
|
TMask_field* get_search_field() const;
|
||||||
|
|
||||||
|
// @cmember Permette di autonumerare un record
|
||||||
bool autonum(TMask* m, bool rec);
|
bool autonum(TMask* m, bool rec);
|
||||||
bool has_filtered_cursor() const { return filtered() || force_cursor_usage();}
|
// @cmember Controlla se il <c TCursor> ha un filtro
|
||||||
|
bool has_filtered_cursor() const
|
||||||
|
{ return filtered() || force_cursor_usage();}
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember Effettua i controlli all'inizio dell'applicazione
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
|
// @cmember Effettua i controlli alla fine dell'applicazione
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
|
// @cmember Controlla se e' possibile modificare la ditta corrente durante l'esecuzione dell'applicazione
|
||||||
virtual bool firm_change_enabled() const;
|
virtual bool firm_change_enabled() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TLocalisamfile& file() const { return get_relation()->lfile(); } // File principale della relazione
|
// @cmember Ritorna il descrittore del file principale della relazione
|
||||||
TRecnotype first() const { return _first;}
|
TLocalisamfile& file() const
|
||||||
TRecnotype last() const { return _first;}
|
{ return get_relation()->lfile(); }
|
||||||
const TString& autoins_caller() const { return _autoins_caller;}
|
// @cmember Ritorna il primo record!!!
|
||||||
|
TRecnotype first() const
|
||||||
|
{ return _first;}
|
||||||
|
// @cmember Ritorna l'ultimo record!!!
|
||||||
|
TRecnotype last() const
|
||||||
|
{ return _first;}
|
||||||
|
// @cmember !!!
|
||||||
|
const TString& autoins_caller() const
|
||||||
|
{ return _autoins_caller;}
|
||||||
|
|
||||||
|
// @cmember Gestisce la barra dei menu' (chiama <mf TRelation_application::main_loop>)
|
||||||
virtual bool menu(MENU_TAG m);
|
virtual bool menu(MENU_TAG m);
|
||||||
virtual bool main_loop(); // Ciclo principale
|
// @cmember Ciclo principale
|
||||||
|
virtual bool main_loop();
|
||||||
|
|
||||||
virtual bool user_create() pure; // Inizializzazione dati utente
|
// @cmember Inizializzazione dei dati dell'utente
|
||||||
virtual bool user_destroy() pure; // Distruzione dati utente
|
virtual bool user_create() pure;
|
||||||
|
// @cmember Distruzione dei dati dell'utente
|
||||||
|
virtual bool user_destroy() pure;
|
||||||
|
|
||||||
void set_fixed(); // Fissa i campi non modificabili
|
// @cmember Fissa i campi non modificabili
|
||||||
bool search_mode(); // Attiva la maschera di ricerca
|
void set_fixed();
|
||||||
void query_mode(bool pre_ins = FALSE); // Entra in modo ricerca
|
// @cmember Attiva la maschera di ricerca
|
||||||
bool modify_mode(); // Entra in modo modifica
|
bool search_mode();
|
||||||
|
// @cmember Entra in modo di ricerca
|
||||||
|
void query_mode(bool pre_ins = FALSE);
|
||||||
|
// @cmember Entra in modo modifica
|
||||||
|
bool modify_mode();
|
||||||
|
// @cmember Legge i campi chiave della maschera e setta il cursore relativo
|
||||||
void setkey();
|
void setkey();
|
||||||
bool lnflag() const { return _lnflag;}
|
// @cmember !!!
|
||||||
// La richiesta della maschera da utilizzare per ogni fase di lavoro (ricerca, inserimento,
|
bool lnflag() const
|
||||||
// modifica avviene sempre in due tempi: changing_mask e get_mask. Cio' serve per gestire
|
{ return _lnflag;}
|
||||||
// Correttamente le applicazioni con mashere multiple. La prima funzione serve a sapere se
|
// @cmember Indica se la futura <mf TRelation_application::get_mask> ritornera' una maschera diversa
|
||||||
// la futura get_mask ritornera' una maschera diversa dalla corrente.
|
// dalla corrente.
|
||||||
|
// <nl>La richiesta della maschera da utilizzare per ogni fase di lavoro
|
||||||
|
// (ricerca, inserimento, modifica) avviene sempre in due tempi: <mf TRelation_application::changing_mask> e
|
||||||
|
// <mf TRelation_application::get_mask>. Cio' serve per gestire correttamente le applicazioni
|
||||||
|
// con mashere multiple.
|
||||||
virtual bool changing_mask(int mode) pure;
|
virtual bool changing_mask(int mode) pure;
|
||||||
virtual TMask* get_mask(int mode) pure; // Richiede la maschera da usare
|
// @cmember Richiede la maschera da usare
|
||||||
|
virtual TMask* get_mask(int mode) pure;
|
||||||
|
|
||||||
// metodo per far forzare la rigenerazione della lista interna di chiavi ad ogni find()
|
// @cmember Forza la rigenerazione della lista interna di chiavi ad ogni <mf TRealtion_application::find>
|
||||||
virtual bool changing_keys() const { return FALSE; }
|
virtual bool changing_keys() const
|
||||||
|
{ return FALSE; }
|
||||||
|
|
||||||
virtual TRelation* get_relation() const pure; // Relazione da modificare
|
// @cmember Ritorna la relazione da modificare
|
||||||
virtual int read(TMask& m); // Legge dalla relazione i valori nella maschera
|
virtual TRelation* get_relation() const pure;
|
||||||
virtual int write(const TMask& m); // Scrive sulla relazione i valori dalla maschera
|
// @cmember Legge dalla relazione i valori nella maschera <p m>
|
||||||
virtual int rewrite(const TMask& m); // Riscrive sulla relazione i valori dalla maschera
|
virtual int read(TMask& m);
|
||||||
virtual bool remove(); // Cancella il record corrente
|
// @cmember Scrive sulla relazione i valori dalla maschera <p m>
|
||||||
|
virtual int write(const TMask& m);
|
||||||
|
// @cmember Riscrive sulla relazione i valori dalla maschera <p m>
|
||||||
|
virtual int rewrite(const TMask& m);
|
||||||
|
// @cmember Cancella il record corrente
|
||||||
|
virtual bool remove();
|
||||||
|
|
||||||
// Richiede una stringa nella forma CAMPO1|VALORE1|CAMPO2|VALORE2|...|CAMPOn|VALOREn
|
// @cmember Richiede una stringa nella forma CAMPO1<pipe>VALORE1<pipe>CAMPO2<pipe>VALORE2<pipe>...
|
||||||
// contenente le coppie NUMERO_CAMPO_MASCHERA - VALORE_DA_ASSEGNARE che descrivono il
|
// <pipe>CAMPOn<pipe>VALOREn contenente le coppie NUMERO_CAMPO_MASCHERA - VALORE_DA_ASSEGNARE
|
||||||
// prossimo codice libero da utilizzare per la autonumerazione.
|
// che descrivono il prossimo codice libero da utilizzare per la autonumerazione.
|
||||||
// Nel caso di banale numerazione progressiva potrebbe essere implementata come
|
// <nl>Nel caso di banale numerazione progressiva potrebbe essere implementata come
|
||||||
// return format("%d|%s", F_NUM, get_relation()->items());
|
// return format("%d<pipe>%s", F_NUM, get_relation()-<gt>items());
|
||||||
virtual const char* get_next_key() { return ""; }
|
virtual const char* get_next_key()
|
||||||
|
{ return ""; }
|
||||||
|
|
||||||
// Richiede se il record corrente e' protetto (non cancellabile)
|
// @cmember Richiede se il record corrente e' protetto (non cancellabile)
|
||||||
virtual bool protected_record(TRectype&) { return FALSE; }
|
virtual bool protected_record(TRectype&)
|
||||||
|
{ return FALSE; }
|
||||||
|
|
||||||
virtual void init_query_mode(TMask&) { } // Inizializza la maschera per il modo ricerca
|
// @cmember Inizializza la maschera per il modo ricerca
|
||||||
virtual void init_query_insert_mode(TMask& m) { init_query_mode(m); }
|
virtual void init_query_mode(TMask&)
|
||||||
virtual void init_insert_mode(TMask&) { } // Inizializza la maschera per il modo inserimento
|
{ }
|
||||||
virtual void init_modify_mode(TMask&) { } // Inizializza la maschera per il modo modifica
|
// @cmember Inizializza la maschera per il modo ricerca ed inserimento (chiama <mf TRelation_application::init_query_mode>)
|
||||||
|
virtual void init_query_insert_mode(TMask& m)
|
||||||
|
{ init_query_mode(m); }
|
||||||
|
// @cmember Inizializza la maschera per il modo inserimento
|
||||||
|
virtual void init_insert_mode(TMask&)
|
||||||
|
{ }
|
||||||
|
// @cmember Inizializza la maschera per il modo modifica
|
||||||
|
virtual void init_modify_mode(TMask&)
|
||||||
|
{ }
|
||||||
|
|
||||||
virtual bool force_cursor_usage() const { return FALSE;}
|
// @cmember Simula l'utilizzo di un filtro da un'altra applicazione
|
||||||
virtual void write_enable(bool on = TRUE) { get_relation()->write_enable(0, on); }
|
virtual bool force_cursor_usage() const
|
||||||
void write_disable() { write_enable(FALSE); }
|
{ return FALSE;}
|
||||||
|
// @cmember Indica se abilitare/disabilitare la scrittura sul file
|
||||||
|
// principale (vedi <mf TRealtion::write_enable>)
|
||||||
|
virtual void write_enable(bool on = TRUE)
|
||||||
|
{ get_relation()->write_enable(0, on); }
|
||||||
|
// @cmember Indica se disabilitare la scrittura sul file principale (vedi <mf TRealtion::write_enable>)
|
||||||
|
void write_disable()
|
||||||
|
{ write_enable(FALSE); }
|
||||||
|
|
||||||
|
// @cmember Salva il record corrente e si predispone per un nuovo inserimento
|
||||||
virtual bool save_and_new() const;
|
virtual bool save_and_new() const;
|
||||||
|
|
||||||
void set_search_field(short id) { _search_id = id;} // Impone il campo da utilizzare col bottone Ricerca
|
// @cmember Impone il campo da utilizzare col bottone Ricerca
|
||||||
|
void set_search_field(short id)
|
||||||
|
{ _search_id = id;}
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
TMask& curr_mask() const { return *_mask; }
|
// @cmember Ritorna la maschera corrente
|
||||||
|
TMask& curr_mask() const
|
||||||
|
{ return *_mask; }
|
||||||
|
|
||||||
bool filtered() const { return _fixed.not_empty(); }
|
// @cmember Ritorna se sono stati posti dei filtri sul file corrente
|
||||||
|
bool filtered() const
|
||||||
|
{ return _fixed.not_empty(); }
|
||||||
|
// @cmember Cerca un record corrispondete alla chiava <p key> (0 prima chiave completa!!!)
|
||||||
bool find(byte key = 0);
|
bool find(byte key = 0);
|
||||||
|
// @cmember Costruisce il membro <md TRelation_application::_fixed>
|
||||||
void set_link(TMask & m, const char * keyexpr);
|
void set_link(TMask & m, const char * keyexpr);
|
||||||
|
|
||||||
|
// @cmember Costruttore
|
||||||
TRelation_application();
|
TRelation_application();
|
||||||
|
// @cmember Distruttore
|
||||||
virtual ~TRelation_application();
|
virtual ~TRelation_application();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: relation.h,v 1.32 1995-12-29 12:09:12 andrea Exp $ */
|
/* $Id: relation.h,v 1.33 1996-01-31 17:18:43 andrea Exp $ */
|
||||||
// join.h
|
// join.h
|
||||||
// fv 12/8/93
|
// fv 12/8/93
|
||||||
// join class for isam files
|
// join class for isam files
|
||||||
@ -20,7 +20,7 @@ class TSort;
|
|||||||
//
|
//
|
||||||
// @base public | TObject
|
// @base public | TObject
|
||||||
class TRelation : public TObject
|
class TRelation : public TObject
|
||||||
// @author(:INTERNAL) Sandro
|
// @author:(INTERNAL) Sandro
|
||||||
{
|
{
|
||||||
// @cfriend TRelationdef
|
// @cfriend TRelationdef
|
||||||
friend class TRelationdef;
|
friend class TRelationdef;
|
||||||
@ -29,7 +29,7 @@ class TRelation : public TObject
|
|||||||
// @cfriend TCursor
|
// @cfriend TCursor
|
||||||
friend class TCursor;
|
friend class TCursor;
|
||||||
|
|
||||||
// @access Provate Member
|
// @access Private Member
|
||||||
|
|
||||||
// @cmember Stato della relazione
|
// @cmember Stato della relazione
|
||||||
TToken_string _status;
|
TToken_string _status;
|
||||||
@ -220,7 +220,7 @@ public:
|
|||||||
// @base public | TArray
|
// @base public | TArray
|
||||||
class TRecord_array : private TArray
|
class TRecord_array : private TArray
|
||||||
|
|
||||||
// @author(:ITERNAL) Guido
|
// @author:(INTERNAL) Guido
|
||||||
|
|
||||||
// @access Private Member
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
@ -283,8 +283,13 @@ void TSheet::handler(WINDOW win, EVENT* ep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @func ???!!!???
|
// @mfunc Converte le coordinate da logiche (caratteri) in coordinate fisiche (pixel)
|
||||||
PNT TSheet::log2dev(long x, long y) const
|
// (vedi <mf TWindow::log2dev>)
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna le coordinate fisiche cercate
|
||||||
|
PNT TSheet::log2dev(
|
||||||
|
long x, // @parm Coordinata X da convertire
|
||||||
|
long y) const // @parm Coordinata Y da convertire
|
||||||
{
|
{
|
||||||
if (autoscrolling()) x -= origin().x;
|
if (autoscrolling()) x -= origin().x;
|
||||||
return TWindow::log2dev(x, y);
|
return TWindow::log2dev(x, y);
|
||||||
|
@ -5,22 +5,32 @@
|
|||||||
#include <array.h>
|
#include <array.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @C
|
// @doc EXTERNAL
|
||||||
// Classe TStack : private TArray
|
|
||||||
// @END
|
|
||||||
|
|
||||||
|
// @class TStack | Classe per la gestione dello stack a basso livello
|
||||||
|
//
|
||||||
|
// @base public | TArray
|
||||||
class TStack : private TArray
|
class TStack : private TArray
|
||||||
|
|
||||||
|
// @author:(INTERNAL) ???
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @cmember Puntatore alla cima dello stack
|
||||||
int _sp; // Puntatore alla cima dello stack
|
int _sp;
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @cmember Costruttore. Chaima il costruttore di <c TArray>
|
||||||
TStack(int size); // Chiama il costruttore di TArray(size)
|
TStack(int size);
|
||||||
|
|
||||||
int count() const { return _sp; } // Ritorna il puntatore allo stack
|
// @cmember Ritorna il puntatore allo stack
|
||||||
void push(const TObject&); // Aggiunge un oggetto sullo stack
|
int count() const
|
||||||
TObject& pop(); // Ritorna il primo oggetto sulla cima dello stack
|
{ return _sp; }
|
||||||
|
// @cmember Aggiunge un oggetto sullo stack
|
||||||
|
void push(const TObject&);
|
||||||
|
// @cmember Ritorna il primo oggetto sulla cima dello stack
|
||||||
|
TObject& pop();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,9 +23,15 @@
|
|||||||
extern isfdptr *openf;
|
extern isfdptr *openf;
|
||||||
HIDDEN long _stdlevel = 0;
|
HIDDEN long _stdlevel = 0;
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
|
// @func Ritorna il livello degli archivi
|
||||||
long get_std_level()
|
long get_std_level()
|
||||||
{ return _stdlevel; }
|
{ return _stdlevel; }
|
||||||
|
|
||||||
|
// @func Ritorna il numero di serie della chiave
|
||||||
|
//
|
||||||
|
// @rdesc Numero di serie della chiave
|
||||||
int get_serial_number()
|
int get_serial_number()
|
||||||
{
|
{
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
#if XVT_OS != XVT_OS_SCOUNIX
|
||||||
@ -36,6 +42,7 @@ int get_serial_number()
|
|||||||
return getser();
|
return getser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @func Inizilizza le variabili globali
|
||||||
void init_global_vars()
|
void init_global_vars()
|
||||||
{
|
{
|
||||||
TPrefix& pref = prefix_init();
|
TPrefix& pref = prefix_init();
|
||||||
@ -70,6 +77,7 @@ void init_global_vars()
|
|||||||
DB_init();
|
DB_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @func Dealloca le variabili globali
|
||||||
void free_global_vars()
|
void free_global_vars()
|
||||||
{
|
{
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
#if XVT_OS != XVT_OS_SCOUNIX
|
||||||
@ -91,7 +99,15 @@ void free_global_vars()
|
|||||||
unsigned long _alloc_count = 0;
|
unsigned long _alloc_count = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// @func Operatore per la creazione di un oggetto (sostituisce operatore C++)
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna il puntatore all'oggetto creato
|
||||||
void* operator new(size_t size)
|
void* operator new(size_t size)
|
||||||
|
|
||||||
|
// @comm Per maggiori informazioni fare riferimento all'omonimo comando sull'help
|
||||||
|
// in linea del C++.
|
||||||
|
// <nl>Questa funzione viene implementata se non si opera in ambiante FoxPro.
|
||||||
|
|
||||||
{
|
{
|
||||||
void* mem = (void*)malloc(size);
|
void* mem = (void*)malloc(size);
|
||||||
if (mem == NULL)
|
if (mem == NULL)
|
||||||
@ -104,7 +120,15 @@ void* operator new(size_t size)
|
|||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void* ptr)
|
// @func Operatore per la distruzione di un oggetto (sostituisce operatore C++)
|
||||||
|
void operator delete(
|
||||||
|
void* ptr) // @parm Puntatore all'oggetto da distruggere
|
||||||
|
|
||||||
|
// @comm Per maggiori informazioni fare riferimento all'omonimo comando sull'help
|
||||||
|
// in linea del C++.
|
||||||
|
// <nl>Nel caso venga passato un puntatore NULL viene emesso un <f CKECK>.
|
||||||
|
// <nl>Questa funzione viene implementata se non si opera in ambiante FoxPro.
|
||||||
|
|
||||||
{
|
{
|
||||||
CHECK(ptr, "Can't delete a NULL pointer");
|
CHECK(ptr, "Can't delete a NULL pointer");
|
||||||
free(ptr);
|
free(ptr);
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* @M */
|
// @doc EXTERNAL
|
||||||
|
|
||||||
#define pure =0
|
#define pure =0
|
||||||
|
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
@ -17,40 +18,49 @@
|
|||||||
|
|
||||||
#define EOL -1
|
#define EOL -1
|
||||||
#define NOERR 0
|
#define NOERR 0
|
||||||
/* @END */
|
|
||||||
|
|
||||||
/* @T */
|
// @type UINT8 | Altro nome di assegnazione per gli unsigned char
|
||||||
typedef unsigned char UINT8;
|
typedef unsigned char UINT8;
|
||||||
#ifdef M_I386
|
#ifdef M_I386
|
||||||
|
// @type UINT16 | Altro nome di assegnazione per gli unsigned short (se compilato a 32bit)
|
||||||
|
// oppure unsigned int (se non definito M_I386)
|
||||||
typedef unsigned short UINT16;
|
typedef unsigned short UINT16;
|
||||||
#else
|
#else
|
||||||
typedef unsigned int UINT16;
|
typedef unsigned int UINT16;
|
||||||
#endif
|
#endif
|
||||||
|
// @type UINT32 | Altro nome di assegnazione per gli unsigned long
|
||||||
typedef unsigned long UINT32;
|
typedef unsigned long UINT32;
|
||||||
|
|
||||||
|
// @type INT8 | Altro nome di assegnazione per i char
|
||||||
typedef char INT8;
|
typedef char INT8;
|
||||||
#ifdef M_I386
|
#ifdef M_I386
|
||||||
|
// @type INT16 | Altro nome di assegnazione per gli short (se compilato a 32bit)
|
||||||
|
// oppure int (se non definito M_I386)
|
||||||
typedef short INT16;
|
typedef short INT16;
|
||||||
#else
|
#else
|
||||||
typedef int INT16;
|
typedef int INT16;
|
||||||
#endif
|
#endif
|
||||||
|
// @type INT32 | Altro nome di assegnazione per i long
|
||||||
typedef long INT32;
|
typedef long INT32;
|
||||||
|
|
||||||
|
// @type bool | Tipo booleano che puo' assumere i valori TRUE (definito come 1)
|
||||||
|
// e FALSE (definito come 0).
|
||||||
typedef UINT8 bool;
|
typedef UINT8 bool;
|
||||||
|
// @type word | Tipo per la definizione di tipi di lunghezza pari a due byte
|
||||||
typedef UINT16 word;
|
typedef UINT16 word;
|
||||||
|
// @type dword | Tipo per la definizione di tipi di lunghezza pari a quattro byte
|
||||||
typedef UINT32 dword;
|
typedef UINT32 dword;
|
||||||
|
// @type byte | Tipo per la definizione di tipi di lunghezza pari ad un byte
|
||||||
typedef UINT8 byte;
|
typedef UINT8 byte;
|
||||||
|
|
||||||
|
// @type KEY | Tipo per la definizione di variabili destinati a contenere i caratteri
|
||||||
|
// immessi da tastiera
|
||||||
typedef UINT16 KEY;
|
typedef UINT16 KEY;
|
||||||
|
|
||||||
#define UNDEFINED -32767
|
#define UNDEFINED -32767
|
||||||
|
|
||||||
#undef _SVID
|
#undef _SVID
|
||||||
|
|
||||||
/* @END */
|
|
||||||
|
|
||||||
|
|
||||||
/* @FPUB */
|
|
||||||
int get_serial_number();
|
int get_serial_number();
|
||||||
long get_std_level();
|
long get_std_level();
|
||||||
void init_global_vars();
|
void init_global_vars();
|
||||||
@ -61,9 +71,6 @@ extern void* operator new(unsigned);
|
|||||||
extern void operator delete(void*);
|
extern void operator delete(void*);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* @END */
|
#endif // __STDTYPES_H
|
||||||
|
|
||||||
#endif /* __STDTYPES_H */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,27 +11,60 @@
|
|||||||
|
|
||||||
#define FPC "FPC"
|
#define FPC "FPC"
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
|
// @class Tab_application | Classe per la definizione della <c TRelation_application> per le tabelle
|
||||||
|
//
|
||||||
|
// @base public | TRelation_application
|
||||||
class Tab_application : public TRelation_application
|
class Tab_application : public TRelation_application
|
||||||
|
|
||||||
|
// @author:(INTERNAL) Nicola
|
||||||
|
|
||||||
|
// @access Private Member
|
||||||
{
|
{
|
||||||
|
// @cmember Maschera corrente dell'applicazione
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
|
// @cmember Relazione corrente dell'applicazione
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
|
// @cmember Nome della tabella da utilizzare
|
||||||
TString16 _tabname;
|
TString16 _tabname;
|
||||||
|
|
||||||
|
// @access Protected Member
|
||||||
protected:
|
protected:
|
||||||
|
// @cmember Richiede se il record corrente e' protetto (non cancellabile)
|
||||||
virtual bool protected_record(TRectype& rec);
|
virtual bool protected_record(TRectype& rec);
|
||||||
virtual TMask* get_mask(int mode = NO_MODE) { return _msk;}
|
// @cmember Richiede la maschera da usare
|
||||||
virtual bool changing_mask(int mode) { return FALSE;}
|
virtual TMask* get_mask(int mode = NO_MODE)
|
||||||
virtual TRelation* get_relation() const { return _rel;}
|
{ return _msk;}
|
||||||
|
// @cmember Indica se la futura <mf Tab_application::get_mask> ritornera' una maschera diversa
|
||||||
|
// dalla corrente.
|
||||||
|
virtual bool changing_mask(int mode)
|
||||||
|
{ return FALSE;}
|
||||||
|
// @cmember Ritorna la relazione da modificare
|
||||||
|
virtual TRelation* get_relation() const
|
||||||
|
{ return _rel;}
|
||||||
|
// @cmember Inizializza la maschera per il modo ricerca
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
|
// @cmember Inizializza la maschera per il modo modifica
|
||||||
virtual void init_modify_mode(TMask& m);
|
virtual void init_modify_mode(TMask& m);
|
||||||
|
// @cmember Inizializzazione dei dati dell'utente
|
||||||
virtual bool user_create() ;
|
virtual bool user_create() ;
|
||||||
|
// @cmember Distruzione dei dati dell'utente
|
||||||
virtual bool user_destroy() ;
|
virtual bool user_destroy() ;
|
||||||
|
// @cmember Chiama il programma di stampa
|
||||||
virtual void print();
|
virtual void print();
|
||||||
|
|
||||||
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
Tab_application() : _msk(NULL), _rel(NULL) {}
|
// @cmember Costruttore
|
||||||
virtual ~Tab_application() {}
|
Tab_application() : _msk(NULL), _rel(NULL)
|
||||||
const TString& get_tabname() const { return _tabname; }
|
{}
|
||||||
|
// @cmember Distruttore
|
||||||
|
virtual ~Tab_application()
|
||||||
|
{}
|
||||||
|
// @cmember Ritorna il nome della tabella
|
||||||
|
const TString& get_tabname() const
|
||||||
|
{ return _tabname; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -120,8 +120,8 @@ bool make_dir(
|
|||||||
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
|
|
||||||
// @func Setta la token string modificando la lista dei file formata con caratteri jolly
|
// @func Ritorna la lista dei file il cui nome corrisponde alla stringa (con caratteri
|
||||||
// in lista con caratteri estesi
|
// jolly) passata.
|
||||||
//
|
//
|
||||||
// @rdesc Ritorna il numero di file che soddisfano la condizione passata (numero di elementi
|
// @rdesc Ritorna il numero di file che soddisfano la condizione passata (numero di elementi
|
||||||
// della token string)
|
// della token string)
|
||||||
@ -171,7 +171,7 @@ int list_files(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Certified 99%
|
// Certified 99%
|
||||||
// @func Permette di ritornare una stringa formata da parametri
|
// @func Permette di ritornare una stringa formattata
|
||||||
//
|
//
|
||||||
// @rdesc Ritorna la stringa desiderata
|
// @rdesc Ritorna la stringa desiderata
|
||||||
char* format(
|
char* format(
|
||||||
@ -179,7 +179,7 @@ char* format(
|
|||||||
...) // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
|
...) // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
|
||||||
|
|
||||||
// @comm Il funzionamento e' come la <f sprintf> del C, solo che non e' necessario passare la
|
// @comm Il funzionamento e' come la <f sprintf> del C, solo che non e' necessario passare la
|
||||||
// stringa di destinazione alla funzione
|
// stringa di destinazione alla funzione.
|
||||||
{
|
{
|
||||||
va_list pars;
|
va_list pars;
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ const char * decode(const char* data);
|
|||||||
//
|
//
|
||||||
// @rdesc Ritorna i seguneti valori:
|
// @rdesc Ritorna i seguneti valori:
|
||||||
//
|
//
|
||||||
// @flag TRUE | Se il carattere <p s> e' uno slash
|
// @flag TRUE | Se il carattere <p s> non e' uno slash
|
||||||
// @flag FALSE | Se il carattere <p s> non e' uno slash
|
// @flag FALSE | Se il carattere <p s> e' uno slash
|
||||||
inline bool is_not_slash(
|
inline bool is_not_slash(
|
||||||
char s) // @parm Carattere da confrontare
|
char s) // @parm Carattere da confrontare
|
||||||
{ return s != '\\' && s != '/'; }
|
{ return s != '\\' && s != '/'; }
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
|
||||||
|
|
||||||
|
// @doc EXTERNAL
|
||||||
|
|
||||||
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
|
typedef bool (*VAL_FUNC)(TMask_field&, KEY k);
|
||||||
HIDDEN const TArray* _parms;
|
HIDDEN const TArray* _parms;
|
||||||
|
|
||||||
@ -65,8 +67,15 @@ HIDDEN bool _emptycopy_val(TMask_field& f, KEY)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @func Controlla se la Partita IVA assume un valore valido
|
||||||
bool pi_check(const char * st, const char * paiva)
|
//
|
||||||
|
// @rdesc Ritorna i seguenti valori:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Se il valore della Partita IVA assume un valore corretto
|
||||||
|
// @flag FALSE | Se il valore della Partita IVA non puo' essere valido
|
||||||
|
bool pi_check(
|
||||||
|
const char* st, // @parm Stato di assegnazione della Partita IVA
|
||||||
|
const char* paiva) // @parm Codice della Partita IVA da controllare
|
||||||
{
|
{
|
||||||
int tot = 0, y;
|
int tot = 0, y;
|
||||||
TString16 stato (st);
|
TString16 stato (st);
|
||||||
@ -187,7 +196,16 @@ HIDDEN bool __cf_check (const char * codcf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool cf_check (const char * stato, const char * codcf)
|
// @func Controlla se il Codice Fiscale assume un valore valido
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna i seguenti valori:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Se il valore del Codice Fiscale assume un valore corretto
|
||||||
|
// @flag FALSE | Se il valore del Codice Fiscale non puo' essere valido
|
||||||
|
|
||||||
|
bool cf_check (
|
||||||
|
const char* stato, // @parm Stato di assegnazione del Codice Fiscale
|
||||||
|
const char* codcf) // @parm Codice Fiscale da controllare
|
||||||
{
|
{
|
||||||
TString16 cf (codcf);
|
TString16 cf (codcf);
|
||||||
if (cf.empty())
|
if (cf.empty())
|
||||||
@ -807,7 +825,18 @@ HIDDEN VAL_FUNC _global_val_func[MAX_FUNC] =
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool validate(int fn, TMask_field& f, KEY k, const TArray& parms)
|
|
||||||
|
// @func Effettua i controlli sui campi di una maschera
|
||||||
|
//
|
||||||
|
// @rdesc Ritorna se il controllo ha avuto successo:
|
||||||
|
//
|
||||||
|
// @flag TRUE | Il campo e' positivo al controllo
|
||||||
|
// @flag FALSE | Il campo non ha i requisiti necessari per passare il controllo
|
||||||
|
bool validate(
|
||||||
|
int fn, // @parm Numero della funzione da effettuare
|
||||||
|
TMask_field& f, // @parm Identificatore del campo da controllare
|
||||||
|
KEY k, // @parm Codice del tasto premuto sul campo
|
||||||
|
const TArray& parms) // @parm Array di paramtri per effettuare il controllo
|
||||||
{
|
{
|
||||||
_parms = &parms;
|
_parms = &parms;
|
||||||
return (fn >= 0 && fn < MAX_FUNC) ? _global_val_func[fn](f, k) : TRUE;
|
return (fn >= 0 && fn < MAX_FUNC) ? _global_val_func[fn](f, k) : TRUE;
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @doc EXTERNAL
|
|
||||||
|
|
||||||
HIDDEN MENU_ITEM* find_menu_item(MENU_ITEM* menu, MENU_TAG id, bool ismbar)
|
HIDDEN MENU_ITEM* find_menu_item(MENU_ITEM* menu, MENU_TAG id, bool ismbar)
|
||||||
{
|
{
|
||||||
@ -265,12 +264,12 @@ void close_all_dialogs()
|
|||||||
WinManager.destroy();
|
WinManager.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @func Indica se possono essere chiuse le finestre aperte
|
// @func Indica se l'applicazione puo' essere terminata
|
||||||
//
|
//
|
||||||
// @rdesc Ritorna il risultato della ricerca:
|
// @rdesc Ritorna il risultato della ricerca:
|
||||||
//
|
//
|
||||||
// @flag TRUE | Se le finestre aperte possono essere chiuse
|
// @flag TRUE | Se l'aplicazione puo' essere chiusa
|
||||||
// @flag FALSE | Se le finestre aperte non possono essere chiuse
|
// @flag FALSE | Se l'applicazione non puo' essere chiusa
|
||||||
bool can_close()
|
bool can_close()
|
||||||
{
|
{
|
||||||
return WinManager.can_close();
|
return WinManager.can_close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user