Gestione tasti rapidi.
git-svn-id: svn://10.65.10.50/trunk@52 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5f96e2e4ea
commit
6d79069eb6
@ -12,7 +12,7 @@ MENUBAR MENU_BAR(1)
|
|||||||
|
|
||||||
MENU MENU_BAR(1)
|
MENU MENU_BAR(1)
|
||||||
SUBMENU MENU_FILE "~File"
|
SUBMENU MENU_FILE "~File"
|
||||||
ITEM BAR_ITEM(1) "~Selezione"
|
ITEM BAR_ITEM(1) "~Test"
|
||||||
|
|
||||||
|
|
||||||
/* ba1 -2 */
|
/* ba1 -2 */
|
||||||
|
@ -47,7 +47,7 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_FIELDS 34 7
|
SPREADSHEET F_FIELDS 44 7
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 15 4 ""
|
PROMPT 15 4 ""
|
||||||
ITEM "Nome@10"
|
ITEM "Nome@10"
|
||||||
|
@ -21,28 +21,28 @@ public:
|
|||||||
|
|
||||||
bool TTest_application::menu(MENU_TAG)
|
bool TTest_application::menu(MENU_TAG)
|
||||||
{
|
{
|
||||||
TLocalisamfile tab(LF_TABCOM);
|
TLocalisamfile tab(LF_COMUNI);
|
||||||
const TRecnotype n = tab.items();
|
const TRecnotype n = tab.items();
|
||||||
|
|
||||||
time_t start;
|
clock_t start;
|
||||||
TRecnotype r = 1;
|
TRecnotype r = 1;
|
||||||
TString80 msg;
|
TString80 msg;
|
||||||
{
|
{
|
||||||
TProgind p(n, "Lettura file tabelle comuni", TRUE, TRUE, 32);
|
TProgind p(n, "Lettura file comuni", TRUE, TRUE, 32);
|
||||||
start = time(NULL);
|
start = clock();
|
||||||
for (tab.first(); tab.good(); tab.next(), r++)
|
for (tab.first(); tab.good(); tab.next(), r++)
|
||||||
{
|
{
|
||||||
if ((r % 50) == 0)
|
if ((r % 100) == 0)
|
||||||
{
|
{
|
||||||
msg.format("%ld records %ld sec", r, time(NULL) - start);
|
msg.format("%ld records %ld msec", r, clock() - start);
|
||||||
p.setstatus(r);
|
p.setstatus(r);
|
||||||
p.set_text(msg);
|
p.set_text(msg);
|
||||||
|
if (p.iscancelled()) break;
|
||||||
}
|
}
|
||||||
if (p.iscancelled()) break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const time_t t = time(NULL) - start;
|
const clock_t t = clock() - start;
|
||||||
msg.format("%ld records in %ld sec\n%lg records per sec", r, t, (double)r/t);
|
msg.format("%ld records in %ld msec\n%lg records per sec", r, t, 1000.0*r/t);
|
||||||
message_box(msg);
|
message_box(msg);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
1486
ba/ba4300a.uml
1486
ba/ba4300a.uml
File diff suppressed because it is too large
Load Diff
22
ba/ba6.cpp
22
ba/ba6.cpp
@ -1,23 +1,21 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#include <strings.h>
|
|
||||||
#include <checks.h>
|
#include <checks.h>
|
||||||
|
|
||||||
#include "ba6.h"
|
#include "ba6.h"
|
||||||
|
|
||||||
#define usage "Error - usage : %s -0"
|
#define usage "Errore - uso : %s -{0,1}"
|
||||||
|
|
||||||
int main(int argc,char** argv)
|
int main(int argc,char** argv)
|
||||||
|
|
||||||
{
|
{
|
||||||
int rt = 0 ;
|
const int r = (argc > 1) ? atoi(argv[1]) : -1;
|
||||||
TString p = argv[0], s = argv[1] ;
|
|
||||||
|
switch (r)
|
||||||
if (argc!=2) fatal_box(usage, (const char*) p) ;
|
{
|
||||||
else
|
case 0:ba6100(argc,argv) ; break;
|
||||||
if (s == "-0") rt = ba6100(argc,argv) ;
|
case 1:ba6200(argc,argv) ; break;
|
||||||
if (s == "-1") rt = ba6200(argc,argv) ;
|
default:error_box(usage, argv[0]) ; break;
|
||||||
else fatal_box(usage, (const char*) p) ;
|
}
|
||||||
return rt;
|
return r < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
252
ba/ba6200a.uml
252
ba/ba6200a.uml
@ -1,126 +1,126 @@
|
|||||||
#include "ba6200.h"
|
#include "ba6200.h"
|
||||||
|
|
||||||
PAGE "" -1 -1 65 14
|
PAGE "" -1 -1 65 14
|
||||||
|
|
||||||
RADIOBUTTON F_SCELTA 25
|
RADIOBUTTON F_SCELTA 25
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Stampa per: "
|
PROMPT 1 1 "Stampa per: "
|
||||||
ITEM "1|Codice comune "
|
ITEM "1|Codice comune "
|
||||||
MESSAGE HIDE,F_NOMEINI|HIDE,F_NOMEFINE|HIDE,F_NOME
|
MESSAGE HIDE,F_NOMEINI|HIDE,F_NOMEFINE|HIDE,F_NOME
|
||||||
MESSAGE RESET,F_NOMEINI|RESET,F_NOMEFINE|RESET,F_NOME
|
MESSAGE RESET,F_NOMEINI|RESET,F_NOMEFINE|RESET,F_NOME
|
||||||
MESSAGE SHOW,F_CODICEINI|SHOW,F_CODICEFINE|SHOW,F_CODICE
|
MESSAGE SHOW,F_CODICEINI|SHOW,F_CODICEFINE|SHOW,F_CODICE
|
||||||
MESSAGE SHOW,F_STATOINI|SHOW,F_STATOFINE
|
MESSAGE SHOW,F_STATOINI|SHOW,F_STATOFINE
|
||||||
ITEM "2|Denominazione comune"
|
ITEM "2|Denominazione comune"
|
||||||
MESSAGE HIDE,F_CODICEINI|HIDE,F_CODICEFINE|HIDE,F_CODICE
|
MESSAGE HIDE,F_CODICEINI|HIDE,F_CODICEFINE|HIDE,F_CODICE
|
||||||
MESSAGE HIDE,F_STATOINI|HIDE,F_STATOFINE
|
MESSAGE HIDE,F_STATOINI|HIDE,F_STATOFINE
|
||||||
MESSAGE RESET,F_CODICEINI|RESET,F_CODICEFINE|RESET,F_CODICE
|
MESSAGE RESET,F_CODICEINI|RESET,F_CODICEFINE|RESET,F_CODICE
|
||||||
MESSAGE RESET,F_STATOINI|RESET,F_STATOFINE
|
MESSAGE RESET,F_STATOINI|RESET,F_STATOFINE
|
||||||
MESSAGE SHOW,F_NOMEINI|SHOW,F_NOMEFINE|SHOW,F_NOME
|
MESSAGE SHOW,F_NOMEINI|SHOW,F_NOMEFINE|SHOW,F_NOME
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATA
|
DATE F_DATA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 37 2 "Data di stampa "
|
PROMPT 37 2 "Data di stampa "
|
||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX F_CODICE 63 3
|
GROUPBOX F_CODICE 63 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 ""
|
PROMPT 1 5 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_STATOINI 3
|
STRING F_STATOINI 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Da codice "
|
PROMPT 2 6 "Da codice "
|
||||||
USE LF_COMUNI KEY 1
|
USE LF_COMUNI KEY 1
|
||||||
INPUT STATO F_STATOINI
|
INPUT STATO F_STATOINI
|
||||||
INPUT COM F_CODICEINI
|
INPUT COM F_CODICEINI
|
||||||
DISPLAY "Stato" STATO
|
DISPLAY "Stato" STATO
|
||||||
DISPLAY "Comune" COM
|
DISPLAY "Comune" COM
|
||||||
DISPLAY "Denominazione@50" DENCOM
|
DISPLAY "Denominazione@50" DENCOM
|
||||||
OUTPUT F_STATOINI STATO
|
OUTPUT F_STATOINI STATO
|
||||||
OUTPUT F_CODICEINI COM
|
OUTPUT F_CODICEINI COM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_CODICEINI 4
|
STRING F_CODICEINI 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 20 6 ""
|
PROMPT 20 6 ""
|
||||||
COPY USE F_STATOINI
|
COPY USE F_STATOINI
|
||||||
INPUT STATO F_STATOINI
|
INPUT STATO F_STATOINI
|
||||||
INPUT COM F_CODICEINI
|
INPUT COM F_CODICEINI
|
||||||
COPY DISPLAY F_STATOINI
|
COPY DISPLAY F_STATOINI
|
||||||
OUTPUT F_STATOINI STATO
|
OUTPUT F_STATOINI STATO
|
||||||
OUTPUT F_CODICEINI COM
|
OUTPUT F_CODICEINI COM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_STATOFINE 3
|
STRING F_STATOFINE 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 37 6 "A codice "
|
PROMPT 37 6 "A codice "
|
||||||
COPY USE F_STATOINI
|
COPY USE F_STATOINI
|
||||||
INPUT STATO F_STATOFINE
|
INPUT STATO F_STATOFINE
|
||||||
INPUT COM F_CODICEFINE
|
INPUT COM F_CODICEFINE
|
||||||
COPY DISPLAY F_STATOINI
|
COPY DISPLAY F_STATOINI
|
||||||
OUTPUT F_STATOFINE STATO
|
OUTPUT F_STATOFINE STATO
|
||||||
OUTPUT F_CODICEFINE COM
|
OUTPUT F_CODICEFINE COM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_CODICEFINE 4
|
STRING F_CODICEFINE 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 54 6 ""
|
PROMPT 54 6 ""
|
||||||
COPY USE F_STATOINI
|
COPY USE F_STATOINI
|
||||||
INPUT STATO F_STATOFINE
|
INPUT STATO F_STATOFINE
|
||||||
INPUT COM F_CODICEFINE
|
INPUT COM F_CODICEFINE
|
||||||
COPY DISPLAY F_STATOINI
|
COPY DISPLAY F_STATOINI
|
||||||
OUTPUT F_STATOFINE STATO
|
OUTPUT F_STATOFINE STATO
|
||||||
OUTPUT F_CODICEFINE COM
|
OUTPUT F_CODICEFINE COM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX F_NOME 63 4
|
GROUPBOX F_NOME 63 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 ""
|
PROMPT 1 5 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_NOMEINI 50
|
STRING F_NOMEINI 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Da nome "
|
PROMPT 2 6 "Da nome "
|
||||||
USE LF_COMUNI KEY 2
|
USE LF_COMUNI KEY 2
|
||||||
INPUT DENCOM F_NOMEINI
|
INPUT DENCOM F_NOMEINI
|
||||||
DISPLAY "Denominazione@50" DENCOM
|
DISPLAY "Denominazione@50" DENCOM
|
||||||
OUTPUT F_NOMEINI DENCOM
|
OUTPUT F_NOMEINI DENCOM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_NOMEFINE 50
|
STRING F_NOMEFINE 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 7 "A nome "
|
PROMPT 2 7 "A nome "
|
||||||
COPY USE F_NOMEINI
|
COPY USE F_NOMEINI
|
||||||
INPUT DENCOM F_NOMEFINE
|
INPUT DENCOM F_NOMEFINE
|
||||||
COPY DISPLAY F_NOMEINI
|
COPY DISPLAY F_NOMEINI
|
||||||
OUTPUT F_NOMEFINE DENCOM
|
OUTPUT F_NOMEFINE DENCOM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_PROVCOM 5
|
STRING F_PROVCOM 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 9 "Stampa solo la provincia di "
|
PROMPT 1 9 "Stampa solo la provincia di "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_OK 9 0
|
BUTTON DLG_OK 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 10 12 ""
|
PROMPT -12 -2 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_CANCEL 9 0
|
BUTTON DLG_CANCEL 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 43 12 ""
|
PROMPT -22 -2 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
|
||||||
|
@ -637,7 +637,7 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
|||||||
if (key == K_TAB && f.get().not_empty())
|
if (key == K_TAB && f.get().not_empty())
|
||||||
{
|
{
|
||||||
if (app().find(1))
|
if (app().find(1))
|
||||||
dispatch_e_char(f.parent(), K_SHIFT_ENTER);
|
dispatch_e_char(f.parent(), K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -659,7 +659,7 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
const bool ok = suspended_handler(f, key); // Controlla sospensione
|
const bool ok = suspended_handler(f, key); // Controlla sospensione
|
||||||
if (ok)
|
if (ok)
|
||||||
dispatch_e_char(f.parent(), K_INS); // Entra in modo inserimento
|
f.mask().stop_run(K_INS); // Entra in modo inserimento
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "cg4.h"
|
#include "cg4.h"
|
||||||
|
|
||||||
#define usage "Error - usage : %s -{0,2,3,4,5}"
|
const char* const usage = "Errore - uso : %s -{0,2,3,4,5}";
|
||||||
|
|
||||||
int main(int argc,char** argv)
|
int main(int argc,char** argv)
|
||||||
{
|
{
|
||||||
@ -24,6 +24,7 @@ int main(int argc,char** argv)
|
|||||||
default:
|
default:
|
||||||
error_box(usage, argv[0]);
|
error_box(usage, argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return n < 0;
|
return n < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,12 +36,9 @@ HIDDEN int compare(const TObject** o1, const TObject** o2)
|
|||||||
{
|
{
|
||||||
TRigaiva* r1 = (TRigaiva*)*o1;
|
TRigaiva* r1 = (TRigaiva*)*o1;
|
||||||
TRigaiva* r2 = (TRigaiva*)*o2;
|
TRigaiva* r2 = (TRigaiva*)*o2;
|
||||||
TString campo1;
|
TString16 campo1; campo1.format("%d%4s", r1->_tipodet, (const char*)r1->_codiva);
|
||||||
TString campo2;
|
TString16 campo2; campo2.format("%d%4s", r2->_tipodet, (const char*)r2->_codiva);
|
||||||
|
return (strcmp(campo1, campo2));
|
||||||
campo1.format("%d%4s", r1->_tipodet, (const char*)r1->_codiva);
|
|
||||||
campo2.format("%d%4s", r2->_tipodet, (const char*)r2->_codiva);
|
|
||||||
return (strcmp((const char*)campo1, (const char*)campo2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
234
cg/cg4400.h
234
cg/cg4400.h
@ -1,121 +1,121 @@
|
|||||||
//
|
//
|
||||||
// cg4400.h
|
// cg4400.h
|
||||||
//
|
//
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <lffiles.h>
|
#include <printapp.h>
|
||||||
#include <printapp.h>
|
#include <mask.h>
|
||||||
#include <mask.h>
|
#include <tabutil.h>
|
||||||
#include <strings.h>
|
#include <utility.h>
|
||||||
#include <tabutil.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <sheet.h>
|
||||||
#include <stdlib.h>
|
#include <config.h>
|
||||||
#include <urldefid.h>
|
|
||||||
#include <sheet.h>
|
#include "cglib03.h"
|
||||||
#include <config.h>
|
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <occas.h>
|
#include <occas.h>
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <cglib03.h>
|
|
||||||
|
|
||||||
const int MAXSTR = 128;
|
const int MAXSTR = 128;
|
||||||
static char __tmp[MAXSTR];
|
static char __tmp[MAXSTR];
|
||||||
|
|
||||||
//enum STAMPA { bollati=1, unici=2 };
|
//enum STAMPA { bollati=1, unici=2 };
|
||||||
const int TABREG = (int)TTable::name2log("REG");
|
const int TABREG = (int)TTable::name2log("REG");
|
||||||
|
|
||||||
bool filter_func (const TRelation*);
|
bool filter_func (const TRelation*);
|
||||||
bool my_handler (TMask_field&, KEY);
|
bool my_handler (TMask_field&, KEY);
|
||||||
bool mask_cod (TMask_field&, KEY);
|
bool mask_cod (TMask_field&, KEY);
|
||||||
bool mask_mese (TMask_field&, KEY);
|
bool mask_mese (TMask_field&, KEY);
|
||||||
bool mask_fino_a_mese (TMask_field&, KEY);
|
bool mask_fino_a_mese (TMask_field&, KEY);
|
||||||
bool mask_select (TMask_field&, KEY);
|
bool mask_select (TMask_field&, KEY);
|
||||||
bool mask_verifica (TMask_field&, KEY);
|
bool mask_verifica (TMask_field&, KEY);
|
||||||
bool mask_annulla (TMask_field&, KEY);
|
bool mask_annulla (TMask_field&, KEY);
|
||||||
|
|
||||||
class TDati_ditta : public TObject
|
class TDati_ditta : public TObject
|
||||||
{
|
{
|
||||||
TLocalisamfile * _nditte, * _anag, *_comuni;
|
TLocalisamfile * _nditte, * _anag, *_comuni;
|
||||||
TString _ragsoc, _cofi, _paiva;
|
TString _ragsoc, _cofi, _paiva;
|
||||||
TString _comunefis, _viafis, _provfis, _cap;
|
TString _comunefis, _viafis, _provfis, _cap;
|
||||||
long _codditta;
|
long _codditta;
|
||||||
int _stampa_width;
|
int _stampa_width;
|
||||||
protected:
|
protected:
|
||||||
void get_dati_ditta();
|
void get_dati_ditta();
|
||||||
TRectype& look_com (const char * codice);
|
TRectype& look_com (const char * codice);
|
||||||
public:
|
public:
|
||||||
const char* prima_riga ();
|
const char* prima_riga ();
|
||||||
const char* seconda_riga ();
|
const char* seconda_riga ();
|
||||||
TDati_ditta (long cod_ditta, int stampa_width);
|
TDati_ditta (long cod_ditta, int stampa_width);
|
||||||
virtual ~TDati_ditta();
|
virtual ~TDati_ditta();
|
||||||
};
|
};
|
||||||
|
|
||||||
class CG4400_application : public TPrintapp
|
class CG4400_application : public TPrintapp
|
||||||
{
|
{
|
||||||
friend bool filter_func (const TRelation *r);
|
friend bool filter_func (const TRelation *r);
|
||||||
friend bool mask_cod (TMask_field&, KEY);
|
friend bool mask_cod (TMask_field&, KEY);
|
||||||
friend bool mask_mese (TMask_field&, KEY);
|
friend bool mask_mese (TMask_field&, KEY);
|
||||||
friend bool mask_fino_a_mese (TMask_field&, KEY);
|
friend bool mask_fino_a_mese (TMask_field&, KEY);
|
||||||
friend bool my_handler (TMask_field&, KEY);
|
friend bool my_handler (TMask_field&, KEY);
|
||||||
friend bool mask_select (TMask_field&, KEY);
|
friend bool mask_select (TMask_field&, KEY);
|
||||||
friend bool mask_verifica (TMask_field&, KEY);
|
friend bool mask_verifica (TMask_field&, KEY);
|
||||||
friend bool mask_annulla (TMask_field&, KEY);
|
friend bool mask_annulla (TMask_field&, KEY);
|
||||||
|
|
||||||
TCursor * _cur;
|
TCursor * _cur;
|
||||||
TRelation *_rel;
|
TRelation *_rel;
|
||||||
TLocalisamfile *_clifo, *_nditte, *_occas, *_tab, *_tabcom;
|
TLocalisamfile *_clifo, *_nditte, *_occas, *_tab, *_tabcom;
|
||||||
TTable *_tabreg;
|
TTable *_tabreg;
|
||||||
TRigaiva_array _iva_array, _riga_rmi;
|
TRigaiva_array _iva_array, _riga_rmi;
|
||||||
TTipodoc_array _doc_array;
|
TTipodoc_array _doc_array;
|
||||||
TRiga_array _tot_iva_array;
|
TRiga_array _tot_iva_array;
|
||||||
TArray_sheet *_ditte;
|
TArray_sheet *_ditte;
|
||||||
TBit_array _selected;
|
TBit_array _selected;
|
||||||
TArray _nomiditte; //array descrizioni ditte per sheet
|
TArray _nomiditte; //array descrizioni ditte per sheet
|
||||||
bool _riferim, _mov_empty;
|
bool _riferim, _mov_empty;
|
||||||
char _frequiva;
|
char _frequiva;
|
||||||
TDate _data_da, _data_a, _data_stampa, _dataregp, _datareg;
|
TDate _data_da, _data_a, _data_stampa, _dataregp, _datareg;
|
||||||
long _annoes, _n_ditte;
|
long _annoes, _n_ditte;
|
||||||
int _riepil, _tipo_reg, _fino_a_mese, _tipo_stampa;
|
int _riepil, _tipo_reg, _fino_a_mese, _tipo_stampa;
|
||||||
int _r, _stampa_width; // riga corrente di stampa
|
int _r, _stampa_width; // riga corrente di stampa
|
||||||
real _totale_doc;
|
real _totale_doc;
|
||||||
TString _codreg, _desc_lib, _codatt, _attivita;
|
TString _codreg, _desc_lib, _codatt, _attivita;
|
||||||
TString _codtab, _tipodoc, _descr_doc;
|
TString _codtab, _tipodoc, _descr_doc;
|
||||||
bool _stampa_tutti_i_registri;
|
bool _stampa_tutti_i_registri;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const char* desc_attivita (const char * codatt);
|
const char* desc_attivita (const char * codatt);
|
||||||
const char* descr_doc (const char * tipo);
|
const char* descr_doc (const char * tipo);
|
||||||
const char* descr_iva (const char * cod);
|
const char* descr_iva (const char * cod);
|
||||||
const char* ricerca_cf (char tipocf, long codcf);
|
const char* ricerca_cf (char tipocf, long codcf);
|
||||||
const char* ricerca_occ(const char * occ);
|
const char* ricerca_occ(const char * occ);
|
||||||
int setta_riga (int, const TRigaiva&, real&, real&, real&, real&);
|
int setta_riga (int, const TRigaiva&, real&, real&, real&, real&);
|
||||||
int riga_rmoviva();
|
int riga_rmoviva();
|
||||||
bool set_print(int);
|
bool set_print(int);
|
||||||
bool set_ditte(TMask&);
|
bool set_ditte(TMask&);
|
||||||
bool compila_reg();
|
bool compila_reg();
|
||||||
bool controlla_liquidazione();
|
bool controlla_liquidazione();
|
||||||
bool controlla_mov();
|
bool controlla_mov();
|
||||||
void stampa_registri_IVA();
|
void stampa_registri_IVA();
|
||||||
void set_page_tot_reg();
|
void set_page_tot_reg();
|
||||||
void calcola_progressivi(real&, real&, const char*, const int);
|
void calcola_progressivi(real&, real&, const char*, const int);
|
||||||
void user_create();
|
void user_create();
|
||||||
void user_destroy();
|
void user_destroy();
|
||||||
bool preprocess_page(int, int);
|
bool preprocess_page(int, int);
|
||||||
int stampa_intestazione_ditta();
|
int stampa_intestazione_ditta();
|
||||||
bool preprocess_print(int, int);
|
bool preprocess_print(int, int);
|
||||||
print_action postprocess_print(int, int);
|
print_action postprocess_print(int, int);
|
||||||
void preprocess_header();
|
void preprocess_header();
|
||||||
|
|
||||||
CG4400_application() : TPrintapp(),_ditte(NULL),_selected(10000),
|
CG4400_application() : TPrintapp(),_ditte(NULL),_selected(10000),
|
||||||
_nomiditte(100) {}
|
_nomiditte(100) {}
|
||||||
|
|
||||||
virtual ~CG4400_application() {}
|
virtual ~CG4400_application() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1170
cg/cg4500.cpp
1170
cg/cg4500.cpp
File diff suppressed because it is too large
Load Diff
@ -42,9 +42,9 @@ void TTab_conti::do_agg(TConto* tc, int anno_es, const real& importo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TTab_conti::aggiorna_conto(const TConto& tcon, const int anno_es, const real& importo, char sezione, bool movap, bool provv, bool somma)
|
void TTab_conti::aggiorna_conto(const TConto& tcon, int anno_es, const real& importo, char sezione, bool movap, bool provv, bool somma)
|
||||||
{
|
{
|
||||||
TString key;
|
TString80 key;
|
||||||
key << format("%4d", anno_es);
|
key << format("%4d", anno_es);
|
||||||
key << format("%3d", tcon.gruppo());
|
key << format("%3d", tcon.gruppo());
|
||||||
key << format("%3d", tcon.conto());
|
key << format("%3d", tcon.conto());
|
||||||
@ -68,7 +68,7 @@ void TTab_conti::aggiorna_conto(int gruppo, int conto, long sottoconto,
|
|||||||
int anno_es, const real& importo, char sezione,
|
int anno_es, const real& importo, char sezione,
|
||||||
bool movap, bool provv, bool somma)
|
bool movap, bool provv, bool somma)
|
||||||
{
|
{
|
||||||
TString key;
|
TString80 key;
|
||||||
key << format("%4d", anno_es);
|
key << format("%4d", anno_es);
|
||||||
key << format("%3d", gruppo);
|
key << format("%3d", gruppo);
|
||||||
key << format("%3d", conto);
|
key << format("%3d", conto);
|
||||||
|
1074
include/applicat.cpp
1074
include/applicat.cpp
File diff suppressed because it is too large
Load Diff
2049
include/controls.cpp
2049
include/controls.cpp
File diff suppressed because it is too large
Load Diff
@ -1,84 +1,83 @@
|
|||||||
#ifndef APPNAME
|
#ifndef APPNAME
|
||||||
#define APPNAME CAMPO
|
#define APPNAME CAMPO
|
||||||
#define QAPPNAME "CAMPO"
|
#define QAPPNAME "CAMPO"
|
||||||
#define LIBDIR c:\xvt.322\xvtwin\lib
|
#define LIBDIR c:\xvt.322\xvtwin\lib
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NO_STD_EDIT_MENU
|
#define NO_STD_EDIT_MENU
|
||||||
#define NO_STD_FILE_MENU
|
#define NO_STD_FILE_MENU
|
||||||
#define NO_STD_FONT_MENU
|
#define NO_STD_FONT_MENU
|
||||||
#define NO_STD_HELP_MENU
|
#define NO_STD_HELP_MENU
|
||||||
#define NO_STD_ABOUT_BOX
|
#define NO_STD_ABOUT_BOX
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
|
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
MENUBAR TASK_MENUBAR
|
MENUBAR TASK_MENUBAR
|
||||||
|
|
||||||
MENU MENU_FILE
|
MENU MENU_FILE
|
||||||
ITEM M_FILE_NEW "Scelta ~Ditta..."
|
ITEM M_FILE_NEW "Scelta ~Ditta..."
|
||||||
ITEM M_FILE_REVERT "Impostazione ~Parametri..."
|
ITEM M_FILE_REVERT "Impostazione ~Parametri..."
|
||||||
SEPARATOR
|
SEPARATOR
|
||||||
ITEM M_FILE_PG_SETUP "~Impostazione Stampante..."
|
ITEM M_FILE_PG_SETUP "~Impostazione Stampante..."
|
||||||
ITEM M_FILE_PRINT "~Stampa" DISABLED
|
ITEM M_FILE_PRINT "~Stampa" DISABLED
|
||||||
SEPARATOR
|
SEPARATOR
|
||||||
ITEM (M_FILE+11) "I~nformazioni"
|
ITEM (M_FILE+11) "I~nformazioni"
|
||||||
ITEM M_FILE_QUIT "~Fine"
|
ITEM M_FILE_QUIT "~Fine"
|
||||||
|
|
||||||
MENU MENU_EDIT
|
MENU MENU_EDIT
|
||||||
ITEM M_EDIT_INSERT "~Inserisci"
|
ITEM M_EDIT_INSERT "~Inserisci"
|
||||||
ITEM M_EDIT_MODIFY "~Aggiorna"
|
ITEM M_EDIT_MODIFY "~Aggiorna"
|
||||||
ITEM M_EDIT_DELETE "~Cancella"
|
ITEM M_EDIT_DELETE "~Cancella"
|
||||||
ITEM M_EDIT_SHOW "~Visualizza"
|
ITEM M_EDIT_SHOW "~Visualizza"
|
||||||
ITEM M_EDIT_SEARCH "C~erca" DISABLED
|
ITEM M_EDIT_SEARCH "C~erca" DISABLED
|
||||||
|
|
||||||
MENU MENU_ALT_EDIT
|
MENU MENU_ALT_EDIT
|
||||||
ITEM M_EDIT_EDIT "~Aggiorna"
|
ITEM M_EDIT_EDIT "~Aggiorna"
|
||||||
ITEM M_EDIT_SEARCH "C~erca" DISABLED
|
ITEM M_EDIT_SEARCH "C~erca" DISABLED
|
||||||
|
|
||||||
ACCEL MENU_FILE "f" ALT
|
ACCEL MENU_FILE "f" ALT
|
||||||
ACCEL MENU_EDIT "g" ALT
|
|
||||||
|
#if XVTWS == WINWS
|
||||||
#if XVTWS == WINWS
|
#scan <xil.h>
|
||||||
#scan <xil.h>
|
#transparent $$$
|
||||||
#transparent $$$
|
XI_CURSOR_RESIZE cursor DISCARDABLE f:\p.due\bmp\resize.cur
|
||||||
XI_CURSOR_RESIZE cursor DISCARDABLE f:\p.due\bmp\resize.cur
|
XI_CURSOR_HAND cursor DISCARDABLE f:\p.due\bmp\hand.cur
|
||||||
XI_CURSOR_HAND cursor DISCARDABLE f:\p.due\bmp\hand.cur
|
XI_CURSOR_VRESIZE cursor DISCARDABLE f:\p.due\bmp\vresize.cur
|
||||||
XI_CURSOR_VRESIZE cursor DISCARDABLE f:\p.due\bmp\vresize.cur
|
COMBO_ICON icon DISCARDABLE f:\p.due\bmp\combo.ico
|
||||||
COMBO_ICON icon DISCARDABLE f:\p.due\bmp\combo.ico
|
BMP_OK bitmap DISCARDABLE f:\p.due\bmp\ok.bmp
|
||||||
BMP_OK bitmap DISCARDABLE f:\p.due\bmp\ok.bmp
|
BMP_CANCEL bitmap DISCARDABLE f:\p.due\bmp\cancel.bmp
|
||||||
BMP_CANCEL bitmap DISCARDABLE f:\p.due\bmp\cancel.bmp
|
BMP_QUIT bitmap DISCARDABLE f:\p.due\bmp\quit.bmp
|
||||||
BMP_QUIT bitmap DISCARDABLE f:\p.due\bmp\quit.bmp
|
BMP_QUITDN bitmap DISCARDABLE f:\p.due\bmp\quitdn.bmp
|
||||||
BMP_QUITDN bitmap DISCARDABLE f:\p.due\bmp\quitdn.bmp
|
BMP_SELECT bitmap DISCARDABLE f:\p.due\bmp\select.bmp
|
||||||
BMP_SELECT bitmap DISCARDABLE f:\p.due\bmp\select.bmp
|
BMP_FIRSTREC bitmap DISCARDABLE f:\p.due\bmp\firstrec.bmp
|
||||||
BMP_FIRSTREC bitmap DISCARDABLE f:\p.due\bmp\firstrec.bmp
|
BMP_PREVREC bitmap DISCARDABLE f:\p.due\bmp\prevrec.bmp
|
||||||
BMP_PREVREC bitmap DISCARDABLE f:\p.due\bmp\prevrec.bmp
|
BMP_STOPREC bitmap DISCARDABLE f:\p.due\bmp\stoprec.bmp
|
||||||
BMP_STOPREC bitmap DISCARDABLE f:\p.due\bmp\stoprec.bmp
|
BMP_NEXTREC bitmap DISCARDABLE f:\p.due\bmp\nextrec.bmp
|
||||||
BMP_NEXTREC bitmap DISCARDABLE f:\p.due\bmp\nextrec.bmp
|
BMP_LASTREC bitmap DISCARDABLE f:\p.due\bmp\lastrec.bmp
|
||||||
BMP_LASTREC bitmap DISCARDABLE f:\p.due\bmp\lastrec.bmp
|
BMP_SAVEREC bitmap DISCARDABLE f:\p.due\bmp\saverec.bmp
|
||||||
BMP_SAVEREC bitmap DISCARDABLE f:\p.due\bmp\saverec.bmp
|
BMP_SAVERECDN bitmap DISCARDABLE f:\p.due\bmp\saverecd.bmp
|
||||||
BMP_SAVERECDN bitmap DISCARDABLE f:\p.due\bmp\saverecd.bmp
|
BMP_NEWREC bitmap DISCARDABLE f:\p.due\bmp\newrec.bmp
|
||||||
BMP_NEWREC bitmap DISCARDABLE f:\p.due\bmp\newrec.bmp
|
BMP_NEWRECDN bitmap DISCARDABLE f:\p.due\bmp\newrecdn.bmp
|
||||||
BMP_NEWRECDN bitmap DISCARDABLE f:\p.due\bmp\newrecdn.bmp
|
BMP_DELREC bitmap DISCARDABLE f:\p.due\bmp\delrec.bmp
|
||||||
BMP_DELREC bitmap DISCARDABLE f:\p.due\bmp\delrec.bmp
|
BMP_DELRECDN bitmap DISCARDABLE f:\p.due\bmp\delrecdn.bmp
|
||||||
BMP_DELRECDN bitmap DISCARDABLE f:\p.due\bmp\delrecdn.bmp
|
BMP_FINDREC bitmap DISCARDABLE f:\p.due\bmp\findrec.bmp
|
||||||
BMP_FINDREC bitmap DISCARDABLE f:\p.due\bmp\findrec.bmp
|
BMP_SEARCH bitmap DISCARDABLE f:\p.due\bmp\search.bmp
|
||||||
BMP_SEARCH bitmap DISCARDABLE f:\p.due\bmp\search.bmp
|
BMP_CHECK_ON bitmap DISCARDABLE f:\p.due\bmp\checkon.bmp
|
||||||
BMP_CHECK_ON bitmap DISCARDABLE f:\p.due\bmp\checkon.bmp
|
BMP_CHECK_OFF bitmap DISCARDABLE f:\p.due\bmp\checkoff.bmp
|
||||||
BMP_CHECK_OFF bitmap DISCARDABLE f:\p.due\bmp\checkoff.bmp
|
BMP_RADIO_ON bitmap DISCARDABLE f:\p.due\bmp\radioon.bmp
|
||||||
BMP_RADIO_ON bitmap DISCARDABLE f:\p.due\bmp\radioon.bmp
|
BMP_RADIO_OFF bitmap DISCARDABLE f:\p.due\bmp\radiooff.bmp
|
||||||
BMP_RADIO_OFF bitmap DISCARDABLE f:\p.due\bmp\radiooff.bmp
|
BMP_MODULE1 bitmap DISCARDABLE f:\p.due\bmp\module1.bmp
|
||||||
BMP_MODULE1 bitmap DISCARDABLE f:\p.due\bmp\module1.bmp
|
BMP_MODULE2 bitmap DISCARDABLE f:\p.due\bmp\module2.bmp
|
||||||
BMP_MODULE2 bitmap DISCARDABLE f:\p.due\bmp\module2.bmp
|
BMP_MODULE3 bitmap DISCARDABLE f:\p.due\bmp\module3.bmp
|
||||||
BMP_MODULE3 bitmap DISCARDABLE f:\p.due\bmp\module3.bmp
|
BMP_MODULE4 bitmap DISCARDABLE f:\p.due\bmp\module4.bmp
|
||||||
BMP_MODULE4 bitmap DISCARDABLE f:\p.due\bmp\module4.bmp
|
BMP_BOOK1 bitmap DISCARDABLE f:\p.due\bmp\book1.bmp
|
||||||
BMP_BOOK1 bitmap DISCARDABLE f:\p.due\bmp\book1.bmp
|
BMP_BOOK2 bitmap DISCARDABLE f:\p.due\bmp\book2.bmp
|
||||||
BMP_BOOK2 bitmap DISCARDABLE f:\p.due\bmp\book2.bmp
|
BMP_BOOK3 bitmap DISCARDABLE f:\p.due\bmp\book3.bmp
|
||||||
BMP_BOOK3 bitmap DISCARDABLE f:\p.due\bmp\book3.bmp
|
BMP_MODULE bitmap DISCARDABLE f:\p.due\bmp\module.bmp
|
||||||
BMP_MODULE bitmap DISCARDABLE f:\p.due\bmp\module.bmp
|
BMP_EDIT bitmap DISCARDABLE f:\p.due\bmp\edit.bmp
|
||||||
BMP_EDIT bitmap DISCARDABLE f:\p.due\bmp\edit.bmp
|
BMP_LINK bitmap DISCARDABLE f:\p.due\bmp\link.bmp
|
||||||
BMP_LINK bitmap DISCARDABLE f:\p.due\bmp\link.bmp
|
BMP_PRINT bitmap DISCARDABLE f:\p.due\bmp\print.bmp
|
||||||
BMP_PRINT bitmap DISCARDABLE f:\p.due\bmp\print.bmp
|
|
||||||
|
$$$
|
||||||
$$$
|
#endif
|
||||||
#endif
|
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
|
|
||||||
class TFile : public TObject
|
class TFile : public TObject
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
SecDef* _file;
|
SecDef* _file;
|
||||||
int _len;
|
int _len;
|
||||||
int _base;
|
int _base;
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
void open(const char* name, TFilelock lockmode = _manulock);
|
void open(const char* name, TFilelock lockmode = _manulock);
|
||||||
bool verify(const char* name);
|
bool verify(const char* name);
|
||||||
void create(const char* name, TRecnotype nrecord = 10);
|
void create(const char* name, TRecnotype nrecord = 10);
|
||||||
@ -54,12 +54,12 @@ public:
|
|||||||
|
|
||||||
class TDir : public TObject
|
class TDir : public TObject
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
FileDes* _dir;
|
FileDes* _dir;
|
||||||
int _num;
|
int _num;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
void get(int nfile, TReclock lock = _nolock, TDirtype dirtype = _nordir, TDirop op = _nordirop);
|
void get(int nfile, TReclock lock = _nolock, TDirtype dirtype = _nordir, TDirop op = _nordirop);
|
||||||
void put(int nfile, TDirtype dirtype = _nordir, TDirop op = _nordirop);
|
void put(int nfile, TDirtype dirtype = _nordir, TDirop op = _nordirop);
|
||||||
void zero();
|
void zero();
|
||||||
@ -91,14 +91,14 @@ public:
|
|||||||
|
|
||||||
class TTrec : public TSortable
|
class TTrec : public TSortable
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
RecDes* _rec;
|
RecDes* _rec;
|
||||||
int _num;
|
int _num;
|
||||||
protected:
|
protected:
|
||||||
int compare(const TSortable& a) const;
|
int compare(const TSortable& a) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
void get(int nfile, TDirtype dirtype = _nordir);
|
void get(int nfile, TDirtype dirtype = _nordir);
|
||||||
void put(int nfile, TDirtype dirtype = _nordir);
|
void put(int nfile, TDirtype dirtype = _nordir);
|
||||||
void zero();
|
void zero();
|
||||||
@ -114,13 +114,15 @@ public:
|
|||||||
void set_keys(int nkeys) { _rec->NKeys = nkeys;}
|
void set_keys(int nkeys) { _rec->NKeys = nkeys;}
|
||||||
const char* fielddef(int fld) const; // ritorna una token string
|
const char* fielddef(int fld) const; // ritorna una token string
|
||||||
const char* keydef(int key) const;
|
const char* keydef(int key) const;
|
||||||
|
int len() const { return _rec->Fd[fields() - 1].RecOff +
|
||||||
|
_rec->Fd[fields() - 1].Len; }
|
||||||
|
|
||||||
|
#ifndef FOXPRO
|
||||||
void update_keydef(int key, const char* desc); //desc e' una token string
|
void update_keydef(int key, const char* desc); //desc e' una token string
|
||||||
void update_fielddef(int nfld, const char* desc); //desc e' una token string
|
void update_fielddef(int nfld, const char* desc); //desc e' una token string
|
||||||
int len() const { return _rec->Fd[fields() - 1].RecOff +
|
|
||||||
_rec->Fd[fields() - 1].Len; }
|
|
||||||
virtual void print_on(ostream& out) const;
|
virtual void print_on(ostream& out) const;
|
||||||
virtual void read_from(istream& in);
|
virtual void read_from(istream& in);
|
||||||
|
#endif
|
||||||
|
|
||||||
TTrec();
|
TTrec();
|
||||||
virtual ~TTrec();
|
virtual ~TTrec();
|
||||||
|
@ -1,26 +1,27 @@
|
|||||||
#ifndef __KEYS_H
|
#ifndef __KEYS_H
|
||||||
#define __KEYS_H
|
#define __KEYS_H
|
||||||
|
|
||||||
#ifndef XVT_INCL_CONST
|
#ifndef XVT_INCL_CONST
|
||||||
#include <xvtconst.h>
|
#include <xvtconst.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* @M */
|
/* @M */
|
||||||
#define K_BACKSPACE 8
|
#define K_BACKSPACE 8
|
||||||
#define K_TAB 9
|
#define K_TAB 9
|
||||||
#define K_ENTER 13
|
#define K_ENTER 13
|
||||||
#define K_ESC 27
|
#define K_ESC 27
|
||||||
#define K_SPACE 32
|
#define K_SPACE 32
|
||||||
#define K_SHIFT 1000
|
#define K_SHIFT 1000
|
||||||
#define K_CTRL 10000
|
#define K_CTRL 10000
|
||||||
#define K_SHIFT_ENTER K_ENTER+K_SHIFT
|
#define K_CTRL_ENTER K_CTRL+K_ENTER
|
||||||
#define K_SHIFT_TAB K_TAB+K_SHIFT
|
#define K_AUTO_ENTER K_SHIFT+K_ENTER
|
||||||
#define K_SHIFT_F2 K_SHIFT+K_F2
|
#define K_QUIT 10334
|
||||||
#define K_SHIFT_F3 K_SHIFT+K_F3
|
#define K_SAVE 10082
|
||||||
#define K_NO 'N'
|
#define K_SHIFT_TAB K_SHIFT+K_TAB
|
||||||
#define K_SAVE 'S'
|
#define K_SHIFT_F2 K_SHIFT+K_F2
|
||||||
#define K_QUIT 'Q'
|
#define K_SHIFT_F3 K_SHIFT+K_F3
|
||||||
#define K_YES 'Y'
|
#define K_NO 'N'
|
||||||
|
#define K_YES 'Y'
|
||||||
/* @END */
|
|
||||||
#endif
|
/* @END */
|
||||||
|
#endif
|
||||||
|
151
include/mask.cpp
151
include/mask.cpp
@ -97,30 +97,46 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
|||||||
case E_CONTROL:
|
case E_CONTROL:
|
||||||
switch(ep->v.ctl.id)
|
switch(ep->v.ctl.id)
|
||||||
{
|
{
|
||||||
case DLG_OK :on_key(K_SHIFT_ENTER); break;
|
case DLG_OK :
|
||||||
case DLG_BAR :
|
on_key(K_AUTO_ENTER); break;
|
||||||
case DLG_CANCEL :on_key(K_ESC); break;
|
case DLG_BAR :
|
||||||
case DLG_PGDN :on_key(K_NEXT); break;
|
case DLG_CANCEL :
|
||||||
case DLG_PGUP :on_key(K_PREV); break;
|
on_key(K_ESC); break;
|
||||||
case DLG_FIRSTREC:stop_run(K_HOME); break;
|
/*
|
||||||
case DLG_PREVREC :stop_run(K_PREV); break;
|
case DLG_PGDN :
|
||||||
case DLG_NEXTREC :stop_run(K_NEXT); break;
|
on_key(K_NEXT); break;
|
||||||
case DLG_FINDREC :stop_run(K_F9); break;
|
case DLG_PGUP :
|
||||||
case DLG_LASTREC :stop_run(K_END); break;
|
on_key(K_PREV); break;
|
||||||
case DLG_NEWREC :stop_run(K_INS); break;
|
case DLG_FIRSTREC:
|
||||||
case DLG_DELREC :stop_run(K_DEL); break;
|
stop_run(K_HOME); break;
|
||||||
case DLG_SAVEREC :stop_run(K_SAVE); break;
|
case DLG_PREVREC :
|
||||||
case DLG_QUIT :stop_run(K_QUIT); break;
|
stop_run(K_PREV); break;
|
||||||
case DLG_F9:
|
case DLG_NEXTREC :
|
||||||
{
|
stop_run(K_NEXT); break;
|
||||||
TMask_field* f = (TMask_field*)get_app_data(ep->v.ctl.ci.win);
|
case DLG_FINDREC :
|
||||||
f->on_key(K_F9);
|
stop_run(K_F9); break;
|
||||||
}
|
case DLG_LASTREC :
|
||||||
break;
|
stop_run(K_END); break;
|
||||||
default:
|
case DLG_NEWREC :
|
||||||
control_handler(ep);
|
stop_run(K_INS); break;
|
||||||
break;
|
case DLG_DELREC :
|
||||||
}
|
stop_run(K_DEL); break;
|
||||||
|
case DLG_SAVEREC :
|
||||||
|
stop_run(K_SAVE); break;
|
||||||
|
case DLG_QUIT :
|
||||||
|
stop_run(K_QUIT); break;
|
||||||
|
*/
|
||||||
|
case DLG_F9:
|
||||||
|
{
|
||||||
|
// Attiva ricerca sul campo associato al bottone
|
||||||
|
TMask_field* f = (TMask_field*)get_app_data(ep->v.ctl.ci.win);
|
||||||
|
f->on_key(K_F9);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
control_handler(ep);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -130,15 +146,16 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
|||||||
|
|
||||||
void TMask::init_mask(int mode)
|
void TMask::init_mask(int mode)
|
||||||
{
|
{
|
||||||
_sheets = _pages = 0;
|
_sheets = _pages = 0; // Azzera numero pagine e sheets
|
||||||
_enabled = 0xffff;
|
_enabled = 0xffff; // Abilita tutte le pagine
|
||||||
_focus = _first_focus = 0;
|
_focus = _first_focus = 0; // Nessuna ha il focus
|
||||||
_page = -1;
|
_page = -1; // Nessuan pagina corrente
|
||||||
_handler = NULL; _mode = mode;
|
_handler = NULL; // Nessun handler utente
|
||||||
_exchange = 1.0;
|
_mode = mode; // Inizializza modo
|
||||||
|
_exchange = 1.0; // Il cambio per la valuta e' la lira
|
||||||
|
|
||||||
for (int i = 0; i <= MAX_PAGES; i++)
|
for (int i = 0; i <= MAX_PAGES; i++)
|
||||||
_pagewin[i] = NULL_WIN;
|
_pagewin[i] = NULL_WIN; // Azzera le finestre delle varie pagine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -584,13 +601,42 @@ void TMask::move_focus_field(int d)
|
|||||||
|
|
||||||
bool TMask::stop_run(KEY key)
|
bool TMask::stop_run(KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_SHIFT_ENTER) key = K_ENTER;
|
if (key == K_CTRL_ENTER) key = K_ENTER;
|
||||||
|
|
||||||
|
if (key != K_AUTO_ENTER)
|
||||||
|
{
|
||||||
|
const int last = fields();
|
||||||
|
bool found = FALSE;
|
||||||
|
for (int i = 0; i < last; i++)
|
||||||
|
{
|
||||||
|
const TMask_field& f = fld(i);
|
||||||
|
if (f.class_id() != CLASS_BUTTON_FIELD) continue;
|
||||||
|
const TButton_field& b = (const TButton_field&)f;
|
||||||
|
if (b.exit_key() == key)
|
||||||
|
{
|
||||||
|
if (b.active())
|
||||||
|
{
|
||||||
|
found = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
#ifdef DBG
|
||||||
|
return error_box("Non e' attivo il bottone associato a %d", key);
|
||||||
|
#else
|
||||||
|
beep();
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
} else key = K_ENTER;
|
||||||
|
|
||||||
if (key != K_ESC && key != K_QUIT && key != K_DEL)
|
if (key != K_ESC && key != K_QUIT && key != K_DEL)
|
||||||
{
|
{
|
||||||
const bool ok = check_fields();
|
const bool ok = check_fields();
|
||||||
if (!ok) return FALSE;
|
if (!ok) return FALSE;
|
||||||
if (is_running()) // Gestisce meglio le maschere chiuse
|
if (is_running()) // Gestisce correttamenete le maschere chiuse
|
||||||
get_mask_fields();
|
get_mask_fields();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,12 +652,11 @@ bool TMask::on_key(KEY key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
case K_SHIFT_ENTER:
|
case K_AUTO_ENTER:
|
||||||
|
case K_CTRL_ENTER:
|
||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
case K_ESC:
|
case K_ESC:
|
||||||
case K_INS:
|
|
||||||
case K_DEL:
|
|
||||||
stop_run(key);
|
stop_run(key);
|
||||||
break;
|
break;
|
||||||
case K_UP:
|
case K_UP:
|
||||||
@ -639,18 +684,34 @@ bool TMask::on_key(KEY key)
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
case K_F11:
|
case K_F11:
|
||||||
message_box("Siete fortunati utenti del campo %d della maschera '%s'\n"
|
message_box("Siete fortunati utenti del campo %d della maschera '%s'\n"
|
||||||
"caricata nell'incredibile tempo di %ld cicli\n"
|
"caricata nell'incredibile tempo di %ld millisecondi\n"
|
||||||
"ed inizializzata mostruosamente in %ld cicli\n"
|
"ed inizializzata mostruosamente in %ld millisecondi\n"
|
||||||
"Grazie per la comprensione",
|
"Grazie per la comprensione",
|
||||||
fld(_focus).dlg(), (const char*)source_file(), clock1, clock2);
|
fld(_focus).dlg(), (const char*)source_file(), clock1, clock2);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
if (key >= K_CTRL+K_F1 && key <= K_CTRL+K_F12)
|
if (key > K_CTRL)
|
||||||
{
|
{
|
||||||
const int page = key - (K_CTRL+K_F1);
|
key -= K_CTRL;
|
||||||
next_page(1000+page);
|
if (key >= K_F1 && key <= K_F10)
|
||||||
}
|
next_page(1000 + key - K_F1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const int last = fields();
|
||||||
|
for (int i = 0; i < last; i++)
|
||||||
|
{
|
||||||
|
TMask_field& f = fld(i);
|
||||||
|
if (f.class_id() != CLASS_BUTTON_FIELD || !f.active()) continue;
|
||||||
|
TButton_field& b = (TButton_field&)f;
|
||||||
|
if (b.virtual_key() == key && fld(_focus).on_key(K_TAB) == TRUE)
|
||||||
|
{
|
||||||
|
f.on_key(K_SPACE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else return fld(_focus).on_key(key);
|
else return fld(_focus).on_key(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
374
include/mask.h
374
include/mask.h
@ -1,187 +1,187 @@
|
|||||||
#ifndef __MASK_H
|
#ifndef __MASK_H
|
||||||
#define __MASK_H
|
#define __MASK_H
|
||||||
|
|
||||||
#ifndef __WINDOW_H
|
#ifndef __WINDOW_H
|
||||||
#include <window.h>
|
#include <window.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __MASKFLD_H
|
#ifndef __MASKFLD_H
|
||||||
#include <maskfld.h>
|
#include <maskfld.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __REAL_H
|
#ifndef __REAL_H
|
||||||
#include <real.h>
|
#include <real.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// @T
|
// @T
|
||||||
typedef bool (*MASK_HANDLER)(TMask& mask, KEY key);
|
typedef bool (*MASK_HANDLER)(TMask& mask, KEY key);
|
||||||
enum TMaskmode { NO_MODE, MODE_INS , MODE_MOD , MODE_DEL ,
|
enum TMaskmode { NO_MODE, MODE_INS , MODE_MOD , MODE_DEL ,
|
||||||
MODE_VIS , MODE_QUERY, MODE_QUERYINS,
|
MODE_VIS , MODE_QUERY, MODE_QUERYINS,
|
||||||
MODE_SEARCH };
|
MODE_SEARCH };
|
||||||
// @END
|
// @END
|
||||||
|
|
||||||
// @C
|
// @C
|
||||||
// Classe TMask : public TWindow
|
// Classe TMask : public TWindow
|
||||||
// @END
|
// @END
|
||||||
|
|
||||||
class TMask : public TWindow
|
class TMask : public TWindow
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
enum { MAX_PAGES = 12 }; // Massimo numero di pagine nella maschera
|
enum { MAX_PAGES = 12 }; // Massimo numero di pagine nella maschera
|
||||||
WINDOW _pagewin[MAX_PAGES+1]; // Windows of the pages
|
WINDOW _pagewin[MAX_PAGES+1]; // Windows of the pages
|
||||||
|
|
||||||
int _pages; // Number of pages of the mask
|
int _pages; // Number of pages of the mask
|
||||||
int _page; // Current page
|
int _page; // Current page
|
||||||
|
|
||||||
word _enabled; // Are pages enabled (bit field)
|
word _enabled; // Are pages enabled (bit field)
|
||||||
int _mode; // Mode of the mask
|
int _mode; // Mode of the mask
|
||||||
TArray _field; // Fields in the mask
|
TArray _field; // Fields in the mask
|
||||||
|
|
||||||
int _first_focus; // First control to have focus
|
int _first_focus; // First control to have focus
|
||||||
int _focus; // Control with focus
|
int _focus; // Control with focus
|
||||||
int _sheets; // Number of sheets
|
int _sheets; // Number of sheets
|
||||||
|
|
||||||
MASK_HANDLER _handler; // User defined key handler
|
MASK_HANDLER _handler; // User defined key handler
|
||||||
|
|
||||||
TFilename _source_file; // Source file of the mask
|
TFilename _source_file; // Source file of the mask
|
||||||
TFilename _workfile; // Name of savefile
|
TFilename _workfile; // Name of savefile
|
||||||
long _lastpos; // last read offset on savefile
|
long _lastpos; // last read offset on savefile
|
||||||
|
|
||||||
real _exchange; // Current value exhange
|
real _exchange; // Current value exhange
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Ritorna la finestra della pagina corrente (Usare con attenzione)
|
// Ritorna la finestra della pagina corrente (Usare con attenzione)
|
||||||
WINDOW win() const { return _page == -1 ? NULL_WIN : _pagewin[_page]; }
|
WINDOW win() const { return _page == -1 ? NULL_WIN : _pagewin[_page]; }
|
||||||
WINDOW toolwin() const { return _pagewin[MAX_PAGES]; }
|
WINDOW toolwin() const { return _pagewin[MAX_PAGES]; }
|
||||||
|
|
||||||
int find_field_win(WINDOW win) const; // number of field with window win
|
int find_field_win(WINDOW win) const; // number of field with window win
|
||||||
|
|
||||||
void set_mask_fields() const; // update screen
|
void set_mask_fields() const; // update screen
|
||||||
|
|
||||||
void load_checks() const; // load checks related fields
|
void load_checks() const; // load checks related fields
|
||||||
virtual void start_run(); // called when the mask starts to run
|
virtual void start_run(); // called when the mask starts to run
|
||||||
virtual TMask_field* parse_field(TScanner& scanner);
|
virtual TMask_field* parse_field(TScanner& scanner);
|
||||||
|
|
||||||
void init_mask(int mode);
|
void init_mask(int mode);
|
||||||
WINDOW read_page(TScanner& scanner, bool toolbar = FALSE);
|
WINDOW read_page(TScanner& scanner, bool toolbar = FALSE);
|
||||||
void read_mask(const char* name, int mode, int num);
|
void read_mask(const char* name, int mode, int num);
|
||||||
void add_buttons();
|
void add_buttons();
|
||||||
|
|
||||||
int find_parent_page(const TMask_field&) const;
|
int find_parent_page(const TMask_field&) const;
|
||||||
int find_first_field(WINDOW w, int dir) const;
|
int find_first_field(WINDOW w, int dir) const;
|
||||||
int find_active_field(int first, int dir) const;
|
int find_active_field(int first, int dir) const;
|
||||||
bool check_current_page(); // Check all the fields on the current page
|
bool check_current_page(); // Check all the fields on the current page
|
||||||
void next_page(int p); // Show next/previous page
|
void next_page(int p); // Show next/previous page
|
||||||
int curr_page() const { return _page; } // Current page number
|
int curr_page() const { return _page; } // Current page number
|
||||||
void control_handler(EVENT* ep);
|
void control_handler(EVENT* ep);
|
||||||
void handler(WINDOW win, EVENT* ep);
|
void handler(WINDOW win, EVENT* ep);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
// crea leggendo descrizione da file .msk
|
// crea leggendo descrizione da file .msk
|
||||||
TMask(const char* name, int mode = NO_MODE, int num = 0);
|
TMask(const char* name, int mode = NO_MODE, int num = 0);
|
||||||
|
|
||||||
// crea mask vuota con parametri dati
|
// crea mask vuota con parametri dati
|
||||||
TMask(const char* title, int pages, int cols, int rows, int xpos = -1,
|
TMask(const char* title, int pages, int cols, int rows, int xpos = -1,
|
||||||
int ypos = -1, int mode = NO_MODE);
|
int ypos = -1, int mode = NO_MODE);
|
||||||
|
|
||||||
virtual ~TMask();
|
virtual ~TMask();
|
||||||
|
|
||||||
const TFilename& source_file() const { return _source_file; }
|
const TFilename& source_file() const { return _source_file; }
|
||||||
|
|
||||||
// aggiunta campi a runtime
|
// aggiunta campi a runtime
|
||||||
void add_static (short id, int page, const char* prompt, int x, int y,
|
void add_static (short id, int page, const char* prompt, int x, int y,
|
||||||
const char* flags = "");
|
const char* flags = "");
|
||||||
void add_string (short id, int page, const char* prompt, int x, int y,
|
void add_string (short id, int page, const char* prompt, int x, int y,
|
||||||
int dim, const char* flags = "", int width = 0);
|
int dim, const char* flags = "", int width = 0);
|
||||||
void add_number (short id, int page, const char* prompt, int x, int y,
|
void add_number (short id, int page, const char* prompt, int x, int y,
|
||||||
int dim, const char* flags = "", int ndec = 0);
|
int dim, const char* flags = "", int ndec = 0);
|
||||||
void add_date (short id, int page, const char* prompt, int x, int y,
|
void add_date (short id, int page, const char* prompt, int x, int y,
|
||||||
const char* flags = "");
|
const char* flags = "");
|
||||||
void add_button (short id, int page, const char* prompt, int x, int y,
|
void add_button (short id, int page, const char* prompt, int x, int y,
|
||||||
int dx = 9, int dy = 1, const char* flags = "");
|
int dx = 9, int dy = 1, const char* flags = "");
|
||||||
|
|
||||||
void add_radio(short id, int page, const char* prompt, int x, int y,
|
void add_radio(short id, int page, const char* prompt, int x, int y,
|
||||||
int dx, const char* codes, const char* items, const char* flags = "");
|
int dx, const char* codes, const char* items, const char* flags = "");
|
||||||
|
|
||||||
int fields() const { return _field.items(); }
|
int fields() const { return _field.items(); }
|
||||||
int sheets() const { return _sheets; }
|
int sheets() const { return _sheets; }
|
||||||
|
|
||||||
void set_mode(int m) { _mode = m; }
|
void set_mode(int m) { _mode = m; }
|
||||||
int mode() const { return _mode; }
|
int mode() const { return _mode; }
|
||||||
|
|
||||||
void set_exchange(const real& e);
|
void set_exchange(const real& e);
|
||||||
const real& exchange() const { return _exchange; }
|
const real& exchange() const { return _exchange; }
|
||||||
|
|
||||||
bool check_fields();
|
bool check_fields();
|
||||||
void get_mask_fields(); // read screen contents
|
void get_mask_fields(); // read screen contents
|
||||||
virtual bool stop_run(KEY key); // called to close the mask
|
virtual bool stop_run(KEY key); // called to close the mask
|
||||||
|
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
virtual void close();
|
virtual void close();
|
||||||
virtual void enable(bool on) const;
|
virtual void enable(bool on) const;
|
||||||
|
|
||||||
int id2pos(short id) const;
|
int id2pos(short id) const;
|
||||||
TMask_field& fld(int i) const { return (TMask_field&)_field[i]; } // Ritorna il campo i-esimo della maschera
|
TMask_field& fld(int i) const { return (TMask_field&)_field[i]; } // Ritorna il campo i-esimo della maschera
|
||||||
TMask_field& field(short id) const; // field with given id
|
TMask_field& field(short id) const; // field with given id
|
||||||
|
|
||||||
void set(short fld_id, const char* str, bool hit=FALSE);
|
void set(short fld_id, const char* str, bool hit=FALSE);
|
||||||
void set(short fld_id, long num, bool hit=FALSE);
|
void set(short fld_id, long num, bool hit=FALSE);
|
||||||
const TString& get(short fld_id) const;
|
const TString& get(short fld_id) const;
|
||||||
long get_long(short fld_id) const;
|
long get_long(short fld_id) const;
|
||||||
int get_int(short fld_id) const { return (int)get_long(fld_id); }
|
int get_int(short fld_id) const { return (int)get_long(fld_id); }
|
||||||
bool get_bool(short fld_id) const;
|
bool get_bool(short fld_id) const;
|
||||||
|
|
||||||
int first_focus(short id);
|
int first_focus(short id);
|
||||||
void set_focus();
|
void set_focus();
|
||||||
void move_focus_field(int num);
|
void move_focus_field(int num);
|
||||||
void set_focus_win(WINDOW win, bool force);
|
void set_focus_win(WINDOW win, bool force);
|
||||||
int focus_field() const { return _focus;}
|
int focus_field() const { return _focus;}
|
||||||
|
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
void enable(short fld_id, bool on = TRUE); // Abilita un campo
|
void enable(short fld_id, bool on = TRUE); // Abilita un campo
|
||||||
void disable(short fld_id) { enable(fld_id, FALSE); }
|
void disable(short fld_id) { enable(fld_id, FALSE); }
|
||||||
void enable_default(short fld_id = -1);
|
void enable_default(short fld_id = -1);
|
||||||
|
|
||||||
void enable_page(int p, bool on = TRUE);
|
void enable_page(int p, bool on = TRUE);
|
||||||
void disable_page(int p) { enable_page(p, FALSE); }
|
void disable_page(int p) { enable_page(p, FALSE); }
|
||||||
bool page_enabled(int p) const;
|
bool page_enabled(int p) const;
|
||||||
|
|
||||||
byte num_keys() const;
|
byte num_keys() const;
|
||||||
void enable_key(byte key, bool on = TRUE);
|
void enable_key(byte key, bool on = TRUE);
|
||||||
void disable_key(byte key) { enable_key(key, FALSE); }
|
void disable_key(byte key) { enable_key(key, FALSE); }
|
||||||
short get_key_field(byte key, bool first) const;
|
short get_key_field(byte key, bool first) const;
|
||||||
bool key_valid(int key) const;
|
bool key_valid(int key) const;
|
||||||
|
|
||||||
void show(short fld_id = -1, bool on = TRUE);
|
void show(short fld_id = -1, bool on = TRUE);
|
||||||
void hide(short fld_id = -1) { show(fld_id, FALSE); }
|
void hide(short fld_id = -1) { show(fld_id, FALSE); }
|
||||||
void show_default(short fld_id = -1);
|
void show_default(short fld_id = -1);
|
||||||
|
|
||||||
void reset(short fld_id = -1);
|
void reset(short fld_id = -1);
|
||||||
void undo(short fld_id = -1);
|
void undo(short fld_id = -1);
|
||||||
|
|
||||||
void autoload(const TRelation* = NULL);
|
void autoload(const TRelation* = NULL);
|
||||||
void autosave(TRelation* = NULL) const;
|
void autosave(TRelation* = NULL) const;
|
||||||
|
|
||||||
void send_key(KEY key, short id) const;
|
void send_key(KEY key, short id) const;
|
||||||
void set_handler(short fld_id, CONTROL_HANDLER handler);
|
void set_handler(short fld_id, CONTROL_HANDLER handler);
|
||||||
void set_handler(MASK_HANDLER handler);
|
void set_handler(MASK_HANDLER handler);
|
||||||
void set_workfile(const char* workfile) { _workfile = workfile; _lastpos = 0L;}
|
void set_workfile(const char* workfile) { _workfile = workfile; _lastpos = 0L;}
|
||||||
bool save(bool append = FALSE) const;
|
bool save(bool append = FALSE) const;
|
||||||
bool load(bool reset = FALSE);
|
bool load(bool reset = FALSE);
|
||||||
|
|
||||||
short dirty() const; // Ritorna il primo campo dirty
|
short dirty() const; // Ritorna il primo campo dirty
|
||||||
|
|
||||||
bool no_mode() const { return _mode == NO_MODE; }
|
bool no_mode() const { return _mode == NO_MODE; }
|
||||||
bool query_mode() const { return _mode == MODE_QUERY || _mode == MODE_QUERYINS; }
|
bool query_mode() const { return _mode == MODE_QUERY || _mode == MODE_QUERYINS; }
|
||||||
bool edit_mode() const { return _mode == MODE_MOD || _mode == MODE_VIS || _mode == MODE_DEL; }
|
bool edit_mode() const { return _mode == MODE_MOD || _mode == MODE_VIS || _mode == MODE_DEL; }
|
||||||
bool insert_mode() const { return _mode == MODE_QUERYINS || _mode == MODE_INS; }
|
bool insert_mode() const { return _mode == MODE_QUERYINS || _mode == MODE_INS; }
|
||||||
|
|
||||||
virtual const char* get_caption() const;
|
virtual const char* get_caption() const;
|
||||||
virtual void set_caption(const char* c);
|
virtual void set_caption(const char* c);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __MASK_H
|
#endif // __MASK_H
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: maskfld.cpp,v 1.2 1994-08-17 14:05:45 guy Exp $
|
// $Id: maskfld.cpp,v 1.3 1994-08-23 13:52:21 guy Exp $
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
@ -1823,7 +1823,7 @@ bool TEdit_field::on_key(KEY key)
|
|||||||
{
|
{
|
||||||
for (int fld = m.get_key_field(i, TRUE); fld != -1; fld = m.get_key_field(i, FALSE))
|
for (int fld = m.get_key_field(i, TRUE); fld != -1; fld = m.get_key_field(i, FALSE))
|
||||||
m.field(fld).set_dirty(FALSE);
|
m.field(fld).set_dirty(FALSE);
|
||||||
dispatch_e_char(get_parent(win()), K_SHIFT_ENTER);
|
dispatch_e_char(get_parent(win()), K_AUTO_ENTER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2053,29 +2053,49 @@ void TButton_field::create(WINDOW parent)
|
|||||||
{
|
{
|
||||||
long flags = CTL_FLAG_CENTER_JUST;
|
long flags = CTL_FLAG_CENTER_JUST;
|
||||||
|
|
||||||
if (_prompt.empty()) switch (dlg())
|
switch (dlg())
|
||||||
{
|
{
|
||||||
case DLG_OK:
|
case DLG_OK:
|
||||||
_prompt = "Conferma";
|
if (_prompt.empty())
|
||||||
|
_prompt = "Conferma";
|
||||||
|
_virtual_key = _exit_key = K_ENTER;
|
||||||
flags |= CTL_FLAG_DEFAULT;
|
flags |= CTL_FLAG_DEFAULT;
|
||||||
break;
|
break;
|
||||||
case DLG_CANCEL:
|
case DLG_CANCEL:
|
||||||
_prompt = "Annulla";
|
if (_prompt.empty())
|
||||||
|
_prompt = "Annulla";
|
||||||
|
_virtual_key = _exit_key = K_ESC;
|
||||||
break;
|
break;
|
||||||
case DLG_PGUP:
|
|
||||||
_prompt = "Pag <<"; break;
|
|
||||||
case DLG_PGDN:
|
|
||||||
_prompt = "Pag >>"; break;
|
|
||||||
case DLG_SAVEREC:
|
|
||||||
_prompt = "Registra"; break;
|
|
||||||
case DLG_QUIT:
|
case DLG_QUIT:
|
||||||
_prompt = "Fine"; break;
|
if (_prompt.empty())
|
||||||
|
_prompt = "Fine";
|
||||||
|
_virtual_key = K_F4;
|
||||||
|
_exit_key = K_QUIT;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
|
_exit_key = 0;
|
||||||
|
TToken_string* message = (TToken_string*)_message.objptr(0);
|
||||||
|
if (message != NULL)
|
||||||
|
{
|
||||||
|
TToken_string msg(message->get(0), ',');
|
||||||
|
const TFixed_string m(msg.get(0));
|
||||||
|
if (m == "EXIT")
|
||||||
|
_exit_key = msg.get_int();
|
||||||
|
else
|
||||||
|
if (msg.get_int() == 0) _exit_key = atoi(m);
|
||||||
|
}
|
||||||
|
const int n = _prompt.find('~');
|
||||||
|
_virtual_key = (n >= 0) ? toupper(_prompt[n+1]) : _exit_key;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if XWTWS == WMWS
|
#if XWTWS == WMWS
|
||||||
_prompt.center_just(_width);
|
_prompt.center_just(_width);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wincreate(WC_PUSHBUTTON, _width + 2, _size, _prompt, parent, flags);
|
wincreate(WC_PUSHBUTTON, _width + 2, _size, _prompt, parent, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: maskfld.h,v 1.1.1.1 1994-08-12 10:51:57 alex Exp $ */
|
/* $Id: maskfld.h,v 1.2 1994-08-23 13:52:23 guy Exp $ */
|
||||||
#ifndef __MASKFLD_H
|
#ifndef __MASKFLD_H
|
||||||
#define __MASKFLD_H
|
#define __MASKFLD_H
|
||||||
|
|
||||||
@ -17,8 +17,8 @@
|
|||||||
class TMask_field;
|
class TMask_field;
|
||||||
|
|
||||||
class TRelation; // __RELATION_H
|
class TRelation; // __RELATION_H
|
||||||
class TCursor;
|
class TCursor;
|
||||||
class TFieldref;
|
class TFieldref;
|
||||||
|
|
||||||
// @T
|
// @T
|
||||||
typedef bool (*CONTROL_HANDLER)(TMask_field& field, KEY key);
|
typedef bool (*CONTROL_HANDLER)(TMask_field& field, KEY key);
|
||||||
@ -33,167 +33,167 @@ enum CheckTime { RUNNING_CHECK, STARTING_CHECK, FINAL_CHECK };
|
|||||||
|
|
||||||
class TMask_field : public TObject
|
class TMask_field : public TObject
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
friend class TMask;
|
friend class TMask;
|
||||||
|
|
||||||
TMask* _mask; // The mask the control belongs to
|
TMask* _mask; // The mask the control belongs to
|
||||||
|
|
||||||
TString _help; // Help message
|
TString _help; // Help message
|
||||||
TFieldref* _field; // Corresponding field on the file
|
TFieldref* _field; // Corresponding field on the file
|
||||||
TBit_array _keys; // The keys the field belongs to
|
TBit_array _keys; // The keys the field belongs to
|
||||||
TBit_array _groups; // The groups the field belongs to
|
TBit_array _groups; // The groups the field belongs to
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @DPROT
|
// @DPROT
|
||||||
static int _x, _y; // Coordinate of the control
|
static int _x, _y; // Coordinate of the control
|
||||||
static int _width; // Size of the control
|
static int _width; // Size of the control
|
||||||
static TFixed_string _prompt;// Prompt of the field
|
static TFixed_string _prompt;// Prompt of the field
|
||||||
CONTROL_HANDLER _handler;
|
CONTROL_HANDLER _handler;
|
||||||
|
|
||||||
int _size; // Max length of the string
|
int _size; // Max length of the string
|
||||||
|
|
||||||
WINDOW _win; // Window of the control (not its parent!)
|
WINDOW _win; // Window of the control (not its parent!)
|
||||||
WINDOW _promptwin; // Prompt of the control
|
WINDOW _promptwin; // Prompt of the control
|
||||||
short _dlg; // Identifier of the control
|
short _dlg; // Identifier of the control
|
||||||
|
|
||||||
int _validate_func; // Number of validation function
|
int _validate_func; // Number of validation function
|
||||||
TArray _validate_parms; // Parameters for validation function
|
TArray _validate_parms; // Parameters for validation function
|
||||||
TArray _message; // Messages to send on modify
|
TArray _message; // Messages to send on modify
|
||||||
|
|
||||||
struct TField_Flags
|
struct TField_Flags
|
||||||
{
|
{
|
||||||
bool automagic : 1;
|
bool automagic : 1;
|
||||||
bool dirty : 1; // Modified during run ?
|
bool dirty : 1; // Modified during run ?
|
||||||
bool enabled : 1; // Is editable
|
bool enabled : 1; // Is editable
|
||||||
bool enable_default : 1;
|
bool enable_default : 1;
|
||||||
bool firm : 1; // Is the current firm ?
|
bool firm : 1; // Is the current firm ?
|
||||||
bool focusdirty : 1; // Modified during focus ?
|
bool focusdirty : 1; // Modified during focus ?
|
||||||
bool ghost : 1;
|
bool ghost : 1;
|
||||||
bool persistent : 1;
|
bool persistent : 1;
|
||||||
bool rightjust : 1;
|
bool rightjust : 1;
|
||||||
bool roman : 1; // Is a Roman number ?
|
bool roman : 1; // Is a Roman number ?
|
||||||
bool showed : 1; // Is visible
|
bool showed : 1; // Is visible
|
||||||
bool show_default : 1;
|
bool show_default : 1;
|
||||||
bool uppercase : 1;
|
bool uppercase : 1;
|
||||||
bool exchange : 1; // Value exchange
|
bool exchange : 1; // Value exchange
|
||||||
bool zerofilled : 1;
|
bool zerofilled : 1;
|
||||||
|
|
||||||
TField_Flags();
|
TField_Flags();
|
||||||
char update(const char*);
|
char update(const char*);
|
||||||
} _flags;
|
} _flags;
|
||||||
|
|
||||||
void construct(TScanner& scanner, WINDOW parent);
|
void construct(TScanner& scanner, WINDOW parent);
|
||||||
void construct(short id, const char* prompt, int x, int y, int len,
|
void construct(short id, const char* prompt, int x, int y, int len,
|
||||||
WINDOW parent, const char* flags = "", int width = 0);
|
WINDOW parent, const char* flags = "", int width = 0);
|
||||||
|
|
||||||
virtual WINDOW win() const { return _win; }
|
virtual WINDOW win() const { return _win; }
|
||||||
|
|
||||||
WINDOW wincreate(WIN_TYPE ct, short dx, short dy,
|
WINDOW wincreate(WIN_TYPE ct, short dx, short dy,
|
||||||
const char* title, WINDOW parent, long flags);
|
const char* title, WINDOW parent, long flags);
|
||||||
int create_prompt(WINDOW parent, int width = 0, int heigth = 1);
|
int create_prompt(WINDOW parent, int width = 0, int heigth = 1);
|
||||||
|
|
||||||
long default_flags() const;
|
long default_flags() const;
|
||||||
|
|
||||||
virtual void parse_head(TScanner& scanner);
|
virtual void parse_head(TScanner& scanner);
|
||||||
virtual bool parse_item(TScanner& scanner);
|
virtual bool parse_item(TScanner& scanner);
|
||||||
|
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
virtual const char* get_window_data() const;
|
virtual const char* get_window_data() const;
|
||||||
virtual void set_window_data(const char* data);
|
virtual void set_window_data(const char* data);
|
||||||
virtual void set_field_data(const char* data);
|
virtual void set_field_data(const char* data);
|
||||||
virtual const char* get_field_data() const;
|
virtual const char* get_field_data() const;
|
||||||
|
|
||||||
bool do_message(int n);
|
bool do_message(int n);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
short atodlg(const char* s) const;
|
short atodlg(const char* s) const;
|
||||||
|
|
||||||
WINDOW parent() const;
|
WINDOW parent() const;
|
||||||
short dlg() const { return _dlg; }
|
short dlg() const { return _dlg; }
|
||||||
|
|
||||||
virtual bool ok() const;
|
virtual bool ok() const;
|
||||||
|
|
||||||
bool dirty() const { return _flags.dirty; }
|
bool dirty() const { return _flags.dirty; }
|
||||||
bool focusdirty() const { return _flags.focusdirty; }
|
bool focusdirty() const { return _flags.focusdirty; }
|
||||||
void set_focusdirty(bool d = TRUE) { _flags.focusdirty = d; }
|
void set_focusdirty(bool d = TRUE) { _flags.focusdirty = d; }
|
||||||
void set_dirty(bool d = TRUE) { _flags.dirty = d; set_focusdirty(d); }
|
void set_dirty(bool d = TRUE) { _flags.dirty = d; set_focusdirty(d); }
|
||||||
|
|
||||||
virtual const char* class_name() const;
|
virtual const char* class_name() const;
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
|
|
||||||
int size() const { return _size; }
|
int size() const { return _size; }
|
||||||
|
|
||||||
bool roman() const { return _flags.roman; }
|
bool roman() const { return _flags.roman; }
|
||||||
bool automagic() const { return _flags.automagic; }
|
bool automagic() const { return _flags.automagic; }
|
||||||
bool ghost() const { return _flags.ghost; }
|
bool ghost() const { return _flags.ghost; }
|
||||||
|
|
||||||
virtual bool has_check() const { return FALSE;}
|
virtual bool has_check() const { return FALSE;}
|
||||||
virtual bool has_query() const { return FALSE;}
|
virtual bool has_query() const { return FALSE;}
|
||||||
virtual bool has_message() const { return _message.items() > 0; }
|
virtual bool has_message() const { return _message.items() > 0; }
|
||||||
|
|
||||||
virtual CheckType check_type() const { return CHECK_NONE; }
|
virtual CheckType check_type() const { return CHECK_NONE; }
|
||||||
bool required() const { return check_type() == CHECK_REQUIRED; }
|
bool required() const { return check_type() == CHECK_REQUIRED; }
|
||||||
virtual bool check(CheckTime = RUNNING_CHECK) { return TRUE;}
|
virtual bool check(CheckTime = RUNNING_CHECK) { return TRUE;}
|
||||||
|
|
||||||
virtual void reset();
|
virtual void reset();
|
||||||
|
|
||||||
virtual void enable(bool on = TRUE);
|
virtual void enable(bool on = TRUE);
|
||||||
void disable() { enable(FALSE); }
|
void disable() { enable(FALSE); }
|
||||||
bool enabled() const { return _flags.enabled; }
|
bool enabled() const { return _flags.enabled; }
|
||||||
void enable_default();
|
void enable_default();
|
||||||
|
|
||||||
virtual void show(bool on = TRUE);
|
virtual void show(bool on = TRUE);
|
||||||
void hide() { show(FALSE); }
|
void hide() { show(FALSE); }
|
||||||
bool showed() const { return _flags.showed; }
|
bool showed() const { return _flags.showed; }
|
||||||
void show_default();
|
void show_default();
|
||||||
|
|
||||||
bool active() const; // Is visible and enabled?
|
bool active() const; // Is visible and enabled?
|
||||||
|
|
||||||
void set_handler(CONTROL_HANDLER handler) { _handler = handler; }
|
void set_handler(CONTROL_HANDLER handler) { _handler = handler; }
|
||||||
|
|
||||||
bool is_edit() const;
|
bool is_edit() const;
|
||||||
bool to_check(KEY k, bool checkrun = FALSE) const;
|
bool to_check(KEY k, bool checkrun = FALSE) const;
|
||||||
|
|
||||||
virtual bool on_hit();
|
virtual bool on_hit();
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
void set(const char* s);
|
void set(const char* s);
|
||||||
TString& get() const;
|
TString& get() const;
|
||||||
|
|
||||||
virtual const char* picture_data(const char* data, bool video);
|
virtual const char* picture_data(const char* data, bool video);
|
||||||
|
|
||||||
bool autoload(const TRelation* r = NULL);
|
bool autoload(const TRelation* r = NULL);
|
||||||
bool autosave(TRelation* r = NULL) const;
|
bool autosave(TRelation* r = NULL) const;
|
||||||
|
|
||||||
void undo();
|
void undo();
|
||||||
|
|
||||||
const char* prompt() const;
|
const char* prompt() const;
|
||||||
void set_prompt(const char* p);
|
void set_prompt(const char* p);
|
||||||
|
|
||||||
bool in_key(byte key) const { return _keys[key]; }
|
bool in_key(byte key) const { return _keys[key]; }
|
||||||
void set_key(byte key) { _keys.set(long(key)); _keys.set(0L);}
|
void set_key(byte key) { _keys.set(long(key)); _keys.set(0L);}
|
||||||
word last_key() const;
|
word last_key() const;
|
||||||
|
|
||||||
bool in_group(byte group) const { return _groups[group]; }
|
bool in_group(byte group) const { return _groups[group]; }
|
||||||
void set_group(byte group) { _groups.set(long(group)); _groups.set(0L);}
|
void set_group(byte group) { _groups.set(long(group)); _groups.set(0L);}
|
||||||
|
|
||||||
const TFieldref* field() const { return _field; }
|
const TFieldref* field() const { return _field; }
|
||||||
|
|
||||||
void set_focus() const;
|
void set_focus() const;
|
||||||
|
|
||||||
// set focus, message-box, set focus
|
// set focus, message-box, set focus
|
||||||
bool message_box(const char* fmt, ...) const;
|
bool message_box(const char* fmt, ...) const;
|
||||||
bool warning_box(const char* fmt, ...) const;
|
bool warning_box(const char* fmt, ...) const;
|
||||||
bool error_box(const char* fmt, ...) const;
|
bool error_box(const char* fmt, ...) const;
|
||||||
bool yesno_box(const char* fmt, ...) const;
|
bool yesno_box(const char* fmt, ...) const;
|
||||||
KEY yesnocancel_box(const char* fmt, ...) const;
|
KEY yesnocancel_box(const char* fmt, ...) const;
|
||||||
|
|
||||||
TMask& mask() const { return *_mask; }
|
TMask& mask() const { return *_mask; }
|
||||||
TMask_field(TMask* mask);
|
TMask_field(TMask* mask);
|
||||||
virtual ~TMask_field();
|
virtual ~TMask_field();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -208,57 +208,57 @@ class TEdit_field : public TMask_field
|
|||||||
friend class TList_sheet;
|
friend class TList_sheet;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @DPROT
|
// @DPROT
|
||||||
TString _str;
|
TString _str;
|
||||||
TString _picture;
|
TString _picture;
|
||||||
TString _warning;
|
TString _warning;
|
||||||
CheckType _check; // Accettabilita' di valori nulli
|
CheckType _check; // Accettabilita' di valori nulli
|
||||||
bool _forced;
|
bool _forced;
|
||||||
bool _check_enabled; // Abilitato
|
bool _check_enabled; // Abilitato
|
||||||
|
|
||||||
TBrowse* _browse;
|
TBrowse* _browse;
|
||||||
TList_sheet* _sheet;
|
TList_sheet* _sheet;
|
||||||
WINDOW _buttonwin;
|
WINDOW _buttonwin;
|
||||||
|
|
||||||
const TBrowse* get_browse(TScanner& scanner) const;
|
const TBrowse* get_browse(TScanner& scanner) const;
|
||||||
|
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
virtual void parse_head(TScanner& scanner);
|
virtual void parse_head(TScanner& scanner);
|
||||||
virtual bool parse_item(TScanner& scanner);
|
virtual bool parse_item(TScanner& scanner);
|
||||||
virtual void show(bool on);
|
virtual void show(bool on);
|
||||||
virtual void enable(bool on);
|
virtual void enable(bool on);
|
||||||
|
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
bool validate(KEY k);
|
bool validate(KEY k);
|
||||||
|
|
||||||
virtual void set_window_data(const char* data);
|
virtual void set_window_data(const char* data);
|
||||||
virtual void set_field_data(const char* data);
|
virtual void set_field_data(const char* data);
|
||||||
virtual const char* get_field_data() const;
|
virtual const char* get_field_data() const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
virtual bool on_hit();
|
virtual bool on_hit();
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
virtual bool has_check() const;
|
virtual bool has_check() const;
|
||||||
virtual bool has_query() const { return _browse || _sheet;}
|
virtual bool has_query() const { return _browse || _sheet;}
|
||||||
virtual const char* picture_data(const char* data, bool video);
|
virtual const char* picture_data(const char* data, bool video);
|
||||||
virtual CheckType check_type() const { return _check; }
|
virtual CheckType check_type() const { return _check; }
|
||||||
void check_type(CheckType c) { _check = c; }
|
void check_type(CheckType c) { _check = c; }
|
||||||
|
|
||||||
bool forced() const { return _forced;}
|
bool forced() const { return _forced;}
|
||||||
virtual bool check(CheckTime = RUNNING_CHECK);
|
virtual bool check(CheckTime = RUNNING_CHECK);
|
||||||
TBrowse* browse() const { return _browse;}
|
TBrowse* browse() const { return _browse;}
|
||||||
void enable_check(bool on = TRUE) ;
|
void enable_check(bool on = TRUE) ;
|
||||||
bool check_enabled() const { return _check_enabled;}
|
bool check_enabled() const { return _check_enabled;}
|
||||||
|
|
||||||
const char* format(const char* data);
|
const char* format(const char* data);
|
||||||
const char* picture() const { return _picture; }
|
const char* picture() const { return _picture; }
|
||||||
|
|
||||||
TEdit_field(TMask* mask);
|
TEdit_field(TMask* mask);
|
||||||
virtual ~TEdit_field();
|
virtual ~TEdit_field();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -268,56 +268,56 @@ public:
|
|||||||
|
|
||||||
class TBrowse
|
class TBrowse
|
||||||
{
|
{
|
||||||
TEdit_field* _fld; // The field owning the sheet
|
TEdit_field* _fld; // The field owning the sheet
|
||||||
TRelation* _relation; // Main relation
|
TRelation* _relation; // Main relation
|
||||||
TCursor* _cursor; // Cursor on the relation
|
TCursor* _cursor; // Cursor on the relation
|
||||||
TString _insert;
|
TString _insert;
|
||||||
TString _filter;
|
TString _filter;
|
||||||
long _rec;
|
long _rec;
|
||||||
bool _secondary;
|
bool _secondary;
|
||||||
bool _checked;
|
bool _checked;
|
||||||
|
|
||||||
TToken_string _head, _items;
|
TToken_string _head, _items;
|
||||||
TToken_string _inp_id, _inp_fn;
|
TToken_string _inp_id, _inp_fn;
|
||||||
TToken_string _out_id, _out_fn;
|
TToken_string _out_id, _out_fn;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void do_output(CheckTime = RUNNING_CHECK);
|
void do_output(CheckTime = RUNNING_CHECK);
|
||||||
void do_clear();
|
void do_clear();
|
||||||
bool do_insert();
|
bool do_insert();
|
||||||
|
|
||||||
TMask_field& field(short n) const;
|
TMask_field& field(short n) const;
|
||||||
TToken_string& create_siblings(TToken_string& siblings);
|
TToken_string& create_siblings(TToken_string& siblings);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int do_input(bool filter = FALSE); // Serve ai TCursor_sheet
|
int do_input(bool filter = FALSE); // Serve ai TCursor_sheet
|
||||||
|
|
||||||
TBrowse(TEdit_field* f, TRelation* r, int key = 1, const char* filter = "");
|
TBrowse(TEdit_field* f, TRelation* r, int key = 1, const char* filter = "");
|
||||||
TBrowse(TEdit_field* f, TCursor* c);
|
TBrowse(TEdit_field* f, TCursor* c);
|
||||||
~TBrowse();
|
~TBrowse();
|
||||||
|
|
||||||
void parse_join(TScanner& scanner);
|
void parse_join(TScanner& scanner);
|
||||||
void parse_input(TScanner& scanner);
|
void parse_input(TScanner& scanner);
|
||||||
void parse_display(TScanner& scanner);
|
void parse_display(TScanner& scanner);
|
||||||
void parse_output(TScanner& scanner);
|
void parse_output(TScanner& scanner);
|
||||||
void parse_insert(TScanner& scanner);
|
void parse_insert(TScanner& scanner);
|
||||||
bool parse_copy(const TString& what, const TBrowse* b);
|
bool parse_copy(const TString& what, const TBrowse* b);
|
||||||
|
|
||||||
void set_insert(const char* s) { _insert = s;}
|
void set_insert(const char* s) { _insert = s;}
|
||||||
const TString& get_insert() const { return _insert;}
|
const TString& get_insert() const { return _insert;}
|
||||||
const TString& get_filter() const { return _filter;}
|
const TString& get_filter() const { return _filter;}
|
||||||
|
|
||||||
TEdit_field& field() {return *_fld;}
|
TEdit_field& field() {return *_fld;}
|
||||||
|
|
||||||
bool check(CheckTime = RUNNING_CHECK);
|
bool check(CheckTime = RUNNING_CHECK);
|
||||||
bool empty_check();
|
bool empty_check();
|
||||||
const TToken_string& head() const { return _head;}
|
const TToken_string& head() const { return _head;}
|
||||||
const TToken_string& items() const { return _items;}
|
const TToken_string& items() const { return _items;}
|
||||||
TCursor* cursor() const { return _cursor;}
|
TCursor* cursor() const { return _cursor;}
|
||||||
bool checked() const { return _checked;}
|
bool checked() const { return _checked;}
|
||||||
bool secondary() const { return _secondary;}
|
bool secondary() const { return _secondary;}
|
||||||
|
|
||||||
KEY run();
|
KEY run();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -330,23 +330,23 @@ class TReal_field : public TEdit_field
|
|||||||
int _decimals;
|
int _decimals;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
|
|
||||||
virtual const char* get_window_data() const;
|
virtual const char* get_window_data() const;
|
||||||
virtual void set_window_data(const char* data);
|
virtual void set_window_data(const char* data);
|
||||||
|
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual void parse_head(TScanner& scanner);
|
virtual void parse_head(TScanner& scanner);
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
void set_decimals(int d); // Set precision & picture
|
void set_decimals(int d); // Set precision & picture
|
||||||
int decimals() const { return _decimals; } // Get precision
|
int decimals() const { return _decimals; } // Get precision
|
||||||
void exchange(const real& o, const real& n); // Change value / o * n
|
void exchange(const real& o, const real& n); // Change value / o * n
|
||||||
|
|
||||||
TReal_field(TMask* mask);
|
TReal_field(TMask* mask);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -357,15 +357,15 @@ public:
|
|||||||
class TDate_field : public TEdit_field
|
class TDate_field : public TEdit_field
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
void parse_head(TScanner& scanner);
|
void parse_head(TScanner& scanner);
|
||||||
TDate_field(TMask* mask);
|
TDate_field(TMask* mask);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -376,24 +376,24 @@ public:
|
|||||||
class TBoolean_field : public TMask_field
|
class TBoolean_field : public TMask_field
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// @DPROT
|
// @DPROT
|
||||||
bool _on;
|
bool _on;
|
||||||
|
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
|
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual const char* get_window_data() const;
|
virtual const char* get_window_data() const;
|
||||||
virtual void set_window_data(const char* data);
|
virtual void set_window_data(const char* data);
|
||||||
virtual void set_field_data(const char* data = NULL);
|
virtual void set_field_data(const char* data = NULL);
|
||||||
virtual const char* get_field_data() const;
|
virtual const char* get_field_data() const;
|
||||||
virtual bool parse_item(TScanner& scanner);
|
virtual bool parse_item(TScanner& scanner);
|
||||||
virtual void enable(bool on);
|
virtual void enable(bool on);
|
||||||
virtual bool on_hit();
|
virtual bool on_hit();
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
TBoolean_field(TMask* mask);
|
TBoolean_field(TMask* mask);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -403,43 +403,43 @@ public:
|
|||||||
|
|
||||||
class TList_field : public TMask_field
|
class TList_field : public TMask_field
|
||||||
{
|
{
|
||||||
// @FPRIV
|
// @FPRIV
|
||||||
void add_list();
|
void add_list();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
TToken_string _values;
|
TToken_string _values;
|
||||||
TToken_string _codes;
|
TToken_string _codes;
|
||||||
TString _str;
|
TString _str;
|
||||||
|
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
|
|
||||||
virtual void set_window_data(const char* data);
|
virtual void set_window_data(const char* data);
|
||||||
virtual const char* get_window_data() const;
|
virtual const char* get_window_data() const;
|
||||||
virtual void set_field_data(const char* data = NULL);
|
virtual void set_field_data(const char* data = NULL);
|
||||||
virtual const char* get_field_data() const;
|
virtual const char* get_field_data() const;
|
||||||
// virtual const char* picture_data(const char* data, bool video);
|
// virtual const char* picture_data(const char* data, bool video);
|
||||||
|
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
|
|
||||||
virtual void current(int n);
|
virtual void current(int n);
|
||||||
virtual int current() const;
|
virtual int current() const;
|
||||||
|
|
||||||
int str2curr(const char* data);
|
int str2curr(const char* data);
|
||||||
virtual bool on_hit();
|
virtual bool on_hit();
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
virtual void read_item(TScanner& scanner);
|
virtual void read_item(TScanner& scanner);
|
||||||
|
|
||||||
virtual void parse_head(TScanner& scanner);
|
virtual void parse_head(TScanner& scanner);
|
||||||
virtual bool parse_item(TScanner& scanner);
|
virtual bool parse_item(TScanner& scanner);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
TList_field(TMask* mask);
|
TList_field(TMask* mask);
|
||||||
virtual void replace_items(const char* codes, const char* values);
|
virtual void replace_items(const char* codes, const char* values);
|
||||||
virtual void add_item(const char* code_value);
|
virtual void add_item(const char* code_value);
|
||||||
virtual void delete_item(const char* code);
|
virtual void delete_item(const char* code);
|
||||||
int items() const;
|
int items() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -451,29 +451,29 @@ class TRadio_field : public TList_field
|
|||||||
{
|
{
|
||||||
enum { MAX_RADIO = 8 };
|
enum { MAX_RADIO = 8 };
|
||||||
|
|
||||||
// @FPRIV
|
// @FPRIV
|
||||||
int _nitems;
|
int _nitems;
|
||||||
int _active_item;
|
int _active_item;
|
||||||
WINDOW _radio_ctl_win[MAX_RADIO];
|
WINDOW _radio_ctl_win[MAX_RADIO];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
virtual void enable(bool on);
|
virtual void enable(bool on);
|
||||||
virtual void show(bool on);
|
virtual void show(bool on);
|
||||||
|
|
||||||
virtual void current(int n);
|
virtual void current(int n);
|
||||||
virtual int current() const;
|
virtual int current() const;
|
||||||
WINDOW win() const { return _radio_ctl_win[_active_item]; }
|
WINDOW win() const { return _radio_ctl_win[_active_item]; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
TRadio_field(TMask* mask);
|
TRadio_field(TMask* mask);
|
||||||
|
|
||||||
void check_radiobutton(WINDOW checked);
|
void check_radiobutton(WINDOW checked);
|
||||||
bool move_focus(int d);
|
bool move_focus(int d);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -483,21 +483,25 @@ public:
|
|||||||
// @END
|
// @END
|
||||||
|
|
||||||
class TButton_field : public TMask_field
|
class TButton_field : public TMask_field
|
||||||
{
|
{
|
||||||
|
KEY _virtual_key, _exit_key;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
virtual word class_id() const;
|
virtual word class_id() const;
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
|
|
||||||
void parse_head(TScanner& scanner);
|
void parse_head(TScanner& scanner);
|
||||||
bool parse_item(TScanner& scanner);
|
bool parse_item(TScanner& scanner);
|
||||||
virtual void enable(bool);
|
virtual void enable(bool);
|
||||||
virtual void show(bool);
|
virtual void show(bool);
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
TButton_field(TMask* mask);
|
TButton_field(TMask* mask);
|
||||||
|
KEY virtual_key() const { return _virtual_key; }
|
||||||
|
KEY exit_key() const { return _exit_key; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -508,12 +512,12 @@ public:
|
|||||||
class TGroup_field : public TMask_field
|
class TGroup_field : public TMask_field
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// @DPROT
|
// @DPROT
|
||||||
virtual void parse_head(TScanner& scanner);
|
virtual void parse_head(TScanner& scanner);
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
TGroup_field(TMask* mask);
|
TGroup_field(TMask* mask);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -609,6 +609,14 @@ break;
|
|||||||
}
|
}
|
||||||
set_focus_cell(cur_row, cur_col);
|
set_focus_cell(cur_row, cur_col);
|
||||||
check_enabled = TRUE; // Enable checks
|
check_enabled = TRUE; // Enable checks
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case K_PREV:
|
||||||
|
case K_NEXT:
|
||||||
|
{
|
||||||
|
XI_OBJ* itf = xi_get_itf(win());
|
||||||
|
const bool ok = (bool)xi_move_focus(itf);
|
||||||
|
if (ok) dispatch_e_char(parent(), k);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: relapp.cpp,v 1.2 1994-08-17 14:08:21 guy Exp $
|
// $Id: relapp.cpp,v 1.3 1994-08-23 13:52:26 guy Exp $
|
||||||
#include <mailbox.h>
|
#include <mailbox.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -676,7 +676,7 @@ bool TRelation_application::main_loop()
|
|||||||
KEY k;
|
KEY k;
|
||||||
|
|
||||||
// Provoca l'autopremimento per il messaggio di LINK
|
// Provoca l'autopremimento per il messaggio di LINK
|
||||||
if (_lnflag) _mask->send_key(K_SHIFT_ENTER, 0);
|
if (_lnflag) _mask->send_key(K_CTRL_ENTER, 0);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
1468
include/sheet.cpp
1468
include/sheet.cpp
File diff suppressed because it is too large
Load Diff
@ -1,31 +1,36 @@
|
|||||||
|
BUTTON DLG_SAVEREC 8 2
|
||||||
BUTTON DLG_SAVEREC 8 2
|
BEGIN
|
||||||
BEGIN
|
PROMPT -16 -1 "~Registra"
|
||||||
PROMPT -16 -1 ""
|
MESSAGE EXIT,K_SAVE
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_NEWREC 8 2
|
BUTTON DLG_NEWREC 8 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -26 -1 "Nuovo"
|
PROMPT -26 -1 "~Nuovo"
|
||||||
END
|
MESSAGE EXIT,K_INS
|
||||||
|
END
|
||||||
BUTTON DLG_DELREC 8 2
|
|
||||||
BEGIN
|
BUTTON DLG_DELREC 8 2
|
||||||
PROMPT -36 -1 "Elimina"
|
BEGIN
|
||||||
END
|
PROMPT -36 -1 "~Elimina"
|
||||||
|
MESSAGE EXIT,K_DEL
|
||||||
BUTTON DLG_FINDREC 8 2
|
END
|
||||||
BEGIN
|
|
||||||
PROMPT -46 -1 "Ricerca"
|
BUTTON DLG_FINDREC 8 2
|
||||||
END
|
BEGIN
|
||||||
|
PROMPT -46 -1 "Ricerca"
|
||||||
BUTTON DLG_CANCEL 8 2
|
MESSAGE EXIT,K_F9
|
||||||
BEGIN
|
END
|
||||||
PROMPT -56 -1 ""
|
|
||||||
END
|
BUTTON DLG_CANCEL 8 2
|
||||||
|
BEGIN
|
||||||
BUTTON DLG_QUIT 8 2
|
PROMPT -56 -1 ""
|
||||||
BEGIN
|
MESSAGE EXIT,K_ESC
|
||||||
PROMPT -66 -1 ""
|
END
|
||||||
END
|
|
||||||
|
BUTTON DLG_QUIT 8 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -66 -1 ""
|
||||||
|
MESSAGE EXIT,K_QUIT
|
||||||
|
END
|
||||||
|
|
||||||
|
1120
include/validate.cpp
1120
include/validate.cpp
File diff suppressed because it is too large
Load Diff
2568
include/viswin.cpp
2568
include/viswin.cpp
File diff suppressed because it is too large
Load Diff
1462
include/window.cpp
1462
include/window.cpp
File diff suppressed because it is too large
Load Diff
431
include/window.h
431
include/window.h
@ -1,215 +1,216 @@
|
|||||||
#ifndef __WINDOW_H
|
#ifndef __WINDOW_H
|
||||||
#define __WINDOW_H
|
#define __WINDOW_H
|
||||||
|
|
||||||
#ifndef __XVTILITY_H
|
#ifndef __XVTILITY_H
|
||||||
#include <xvtility.h>
|
#include <xvtility.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void close_all_dialogs();
|
void close_all_dialogs();
|
||||||
bool can_close();
|
bool can_close();
|
||||||
|
WINDOW cur_win();
|
||||||
// @C
|
|
||||||
// Classe TPoint
|
// @C
|
||||||
// @END
|
// Classe TPoint
|
||||||
|
// @END
|
||||||
// @N
|
|
||||||
// Punto dello schermo
|
// @N
|
||||||
// @END
|
// Punto dello schermo
|
||||||
|
// @END
|
||||||
struct TPoint
|
|
||||||
{
|
struct TPoint
|
||||||
// @DPUB
|
{
|
||||||
long x, y;
|
// @DPUB
|
||||||
// Coordinate
|
long x, y;
|
||||||
|
// Coordinate
|
||||||
// @FPUB
|
|
||||||
TPoint(long sx = 0, long sy = 0) : x(sx), y(sy) {}
|
// @FPUB
|
||||||
// Costruttore
|
TPoint(long sx = 0, long sy = 0) : x(sx), y(sy) {}
|
||||||
TPoint(PNT pnt) : x(pnt.h/CHARX), y(pnt.v/CHARY) {}
|
// Costruttore
|
||||||
void set(long sx, long sy) { x = sx; y = sy; }
|
TPoint(PNT pnt) : x(pnt.h/CHARX), y(pnt.v/CHARY) {}
|
||||||
void set(PNT pnt) { x = pnt.h/CHARX; y = pnt.v/CHARY; }
|
void set(long sx, long sy) { x = sx; y = sy; }
|
||||||
TPoint& operator= (PNT pnt) { set(pnt); return *this; }
|
void set(PNT pnt) { x = pnt.h/CHARX; y = pnt.v/CHARY; }
|
||||||
TPoint& operator= (TPoint pnt) { set(pnt.x,pnt.y); return *this; }
|
TPoint& operator= (PNT pnt) { set(pnt); return *this; }
|
||||||
bool operator ==(const TPoint& p) { return p.x == x && p.y == y; }
|
TPoint& operator= (TPoint pnt) { set(pnt.x,pnt.y); return *this; }
|
||||||
bool operator !=(const TPoint& p) { return p.x != x || p.y != y; }
|
bool operator ==(const TPoint& p) { return p.x == x && p.y == y; }
|
||||||
};
|
bool operator !=(const TPoint& p) { return p.x != x || p.y != y; }
|
||||||
|
};
|
||||||
|
|
||||||
// @C
|
|
||||||
// Classe TWindow
|
// @C
|
||||||
//
|
// Classe TWindow
|
||||||
// @END
|
//
|
||||||
|
// @END
|
||||||
class TWindow
|
|
||||||
{
|
class TWindow
|
||||||
|
{
|
||||||
friend class TWindow_manager;
|
|
||||||
|
friend class TWindow_manager;
|
||||||
// @DPRIV
|
|
||||||
static DRAW_CTOOLS _ct; // Set di drawing tools (xvttype.h)
|
// @DPRIV
|
||||||
static bool _ctools_saved; // E' stata salvata _ct ?
|
static DRAW_CTOOLS _ct; // Set di drawing tools (xvttype.h)
|
||||||
|
static bool _ctools_saved; // E' stata salvata _ct ?
|
||||||
WINDOW _win; // Descrittore finestra
|
|
||||||
KEY _lastkey; // Tasto di uscita
|
WINDOW _win; // Descrittore finestra
|
||||||
|
KEY _lastkey; // Tasto di uscita
|
||||||
// @FPRIV
|
|
||||||
bool save_ctools(); // Compila la struct _ct con i valori correnti
|
// @FPRIV
|
||||||
bool restore_ctools(); // Ripristina i valori DA _ct
|
bool save_ctools(); // Compila la struct _ct con i valori correnti
|
||||||
|
bool restore_ctools(); // Ripristina i valori DA _ct
|
||||||
protected:
|
|
||||||
// @DPROT
|
protected:
|
||||||
bool _open : 1; // Se la finestra e' aperta
|
// @DPROT
|
||||||
bool _modal : 1; // Se la finestra e' modale
|
bool _open : 1; // Se la finestra e' aperta
|
||||||
bool _running : 1; // Se la finestra e' in esecuzione
|
bool _modal : 1; // Se la finestra e' modale
|
||||||
|
bool _running : 1; // Se la finestra e' in esecuzione
|
||||||
// @FPROT
|
|
||||||
static long window_handler(WINDOW win, EVENT* ep);
|
// @FPROT
|
||||||
virtual WINDOW create(short x, short y, short dx, short dy,
|
static long window_handler(WINDOW win, EVENT* ep);
|
||||||
const char* title = "", long flags = WSF_NONE,
|
virtual WINDOW create(short x, short y, short dx, short dy,
|
||||||
WIN_TYPE rt = W_DOC, WINDOW parent = NULL_WIN) ;
|
const char* title = "", long flags = WSF_NONE,
|
||||||
|
WIN_TYPE rt = W_DOC, WINDOW parent = NULL_WIN) ;
|
||||||
void set_win(WINDOW w) { _win = w; } // Usare con cautela
|
|
||||||
|
void set_win(WINDOW w) { _win = w; } // Usare con cautela
|
||||||
void set_modal(bool m) { _modal = m; } // Modifica il flag _modal
|
|
||||||
|
void set_modal(bool m) { _modal = m; } // Modifica il flag _modal
|
||||||
WINDOW parent() const;
|
|
||||||
|
WINDOW parent() const;
|
||||||
virtual void update() {} // E_UPDATE
|
|
||||||
virtual bool on_key(KEY) { return TRUE; } // E_CHAR
|
virtual void update() {} // E_UPDATE
|
||||||
|
virtual bool on_key(KEY) { return TRUE; } // E_CHAR
|
||||||
virtual PNT log2dev(long x, long y) const;
|
|
||||||
virtual TPoint dev2log(const PNT& p) const;
|
virtual PNT log2dev(long x, long y) const;
|
||||||
|
virtual TPoint dev2log(const PNT& p) const;
|
||||||
public:
|
|
||||||
// @FPUB
|
public:
|
||||||
TWindow(); // Costruttore
|
// @FPUB
|
||||||
virtual ~TWindow();
|
TWindow(); // Costruttore
|
||||||
|
virtual ~TWindow();
|
||||||
virtual void handler(WINDOW win, EVENT* ep); // Handler finestra
|
|
||||||
virtual void set_focus(); // Mette la finestra in primo piano
|
virtual void handler(WINDOW win, EVENT* ep); // Handler finestra
|
||||||
virtual WINDOW win() const { return _win; } // Ritorna il descrittore della finestra
|
virtual void set_focus(); // Mette la finestra in primo piano
|
||||||
|
virtual WINDOW win() const { return _win; } // Ritorna il descrittore della finestra
|
||||||
bool is_open() const { return _open; } // Ritorna _open
|
|
||||||
bool is_modal() const { return _modal; } // Ritorna _modal
|
bool is_open() const { return _open; } // Ritorna _open
|
||||||
bool is_running() const { return _running; } // Ritorna _running
|
bool is_modal() const { return _modal; } // Ritorna _modal
|
||||||
|
bool is_running() const { return _running; } // Ritorna _running
|
||||||
TPoint size() const; // Determina numero di righe e colonne nella finestra
|
|
||||||
short rows() const { return (short)size().y; }// Ritorna numero di righe
|
TPoint size() const; // Determina numero di righe e colonne nella finestra
|
||||||
short columns() const { return (short)size().x; } // Ritorna numero di colonne
|
short rows() const { return (short)size().y; }// Ritorna numero di righe
|
||||||
|
short columns() const { return (short)size().x; } // Ritorna numero di colonne
|
||||||
virtual void start_run() {}
|
|
||||||
virtual bool stop_run(KEY key);
|
virtual void start_run() {}
|
||||||
void force_update(); // Forza ridisegno della finestra
|
virtual bool stop_run(KEY key);
|
||||||
|
void force_update(); // Forza ridisegno della finestra
|
||||||
virtual void open(); // Mostra la finestra
|
|
||||||
virtual void close(); // Nasconde la finestra
|
virtual void open(); // Mostra la finestra
|
||||||
|
virtual void close(); // Nasconde la finestra
|
||||||
void iconize() const;
|
|
||||||
void maximize() const;
|
void iconize() const;
|
||||||
virtual void enable(bool = TRUE) const;
|
void maximize() const;
|
||||||
void disable() const { enable(FALSE); }
|
virtual void enable(bool = TRUE) const;
|
||||||
|
void disable() const { enable(FALSE); }
|
||||||
void open_modal(); // Mostra la finestra modale
|
|
||||||
void close_modal(); // Nasconde la finestra modale
|
void open_modal(); // Mostra la finestra modale
|
||||||
|
void close_modal(); // Nasconde la finestra modale
|
||||||
KEY run(); // Esegue la finestra
|
|
||||||
KEY last_key() const { return _lastkey; } // Ritorna l'ultimo tasto
|
KEY run(); // Esegue la finestra
|
||||||
|
KEY last_key() const { return _lastkey; } // Ritorna l'ultimo tasto
|
||||||
virtual void set_caption(const char* title);
|
|
||||||
virtual const char* get_caption() const;
|
virtual void set_caption(const char* title);
|
||||||
|
virtual const char* get_caption() const;
|
||||||
// Riempie la finestra con il colore in color
|
|
||||||
void clear(COLOR color);
|
// Riempie la finestra con il colore in color
|
||||||
|
void clear(COLOR color);
|
||||||
// Setta il draw mode
|
|
||||||
void set_mode(DRAW_MODE mode);
|
// Setta il draw mode
|
||||||
|
void set_mode(DRAW_MODE mode);
|
||||||
// Setta il colore
|
|
||||||
void set_color(COLOR fore, COLOR back);
|
// Setta il colore
|
||||||
|
void set_color(COLOR fore, COLOR back);
|
||||||
// Setta opaque_text. Quando e' FALSE il testo viene scritto in modo trasparente
|
|
||||||
void set_opaque_text(bool o);
|
// Setta opaque_text. Quando e' FALSE il testo viene scritto in modo trasparente
|
||||||
|
void set_opaque_text(bool o);
|
||||||
// Sceglie penna con colore color eccetera
|
|
||||||
void set_pen(COLOR color, int width = 1, PAT_STYLE pat = PAT_SOLID, PEN_STYLE st = P_SOLID);
|
// Sceglie penna con colore color eccetera
|
||||||
void hide_pen(); // Nasconde la penna
|
void set_pen(COLOR color, int width = 1, PAT_STYLE pat = PAT_SOLID, PEN_STYLE st = P_SOLID);
|
||||||
void hide_brush(); // Nasconde il pennello
|
void hide_pen(); // Nasconde la penna
|
||||||
void set_brush(COLOR color, PAT_STYLE = PAT_SOLID); // Sceglie pennello con colore color
|
void hide_brush(); // Nasconde il pennello
|
||||||
void set_font(int family = FF_SYSTEM, int style = 0, int dim = 0); // Sceglie il font
|
void set_brush(COLOR color, PAT_STYLE = PAT_SOLID); // Sceglie pennello con colore color
|
||||||
|
void set_font(int family = FF_SYSTEM, int style = 0, int dim = 0); // Sceglie il font
|
||||||
// Disegna un rettangolo con la possibilita' di settare la penna e il draw_mode
|
|
||||||
void frame(short left, short top, short right, short bottom, int flag);
|
// Disegna un rettangolo con la possibilita' di settare la penna e il draw_mode
|
||||||
|
void frame(short left, short top, short right, short bottom, int flag);
|
||||||
// Queste funzioni chiamano tutte frame con diversi flag
|
|
||||||
void rect(short left, short top, short right, short bottom);
|
// Queste funzioni chiamano tutte frame con diversi flag
|
||||||
void bar(short left, short top, short right, short bottom);
|
void rect(short left, short top, short right, short bottom);
|
||||||
void invert_bar(short left, short top, short right, short bottom);
|
void bar(short left, short top, short right, short bottom);
|
||||||
|
void invert_bar(short left, short top, short right, short bottom);
|
||||||
void stringat(short x, short y, const char* str);
|
|
||||||
void printat(short x, short y, const char* fmt, ...); // Scrive un testo nella finestra alla posizione indicata
|
void stringat(short x, short y, const char* str);
|
||||||
|
void printat(short x, short y, const char* fmt, ...); // Scrive un testo nella finestra alla posizione indicata
|
||||||
void line(short x0, short y0, short x1, short y1); // Disegna una linea nella finestra
|
|
||||||
void icon(short x0, short y0, int iconid = -1);
|
void line(short x0, short y0, short x1, short y1); // Disegna una linea nella finestra
|
||||||
};
|
void icon(short x0, short y0, int iconid = -1);
|
||||||
|
};
|
||||||
class TTemp_window : public TWindow
|
|
||||||
{
|
class TTemp_window : public TWindow
|
||||||
public:
|
{
|
||||||
TTemp_window(WINDOW w);
|
public:
|
||||||
virtual ~TTemp_window();
|
TTemp_window(WINDOW w);
|
||||||
};
|
virtual ~TTemp_window();
|
||||||
|
};
|
||||||
// @C
|
|
||||||
// Classe TScroll_window : public TWindow
|
// @C
|
||||||
//
|
// Classe TScroll_window : public TWindow
|
||||||
// Finestra con scrollbar
|
//
|
||||||
//
|
// Finestra con scrollbar
|
||||||
// @END
|
//
|
||||||
|
// @END
|
||||||
class TScroll_window : public TWindow
|
|
||||||
{
|
class TScroll_window : public TWindow
|
||||||
|
{
|
||||||
// @DPRIV
|
|
||||||
TPoint _origin;
|
// @DPRIV
|
||||||
TPoint _max;
|
TPoint _origin;
|
||||||
short _shift;
|
TPoint _max;
|
||||||
|
short _shift;
|
||||||
bool _autoscroll : 1;
|
|
||||||
bool _has_hscroll : 1;
|
bool _autoscroll : 1;
|
||||||
bool _has_vscroll : 1;
|
bool _has_hscroll : 1;
|
||||||
|
bool _has_vscroll : 1;
|
||||||
protected:
|
|
||||||
|
protected:
|
||||||
// @FPROT
|
|
||||||
virtual WINDOW create(short x, short y, short dx, short dy,
|
// @FPROT
|
||||||
const char* title = "", long flags = WSF_NONE,
|
virtual WINDOW create(short x, short y, short dx, short dy,
|
||||||
WIN_TYPE rt = W_DOC, WINDOW parent = NULL_WIN) ; // Crea la finestra
|
const char* title = "", long flags = WSF_NONE,
|
||||||
|
WIN_TYPE rt = W_DOC, WINDOW parent = NULL_WIN) ; // Crea la finestra
|
||||||
virtual PNT log2dev(long x, long y) const;
|
|
||||||
virtual bool on_key(KEY key);
|
virtual PNT log2dev(long x, long y) const;
|
||||||
|
virtual bool on_key(KEY key);
|
||||||
public:
|
|
||||||
// @FPUB
|
public:
|
||||||
|
// @FPUB
|
||||||
TScroll_window();
|
|
||||||
// Costruttore
|
TScroll_window();
|
||||||
|
// Costruttore
|
||||||
virtual void handler(WINDOW win, EVENT* ep);
|
|
||||||
|
virtual void handler(WINDOW win, EVENT* ep);
|
||||||
void set_scroll_max(long maxx, long maxy);
|
|
||||||
// Setta punto di massimo scroll
|
void set_scroll_max(long maxx, long maxy);
|
||||||
void update_thumb(long x = -1, long y = -1);
|
// Setta punto di massimo scroll
|
||||||
// Aggiorna la scrollbar
|
void update_thumb(long x = -1, long y = -1);
|
||||||
|
// Aggiorna la scrollbar
|
||||||
void autoscroll(bool on) { _autoscroll = on; }
|
|
||||||
// Setta autoscroll
|
void autoscroll(bool on) { _autoscroll = on; }
|
||||||
|
// Setta autoscroll
|
||||||
bool autoscrolling() const { return _autoscroll; }
|
|
||||||
|
bool autoscrolling() const { return _autoscroll; }
|
||||||
const TPoint& origin() const { return _origin; }
|
|
||||||
// Ritorna punto origine
|
const TPoint& origin() const { return _origin; }
|
||||||
const TPoint& range() const { return _max; }
|
// Ritorna punto origine
|
||||||
// Ritorna punto massimo
|
const TPoint& range() const { return _max; }
|
||||||
};
|
// Ritorna punto massimo
|
||||||
|
};
|
||||||
#endif // __WINDOW_H
|
|
||||||
|
#endif // __WINDOW_H
|
||||||
|
@ -107,11 +107,13 @@ HIDDEN BOOLEAN event_hook(HWND hwnd,
|
|||||||
ULONG lparam,
|
ULONG lparam,
|
||||||
long* ret)
|
long* ret)
|
||||||
{
|
{
|
||||||
if (msg == WM_CTLCOLOR)
|
switch(msg)
|
||||||
|
{
|
||||||
|
case WM_CTLCOLOR:
|
||||||
{
|
{
|
||||||
const word type = HIWORD(lparam);
|
const word type = HIWORD(lparam);
|
||||||
|
|
||||||
if (type == CTLCOLOR_LISTBOX || type == CTLCOLOR_EDIT ||
|
if (type == CTLCOLOR_LISTBOX || type == CTLCOLOR_EDIT ||
|
||||||
type == CTLCOLOR_MSGBOX)
|
type == CTLCOLOR_MSGBOX)
|
||||||
{
|
{
|
||||||
HWND hwnd = LOWORD(lparam);
|
HWND hwnd = LOWORD(lparam);
|
||||||
@ -137,44 +139,64 @@ HIDDEN BOOLEAN event_hook(HWND hwnd,
|
|||||||
*ret = focus ? FocusBrush : NormalBrush;
|
*ret = focus ? FocusBrush : NormalBrush;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
if (msg == WM_COMMAND)
|
break;
|
||||||
|
case WM_COMMAND:
|
||||||
|
{
|
||||||
|
const word notify = HIWORD(lparam);
|
||||||
|
if (notify == EN_KILLFOCUS || notify == EN_SETFOCUS)
|
||||||
|
{
|
||||||
|
HWND hwnd = LOWORD(lparam); // Ridisegna BENE il campo
|
||||||
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
if (wparam == VK_PRIOR || wparam == VK_NEXT ||
|
||||||
|
wparam == VK_UP || wparam == VK_DOWN )
|
||||||
|
{
|
||||||
|
char name[16];
|
||||||
|
GetClassName(hwnd, name, 5);
|
||||||
|
if (stricmp(name, "Edit") == 0)
|
||||||
|
{
|
||||||
|
KEY key;
|
||||||
|
switch(wparam)
|
||||||
{
|
{
|
||||||
word notify = HIWORD(lparam);
|
case VK_PRIOR:
|
||||||
if (notify == EN_KILLFOCUS || notify == EN_SETFOCUS)
|
wparam = K_PREV; break;
|
||||||
{
|
case VK_NEXT:
|
||||||
HWND hwnd = LOWORD(lparam);
|
key = K_NEXT; break;
|
||||||
InvalidateRect(hwnd, NULL, TRUE);
|
case VK_UP:
|
||||||
}
|
key = K_UP; break;
|
||||||
} else
|
case VK_DOWN:
|
||||||
if (msg == WM_KEYUP)
|
key = K_DOWN; break;
|
||||||
{
|
default:
|
||||||
if (wparam == VK_PRIOR || wparam == VK_NEXT ||
|
key = 0; break;
|
||||||
wparam == VK_UP || wparam == VK_DOWN )
|
}
|
||||||
{
|
if (key > 0)
|
||||||
char name[16];
|
{
|
||||||
GetClassName(hwnd, name, 15);
|
WINDOW w = cur_win();
|
||||||
if (stricmp(name, "Edit") == 0)
|
if (w != NULL_WIN)
|
||||||
{
|
dispatch_e_char(w, key);
|
||||||
switch(wparam)
|
}
|
||||||
{
|
}
|
||||||
case VK_PRIOR:wparam = K_PREV; break;
|
}
|
||||||
case VK_NEXT :wparam = K_NEXT; break;
|
break;
|
||||||
case VK_UP :wparam = K_UP; break;
|
case WM_MENUCHAR:
|
||||||
case VK_DOWN :wparam = K_DOWN; break;
|
{
|
||||||
default:wparam = 0; break;
|
WINDOW w = cur_win();
|
||||||
}
|
if (w != NULL_WIN)
|
||||||
if (wparam)
|
{
|
||||||
{
|
const KEY key = toupper(wparam)+K_CTRL;
|
||||||
WINDOW w = xvtwi_hwnd_to_window(GetParent(hwnd));
|
dispatch_e_char(w, key);
|
||||||
dispatch_e_char(w, wparam);
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
}
|
default:
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -671,6 +693,7 @@ int xvt_get_checked_radio(const WINDOW* ctls, int count)
|
|||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
HIDDEN WINDOW statbar = NULL_WIN;
|
HIDDEN WINDOW statbar = NULL_WIN;
|
||||||
|
HIDDEN TString80 stattext;
|
||||||
|
|
||||||
WINDOW xvt_create_statbar()
|
WINDOW xvt_create_statbar()
|
||||||
{
|
{
|
||||||
@ -701,18 +724,23 @@ WINDOW xvt_create_statbar()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void xvt_statbar_set(const char* text)
|
void xvt_statbar_set(const char* text)
|
||||||
{
|
{
|
||||||
TString t(text); t.cut(60);
|
|
||||||
const TDate oggi(TODAY);
|
|
||||||
t << '\t' << oggi.string() << " - " << MainApp()->title();
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
statbar_set_title(statbar, (char*)(const char*)t);
|
if (text != NULL)
|
||||||
|
{
|
||||||
|
stattext.strncpy(text, 56);
|
||||||
|
const TDate oggi(TODAY);
|
||||||
|
stattext << '\t' << oggi.string() << " - " << MainApp()->title();
|
||||||
|
}
|
||||||
|
statbar_set_title(statbar, (char*)(const char*)stattext);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void xvt_statbar_refresh()
|
void xvt_statbar_refresh()
|
||||||
{
|
{
|
||||||
invalidate_rect(statbar, NULL);
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
statbar_set_title(statbar, (char*)(const char*)stattext);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -742,7 +770,8 @@ bool xvt_test_menu_tag(MENU_TAG tag)
|
|||||||
|
|
||||||
COLOR trans_color(char c)
|
COLOR trans_color(char c)
|
||||||
{
|
{
|
||||||
switch (c) {
|
switch (c)
|
||||||
|
{
|
||||||
case 'n': return COLOR_BLACK; break;
|
case 'n': return COLOR_BLACK; break;
|
||||||
case 'r': return COLOR_RED; break;
|
case 'r': return COLOR_RED; break;
|
||||||
case 'g': return COLOR_GREEN; break;
|
case 'g': return COLOR_GREEN; break;
|
||||||
@ -755,8 +784,9 @@ COLOR trans_color(char c)
|
|||||||
case 'd': return COLOR_DKGRAY; break;
|
case 'd': return COLOR_DKGRAY; break;
|
||||||
case 'l': return COLOR_LTGRAY; break;
|
case 'l': return COLOR_LTGRAY; break;
|
||||||
case 'k': return COLOR_GRAY; break;
|
case 'k': return COLOR_GRAY; break;
|
||||||
default: CHECK(0,"trans_color: Undefined color"); return -1; break;
|
default: CHECK(0,"trans_color: Undefined color"); break;
|
||||||
}
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PAT_STYLE trans_brush(char p)
|
PAT_STYLE trans_brush(char p)
|
||||||
@ -772,8 +802,9 @@ PAT_STYLE trans_brush(char p)
|
|||||||
case '\\': return PAT_BDIAG; break;
|
case '\\': return PAT_BDIAG; break;
|
||||||
case 'X' : return PAT_DIAGCROSS; break;
|
case 'X' : return PAT_DIAGCROSS; break;
|
||||||
case '+' : return PAT_CROSS; break;
|
case '+' : return PAT_CROSS; break;
|
||||||
default: CHECK(0,"trans_brush: Undefined pattern"); return PAT_NONE; break;
|
default : CHECK(0,"trans_brush: Undefined pattern"); break;
|
||||||
}
|
}
|
||||||
|
return PAT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PEN_STYLE trans_pen(char p)
|
PEN_STYLE trans_pen(char p)
|
||||||
@ -783,7 +814,8 @@ PEN_STYLE trans_pen(char p)
|
|||||||
case 'n' : return P_SOLID; break;
|
case 'n' : return P_SOLID; break;
|
||||||
case '.' : return P_DOT; break;
|
case '.' : return P_DOT; break;
|
||||||
case '-' : return P_DASH; break;
|
case '-' : return P_DASH; break;
|
||||||
default: CHECK(0,"trans_pen: Undefined pattern"); return P_SOLID; break;
|
default: CHECK(0,"trans_pen: Undefined pattern"); break;
|
||||||
}
|
}
|
||||||
|
return P_SOLID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user