Patch level : 2003 578

Files correlati     : ef0.exe
Ricompilazione Demo : [ ]
Commento            :

Correzioni necessarie per errori sul modulo effetti: GF20082


git-svn-id: svn://10.65.10.50/trunk@11431 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-09-23 14:47:55 +00:00
parent c5aae552a6
commit 6bcb3fddc6
8 changed files with 89 additions and 49 deletions

View File

@ -733,19 +733,19 @@ void TApplication::run(
if (sn < 0) if (sn < 0)
{ {
error_box(TR("Probabilmente non e' stata inserita la chiave di protezione")); error_box(TR("Probabilmente non e' inserita la chiave di protezione\noppure mancano i relativi driver."));
return; return;
} }
if (!test_assistance_year()) if (!test_assistance_year())
{ {
error_box(TR("Probabilmente e' necessario attivare il contratto di assistenza")); error_box(TR("Probabilmente e' necessario attivare il contratto di assistenza per l'anno in corso"));
return; return;
} }
set_perms(); set_perms();
const TFixed_string mod(get_module_name()); const char* mod = get_module_name();
if (mod.empty()) if (mod == NULL || *mod == '\0')
return; return;
XVT_CONFIG cfg; XVT_CONFIG cfg;

View File

@ -327,7 +327,7 @@ bool TDongle::hardlock_login(bool test_all_keys)
{ {
_year_assist = data[0]; _year_assist = data[0];
_max_users = data[1]; _max_users = data[1];
const long& giulio = (const long&)data[2]; const long giulio = *((const long*)&data[2]);
const long yyyymmdd = _last_update.julian2date(giulio); const long yyyymmdd = _last_update.julian2date(giulio);
_last_update = yyyymmdd; _last_update = yyyymmdd;
} }
@ -663,7 +663,7 @@ bool TDongle::burn_hardlock()
return error_box("On Line Assistance error."); return error_box("On Line Assistance error.");
if (data[1] == 0 || data[1] >= 10000) if (data[1] == 0 || data[1] >= 10000)
return error_box("Bad users number."); return error_box("Bad users number.");
const long& val = (const long&)data[2]; const long val = *((const long*)&data[2]);
const long yyyymmdd = today.julian2date(val); const long yyyymmdd = today.julian2date(val);
const TDate date(yyyymmdd); const TDate date(yyyymmdd);
if (date > today) if (date > today)
@ -672,8 +672,8 @@ bool TDongle::burn_hardlock()
data[0] = _year_assist; data[0] = _year_assist;
data[1] = _max_users; data[1] = _max_users;
long& val = (long&)data[2]; long* val = (long*)&data[2];
val = today.date2julian(); *val = today.date2julian();
garble(data); garble(data);
write_words(60, 4, data); write_words(60, 4, data);
_last_update = today; _last_update = today;

View File

@ -3984,31 +3984,42 @@ bool TForm::validate(TForm_item &cf, TToken_string &s)
pagetype pt; pagetype pt;
char sec; char sec;
TLocalisamfile *file; TLocalisamfile *file;
TString f_code(s.get()); // prende il codice del file da leggere const TString f_code(s.get()); // prende il codice del file da leggere
if (atoi(f_code) != 0) file= new TLocalisamfile(atoi(f_code)); // se il codice è numerico allora è un file if (atoi(f_code) != 0)
else file= new TTable(f_code); // altrimenti è una tabella file= new TLocalisamfile(atoi(f_code)); // se il codice è numerico allora è un file
else
file= new TTable(f_code); // altrimenti è una tabella
file->zero(); // vuota il record corrente del file file->zero(); // vuota il record corrente del file
TToken_string in(s.get(), '!'); TToken_string in(s.get(), '!');
for (i=0; i<in.items(); i++) for (i=0; i<in.items(); i++)
{ // scansione sugli elementi dell'input { // scansione sugli elementi dell'input
TString curr(in.get(i)); const TString& curr = in.get(i);
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue poseq= curr.find('='); // divide la stringa corrente in lvalue e rvalue
if (poseq== -1) posrv = poseq+1;
{ if (curr[posrv] == '=')
poseq= curr.find('='); posrv++;
if (poseq != -1) posrv= poseq+1;
} const TString16 fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
else TExpression rval(curr.mid(posrv), _strexpr); // preleva l'espressione di assegnamento alla destra dell'uguale
posrv= poseq+2; TString16 var;
TString fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
TString expr(curr.mid(posrv)); // preleva l'espressione di assegnamento alla destra dell'uguale
TExpression rval(expr, _strexpr);
for (j=0; j<rval.numvar(); j++) for (j=0; j<rval.numvar(); j++)
{ // scansione delle variabili dell'espressione di rvalue { // scansione delle variabili dell'espressione di rvalue
TString var= rval.varname(j); var = rval.varname(j);
if (var[0]=='#') var.ltrim(1); // rimuove dalla stringa il primo carattere const bool is_form_field = var[0]=='#' || // #3
TForm_item &fi= cf.find_field(var); (isdigit(var[0]) && var.find("->")<0) || // 3
rval.setvar(j, fi.get()); // il valore corrente del campo viene settato nell'espressione (isalpha(var[0]) && var.find("->")>0); // BO->3
if (is_form_field) // E' un campo del form
{
if (var[0] == '#')
var.ltrim(1);
TForm_item &fi= cf.find_field(var);
rval.setvar(j, fi.get()); // il valore corrente del campo viene settato nell'espressione
}
else // E' un campo della relazione
{
TFieldref fr(var, 0); // CODCF oppure 33->CODCF
rval.setvar(j, fr.read(*relation())); // il valore corrente del campo viene settato nell'espressione
}
} }
file->put(fld, rval.as_string()); // scrive il risultato dell'espressione nel campo del file file->put(fld, rval.as_string()); // scrive il risultato dell'espressione nel campo del file
} }

View File

@ -4865,6 +4865,7 @@ void TField_window::update()
MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR); MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR);
} }
xvt_dwin_clear(me, NORMAL_BACK_COLOR); xvt_dwin_clear(me, NORMAL_BACK_COLOR);
set_font();
} }
TField_window::TField_window(int x, int y, int dx, int dy, WINDOW parent, TWindowed_field* owner) TField_window::TField_window(int x, int y, int dx, int dy, WINDOW parent, TWindowed_field* owner)
@ -4873,7 +4874,6 @@ TField_window::TField_window(int x, int y, int dx, int dy, WINDOW parent, TWindo
if (owner) if (owner)
{ {
create(x, y, dx, dy, "", WSF_HSCROLL | WSF_VSCROLL, W_PLAIN, parent); create(x, y, dx, dy, "", WSF_HSCROLL | WSF_VSCROLL, W_PLAIN, parent);
set_font();
activate(owner->enabled()); activate(owner->enabled());
if (owner->shown()) if (owner->shown())
open(); open();

View File

@ -132,12 +132,13 @@ void TIndwin::update_bar()
// Rettangolo contenente l'intera barra // Rettangolo contenente l'intera barra
RCT r; get_bar_rct(r); RCT r; get_bar_rct(r);
RCT b = r; set_font();
const WINDOW w = win();
if (ADVANCED_GRAPHICS) if (ADVANCED_GRAPHICS)
{ {
const WINDOW w = win();
RCT b = r;
// Rettangolo scavato // Rettangolo scavato
xi_draw_3d_rect((XinWindow)w, (XinRect*)&r, TRUE, 2, xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, TRUE, 2,
MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR); MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR);
b.left += 2; b.right -= 2; b.left += 2; b.right -= 2;
b.top += 2; b.bottom -= 2; b.top += 2; b.bottom -= 2;
@ -185,16 +186,17 @@ void TIndwin::update_bar()
else else
{ {
// Rettangolo in rilievo // Rettangolo in rilievo
RCT b = r;
b.right = b.left + int((r.right-r.left)*prc); b.right = b.left + int((r.right-r.left)*prc);
xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, FALSE, 2, xi_draw_3d_rect((XinWindow)win(), (XinRect*)&b, FALSE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR); BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
// Rettangolo scavato // Rettangolo scavato
b.left = b.right; b.right = r.right; b.left = b.right; b.right = r.right;
xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, TRUE, 2, xi_draw_3d_rect((XinWindow)win(), (XinRect*)&b, TRUE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR); BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
char n[8]; sprintf(n, "%d%%", int(prc * 100.0 + 0.5)); char n[8]; sprintf(n, "%d%%", int(prc * 100.0 + 0.5));
xvt_dwin_draw_text(w, r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1); xvt_dwin_draw_text(win(), r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1);
} }
check_stop(); check_stop();

View File

@ -21,14 +21,19 @@ TRelation_application::TRelation_application()
TRelation_application::~TRelation_application() TRelation_application::~TRelation_application()
{ } { }
TCursor& TRelation_application::get_filtered_cursor() const
{
TEdit_field& f = get_search_field();
TCursor* cur = f.browse()->cursor();
return *cur;
}
void TRelation_application::setkey() void TRelation_application::setkey()
{ {
if (has_filtered_cursor()) if (has_filtered_cursor())
{ {
TEdit_field& f = get_search_field(); get_filtered_cursor().setkey();
TCursor* cur = f.browse()->cursor(); return; // ?????
cur->setkey();
return;
} }
file().setkey(1); file().setkey(1);
} }
@ -81,7 +86,6 @@ void TRelation_application::set_limits(
if (has_filtered_cursor()) if (has_filtered_cursor())
{ {
TEdit_field& f = get_search_field(); TEdit_field& f = get_search_field();
TBrowse* b = f.browse(); TBrowse* b = f.browse();
TCursor* cur = b != NULL ? b->cursor() : NULL; TCursor* cur = b != NULL ? b->cursor() : NULL;
if (cur) if (cur)
@ -1387,11 +1391,31 @@ void TRelation_application::main_loop()
break; break;
case K_NEXT: case K_NEXT:
err = file().reread(); err = file().reread();
err = file().next(_testandlock); if (has_filtered_cursor())
{
TCursor& cur = get_filtered_cursor();
cur.curr() = file().curr();
cur.read();
++cur;
file().curr() = cur.curr();
err = get_relation()->read(_isequal, _testandlock);
}
else
err = file().next(_testandlock);
break; break;
case K_PREV: case K_PREV:
err = file().reread(); file().reread();
err = file().prev(_testandlock); if (has_filtered_cursor())
{
TCursor& cur = get_filtered_cursor();
cur.curr() = file().curr();
cur.read();
--cur;
file().curr() = cur.curr();
err = get_relation()->read(_isequal, _testandlock);
}
else
err = file().prev(_testandlock);
break; break;
case K_END: case K_END:
err = file().readat(_last, _testandlock); err = file().readat(_last, _testandlock);

View File

@ -104,6 +104,7 @@ private:
// @cmember:(INTERNAL) Controlla se il <c TCursor> ha un filtro // @cmember:(INTERNAL) Controlla se il <c TCursor> ha un filtro
virtual bool has_filtered_cursor() const virtual bool has_filtered_cursor() const
{ return filtered(); } { return filtered(); }
virtual TCursor& get_filtered_cursor() const;
// @cmember:(INTERNAL) Sistema il bottone ricerca se necessario // @cmember:(INTERNAL) Sistema il bottone ricerca se necessario
void set_find_button(); void set_find_button();

View File

@ -273,7 +273,7 @@ WINDOW cur_win()
{ {
WINDOW win = NULL_WIN; WINDOW win = NULL_WIN;
TWindow* w = WinManager.cur_win(); TWindow* w = WinManager.cur_win();
if (w) if (w != NULL)
{ {
win = w->win(); win = w->win();
if (!is_valid_window(w->win())) if (!is_valid_window(w->win()))
@ -390,11 +390,13 @@ void TWindow::close()
void TWindow::close_modal() void TWindow::close_modal()
{ {
CHECK(is_modal(), "Can't modal-close a non-modal window"); if (is_modal())
WinManager.unreg(this); {
close(); WinManager.unreg(this);
_open = FALSE; close();
set_modal(FALSE); _open = FALSE;
set_modal(FALSE);
}
} }
bool TWindow::stop_run(KEY key) bool TWindow::stop_run(KEY key)
@ -437,7 +439,7 @@ KEY TWindow::run()
xvt_sys_sleep(50); xvt_sys_sleep(50);
} }
if (!was_open && is_open()) if (!was_open)
close_modal(); close_modal();
do_events(); do_events();