Aggiunti distruttori virtuali

git-svn-id: svn://10.65.10.50/trunk@900 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-01-24 08:52:49 +00:00
parent 98bf7a09c8
commit 789ac315d5
11 changed files with 59 additions and 29 deletions

View File

@ -92,7 +92,7 @@ protected:
public: public:
TBit_array(long size = 0); TBit_array(long size = 0);
TBit_array(const TBit_array& ba); TBit_array(const TBit_array& ba);
~TBit_array(); virtual ~TBit_array();
TBit_array& operator=(const TBit_array& ba); TBit_array& operator=(const TBit_array& ba);
bool operator[] (long n) const; bool operator[] (long n) const;

View File

@ -148,6 +148,12 @@ long TConfig::get_long(const char* var, const char* section, int index, long def
return 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) bool TConfig::get_bool(const char* var, const char* section, int index, bool def)
{ {
if (def) strcpy(__tmp_string, "X"); if (def) strcpy(__tmp_string, "X");

View File

@ -48,6 +48,8 @@ public:
// questa ritorna 0 se non c'e', il che e' un po' sfigotto // 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); 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 // 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); bool get_bool(const char* var, const char* section = NULL, int index = -1, bool def = FALSE);

View File

@ -47,8 +47,8 @@ MENU M_EDIT
ITEM M_EDIT_COPY "~Copia" DISABLED ITEM M_EDIT_COPY "~Copia" DISABLED
ITEM M_EDIT_CLEAR "~Annulla" DISABLED ITEM M_EDIT_CLEAR "~Annulla" DISABLED
SEPARATOR SEPARATOR
ITEM M_EDIT_SEARCH "Cerca...\tF8" ITEM M_EDIT_SEARCH "Cerca...\tF7"
ITEM M_EDIT_DELETE "Cerca il prossimo\tF9" DISABLED ITEM M_EDIT_DELETE "Cerca il prossimo\tF8" DISABLED
ACCEL MENU_FILE "f" ALT ACCEL MENU_FILE "f" ALT

View File

@ -9,10 +9,6 @@
#include <real.h> #include <real.h>
#endif #endif
#ifndef __ARRAY_H
#include <array.h>
#endif
// @T // @T
// @DES I simboli/istruzioni possibili // @DES I simboli/istruzioni possibili
// @T // @T
@ -54,6 +50,7 @@ public:
TValue(const char* val) { _s = val; _r = real(val);} // Stringa TValue(const char* val) { _s = val; _r = real(val);} // Stringa
TValue(const TValue& val) { *this = val; } // Altro TValue TValue(const TValue& val) { *this = val; } // Altro TValue
TValue() { _r = 0.00; _s = ""; } // 0,0 e "" 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() {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 TCode(TCodesym sym, const TValue& val = nulltvalue) { set(sym, val);} // Costruttore, inizializza simbolo con sym e valore con val
virtual ~TCode() {}
}; };
// @C // @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 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(); } void backtrace(int step = 1) { _ip > step ? _ip -= step : begin(); }
TCodearray(int size = 50); // Il costruttore crea un array di 10 elementi TCodearray(int size = 50); // Il costruttore crea un array di 10 elementi
virtual ~TCodearray() {}
}; };
// @C // @C
@ -146,6 +145,7 @@ public:
TVar() { _name = ""; _val = nulltvalue;} TVar() { _name = ""; _val = nulltvalue;}
TVar(const char* name, const TValue& val = nulltvalue) { _name = name; _val = val;} TVar(const char* name, const TValue& val = nulltvalue) { _name = name; _val = val;}
TVar(TVar& v) { _name = v._name; _val = v._val;} TVar(TVar& v) { _name = v._name; _val = v._val;}
virtual ~TVar() {}
}; };
// @C // @C
@ -182,7 +182,8 @@ public:
int numvar() const { return _last;} // Ritorna il numero di variabili utilizzate int numvar() const { return _last;} // Ritorna il numero di variabili utilizzate
TVararray(int size = 10); TVararray(int size = 10);
virtual ~TVararray() {}
}; };
// @C // @C
@ -237,6 +238,7 @@ public:
bool set(const char* expression, TTypeexp type = _numexpr); bool set(const char* expression, TTypeexp type = _numexpr);
TExpression(const char* expression, TTypeexp type = _numexpr); TExpression(const char* expression, TTypeexp type = _numexpr);
TExpression(TTypeexp type = _numexpr); TExpression(TTypeexp type = _numexpr);
virtual ~TExpression() {}
}; };
#endif // __EXPR_H #endif // __EXPR_H

View File

@ -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 <xvt.h> #include <xvt.h>
#include <applicat.h> #include <applicat.h>
@ -381,7 +381,7 @@ word TMask_field::last_key() const
} }
void TMask_field::set_dirty(bool d) void TMask_field::set_dirty(bool d)
{ {
if (_flags.dirty == 3 && d == FALSE) if (_flags.dirty == 3 && d == FALSE)
return; return;
_flags.dirty = d; _flags.dirty = d;

View File

@ -699,9 +699,8 @@ TPrinter::TPrinter()
} }
TConfig cnf (CONFIG_GENERAL, "Stampa"); TConfig cnf (CONFIG_GENERAL, "Stampa");
_ch_size = cnf.get_int("Size",NULL,-1,12);
_ch_size = atoi(cnf.get("Size",NULL,-1,"X")); _lines_per_inch = cnf.get_int("Lines",NULL,-1,6);
_lines_per_inch = atoi(cnf.get("Lines",NULL,-1,"X"));
#else #else
_isgraphics = FALSE; _isgraphics = FALSE;

View File

@ -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 <mailbox.h> #include <mailbox.h>
#include <sheet.h> #include <sheet.h>
#include <urldefid.h> #include <urldefid.h>
@ -204,7 +204,8 @@ bool TRelation_application::menu(MENU_TAG m)
bool TRelation_application::destroy() bool TRelation_application::destroy()
{ {
if (_maskeys) delete _maskeys;
user_destroy(); user_destroy();
return TApplication::destroy(); return TApplication::destroy();
} }
@ -566,9 +567,10 @@ bool TRelation_application::save(bool check_dirty)
if (check_dirty) if (check_dirty)
{ {
const int dirty = _mask->dirty();
const char* ms = (mode == MODE_MOD) ? "le modifiche" : "i dati inseriti"; const char* ms = (mode == MODE_MOD) ? "le modifiche" : "i dati inseriti";
const int dirty = _mask->dirty();
if (mode == MODE_QUERY) if (mode == MODE_QUERY)
{ {
const bool cont = !dirty || yesno_box("Annullare %s?", ms); const bool cont = !dirty || yesno_box("Annullare %s?", ms);
@ -592,7 +594,14 @@ bool TRelation_application::save(bool check_dirty)
KEY k; KEY k;
if (errore) 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 k = K_ESC;
} }
else else

View File

@ -23,7 +23,8 @@ class TScanner : private ifstream
public: public:
// @FPUB // @FPUB
TScanner(const char* filename); TScanner(const char* filename);
~TScanner() {}
const TString& pop(); const TString& pop();
const TString& key() const { return _key; } const TString& key() const { return _key; }
const TString& popkey() { pop(); return key(); } const TString& popkey() { pop(); return key(); }

View File

@ -319,28 +319,20 @@ bool TSheet::on_key(KEY key)
if (_checkable && _check_enabled && items() > 0) if (_checkable && _check_enabled && items() > 0)
{ {
bool force = FALSE;
switch(key) switch(key)
{ {
case K_SPACE: case K_SPACE:
if (!_disabled[selected()]) check(selected(), !checked(selected()));
{
_checked.not(selected());
force = TRUE;
}
break; break;
case K_F2: case K_F2:
uncheck(-1); uncheck(-1);
force = TRUE;
break; break;
case K_F3: case K_F3:
check(-1); check(-1);
force = TRUE;
break; break;
default: default:
break; break;
} }
if (force) force_update();
} }
return TScroll_window::on_key(key); return TScroll_window::on_key(key);
} }
@ -384,18 +376,33 @@ void TSheet::select(long n)
void TSheet::check(long n, bool on) void TSheet::check(long n, bool on)
{ {
long s = selected();
if (n < 0) if (n < 0)
{ {
if (on) if (on)
{ {
_checked.set(items()-1); // Force the size of Bit_array _checked.set(items()-1); // Force the size of Bit_array
_checked.set(); _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 else
_checked.reset(); _checked.reset();
} }
else else
_checked.set(n, on); {
if (!_disabled[n])
_checked.set(n, on);
}
force_update();
select(s);
} }

View File

@ -81,6 +81,8 @@ void free_global_vars()
} }
#ifndef FOXPRO #ifndef FOXPRO
#include <xvt.h> #include <xvt.h>
@ -101,3 +103,5 @@ void operator delete(void* ptr)
} }
#endif // FOXPRO #endif // FOXPRO