maskfld.cpp La TBrowse::do_clear non deve cancellare i propri input

printapp.cpp	Tolto doppio ; (punto e virgola)
printer.cpp     Corrette indentazioni varie
relapp.h	Aggiunta variabile booleana _autodelete
relapp.cpp	Gestione cancellazione veloce
viswin.cpp	Corretta visualizzazione collegamenti multipli (es. piano conti)


git-svn-id: svn://10.65.10.50/trunk@4321 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-05-06 10:26:19 +00:00
parent 41904da109
commit 8df6da4e55
6 changed files with 143 additions and 93 deletions

View File

@ -2079,6 +2079,22 @@ void TBrowse::do_output(CheckTime t)
void TBrowse::do_clear(CheckTime t) void TBrowse::do_clear(CheckTime t)
{ {
const bool master = s_checking == 0;
if (master)
{
s_checking = field().dlg();
s_checked.reset();
// Rendo intoccabili i campi del MIO input
for (const char* fld = _inp_id.get(0); fld && *fld; fld = _inp_id.get())
{
if (isdigit(*fld))
{
const short id = field().atodlg(fld);
s_checked.set(id);
}
}
}
for (TString16 fld = _out_id.get(0); fld.not_empty(); fld = _out_id.get()) for (TString16 fld = _out_id.get(0); fld.not_empty(); fld = _out_id.get())
{ {
const short id = field().atodlg(fld); const short id = field().atodlg(fld);
@ -2092,6 +2108,9 @@ void TBrowse::do_clear(CheckTime t)
f.check(t); f.check(t);
} }
} }
if (master)
s_checking = 0;
} }

View File

@ -1059,7 +1059,7 @@ void TPrint_application::print()
if (_prind) if (_prind)
{ {
delete _prind;; delete _prind;
_prind = NULL; _prind = NULL;
} }
} }

View File

@ -1770,10 +1770,10 @@ else
} }
#endif #endif
_currentrow = 1; _currentrow = 1;
_currentpage = 1; _currentpage = 1;
return _isopen = TRUE; return _isopen = TRUE;
} }
@ -2003,7 +2003,6 @@ void TPrinter::close ()
const KEY key = _vf->run (); const KEY key = _vf->run ();
if (_vf->is_open ()) _vf->close_modal (); if (_vf->is_open ()) _vf->close_modal ();
_bookmarks.destroy(); _bookmarks.destroy();
freeze (FALSE);
if (key == K_CTRL+'S') if (key == K_CTRL+'S')
{ {
@ -2025,12 +2024,12 @@ void TPrinter::close ()
} }
} }
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
else if (_printertype == winprinter && _txt.lines() > 0L) else if (_printertype == winprinter && _txt.lines() > 0L)
{ {
print_txt(_txt); print_txt(_txt);
} }
else if (_printertype == fileprinter) else if (_printertype == fileprinter)
{ {
FILE* fp = fopen(_printerfile, "w"); FILE* fp = fopen(_printerfile, "w");
if (fp == NULL) if (fp == NULL)
{ {
@ -2041,11 +2040,11 @@ else if (_printertype == fileprinter)
fprintf(fp,"%s\n", _txt.line(i)); fprintf(fp,"%s\n", _txt.line(i));
fclose(fp); fclose(fp);
message_box("Stampa su file terminata. Nome archivio: %s",(const char *)_printerfile); message_box("Stampa su file terminata. Nome archivio: %s",(const char *)_printerfile);
} }
#endif #endif
else if (_printertype == localprinter) else if (_printertype == localprinter)
{ {
#if XVT_OS == XVT_OS_SCOUNIX #if XVT_OS == XVT_OS_SCOUNIX
TFilename s1 = tmpnam (NULL); TFilename s1 = tmpnam (NULL);
switch (fork ()) switch (fork ())
{ {
@ -2058,12 +2057,15 @@ else if (_printertype == localprinter)
} }
remove (s1); remove (s1);
#endif #endif
} }
if (_finker)
{ if (_finker)
{
delete _finker; delete _finker;
_finker = NULL; _finker = NULL;
} }
freeze (FALSE);
_isopen = FALSE; _isopen = FALSE;
WriteProfileString("windows", "device", defPrinter); WriteProfileString("windows", "device", defPrinter);
} }
@ -2201,7 +2203,7 @@ BOOLEAN XVT_CALLCONV1 calc_font_callback(long data)
{ {
font_data& fd = *(font_data*)data; font_data& fd = *(font_data*)data;
// Create pint window // Create print window
WINDOW win = xvt_print_create_win(printer().get_printrcd(), "Calcolo font"); WINDOW win = xvt_print_create_win(printer().get_printrcd(), "Calcolo font");
if (win != NULL_WIN) if (win != NULL_WIN)

View File

@ -13,7 +13,8 @@
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
TRelation_application::TRelation_application() TRelation_application::TRelation_application()
: _mask(NULL), _search_id(-1), _lnflag(FALSE) : _mask(NULL), _search_id(-1), _lnflag(FALSE),
_autodelete(FALSE)
{ } { }
TRelation_application::~TRelation_application() TRelation_application::~TRelation_application()
@ -179,8 +180,8 @@ void TRelation_application::set_toolbar(bool all)
pos = _mask->id2pos(DLG_DELREC); pos = _mask->id2pos(DLG_DELREC);
if (pos >= 0) if (pos >= 0)
{ {
bool enabdel = mode == MODE_MOD; bool enabdel = mode != MODE_INS;
if (enabdel) if (mode == MODE_MOD)
{ {
TRelation& r = *get_relation(); TRelation& r = *get_relation();
const TRecnotype oldpos = r.lfile().recno(); const TRecnotype oldpos = r.lfile().recno();
@ -720,8 +721,11 @@ bool TRelation_application::main_loop()
if (_transaction == "INSERT") if (_transaction == "INSERT")
_mask->send_key(K_CTRL+'N', 0); _mask->send_key(K_CTRL+'N', 0);
else else
{
_autodelete = _transaction == "DELETE";
_mask->send_key(K_AUTO_ENTER, 0); _mask->send_key(K_AUTO_ENTER, 0);
} }
}
do do
{ {
@ -731,8 +735,15 @@ bool TRelation_application::main_loop()
// Dis/abilita cambio parametri // Dis/abilita cambio parametri
enable_menu_item(M_FILE_REVERT, change); enable_menu_item(M_FILE_REVERT, change);
if (_mask->edit_mode() && _transaction == "DELETE") if (_mask->edit_mode() && _autodelete)
{
const int pos = _mask->id2pos(DLG_DELREC);
if (pos >= 0 && _mask->fld(pos).active())
_mask->send_key(K_CTRL+'E', 0); _mask->send_key(K_CTRL+'E', 0);
else
error_box("Documento non eliminabile.");
_autodelete = FALSE;
}
k = _mask->run(); k = _mask->run();
@ -798,6 +809,13 @@ bool TRelation_application::main_loop()
} }
break; break;
case K_DEL: case K_DEL:
if (_mask->query_mode())
{
if (search_mode())
_autodelete = TRUE;
}
else
{
if (relation_remove()) if (relation_remove())
{ {
query_mode(); query_mode();
@ -807,6 +825,7 @@ bool TRelation_application::main_loop()
k = K_QUIT; k = K_QUIT;
} }
} }
}
break; break;
case K_F9: case K_F9:
if (_mask->query_mode() || save(TRUE)) if (_mask->query_mode() || save(TRUE))

View File

@ -50,6 +50,8 @@ class TRelation_application : public TApplication
TString _ini; TString _ini;
// @cmember:(INTERNAL) Azione della transazione corrente // @cmember:(INTERNAL) Azione della transazione corrente
TString _transaction; TString _transaction;
// @cmember:(INTERNAL) Flag di cancellazione automatica veloce
bool _autodelete;
// @cmember:(INTERNAL) Setta i campi fissati da <md TRelation_application::_fixed> // @cmember:(INTERNAL) Setta i campi fissati da <md TRelation_application::_fixed>
bool filter(); bool filter();

View File

@ -405,7 +405,7 @@ bool TViswin::check_link (
TToken_string & ttt = (TToken_string &) (*_links)[id]; TToken_string & ttt = (TToken_string &) (*_links)[id];
ttt.restart (); ttt.restart ();
strcpy (descr, ttt.get ()); strcpy (descr, ttt.get ());
strcat (descr, t.get (3)); // strcat (descr, t.get (3));
_linktxt = t.get(3); _linktxt = t.get(3);
if (_multiple) if (_multiple)
{ {
@ -414,13 +414,21 @@ bool TViswin::check_link (
_txt.read_line (ty); _txt.read_line (ty);
_multiple_link = ""; _multiple_link = "";
const char fg = *ttt.get(1);
const char bg = *ttt.get(2);
while (cp = _txt.piece ()) while (cp = _txt.piece ())
{ {
if (_txt.get_foreground () == *(ttt.get (1)) && if (_txt.get_foreground() == fg && _txt.get_background() == bg)
_txt.get_background () == *(ttt.get (2))) {
_multiple_link.add (cp); _multiple_link.add (cp);
strcat(descr, " ");
strcat(descr, cp);
} }
} }
}
else
strcat(descr, _linktxt);
old_id = _linkID = id; old_id = _linkID = id;
y = ty; y = ty;
x1 = tx1; x1 = tx1;