From 789ac315d538ec31d5822165af6d9778d6dce98e Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 24 Jan 1995 08:52:49 +0000 Subject: [PATCH] Aggiunti distruttori virtuali git-svn-id: svn://10.65.10.50/trunk@900 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/array.h | 2 +- include/config.cpp | 6 ++++++ include/config.h | 2 ++ include/default.url | 4 ++-- include/expr.h | 12 +++++++----- include/maskfld.cpp | 4 ++-- include/printer.cpp | 5 ++--- include/relapp.cpp | 17 +++++++++++++---- include/scanner.h | 3 ++- include/sheet.cpp | 29 ++++++++++++++++++----------- include/stdtypes.cpp | 4 ++++ 11 files changed, 59 insertions(+), 29 deletions(-) diff --git a/include/array.h b/include/array.h index 3e520936e..389db12c0 100755 --- a/include/array.h +++ b/include/array.h @@ -92,7 +92,7 @@ protected: public: TBit_array(long size = 0); TBit_array(const TBit_array& ba); - ~TBit_array(); + virtual ~TBit_array(); TBit_array& operator=(const TBit_array& ba); bool operator[] (long n) const; diff --git a/include/config.cpp b/include/config.cpp index cf26a9adc..d12742aaa 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -148,6 +148,12 @@ long TConfig::get_long(const char* var, const char* section, int index, long def return def; } +int TConfig::get_int(const char* var, const char* section, int index, int def) +{ + return (int)get_long(var, section, index, def); +} + + bool TConfig::get_bool(const char* var, const char* section, int index, bool def) { if (def) strcpy(__tmp_string, "X"); diff --git a/include/config.h b/include/config.h index c939d12c7..3229f9f02 100755 --- a/include/config.h +++ b/include/config.h @@ -48,6 +48,8 @@ public: // questa ritorna 0 se non c'e', il che e' un po' sfigotto long get_long(const char* var, const char* section = NULL, int index = -1, long def = 0L); + + int get_int(const char* var, const char* section = NULL, int index = -1, int def = 0); // questa ritorna FALSE se non c'e', il che e' ancora piu' sfigotto bool get_bool(const char* var, const char* section = NULL, int index = -1, bool def = FALSE); diff --git a/include/default.url b/include/default.url index b6ccf32cb..b5e1394d2 100755 --- a/include/default.url +++ b/include/default.url @@ -47,8 +47,8 @@ MENU M_EDIT ITEM M_EDIT_COPY "~Copia" DISABLED ITEM M_EDIT_CLEAR "~Annulla" DISABLED SEPARATOR - ITEM M_EDIT_SEARCH "Cerca...\tF8" - ITEM M_EDIT_DELETE "Cerca il prossimo\tF9" DISABLED + ITEM M_EDIT_SEARCH "Cerca...\tF7" + ITEM M_EDIT_DELETE "Cerca il prossimo\tF8" DISABLED ACCEL MENU_FILE "f" ALT diff --git a/include/expr.h b/include/expr.h index 8b93f84a0..d0c5d37bf 100755 --- a/include/expr.h +++ b/include/expr.h @@ -9,10 +9,6 @@ #include #endif -#ifndef __ARRAY_H -#include -#endif - // @T // @DES I simboli/istruzioni possibili // @T @@ -54,6 +50,7 @@ public: TValue(const char* val) { _s = val; _r = real(val);} // Stringa TValue(const TValue& val) { *this = val; } // Altro TValue TValue() { _r = 0.00; _s = ""; } // 0,0 e "" + virtual ~TValue() {} }; @@ -87,6 +84,7 @@ public: TCode() {set(_invalid);} // Costruttore, inizializza simbolo con "invalid", valore a nullvalue TCode(TCodesym sym, const TValue& val = nulltvalue) { set(sym, val);} // Costruttore, inizializza simbolo con sym e valore con val + virtual ~TCode() {} }; // @C @@ -113,6 +111,7 @@ public: bool end() const { return ((TCode&) _rpn[_ip]).getsym() == _endsym;} // Ritorna vero se _ip ha raggiunto il simbolo di fine codice void backtrace(int step = 1) { _ip > step ? _ip -= step : begin(); } TCodearray(int size = 50); // Il costruttore crea un array di 10 elementi + virtual ~TCodearray() {} }; // @C @@ -146,6 +145,7 @@ public: TVar() { _name = ""; _val = nulltvalue;} TVar(const char* name, const TValue& val = nulltvalue) { _name = name; _val = val;} TVar(TVar& v) { _name = v._name; _val = v._val;} + virtual ~TVar() {} }; // @C @@ -182,7 +182,8 @@ public: int numvar() const { return _last;} // Ritorna il numero di variabili utilizzate - TVararray(int size = 10); + TVararray(int size = 10); + virtual ~TVararray() {} }; // @C @@ -237,6 +238,7 @@ public: bool set(const char* expression, TTypeexp type = _numexpr); TExpression(const char* expression, TTypeexp type = _numexpr); TExpression(TTypeexp type = _numexpr); + virtual ~TExpression() {} }; #endif // __EXPR_H diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 97b6773e5..af72377fc 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -1,4 +1,4 @@ -// $Id: maskfld.cpp,v 1.70 1995-01-19 13:59:55 guy Exp $ +// $Id: maskfld.cpp,v 1.71 1995-01-24 08:52:30 guy Exp $ #include #include @@ -381,7 +381,7 @@ word TMask_field::last_key() const } void TMask_field::set_dirty(bool d) -{ +{ if (_flags.dirty == 3 && d == FALSE) return; _flags.dirty = d; diff --git a/include/printer.cpp b/include/printer.cpp index 24b40adf2..ccb0cc900 100755 --- a/include/printer.cpp +++ b/include/printer.cpp @@ -699,9 +699,8 @@ TPrinter::TPrinter() } TConfig cnf (CONFIG_GENERAL, "Stampa"); - - _ch_size = atoi(cnf.get("Size",NULL,-1,"X")); - _lines_per_inch = atoi(cnf.get("Lines",NULL,-1,"X")); + _ch_size = cnf.get_int("Size",NULL,-1,12); + _lines_per_inch = cnf.get_int("Lines",NULL,-1,6); #else _isgraphics = FALSE; diff --git a/include/relapp.cpp b/include/relapp.cpp index 92352a3c5..fb2d4caf1 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -1,4 +1,4 @@ -// $Id: relapp.cpp,v 1.45 1995-01-16 15:10:45 guy Exp $ +// $Id: relapp.cpp,v 1.46 1995-01-24 08:52:43 guy Exp $ #include #include #include @@ -204,7 +204,8 @@ bool TRelation_application::menu(MENU_TAG m) bool TRelation_application::destroy() -{ +{ + if (_maskeys) delete _maskeys; user_destroy(); return TApplication::destroy(); } @@ -566,9 +567,10 @@ bool TRelation_application::save(bool check_dirty) if (check_dirty) { + const int dirty = _mask->dirty(); + const char* ms = (mode == MODE_MOD) ? "le modifiche" : "i dati inseriti"; - const int dirty = _mask->dirty(); if (mode == MODE_QUERY) { const bool cont = !dirty || yesno_box("Annullare %s?", ms); @@ -592,7 +594,14 @@ bool TRelation_application::save(bool check_dirty) KEY k; if (errore) { - if (annulla) k = yesno_box("Annullare %s?", ms) ? K_NO : K_ESC; + if (annulla) + { + const char* pr = _mask->field(dirty).prompt(); + TString256 e("Il campo "); + if (isalnum(*pr)) e << pr; else e << dirty; + e << " e' errato:\nAnnullare " << ms; + k = yesno_box(e) ? K_NO : K_ESC; + } else k = K_ESC; } else diff --git a/include/scanner.h b/include/scanner.h index 95ccaaeb2..695ac4117 100755 --- a/include/scanner.h +++ b/include/scanner.h @@ -23,7 +23,8 @@ class TScanner : private ifstream public: // @FPUB - TScanner(const char* filename); + TScanner(const char* filename); + ~TScanner() {} const TString& pop(); const TString& key() const { return _key; } const TString& popkey() { pop(); return key(); } diff --git a/include/sheet.cpp b/include/sheet.cpp index 2b65dd0fa..be1491baa 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -319,28 +319,20 @@ bool TSheet::on_key(KEY key) if (_checkable && _check_enabled && items() > 0) { - bool force = FALSE; switch(key) { case K_SPACE: - if (!_disabled[selected()]) - { - _checked.not(selected()); - force = TRUE; - } + check(selected(), !checked(selected())); break; case K_F2: uncheck(-1); - force = TRUE; break; case K_F3: check(-1); - force = TRUE; break; default: break; } - if (force) force_update(); } return TScroll_window::on_key(key); } @@ -384,18 +376,33 @@ void TSheet::select(long n) void TSheet::check(long n, bool on) { + long s = selected(); + if (n < 0) { if (on) { _checked.set(items()-1); // Force the size of Bit_array _checked.set(); + + if (on && _disabled.first_one() >= 0) + { + for (long i = 0; i < items(); i++) + if (_disabled[i]) _checked.reset(i); + else s = i; + } } else _checked.reset(); } - else - _checked.set(n, on); + else + { + if (!_disabled[n]) + _checked.set(n, on); + } + + force_update(); + select(s); } diff --git a/include/stdtypes.cpp b/include/stdtypes.cpp index 7236bc6a9..34cc8b669 100755 --- a/include/stdtypes.cpp +++ b/include/stdtypes.cpp @@ -81,6 +81,8 @@ void free_global_vars() } + + #ifndef FOXPRO #include @@ -101,3 +103,5 @@ void operator delete(void* ptr) } #endif // FOXPRO + +