diff --git a/include/applicat.cpp b/include/applicat.cpp index ffda13c06..9458898d1 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -701,19 +701,14 @@ void TApplication::enable_menu_item( bool TApplication::has_module(int module, int checktype) const { - bool ok = TRUE; -#ifndef _DEMO_ - // Ignora i bit di attivazione della chiave programmatori (sempre attivati) - if (get_serial_number() == 0) - checktype = CHK_USER; - - - if (checktype == CHK_ALL || checktype == CHK_DONGLE) - ok = dongle().active(module); +#ifdef _DEMO_ + bool ok = true; +#else + bool ok = dongle().active(module); #endif // Testa bit di attivazione dell'utente - if (ok && (checktype == CHK_ALL || checktype == CHK_USER)) + if (ok && checktype != CHK_DONGLE) ok = _user_aut[module]; return ok; } diff --git a/include/applicat.h b/include/applicat.h index e6ef17046..76c0c274b 100755 --- a/include/applicat.h +++ b/include/applicat.h @@ -15,7 +15,7 @@ #define MSG_ED "ED" // message edit (maskfld -> relapp) #define CHK_ALL -1 // all authorization checks #define CHK_DONGLE 0 // dongle authorization checks -#define CHK_USER 1 // user authorization checks +//#define CHK_USER 1 // user authorization checks #ifndef __ASSOC_H class TAssoc_array; diff --git a/include/dongle.cpp b/include/dongle.cpp index 91004bc5f..59490dd4d 100755 --- a/include/dongle.cpp +++ b/include/dongle.cpp @@ -244,6 +244,7 @@ void TDongle::set_developer_permissions() { _module.set(255); // Last module on key _module.set(); // Activate all modules + _shown.reset(); _max_users = 1; _last_update = TDate(TODAY); @@ -298,6 +299,7 @@ bool TDongle::hardlock_login(bool test_all_keys) const bool already = already_programmed(); _module.reset(); // Disattiva tutti i moduli + _shown.reset(); const int last_word = already ? 12 : 4; word data[4]; @@ -489,8 +491,9 @@ bool TDongle::login(bool test_all_keys) _max_users = 1; _last_update = TDate(TODAY); _year_assist = _last_update.year(); - _module.set(255); // Last module on key - _module.set(); // Activate all modules + _module.set(ENDAUT); // Last module on key + _module.set(); // Activate all modules + _shown.reset(); #else if (_type != _no_dongle) // Already logged in logout(); @@ -694,7 +697,7 @@ bool TDongle::active(word module) const yes = r.find("AGA") >= 0; } else - yes = (module < ENDAUT) && _module[module]; + yes = (module < ENDAUT) && _module[module] && shown(module); return yes; } @@ -703,7 +706,7 @@ bool TDongle::activate(word module, bool on) bool ok = module < ENDAUT; if (ok) { - _module.set(module, on); + _module.set(module, on && shown(module)); _dirty = true; } return ok; @@ -986,19 +989,29 @@ const TString& TDongle::module_code2desc(word mod) const bool TDongle::shown(word code) const { - const TString4 mod = module_code2name(code); - bool yes = mod.not_empty(); + bool yes = code < ENDAUT; if (yes) { - bool do_test = true; - if (code != EEAUT) + yes = _shown[code]; + if (!yes) // Puo' voler dire "nascosto" ma anche "non ho mai controllato" { - TConfig cfg("install.ini", mod); - cfg.write_protect(); - do_test = cfg.get_bool("Ee"); + const TString4 mod = module_code2name(code); + yes = mod.not_empty(); + if (yes && code > BAAUT) + { + bool do_test = true; + if (code != EEAUT) + { + TConfig cfg("install.ini", mod); + cfg.write_protect(); + do_test = cfg.get_bool("Ee"); + } + if (do_test) + yes = active(EEAUT); + } + if (yes) + ((TBit_array&)_shown).set(code); // Setto il flag di visibilta' per la prossima volta } - if (do_test) - yes = active(EEAUT); } return yes; } diff --git a/include/dongle.h b/include/dongle.h index bdbce3a7b..ec8e988df 100755 --- a/include/dongle.h +++ b/include/dongle.h @@ -24,6 +24,7 @@ class TDongle : public TObject word _eprom[64]; TDate _last_update; TBit_array _module; + TBit_array _shown; bool _dirty; TDate _last_assist; diff --git a/include/isam.cpp b/include/isam.cpp index adc15171b..ef8b339aa 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -3690,10 +3690,9 @@ char TRectype::get_char(const char* fieldname) const return get_str(fieldname)[0]; } - bool TRectype::get_bool(const char* fieldname) const { - return *(get_str(fieldname)) == 'X'; + return get_char(fieldname) == 'X'; } TDate TRectype::get_date(const char* fieldname) const @@ -3749,8 +3748,7 @@ void TRectype::put(const char* fieldname, char val) void TRectype::put(const char* fieldname, bool val) { - const char s[2] = { val ? 'X' : ' ', '\0' }; - put_str( fieldname, s); + put( fieldname, val ? 'X' : ' '); } diff --git a/include/mask.cpp b/include/mask.cpp index 3c486c72b..de5062b50 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -208,9 +208,9 @@ void TMask::read_mask( { // Costruisce la lista dei gruppi di appartenenza dell'utente const TString_array& uag = user_and_groups(); - TConfig ini(prof); + TConfig ini(prof); FOR_EACH_ARRAY_ROW_BACK(uag, c, utonto) - { + { *utonto << "_Locks"; if (ini.set_paragraph(*utonto)) { diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 0ed9f4b0d..15cb5712b 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -5261,7 +5261,7 @@ void TField_window::update() TField_window::TField_window(int x, int y, int dx, int dy, WINDOW parent, TWindowed_field* owner) : _owner(owner) { - if (owner) + if (owner != NULL) { create(x, y, dx, dy, "", WSF_HSCROLL | WSF_VSCROLL, W_PLAIN, parent); activate(owner->enabled()); diff --git a/include/real.cpp b/include/real.cpp index c14ee84ee..aa32c6e30 100755 --- a/include/real.cpp +++ b/include/real.cpp @@ -313,11 +313,6 @@ long double operator%(const real& a, const real& b) return resto; } -long double sqrt(long double a) -{ - return sqrtl(a); -} - long double sqr(long double a) { return a*a; @@ -328,6 +323,13 @@ long double exp10(long double a) return powl(10.0, a); } +#if _MSC_VER < 1300 + +long double sqrt(long double a) +{ + return sqrtl(a); +} + long double pow(long double a, long double b) { return powl(a, b); @@ -368,6 +370,9 @@ long double abs(long double a) return fabsl(a); } +#endif + + #else #include diff --git a/include/real.h b/include/real.h index a99078818..bb65a12e8 100755 --- a/include/real.h +++ b/include/real.h @@ -125,9 +125,11 @@ inline long double fnc_max(long double a, long double b) { return a > b ? a : b; long double operator%(const real& a, const real& b); void swap(real& a, real& b) ; -long double sqrt(long double) ; long double sqr(long double) ; long double exp10(long double) ; + +#if _MSC_VER < 1300 +long double sqrt(long double) ; long double pow(long double, long double) ; long double exp(long double a) ; long double log10(long double a) ; @@ -136,6 +138,9 @@ long double sin(long double a) ; long double cos(long double a) ; long double tan(long double a) ; long double abs(long double a) ; +#else +#include +#endif #else diff --git a/include/recarray.cpp b/include/recarray.cpp index faa42f3cc..fd0188d2a 100755 --- a/include/recarray.cpp +++ b/include/recarray.cpp @@ -4,6 +4,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////// // TRecord_Array diff --git a/include/strings.cpp b/include/strings.cpp index 68debb9b1..0f52f36c0 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -1,7 +1,6 @@ #include #include -//#include #include #include #include @@ -16,7 +15,6 @@ TString& user() { static TString80 _user; - return _user; } diff --git a/include/viswin.cpp b/include/viswin.cpp index bbdb53e79..8ce9292f2 100755 --- a/include/viswin.cpp +++ b/include/viswin.cpp @@ -39,9 +39,6 @@ int PRINT_HEIGHT = 10; #define CTRL_R (K_CTRL + 'R') #define CTRL_P (K_CTRL + 'P') -HIDDEN bool in_update; - - class _BkMenuItem : public TObject { public: @@ -262,7 +259,7 @@ void TViswin::display_link (long y, long x1, long x2, const char *d) { paint_link (y, x1, x2); _link_displayed = TRUE; - if (in_update) return; + if (_in_update) return; TString80 dd; dd.strncpy(d, 50); xvtil_statbar_set(dd); @@ -295,16 +292,16 @@ void TViswin::erase_link ( { paint_link (y, x1, x2); _link_displayed = FALSE; - if (in_update) return; - if (!in_update) + if (!_in_update) { xvtil_statbar_set(""); xvtil_statbar_refresh(); + if (_showbuts) + disable_button(DLG_LINK); + if (_toplevel) + enable_menu_item(M_VISWIN_LINK, FALSE); } - - if (_showbuts) disable_button(DLG_LINK); - if (_toplevel) enable_menu_item(M_VISWIN_LINK, FALSE); } } // @doc INTERNAL @@ -660,28 +657,31 @@ void TViswin::paint_screen () const long rw = origin ().y + j; if (rw < _txt.lines ()) paint_row (rw); - else if (!_isopen) + else { - autoscroll (FALSE); - set_mode (M_COPY); - set_pen (COLOR_BLACK); + if (!_isopen) + { + autoscroll (FALSE); + set_mode (M_COPY); + set_pen (COLOR_BLACK); - PNT b, e; - b.h = tabx(X_OFFSET-1); - b.v = taby((int)(j + (long)Y_OFFSET - origin().y))/* -2 *****/; - e.h = tabx(columns()); - e.v = b.v; - xvt_dwin_draw_set_pos(win(), b); - xvt_dwin_draw_line(win(), e); - set_pen (COLOR_LTGRAY); - e.v++; - b.v++; - xvt_dwin_draw_set_pos (win (), b); - xvt_dwin_draw_line (win (), e); - set_brush (COLOR_DKGRAY); - bar (X_OFFSET-1, (int)(j+(long)Y_OFFSET-origin().y), - (int)columns()+1, (int)(rows()-(long)BUTTONROW_SIZE)); - autoscroll (TRUE); + PNT b, e; + b.h = tabx(X_OFFSET-1); + b.v = taby((int)(j + (long)Y_OFFSET - origin().y))/* -2 *****/; + e.h = tabx(columns()); + e.v = b.v; + xvt_dwin_draw_set_pos(win(), b); + xvt_dwin_draw_line(win(), e); + set_pen (COLOR_LTGRAY); + e.v++; + b.v++; + xvt_dwin_draw_set_pos (win (), b); + xvt_dwin_draw_line (win (), e); + set_brush (COLOR_DKGRAY); + bar (X_OFFSET-1, (int)(j+(long)Y_OFFSET-origin().y), + (int)columns()+1, (int)(rows()-(long)BUTTONROW_SIZE)); + autoscroll (TRUE); + } break; } } @@ -1152,7 +1152,7 @@ void TViswin::paint_point ( // @flag TRUE | Cancella il cursore precedente // @flag FALSE | Mantiene il cursore precedente { - static bool wasbar; + autoscroll (FALSE); const int x = int(_point.x - origin().x + X_OFFSET); @@ -1173,7 +1173,7 @@ void TViswin::paint_point ( } } autoscroll (TRUE); - wasbar = _isbar; + } // draw screen header @@ -1249,10 +1249,10 @@ bool TViswin::can_be_closed() const void TViswin::update () { - if (_scrolling) + if (_scrolling || _in_update) return; - in_update = TRUE; + _in_update = TRUE; erase_point(); autoscroll(FALSE); @@ -1286,7 +1286,7 @@ void TViswin::update () check_link(&_point); autoscroll (TRUE); _need_scroll = none; - in_update = FALSE; + _in_update = FALSE; } void TViswin::abort_print () @@ -2559,7 +2559,7 @@ TViswin::TViswin(const char *fname, _isprint (printbutton), _iscross (FALSE), _selecting (FALSE), _isselection (FALSE), _isbar (FALSE), _scrolling (FALSE), _istimer (FALSE), _selflag (FALSE), _sel_displayed (FALSE), _link_displayed (FALSE), _cross_displayed (FALSE), _point_displayed (FALSE), - _need_scroll (none), _txt (fname, BUFFERSIZE), _txt_to_find(64), + _need_scroll (none), _txt (fname, BUFFERSIZE), _txt_to_find(64), _in_update(FALSE), _down_dir(TRUE), _case_sensitive(FALSE), _regexp(FALSE), _multiple (FALSE), _frozen (FALSE), _rulers(rulers), _showbuts(FALSE), _menu_present(FALSE), _brwfld(brwfld) { diff --git a/include/viswin.h b/include/viswin.h index 462358bcb..ab47a42ed 100755 --- a/include/viswin.h +++ b/include/viswin.h @@ -80,7 +80,7 @@ class TViswin : public TField_window // @cmember:(INTERNAL) Indica il tipo di scroll richiesto (vedi ) scroll _need_scroll; // @cmember:(INTERNAL) Flag per il disegno intelligente - bool _wasneeded; + bool _in_update; // @cmember:(INTERNAL) Array di bottoni attivi nella finestra TArray _button;