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:
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;

View File

@ -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");

View File

@ -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);

View File

@ -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

View File

@ -9,10 +9,6 @@
#include <real.h>
#endif
#ifndef __ARRAY_H
#include <array.h>
#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

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 <applicat.h>
@ -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;

View File

@ -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;

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 <sheet.h>
#include <urldefid.h>
@ -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

View File

@ -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(); }

View File

@ -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);
}

View File

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