Patch level :4.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :correzioni dovute al passaggio al nuovo compilatore git-svn-id: svn://10.65.10.50/trunk@14698 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d7c67d0d33
commit
e9a4e4b36b
@ -3,16 +3,15 @@
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
|
||||
#include <fstream.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "../xvaga/incstr.h"
|
||||
extern "C"
|
||||
{
|
||||
#include "../xvaga/hlapi_c.h"
|
||||
#include "../xvaga/skeylink.h"
|
||||
}
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
static HINSTANCE _hInstance = NULL;
|
||||
static int _dongle_type = 0;
|
||||
@ -86,7 +85,8 @@ void EncodeEutronPassword(char* str)
|
||||
{
|
||||
const char* const key = "QSECOFR-";
|
||||
char tmp[16];
|
||||
for (int i = 0; str[i]; i++)
|
||||
int i;
|
||||
for (i = 0; str[i]; i++)
|
||||
tmp[i] = str[i] + (i < 8 ? key[i] : str[i - 8]);
|
||||
tmp[i] = '\0';
|
||||
strcpy(str, tmp);
|
||||
@ -160,7 +160,8 @@ void DecodeString(char* data)
|
||||
BuildKey(key);
|
||||
|
||||
char tmp[256];
|
||||
for (int i = 0; data[i]; i++)
|
||||
int i;
|
||||
for (i = 0; data[i]; i++)
|
||||
tmp[i] = data[i] - (i < 8 ? key[i] : tmp[i - 8]);
|
||||
tmp[i] = '\0';
|
||||
strcpy(data, tmp);
|
||||
@ -182,7 +183,8 @@ void ProgramName(char* name)
|
||||
if (ver[0] != '\0')
|
||||
{
|
||||
const char * const encryption_key = "QSECOFR-";
|
||||
for (int i = 0; ver[i]; i++)
|
||||
int i;
|
||||
for (i = 0; ver[i]; i++)
|
||||
name[i] = ver[i] - (i < 8 ? encryption_key[i] : name[i - 8]);
|
||||
name[i] = '\0';
|
||||
}
|
||||
@ -214,7 +216,7 @@ int DongleTest()
|
||||
if (yearKey < verYear) // Chiave già programmata con assistenza pagata
|
||||
{
|
||||
bool ok = FALSE;
|
||||
ifstream keys("./program/zip/dninst.zip", ios::in | ios::nocreate);
|
||||
ifstream keys("./program/zip/dninst.zip");
|
||||
if (keys.good())
|
||||
{
|
||||
char line[256];
|
||||
|
@ -1085,7 +1085,7 @@ bool TMenu_application::check_user()
|
||||
if (_mask == NULL) // Primo login della sessione;
|
||||
{
|
||||
TConfig campo_ini(CONFIG_INSTALL, "Main");
|
||||
const use_system_user = campo_ini.get_bool("AutoLogin");
|
||||
const bool use_system_user = campo_ini.get_bool("AutoLogin");
|
||||
if (use_system_user)
|
||||
ok = !cache().get(LF_USER, utente).empty();
|
||||
}
|
||||
|
@ -15,7 +15,8 @@ HIDDEN void decode_string(char* dninst_key, char* data)
|
||||
{
|
||||
build_key(dninst_key);
|
||||
char tmp[1024];
|
||||
for (int i = 0; data[i]; i++)
|
||||
int i;
|
||||
for (i = 0; data[i]; i++)
|
||||
tmp[i] = data[i] - (i < 8 ? dninst_key[i] : tmp[i - 8]);
|
||||
tmp[i] = '\0';
|
||||
strcpy(data, tmp);
|
||||
@ -28,7 +29,8 @@ HIDDEN void encode_string(char* dninst_key, char* data)
|
||||
build_key(dninst_key);
|
||||
|
||||
char tmp[1024];
|
||||
for (int i = 0; data[i]; i++)
|
||||
int i;
|
||||
for (i = 0; data[i]; i++)
|
||||
tmp[i] = data[i] + (i < 8 ? dninst_key[i] : data[i - 8]);
|
||||
tmp[i] = '\0';
|
||||
strcpy(data, tmp);
|
||||
@ -36,7 +38,7 @@ HIDDEN void encode_string(char* dninst_key, char* data)
|
||||
|
||||
HIDDEN bool build_dninst()
|
||||
{
|
||||
ifstream inf("dninst.txt", ios::in | ios::nocreate);
|
||||
ifstream inf("dninst.txt", ios::in);
|
||||
if (inf.good())
|
||||
{
|
||||
char dninst_key[8] = "";
|
||||
|
@ -1360,7 +1360,7 @@ bool TFascicolator_mask::confirm_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TModule_mask& m = (TModule_mask& )f.mask();
|
||||
const TString& module = m.get(S_MODULE);
|
||||
const patchlevel=m.get_int(S_PATCHLEVEL);
|
||||
const int patchlevel=m.get_int(S_PATCHLEVEL);
|
||||
const bool dirty_module= m.field(S_DATE).dirty() ||
|
||||
m.field(S_PREPROCESS).dirty() ||
|
||||
m.field(S_POSTPROCESS).dirty() ||
|
||||
@ -1887,13 +1887,13 @@ long TFascicolator_mask::find_signature(const TFilename& filename, const char* s
|
||||
bool found = FALSE;
|
||||
long position = -1;
|
||||
int compare = 0;
|
||||
ifstream infile(filename, ios::nocreate | ios::in | ios::binary);
|
||||
ifstream infile(filename, ios::in | ios::binary);
|
||||
for (int car = infile.get(); car != EOF; car = infile.get())
|
||||
{
|
||||
if (car == signature[compare])
|
||||
{
|
||||
if (compare == 0)
|
||||
position = infile.tellg()-1;
|
||||
position = infile.tellg()-1L;
|
||||
compare++;
|
||||
if (signature[compare] == '\0')
|
||||
{
|
||||
@ -1925,7 +1925,7 @@ bool TFascicolator_mask::set_version_info(const TFilename& filename,
|
||||
long position = find_signature(filename, str);
|
||||
if (position > 0)
|
||||
{
|
||||
fstream outfile(filename, ios::in | ios::out | ios::nocreate | ios::binary);
|
||||
fstream outfile(filename, ios::in | ios::out | ios::binary);
|
||||
position += str.len();
|
||||
outfile.seekp(position);
|
||||
if (outfile.good())
|
||||
@ -1993,7 +1993,7 @@ bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patc
|
||||
TFilename filelist;
|
||||
filelist.temp("", main_module);
|
||||
struct _stat info;
|
||||
long lasttime=0;
|
||||
time_t lasttime=0;
|
||||
|
||||
// blocco della prima Progind
|
||||
{
|
||||
@ -2207,7 +2207,8 @@ void TCreazione_dischi::main_loop()
|
||||
// -1 se
|
||||
int find(const TString& name, TString_array & rows)
|
||||
{
|
||||
for(int r=rows.items()-1; r >=0 ; r-- )
|
||||
int r;
|
||||
for(r = rows.items()-1; r >=0 ; r-- )
|
||||
{
|
||||
if (name.compare(rows.row(r).get(0), -1, TRUE) == 0)
|
||||
break;
|
||||
|
@ -479,7 +479,8 @@ bool TInstaller_mask::autoload()
|
||||
const TString16 module = ininame.mid(pos-6, 2);
|
||||
TConfig ini(ininame, module);
|
||||
ini.write_protect();
|
||||
for (int r = int(items()-1); r >=0; r--)
|
||||
int r;
|
||||
for (r = int(items()-1); r >=0; r--)
|
||||
if (module == row(r).get(C_CODE))
|
||||
break;
|
||||
if (r >= 0)
|
||||
|
@ -154,7 +154,8 @@ int TColumnizer_win::on_column(long col)
|
||||
if (col > 0)
|
||||
{
|
||||
int action = 1; // 1 = Add, 2 = Remove
|
||||
for (int i = _column.items()-1; i >= 0; i--)
|
||||
int i;
|
||||
for (i = _column.items()-1; i >= 0; i--)
|
||||
{
|
||||
const long cur_col = _column.get_long(i);
|
||||
if (cur_col == col)
|
||||
@ -746,7 +747,7 @@ void TWizard_mask::file_preview() const
|
||||
const TString& fieldsep = get(F_FIELDSEP);
|
||||
|
||||
const TString& fname = get(F_FILE);
|
||||
int flags = ios::in | ios::nocreate;
|
||||
int flags = ios::in;
|
||||
if (fixedlen)
|
||||
flags |= ios::binary;
|
||||
ifstream f(fname, flags);
|
||||
@ -856,6 +857,7 @@ void TWizard_mask::file_preview() const
|
||||
}
|
||||
|
||||
cf.destroy_rows();
|
||||
int l;
|
||||
for (l = 0; l < righe.items(); l++)
|
||||
{
|
||||
TToken_string& riga = righe.row(l);
|
||||
|
@ -50,7 +50,7 @@ RCT& TEditMask_window::resize_rect(short x, short y, short dx, short dy,
|
||||
if (width > tot) x += (width-tot) / (2*CHARX);
|
||||
}
|
||||
}
|
||||
wt = WC_EDIT;
|
||||
wt = WC_TEXTEDIT;
|
||||
|
||||
r.left = (x+1)*CHARX;
|
||||
r.top = y*ROWY;
|
||||
@ -73,7 +73,7 @@ RCT& TEditMask_window::resize_rect(short x, short y, short dx, short dy,
|
||||
if (x < 0)
|
||||
{
|
||||
x = -x;
|
||||
if (wt != WC_EDIT && x == 1) x = 11;
|
||||
if (wt != WC_TEXTEDIT && x == 1) x = 11;
|
||||
if (x > 10)
|
||||
{
|
||||
const int num = x/10 -1;
|
||||
@ -88,7 +88,7 @@ RCT& TEditMask_window::resize_rect(short x, short y, short dx, short dy,
|
||||
if (y < 0)
|
||||
{
|
||||
y = -y;
|
||||
if (wt != WC_EDIT && y == 1) y = 11;
|
||||
if (wt != WC_TEXTEDIT && y == 1) y = 11;
|
||||
if (y > 10)
|
||||
{
|
||||
const int num = y/10 -1;
|
||||
@ -715,7 +715,8 @@ void TEditMask_string::print_use(ostream& out)const
|
||||
{
|
||||
for(int k=0;;k++)
|
||||
{
|
||||
for(int y=0;_use[k]!='\n' && _use[k];k++,y++)
|
||||
int y;
|
||||
for(y = 0;_use[k]!='\n' && _use[k];k++,y++)
|
||||
in[y]=_use[k];
|
||||
in[y]='\0';
|
||||
out<<" "<< in <<"\n";
|
||||
@ -1689,15 +1690,18 @@ void TEditMask_radio::update() const
|
||||
line(r.left,r.bottom,r.right,r.bottom);
|
||||
padre().set_pen(COLOR_BLACK);
|
||||
|
||||
padre().set_pen(MASK_LIGHT_COLOR);
|
||||
for (int i=0, k=ROWY;i<n_item(); i++, k=k+ROWY) {
|
||||
padre().set_pen(MASK_LIGHT_COLOR);
|
||||
int i,k;
|
||||
for (i = 0, k = ROWY; i < n_item(); i++, k+=ROWY)
|
||||
{
|
||||
line(r.left+(ROWY-10),r.top+ROWY+k,r.left+ROWY-2,r.top+(ROWY-8)+k);
|
||||
line(r.left+(ROWY-2),r.top+(ROWY+8)+k,r.left+(ROWY-10),r.top+ROWY+k);
|
||||
}
|
||||
i=0; k=ROWY;
|
||||
|
||||
padre().set_pen(MASK_DARK_COLOR);
|
||||
for (;i<n_item(); i++, k=k+ROWY) {
|
||||
for (;i<n_item(); i++, k=k+ROWY)
|
||||
{
|
||||
line(r.left+(ROWY+6),r.top+ROWY+k,r.left+(ROWY-2),r.top+(ROWY+8)+k);
|
||||
line(r.left+(ROWY-2),r.top+(ROWY-8)+k,r.left+(ROWY+6),r.top+ROWY+k);
|
||||
}
|
||||
@ -2059,7 +2063,8 @@ void TEditMask_sheet::print_browse(ostream& out)const
|
||||
{
|
||||
for(int k=0;;k++)
|
||||
{
|
||||
for(int y=0;_browse[k]!='\n' && _browse[k];k++,y++)
|
||||
int y;
|
||||
for(y = 0;_browse[k]!='\n' && _browse[k]; k++, y++)
|
||||
in[y]=_browse[k];
|
||||
in[y]='\0';
|
||||
out<<" "<<in<<"\n";
|
||||
|
@ -319,7 +319,7 @@ bool TRecord_selector::add_special_field(short id, const RecFieldDes& rf, int x,
|
||||
prompt[0] = toupper(prompt[0]);
|
||||
prompt.left_just(14);
|
||||
|
||||
const logicnum = get_int(F_FILE);
|
||||
const int logicnum = get_int(F_FILE);
|
||||
|
||||
if (logicnum == LF_DOC && strcmp(rf.Name, "PROVV") == 0)
|
||||
{
|
||||
|
@ -206,7 +206,8 @@ bool TMovanal_msk::is_ripartible_movcg()
|
||||
const TBill zio(row);
|
||||
if (zio.is_analitico())
|
||||
{
|
||||
for (int i = 3; i > 0; i--)
|
||||
int i;
|
||||
for (i = 3; i > 0; i--)
|
||||
{
|
||||
query = "USE RIP SELECT";
|
||||
query << " (GRUPPO=" << zio.gruppo() << ')'; // Il gruppo c'e' sempre
|
||||
@ -241,7 +242,8 @@ void TMovanal_msk::load_cg_row(const TRectype& row)
|
||||
{
|
||||
// Cerco la ripartizione del sottoconto, se non la trovo uso quella del conto o del gruppo
|
||||
TString80 query;
|
||||
for (int i = 3; i > 0; i--)
|
||||
int i;
|
||||
for (i = 3; i > 0; i--)
|
||||
{
|
||||
query = "USE RIP SELECT";
|
||||
query << " (GRUPPO=" << row.get(RMV_GRUPPO) << ')'; // Il gruppo c'e' sempre
|
||||
@ -346,7 +348,8 @@ int TMovanal_msk::get_constant_columns(TToken_string& tok) const
|
||||
const TString campione = sf.row(0).get(i);
|
||||
if (campione.full())
|
||||
{
|
||||
for (int j = items-1; j > 0; j--)
|
||||
int j;
|
||||
for (j = items-1; j > 0; j--)
|
||||
{
|
||||
if (campione != sf.row(j).get(i))
|
||||
break;
|
||||
|
@ -277,7 +277,8 @@ bool TRib_movanal_app::pareggia_commessa(TAnal_mov& anal_mov)
|
||||
{
|
||||
TRecord_array& body = anal_mov.body();
|
||||
// Cerco la commessa/fase/costo tra le righe esistenti
|
||||
for (int i = body.last_row(); i > 0; i--)
|
||||
int i;
|
||||
for (i = body.last_row(); i > 0; i--)
|
||||
{
|
||||
const TRectype& row = body[i];
|
||||
if ((cms->costo().blank() || row.get(RMOVANA_CODCCOSTO) == cms->costo()) &&
|
||||
|
@ -684,7 +684,8 @@ void TPag_per_cms_recordset::find_commesse(const long nreg, const TRectype& riga
|
||||
const TAnal_mov anal_mov(movana.get(MOVANA_NUMREG).as_int());
|
||||
TRecord_array& anal_rows = anal_mov.body();
|
||||
//scandisce le righe del movana alla ricerca di righe compatibili con le commesse sullo sheet
|
||||
for (int m = anal_rows.last_row(); m > 0; m--)
|
||||
int m;
|
||||
for (m = anal_rows.last_row(); m > 0; m--)
|
||||
{
|
||||
if (check_cms_cdc_fsc(anal_rows[m]))
|
||||
break;
|
||||
|
@ -19,7 +19,8 @@ TObject* TIndbil_cache::key2obj(const char* key)
|
||||
const long so = atol(conto.mid(6,6));
|
||||
|
||||
TRectype& panapdrec = panapdc.curr();
|
||||
for (int i = 2; i >= 0; i--)
|
||||
int i;
|
||||
for (i = 2; i >= 0; i--)
|
||||
{
|
||||
panapdrec.zero();
|
||||
panapdrec.put(PANAPDC_GRUPPO, gr);
|
||||
|
@ -271,7 +271,7 @@ const TMultilevel_code_info& ca_multilevel_code_info(int logicnum)
|
||||
|
||||
const TMultilevel_code_info* ca_multilevel_code_info_by_index(int level)
|
||||
{
|
||||
static _logicnum[3] = { -1, -1, -1 };
|
||||
static int _logicnum[3] = { -1, -1, -1 };
|
||||
|
||||
int logic = 0;
|
||||
if (level >= 0 && level < 3)
|
||||
|
@ -702,7 +702,9 @@
|
||||
|
||||
#ifdef S4WIN32
|
||||
#define S4NO_FILELENGTH
|
||||
#define INVALID_HANDLE_VALUE (HANDLE)-1 /* for Windows NT CreateFile */
|
||||
#ifndef INVALID_HANDLE_VALUE
|
||||
#define INVALID_HANDLE_VALUE (HANDLE)-1 /* for Windows NT CreateFile */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef S4WINDOWS
|
||||
|
@ -91,7 +91,7 @@ void TImmissioneDocumenti_app::init_flags()
|
||||
const TDate datadoc = relation.lfile().get_date(DOC_DATADOC);
|
||||
|
||||
if (datadoc.year() == caput_anni.year())
|
||||
fl.set(relation.lfile().get_date(DOC_DATADOC) - caput_anni, 1);
|
||||
fl.set(datadoc - caput_anni, 1);
|
||||
}
|
||||
caput_anni += fl.last_one();
|
||||
m.almanac(i).set_insert_date(m.ordered()[i] ? caput_anni : botime);
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
public:
|
||||
bool is_date_void(int currpage, TDate& cdate);
|
||||
// @cmember Gestione selezione: Setta la prima data dell'anno con l'inserimento attivo
|
||||
void set_insert_date(TDate & d) { _dateinsert = d; }
|
||||
void set_insert_date(const TDate & d) { _dateinsert = d; }
|
||||
bool can_insert(TDate &d) const { return d >= _dateinsert; }
|
||||
|
||||
// @access Public Member
|
||||
|
@ -1542,7 +1542,7 @@ bool TDistinta_tree::push_vars()
|
||||
|
||||
for (const char* str = memo.get(0); str; str = memo.get())
|
||||
{
|
||||
char* equal = strchr(str, '=');
|
||||
char* equal = (char*)strchr(str, '=');
|
||||
if (equal)
|
||||
{
|
||||
*equal = '\0';
|
||||
|
@ -150,8 +150,9 @@ void TVariazione_effetti::common_f(const TMask& m)
|
||||
int items = shcess.items();
|
||||
_effetto->destroy_rows_c();
|
||||
int ii = 1;
|
||||
int i;
|
||||
// scarico tutte le righe dei cessionari dallo sheet sul file
|
||||
for (int i = 0; i < items; i++)
|
||||
for (i = 0; i < items; i++)
|
||||
{
|
||||
TToken_string& row = shcess.row(i);
|
||||
if ( row.items()== 0 ) continue; // salta le righe vuote
|
||||
@ -217,8 +218,9 @@ int TVariazione_effetti::read(TMask& m)
|
||||
TSheet_field& shrighe = righe_sheet();
|
||||
shrighe.reset();
|
||||
int items = _effetto->rows_c();
|
||||
int i;
|
||||
// carica tutti i cessionari nello sheet dal file
|
||||
for (int i = 1; i <= items; i++)
|
||||
for (i = 1; i <= items; i++)
|
||||
{
|
||||
const TRectype& rec = _effetto->row_c(i);
|
||||
riga.cut(0);
|
||||
|
@ -600,8 +600,9 @@ bool TVariazione_distinte::imp_sel_handler(TMask_field& f, KEY k)
|
||||
TString16 val = m->get(F_CODVAL);
|
||||
int items = sf.items();
|
||||
// cerca se esiste un effetto con importo uguale a quello
|
||||
// da caricare
|
||||
for (int i = 0; i < items; i++)
|
||||
// da caricare
|
||||
int i;
|
||||
for (i = 0; i < items; i++)
|
||||
{
|
||||
TToken_string& row = sf.row(i);
|
||||
TString16 codval = row.get(sf.cid2index(F_VALUTA));
|
||||
@ -639,7 +640,7 @@ bool TVariazione_distinte::imp_sel_handler(TMask_field& f, KEY k)
|
||||
calcola();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handler per gestire la pressione del bottone conferma della maschera
|
||||
|
@ -595,7 +595,7 @@ bool TContabilizzazione_effetti_app::add_spese_rows(const real& spese)
|
||||
if (_sc_enabled)
|
||||
row_banca.put(RMV_ROWTYPE, 'L');
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void TContabilizzazione_effetti_app::join_rows(TArray& customers, TAssoc_array& banks,
|
||||
@ -606,13 +606,14 @@ void TContabilizzazione_effetti_app::join_rows(TArray& customers, TAssoc_array&
|
||||
{
|
||||
// aggiunge prima i record delle righe relative ai clienti
|
||||
const int customer_items = customers.items();
|
||||
for (int j=0; j<customer_items;j++)
|
||||
int j;
|
||||
for (j = 0; j < customer_items; j++)
|
||||
join_row((const TRectype&) customers[j]);
|
||||
|
||||
// e poi i record delle righe relative alle banche
|
||||
const int bank_items = banks.items();
|
||||
TRectype* row;
|
||||
for (j=0,row = (TRectype*)banks.first_item(); row != NULL && j<bank_items;j++,row = (TRectype *)banks.succ_item())
|
||||
for (j = 0, row = (TRectype*)banks.first_item(); row != NULL && j < bank_items; j++, row = (TRectype *)banks.succ_item())
|
||||
join_row(*row);
|
||||
|
||||
// infine abbuoni e differenze cambio
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#define XVT_INCL_NATIVE
|
||||
#include <xvt.h>
|
||||
|
||||
#define S4OFF_REPORT
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN32
|
||||
@ -25,7 +24,6 @@
|
||||
#endif
|
||||
|
||||
#include <d4all.h>
|
||||
|
||||
#include <codeb.h>
|
||||
#include <rectypes.h>
|
||||
#include <progind.h>
|
||||
@ -409,7 +407,7 @@ int DB_rewrite(int handle)
|
||||
char msg[256];
|
||||
DB_get_error();
|
||||
sprintf(msg, "Errore in DB_rewrite(): chiave duplicata nel record %ld, file %s",
|
||||
d4recNo(dbdata[handle]) + 1, d4fileName(dbdata[handle]));
|
||||
d4recNo(dbdata[handle]) + 1, d4fileName(dbdata[handle]));
|
||||
xvt_dm_post_fatal_exit(msg);
|
||||
}
|
||||
rt=DB_unlock(handle);
|
||||
|
@ -117,18 +117,9 @@ void TConfig::_write_file()
|
||||
|
||||
if (_file.exist())
|
||||
{
|
||||
#ifdef WIN32
|
||||
|
||||
ifstream in(_file, ios::in | ios::nocreate);
|
||||
|
||||
#else
|
||||
|
||||
ifstream in(_file, ios::in);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
if (in.good())
|
||||
{
|
||||
TString l(1024);
|
||||
|
@ -172,7 +172,7 @@ static void prep_merge()
|
||||
strcpy(fdname, f2name);
|
||||
strcpy(f2name, wname);
|
||||
fclose(fp2);
|
||||
unlink(f2name);
|
||||
xvt_fsys_removefile(f2name);
|
||||
fp2 = NULL;
|
||||
/* @(:) 2.3.00.112 */
|
||||
nrcds *= 2;
|
||||
@ -471,7 +471,7 @@ static FILE *wopen(char* name) /* nome del file temporaneo */
|
||||
if (!j)
|
||||
{
|
||||
fclose(fp1); /* none left */
|
||||
unlink(fdname);
|
||||
xvt_fsys_removefile(fdname);
|
||||
/* @(!) 2.3.00.112 eliminata if (fp2) */
|
||||
/* @(!) 2.3.00.112 eliminata { */
|
||||
/* @(!) 2.3.00.112 eliminata fclose(fp2); */
|
||||
|
@ -1014,11 +1014,8 @@ int TFile_text::open(char mode)
|
||||
if (_read_file)
|
||||
delete _read_file;
|
||||
|
||||
#ifdef WIN32
|
||||
_read_file = new ifstream(_name, ios::binary | ios::nocreate);
|
||||
#else
|
||||
_read_file = new ifstream(_name, ios::binary);
|
||||
#endif
|
||||
|
||||
if (!ok_r())
|
||||
{
|
||||
error_box("Impossibile aprire il file %s in lettura", (const char *)_name);
|
||||
|
@ -342,7 +342,7 @@ void TGolem_field::set_window_data(const char* data)
|
||||
{
|
||||
unsigned int icon = 0;
|
||||
|
||||
char* pipe = strchr(data, '|');
|
||||
char* pipe = (char*)strchr(data, '|'); //antica porcata
|
||||
if (pipe)
|
||||
{
|
||||
*pipe = '\0'; // Poor man TToken_string
|
||||
@ -1002,7 +1002,8 @@ bool TMail_message::send(TMAPI_session& lhSession, bool hide_ui)
|
||||
memset(&msgSend, 0, sizeof(MapiMessage));
|
||||
|
||||
long tot = 0;
|
||||
for (int i = 0; i < items(); i++)
|
||||
int i;
|
||||
for (i = 0; i < items(); i++)
|
||||
tot += row(i).len();
|
||||
char * buffer = new char[tot + 1];
|
||||
long b = 0;
|
||||
|
@ -923,11 +923,8 @@ bool TSocketClient::HttpPostFile(CONNID id, const char* remote, const char* loca
|
||||
ok = conn->WriteLine(buf);
|
||||
if (ok)
|
||||
{
|
||||
#ifdef WIN32
|
||||
ifstream input(local, ios::nocreate | ios::binary);
|
||||
#else
|
||||
ifstream input(local, ios::binary);
|
||||
#endif
|
||||
|
||||
while (!input.eof())
|
||||
{
|
||||
input.read(buf.get_buffer(), buf.size());
|
||||
|
@ -415,7 +415,7 @@ const TVariant& TRecordset::get(const char* column_name) const
|
||||
if (*column_name == '#')
|
||||
return get_var(column_name);
|
||||
|
||||
char* colon = strchr(column_name, ':');
|
||||
char* colon = (char*)strchr(column_name, ':'); //antica porcata
|
||||
if (colon != NULL)
|
||||
{
|
||||
*colon = '\0';
|
||||
@ -1473,14 +1473,11 @@ const TString& TCursor_parser::pop()
|
||||
}
|
||||
else
|
||||
{
|
||||
_token.cut(0);
|
||||
|
||||
_token.cut(0);
|
||||
eatwhite(_instr);
|
||||
if (_instr.eof())
|
||||
return _token;
|
||||
|
||||
char instring = '\0';
|
||||
while (true)
|
||||
|
||||
while (_instr)
|
||||
{
|
||||
char c;
|
||||
_instr.get(c);
|
||||
@ -1994,7 +1991,7 @@ TCursor* TISAM_recordset::cursor() const
|
||||
string s(use.get_buffer());
|
||||
istringstream instr(s);
|
||||
#else
|
||||
istrstream instr(use.get_buffer(), use.len());
|
||||
istrstream instr(use.get_buffer(), use.len()+1); //"barata" x aggiungere il carattere finale
|
||||
#endif
|
||||
TCursor_parser parser(instr, my->_column);
|
||||
|
||||
|
@ -1794,7 +1794,7 @@ bool TBook::export_pdf(const TFilename& filename)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TBook::export()
|
||||
bool TBook::esporta()
|
||||
{
|
||||
if (pages() <= 0)
|
||||
return false;
|
||||
@ -1857,7 +1857,7 @@ bool TBook::preview()
|
||||
switch (k)
|
||||
{
|
||||
case K_QUIT: break;
|
||||
case K_SAVE: export(); break;
|
||||
case K_SAVE: esporta(); break;
|
||||
default : print(); break;
|
||||
}
|
||||
return true;
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
virtual bool export_pdf(const TFilename& fname);
|
||||
virtual bool export_text(const TFilename& fname);
|
||||
virtual bool send_mail(const TFilename& fname);
|
||||
virtual bool export();
|
||||
virtual bool esporta();
|
||||
bool print_or_preview(); // Calls one of the above
|
||||
|
||||
TBook(const char* name);
|
||||
|
@ -12,11 +12,8 @@ TScanner::TScanner(const char* filename)
|
||||
: _token(128), _key(2),
|
||||
_tmp(1024*8), _pushed(FALSE), _line(0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
open(filename, ios::in | ios::nocreate, filebuf::sh_read);
|
||||
#else
|
||||
open(filename, ios::in);
|
||||
#endif
|
||||
|
||||
if (fail())
|
||||
{
|
||||
DIRECTORY dir; xvt_fsys_get_dir(&dir);
|
||||
|
@ -1,23 +1,12 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include <dongle.h>
|
||||
//#include <incstr.h>
|
||||
#include <prefix.h>
|
||||
#include <real.h>
|
||||
#include <utility.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <strstrea.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
#ifndef INCSTR_H
|
||||
#include <incstr.h>
|
||||
#endif
|
||||
#include <xvt.h>
|
||||
#include <dongle.h>
|
||||
#include <prefix.h>
|
||||
#include <real.h>
|
||||
#include <utility.h>
|
||||
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
@ -1557,7 +1546,7 @@ const char* TToken_string::get(
|
||||
|
||||
if (sep >= n)
|
||||
{
|
||||
char* p = strchr(s, _separator);
|
||||
char* p = (char*)strchr(s, _separator); //antica porcata
|
||||
TString& spark = get_tmp_string();
|
||||
|
||||
if (p == NULL)
|
||||
@ -1638,7 +1627,7 @@ bool TToken_string::get(
|
||||
bool found = sep == n;
|
||||
if (found)
|
||||
{
|
||||
char* p = strchr(s, _separator);
|
||||
char* p = (char*)strchr(s, _separator); //antica porcata
|
||||
if (p == NULL)
|
||||
{
|
||||
tok = s;
|
||||
@ -1830,7 +1819,8 @@ void TToken_string::insert_at(const char* s, int pos)
|
||||
if (pos >= 0 && not_empty())
|
||||
{
|
||||
int sep = 0;
|
||||
for (int i = 0; _str[i] && sep < pos; i++)
|
||||
int i;
|
||||
for (i = 0; _str[i] && sep < pos; i++)
|
||||
{
|
||||
if (_str[i] == _separator)
|
||||
sep++;
|
||||
|
@ -557,7 +557,7 @@ const char * decode(
|
||||
//salta gli spazi bianchi ad inizio file
|
||||
istream & eatwhite(istream & i)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && (_MSC_VER <= 1300)
|
||||
i.eatwhite();
|
||||
#else
|
||||
char c;
|
||||
|
@ -270,7 +270,7 @@ const TString & TVariable_rectype::get_str(const char* fieldname) const
|
||||
TToken_string values(get(_memo_fld), '\n');
|
||||
for (const char * s = values.get(0); s && *s; s = values.get())
|
||||
{
|
||||
char * val = strchr(s, '=');
|
||||
char * val = (char*)strchr(s, '='); //antica porcata
|
||||
if (val)
|
||||
{
|
||||
*val = '\0';
|
||||
|
@ -592,7 +592,8 @@ TPushbutton_control* TViswin::add_button (
|
||||
|
||||
bool TViswin::enable_button(short id, bool on)
|
||||
{
|
||||
for (int i = _button.last(); i >= 0; i--)
|
||||
int i;
|
||||
for (i = _button.last(); i >= 0; i--)
|
||||
{
|
||||
TPushbutton_control* b = (TPushbutton_control*)_button.objptr(i);
|
||||
if (b->id() == id)
|
||||
|
@ -1,14 +1,7 @@
|
||||
#include "real.h"
|
||||
#include "xml.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <fstream.h>
|
||||
#include <strstrea.h>
|
||||
#else
|
||||
#include <incstr.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Utilities
|
||||
@ -51,7 +44,8 @@ const TString& EscapeSequence(char cStart, istream& inf)
|
||||
|
||||
if (cStart == '&')
|
||||
{
|
||||
for (char c = inf.get(); c != ';' && c > ' '; c = inf.get())
|
||||
char c;
|
||||
for (c = inf.get(); c != ';' && c > ' '; c = inf.get())
|
||||
str << c;
|
||||
if (c == ';') // Ho trovato il carattere di fine sequenza
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ RCT& resize_rect(
|
||||
if (width > tot) x += (width-tot) / (CHARX<<1);
|
||||
}
|
||||
}
|
||||
wt = WC_EDIT;
|
||||
wt = WC_TEXTEDIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -85,7 +85,7 @@ RCT& resize_rect(
|
||||
|
||||
switch (wt)
|
||||
{
|
||||
case WC_EDIT :
|
||||
case WC_TEXTEDIT :
|
||||
r.left = (x+1)*CHARX;
|
||||
r.top = y*ROWY;
|
||||
r.right = dx*CHARX;
|
||||
@ -120,7 +120,7 @@ RCT& resize_rect(
|
||||
if (x < 0)
|
||||
{
|
||||
x = -x;
|
||||
if (wt != WC_EDIT && x == 1) x = 11;
|
||||
if (wt != WC_TEXTEDIT && x == 1) x = 11;
|
||||
if (x > 10)
|
||||
{
|
||||
const int num = x/10 -1;
|
||||
@ -135,7 +135,7 @@ RCT& resize_rect(
|
||||
if (y < 0)
|
||||
{
|
||||
y = -y;
|
||||
if (wt != WC_EDIT && y == 1) y = 11;
|
||||
if (wt != WC_TEXTEDIT && y == 1) y = 11;
|
||||
if (y > 10)
|
||||
{
|
||||
const int num = y/10 -1;
|
||||
|
@ -10,15 +10,14 @@
|
||||
| |
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/* $Id: p_resource.c,v 1.2 2006-07-11 13:10:33 alex Exp $
|
||||
/* $Id: p_resource.c,v 1.3 2006-12-29 14:13:45 luca Exp $
|
||||
*
|
||||
* PDFlib resource routines
|
||||
*
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "p_intern.h"
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
@ -10,7 +10,7 @@
|
||||
| |
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/* $Id: pdflibdl.c,v 1.2 2006-07-11 13:10:33 alex Exp $
|
||||
/* $Id: pdflibdl.c,v 1.3 2006-12-29 14:13:45 luca Exp $
|
||||
*
|
||||
* C wrapper code for dynamically loading the PDFlib DLL at runtime.
|
||||
*
|
||||
@ -18,8 +18,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "pdflibdl.h"
|
||||
|
||||
/* enable this to avoid error messages */
|
||||
@ -30,7 +28,9 @@
|
||||
/* ---------------------------------- WIN32 ----------------------------- */
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#if _MSC_VER > 1300
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
|
@ -574,8 +574,8 @@ void TCond_vendita::ricerca(bool load_um_only, bool load_scagl_only)
|
||||
|
||||
_load_mask |= load_scagl_only && cv_scagl;
|
||||
_load_mask |= load_scagl_only && cv_um;
|
||||
|
||||
for (int i = 0; percprovv == ZERO && i < len && seqric[i] != '-'; i++)
|
||||
int i;
|
||||
for (i = 0; percprovv == ZERO && i < len && seqric[i] != '-'; i++)
|
||||
{
|
||||
if (isdigit(seqric[i]))
|
||||
{
|
||||
|
@ -902,13 +902,12 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
||||
|
||||
mov.put(MOVMAG_NUMREG, num_movmag);
|
||||
while (mov.read(m, _isequal, _testandlock) == _islocked)
|
||||
message_box("Movimento di magazzino n. %ld in uso da parte di un'altro utente", num);
|
||||
message_box("Movimento di magazzino n. %ld in uso da parte di un'altro utente", num_movmag);
|
||||
if (do_movmag)
|
||||
{
|
||||
TRecord_array & b = mov.body();
|
||||
const int mag_rows = mov.rows();
|
||||
int i;
|
||||
|
||||
int i;
|
||||
for (i = mag_rows; i > 0; i--)
|
||||
{
|
||||
TRectype & r = b[i];
|
||||
|
@ -58,7 +58,7 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
|
||||
|
||||
const TDate dcons = doc_in.get_date(DOC_DATACONS);
|
||||
const TDate ddoc = doc_out.get_date(DOC_DATADOC);
|
||||
const usa_dcons = usa_data_consegna();
|
||||
const bool usa_dcons = usa_data_consegna();
|
||||
|
||||
if (usa_dcons)
|
||||
{
|
||||
|
@ -508,8 +508,9 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis
|
||||
const TipoIVA tiva = caus.iva();
|
||||
TBill bill; caus.bill(RIGA_IVA_NON_DETRAIBILE, bill);
|
||||
|
||||
// Scandisco le righe del documento,
|
||||
for (int i = 1; i <= doc.physical_rows(); i++)
|
||||
// Scandisco le righe del documento,
|
||||
int i;
|
||||
for (i = 1; i <= doc.physical_rows(); i++)
|
||||
{
|
||||
const TRiga_documento& riga = doc[i];
|
||||
|
||||
|
@ -1127,6 +1127,7 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga)
|
||||
const bool use_fsc = fasinfo.levels() > 0;
|
||||
|
||||
int y = 1;
|
||||
int i;
|
||||
short dlg = FR_CDC1; // id del primo campo da generare
|
||||
short dlgd = FR_DESCDC1;
|
||||
|
||||
|
@ -1822,7 +1822,7 @@ bool sppr_handler( TMask_field& f, KEY key )
|
||||
|
||||
for (short i = FR_CDC1; i <= FR_CDC12; i++)
|
||||
{
|
||||
const pos = row_mask.id2pos(i);
|
||||
const int pos = row_mask.id2pos(i);
|
||||
if (pos >=0)
|
||||
{
|
||||
TEdit_field& e = (TEdit_field&)row_mask.fld(pos);
|
||||
|
@ -14,18 +14,22 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <windows.h>
|
||||
#include <crtdbg.h>
|
||||
#include "XTrace.h"
|
||||
#include "XFont.h"
|
||||
|
||||
#include <crtdbg.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// If you do not want TRACE output you can
|
||||
// uncomment the following lines:
|
||||
//
|
||||
#undef TRACE
|
||||
#define TRACE ((void)0)
|
||||
#if _MSC_VER > 1300
|
||||
#define TRACE __noop
|
||||
#else
|
||||
#define TRACE ((void)0)
|
||||
#endif
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -185,7 +189,7 @@ BOOL GetFontFile(LPCTSTR lpszFontName,
|
||||
TCHAR szVersion[100];
|
||||
GetWinVer(szVersion, sizeof(szVersion)/sizeof(TCHAR)-1, &nVersion);
|
||||
|
||||
TRACE(_T("szVersion=%s\n"), szVersion);
|
||||
//TRACE(_T("szVersion=%s\n"), szVersion);
|
||||
|
||||
TCHAR szFontPath[1000];
|
||||
|
||||
@ -320,7 +324,7 @@ BOOL GetFontProperties(LPCTSTR lpszFilePath, FONT_PROPERTIES * lpFontPropsX)
|
||||
index += sizeof(TT_TABLE_DIRECTORY);
|
||||
|
||||
strncpy(szTemp, tblDir.szTag, 4);
|
||||
if (stricmp(szTemp, "name") == 0)
|
||||
if (_stricmp(szTemp, "name") == 0)
|
||||
{
|
||||
bFound = TRUE;
|
||||
tblDir.uLength = SWAPLONG(tblDir.uLength);
|
||||
|
@ -33,6 +33,10 @@
|
||||
#ifndef XTRACE_H
|
||||
#define XTRACE_H
|
||||
|
||||
#ifdef WIN32
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
@ -62,7 +66,7 @@ public:
|
||||
TCHAR buf2[BUFFER_SIZE];
|
||||
|
||||
// add the __FILE__ and __LINE__ to the front
|
||||
LPTSTR cp = (LPTSTR) m_file;
|
||||
LPCTSTR cp = (LPCTSTR) m_file;
|
||||
|
||||
if (!XTRACE_SHOW_FULLPATH)
|
||||
{
|
||||
|
@ -1,12 +1,5 @@
|
||||
#include "wxinc.h"
|
||||
|
||||
#ifdef LINUX
|
||||
#include "xvt_type.h"
|
||||
#include "incstr.h"
|
||||
#else
|
||||
#include <fstream.h>
|
||||
#endif
|
||||
|
||||
#include "agasys.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -2,11 +2,15 @@
|
||||
#define __INCRSTR_H
|
||||
|
||||
#ifdef WIN32
|
||||
#ifndef _INC_FSTREAM
|
||||
#include <fstream.h>
|
||||
#endif
|
||||
#include <strstrea.h>
|
||||
|
||||
#if _MSC_VER > 1300
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <strstream>
|
||||
using namespace std;
|
||||
#else
|
||||
#include <fstream.h>
|
||||
#include <strstrea.h>
|
||||
#endif
|
||||
#else // WIN32
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -95,9 +95,10 @@ int CALLBACK FamilyEnumerator(
|
||||
{
|
||||
XvtData* d = (XvtData*)lParam;
|
||||
int& n = d->cur_count;
|
||||
for (int i = n-1; i >= 0 && stricmp(d->families[i], plf->lfFaceName); i--);
|
||||
int i;
|
||||
for (i = n-1; i >= 0 && wxStricmp(d->families[i], plf->lfFaceName); i--);
|
||||
if (i < 0) // Controlla che il nome del font non ci sia gia'
|
||||
d->families[n++] = strdup(plf->lfFaceName);
|
||||
d->families[n++] = _strdup(plf->lfFaceName);
|
||||
return n < d->max_count;
|
||||
}
|
||||
|
||||
@ -738,7 +739,7 @@ static bool IsInternetAddress(const char* filename)
|
||||
_strlwr(ext);
|
||||
const char* const extensions[] = { "com","edu","gov","it","mil","net","org", NULL };
|
||||
for (int e = 0; extensions[e]; e++)
|
||||
if (stricmp(ext, extensions[e]) == 0)
|
||||
if (wxStricmp(ext, extensions[e]) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@ -919,116 +920,13 @@ int OsWin32_GetSessionId()
|
||||
return (int) session;
|
||||
}
|
||||
|
||||
#define BUFSIZE 80
|
||||
|
||||
//definito il valore della variabile intera SM_REMOTESESSION che non esiste nella versione 98
|
||||
//del MSVC (c'e' nella versione 2003)
|
||||
//definito il valore della variabile intera SM_REMOTESESSION
|
||||
// che non esiste per WINVER < 0x500
|
||||
#ifndef SM_REMOTESESSION
|
||||
#define SM_REMOTESESSION 0x1000
|
||||
#endif
|
||||
|
||||
bool OsWin32_IsWindowsServer()
|
||||
{
|
||||
if (::GetSystemMetrics(SM_REMOTESESSION))
|
||||
return true;
|
||||
|
||||
bool server = false;
|
||||
OSVERSIONINFOEX osvi;
|
||||
BOOL bOsVersionInfoEx;
|
||||
|
||||
// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
|
||||
// If that fails, try using the OSVERSIONINFO structure.
|
||||
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
|
||||
if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
|
||||
{
|
||||
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
|
||||
if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch (osvi.dwPlatformId)
|
||||
{
|
||||
// Test for the Windows NT product family.
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
|
||||
// Test for the specific product family.
|
||||
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
|
||||
server = true; // Microsoft Windows Server 2003 family
|
||||
|
||||
// Test for specific product on Windows NT 4.0 SP6 and later.
|
||||
if( bOsVersionInfoEx )
|
||||
{
|
||||
const BYTE wProductType = osvi.wReserved[1]& 0xFF;
|
||||
// Test for the server type.
|
||||
if ( wProductType == 3 ) // VER_NT_SERVER
|
||||
{
|
||||
if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
|
||||
{
|
||||
/*if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
|
||||
server = true; // Datacenter Edition
|
||||
else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
|
||||
server = true; // Enterprise Edition
|
||||
else if ( osvi.wSuiteMask == VER_SUITE_BLADE )
|
||||
server = true; // Web Edition
|
||||
else
|
||||
server = true; // Standard Edition*/
|
||||
server = true;
|
||||
}
|
||||
|
||||
else if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
|
||||
{
|
||||
/*if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
|
||||
server = true; // Datacenter Server
|
||||
else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
|
||||
server = true; // Advanced Server
|
||||
else
|
||||
server = true; // Server*/
|
||||
server = true;
|
||||
}
|
||||
|
||||
else // Windows NT 4.0
|
||||
{
|
||||
/*if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
|
||||
server = true; // Server 4.0, Enterprise Edition
|
||||
else
|
||||
server = true; // Server 4.0*/
|
||||
server = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Test for specific product on Windows NT 4.0 SP5 and earlier
|
||||
{
|
||||
HKEY hKey;
|
||||
char szProductType[BUFSIZE];
|
||||
DWORD dwBufLen=BUFSIZE;
|
||||
LONG lRet;
|
||||
|
||||
lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
|
||||
"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
|
||||
0, KEY_QUERY_VALUE, &hKey );
|
||||
if( lRet != ERROR_SUCCESS )
|
||||
return FALSE;
|
||||
|
||||
lRet = RegQueryValueEx( hKey, "ProductType", NULL, NULL,
|
||||
(LPBYTE) szProductType, &dwBufLen);
|
||||
if( (lRet != ERROR_SUCCESS) || (dwBufLen > BUFSIZE) )
|
||||
return FALSE;
|
||||
|
||||
RegCloseKey( hKey );
|
||||
|
||||
if ( lstrcmpi( "LANMANNT", szProductType) == 0 )
|
||||
server = true; // Server
|
||||
if ( lstrcmpi( "SERVERNT", szProductType) == 0 )
|
||||
server = true; // Advanced Server
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return server;
|
||||
return ::GetSystemMetrics(SM_REMOTESESSION) != 0;
|
||||
}
|
||||
|
129
xvaga/xvaga.cpp
129
xvaga/xvaga.cpp
@ -158,15 +158,15 @@ wxIcon* GetIconResource(int rid)
|
||||
return icon;
|
||||
}
|
||||
|
||||
wxCursor* GetCursorResource(int rid)
|
||||
const wxCursor* GetCursorResource(int rid)
|
||||
{
|
||||
static wxHashTable cursors;
|
||||
wxCursor* cursor = (wxCursor*)cursors.Get(rid);
|
||||
const wxCursor* cursor = (const wxCursor*)cursors.Get(rid);
|
||||
if (cursor == NULL)
|
||||
{
|
||||
switch (rid)
|
||||
{
|
||||
case CURSOR_CROSS: cursor = new wxCursor(wxCURSOR_CROSS); break;
|
||||
case CURSOR_CROCE: cursor = new wxCursor(wxCURSOR_CROSS); break;
|
||||
case CURSOR_IBEAM: cursor = new wxCursor(wxCURSOR_IBEAM); break;
|
||||
default:
|
||||
{
|
||||
@ -192,7 +192,7 @@ wxCursor* GetCursorResource(int rid)
|
||||
XVT_ASSERT(false);
|
||||
cursor = wxSTANDARD_CURSOR;
|
||||
}
|
||||
cursors.Put(rid, cursor);
|
||||
cursors.Put(rid, (wxCursor*)cursor);
|
||||
}
|
||||
return cursor;
|
||||
}
|
||||
@ -695,12 +695,13 @@ IMPLEMENT_DYNAMIC_CLASS(TwxWindowBase, wxWindow)
|
||||
TwxWindowBase::TwxWindowBase(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &pos, const wxSize &size, long style)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
// Evita inutili sfarfallamenti in quanto wxWidgets crea le finestre visibili per default
|
||||
wxWindowBase::Show(false);
|
||||
#endif
|
||||
Create(parent, id, pos, size, style, title);
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
#else
|
||||
SetTitle(title); // Triste necessita', la Create sembra ignorare il titolo
|
||||
#endif
|
||||
}
|
||||
|
||||
class TwxWindow : public TwxWindowBase
|
||||
@ -966,17 +967,14 @@ void TwxWindow::OnMouseDouble(wxMouseEvent& event)
|
||||
void TwxWindow::OnMouseDown(wxMouseEvent& event)
|
||||
{
|
||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||
e.type = E_MOUSE_DOWN;
|
||||
e.v.mouse.button = (event.RightDown() ? 1 : 0) + (event.MiddleDown() ? 2 : 0);
|
||||
e.v.mouse.control = event.ControlDown();
|
||||
e.v.mouse.shift = event.ShiftDown();
|
||||
e.v.mouse.where.h = event.GetX();
|
||||
e.v.mouse.where.v = event.GetY();
|
||||
DoXvtEvent(e);
|
||||
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
e.type = E_MOUSE_DOWN;
|
||||
e.v.mouse.button = (event.RightDown() ? 1 : 0) + (event.MiddleDown() ? 2 : 0);
|
||||
e.v.mouse.control = event.ControlDown();
|
||||
e.v.mouse.shift = event.ShiftDown();
|
||||
e.v.mouse.where.h = event.GetX();
|
||||
e.v.mouse.where.v = event.GetY();
|
||||
DoXvtEvent(e);
|
||||
SetFocus(); // Triste necessita'
|
||||
#endif
|
||||
}
|
||||
|
||||
void TwxWindow::OnMouseMove(wxMouseEvent& event)
|
||||
@ -1234,7 +1232,11 @@ void TTaskWin::SetMenuTree(const MENU_ITEM* tree)
|
||||
item = new wxMenuItem(pMenu, wxID_SEPARATOR);
|
||||
else
|
||||
item = new wxMenuItem(pMenu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
|
||||
#else
|
||||
pMenu->DoAppend(item);
|
||||
#endif
|
||||
}
|
||||
const int nLast = bar->GetMenuCount()-1;
|
||||
int m;
|
||||
@ -1269,7 +1271,10 @@ void TTaskWin::PushMenuTree(const MENU_ITEM* tree, wxWindow* owner)
|
||||
item = new wxMenuItem(pMenu, wxID_SEPARATOR);
|
||||
else
|
||||
item = new wxMenuItem(pMenu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
#else
|
||||
pMenu->DoAppend(item);
|
||||
#endif
|
||||
}
|
||||
pBar->Append(pMenu, tree->text);
|
||||
}
|
||||
@ -1394,10 +1399,8 @@ void xvt_app_create(int argc, char **argv, unsigned long flags,
|
||||
}
|
||||
|
||||
_task_win = new TTaskWin(NULL, ICON_RSRC, title, pos, size, style);
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
_task_win->SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Lo sfondo viene disegnato nella OnPaint
|
||||
#endif
|
||||
|
||||
|
||||
_nice_windows.Put((WINDOW)_task_win, _task_win);
|
||||
|
||||
wxMenu* Menus[3];
|
||||
@ -1447,11 +1450,7 @@ void xvt_app_create(int argc, char **argv, unsigned long flags,
|
||||
if (ret != 0)
|
||||
{
|
||||
// Simula main loop
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
xvt_app_process_pending_events();
|
||||
#else
|
||||
a->MainLoop();
|
||||
#endif
|
||||
xvt_app_process_pending_events();
|
||||
}
|
||||
a->ExitMainLoop(); // Non entrare nel main loop di wxWindows
|
||||
}
|
||||
@ -1479,14 +1478,10 @@ void xvt_app_process_pending_events(void)
|
||||
wxApp* a = wxTheApp; // Memorizzo il risultato di wxGetInstance
|
||||
if (a != NULL)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
while (a->Pending())
|
||||
a->Dispatch();
|
||||
a->Yield(true);
|
||||
#else
|
||||
for (int m = 0; m < 4 && a->Pending(); m++)
|
||||
a->Dispatch();
|
||||
#endif
|
||||
a->Dispatch();
|
||||
|
||||
a->Yield(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1950,21 +1945,13 @@ static FL_STATUS xvt_dm_post_file_ask(FILE_SPEC *fsp, const char *msg, int flags
|
||||
|
||||
FL_STATUS xvt_dm_post_file_open(FILE_SPEC *fsp, const char *msg)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
const int flags = wxOPEN | wxFILE_MUST_EXIST;
|
||||
#else
|
||||
const int flags = wxOPEN | wxHIDE_READONLY | wxFILE_MUST_EXIST;
|
||||
#endif
|
||||
const int flags = wxOPEN | wxFILE_MUST_EXIST;
|
||||
return xvt_dm_post_file_ask(fsp, msg, flags);
|
||||
}
|
||||
|
||||
FL_STATUS xvt_dm_post_file_save(FILE_SPEC *fsp, const char *msg)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
const int flags = wxSAVE;
|
||||
#else
|
||||
const int flags = wxSAVE | wxHIDE_READONLY;
|
||||
#endif
|
||||
const int flags = wxSAVE;
|
||||
return xvt_dm_post_file_ask(fsp, msg, flags);
|
||||
}
|
||||
|
||||
@ -1986,7 +1973,11 @@ BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD *precp, un
|
||||
wxFontData data;
|
||||
data.SetInitialFont(font.Font(NULL, win));
|
||||
data.EnableEffects(reserved != 0);
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
wxFontDialog dlg(_task_win, data);
|
||||
#else
|
||||
wxFontDialog dlg(_task_win, &data);
|
||||
#endif
|
||||
BOOLEAN ok = dlg.ShowModal() == wxID_OK;
|
||||
if (ok)
|
||||
{
|
||||
@ -2796,7 +2787,7 @@ void xvt_font_deserialize(XVT_FNTID font_id, const char* buf)
|
||||
// 01\\Courier\\0\\10\\WIN01/-13/0/0/0/400/0/0/0/0/1/2/1/49/Courier
|
||||
|
||||
TFontId& font = *(TFontId*)font_id;
|
||||
char* s = strchr(buf, '/');
|
||||
const char* s = strchr(buf, '/');
|
||||
if (s == NULL)
|
||||
return;
|
||||
const int nSize = atoi(s+1);
|
||||
@ -3527,12 +3518,24 @@ BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos,
|
||||
wxMenu menu;
|
||||
for (MENU_ITEM* mi = menu_p; mi != NULL && mi->tag != 0; mi++)
|
||||
{
|
||||
wxMenuItem* item = NULL;
|
||||
wxMenuItem* item = NULL;
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
if (mi->separator)
|
||||
menu.AppendSeparator();
|
||||
else
|
||||
{
|
||||
if (mi->checkable)
|
||||
item = menu.AppendCheckItem(mi->tag, mi->text);
|
||||
else
|
||||
item = menu.Append(mi->tag, mi->text);
|
||||
}
|
||||
#else
|
||||
if (mi->separator)
|
||||
item = new wxMenuItem(&menu, wxID_SEPARATOR);
|
||||
else
|
||||
item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
||||
menu.DoAppend(item);
|
||||
#endif
|
||||
item->Enable(mi->enabled); // Fattibile solo dopo l'append
|
||||
if (mi->checkable)
|
||||
item->Check(mi->checked);
|
||||
@ -3663,7 +3666,7 @@ int xvt_rect_get_width(RCT *rctp)
|
||||
BOOLEAN xvt_rect_has_point(RCT *rctp, PNT pnt)
|
||||
{
|
||||
const wxRect rct = NormalizeRCT(rctp);
|
||||
return rct.Inside(pnt.h, pnt.v);
|
||||
return rct.Contains(pnt.h, pnt.v);
|
||||
}
|
||||
|
||||
BOOLEAN xvt_rect_intersect(RCT *drctp, RCT *rctp1, RCT *rctp2)
|
||||
@ -3761,7 +3764,7 @@ static int SplitString(const wxString& str, wxArrayString& a)
|
||||
a.Clear();
|
||||
while (comma)
|
||||
{
|
||||
comma = strchr(s, ',');
|
||||
comma = (char*)strchr(s, ',');
|
||||
if (comma)
|
||||
{
|
||||
*comma = '\0';
|
||||
@ -3986,7 +3989,7 @@ static void AddWinToList(SLIST list, WINDOW win)
|
||||
if (win != NULL_WIN)
|
||||
{
|
||||
CAST_WIN(win, w);
|
||||
const char* title = w.GetTitle();
|
||||
const char* title = w.GetLabel();
|
||||
xvt_slist_add_at_elt(list, NULL, title, win);
|
||||
}
|
||||
}
|
||||
@ -3996,11 +3999,12 @@ SLIST xvt_scr_list_wins()
|
||||
SLIST list = xvt_slist_create();
|
||||
|
||||
_nice_windows.BeginFind();
|
||||
//#if wxCHECK_VERSION(2,6,1)
|
||||
// for (wxHashTable_Node* node = _nice_windows.Next(); node; node = _nice_windows.Next())
|
||||
//#else
|
||||
for (wxNode* node = _nice_windows.Next(); node; node = _nice_windows.Next())
|
||||
//#endif
|
||||
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
for (wxHashTable::Node* node = _nice_windows.Next(); node; node = _nice_windows.Next())
|
||||
#else
|
||||
for (wxNode* node = _nice_windows.Next(); node; node = _nice_windows.Next())
|
||||
#endif
|
||||
{
|
||||
wxObject* pWin = node->GetData();
|
||||
AddWinToList(list, (WINDOW)pWin);
|
||||
@ -4130,7 +4134,7 @@ int xvt_str_compare_ignoring_case (const char* s1, const char* s2)
|
||||
|
||||
char* xvt_str_duplicate(const char* str)
|
||||
{
|
||||
return str ? strdup(str) : NULL; // bleah!
|
||||
return str ? _strdup(str) : NULL; // bleah!
|
||||
}
|
||||
|
||||
BOOLEAN xvt_str_match(const char* mbs, const char *pat, BOOLEAN case_sensitive)
|
||||
@ -4447,7 +4451,11 @@ int xvt_sys_get_session_id()
|
||||
|
||||
unsigned long xvt_sys_get_free_memory()
|
||||
{
|
||||
unsigned long mem = ::wxGetFreeMemory();
|
||||
unsigned long mem = 0;
|
||||
if (::wxGetFreeMemory().GetHi())
|
||||
mem = -1;
|
||||
else
|
||||
mem = ::wxGetFreeMemory().GetLo();
|
||||
return mem;
|
||||
}
|
||||
|
||||
@ -4522,6 +4530,7 @@ void xvt_sys_searchenv(const char * filename, const char * varname, char * pathn
|
||||
// BOOLEAN o int? Adso!
|
||||
int xvt_fsys_access(const char *pathname, int mode)
|
||||
{
|
||||
wxString str = ::wxGetCwd();
|
||||
return wxAccess(pathname, mode) == -1 ? errno : 0;
|
||||
}
|
||||
|
||||
@ -4776,7 +4785,7 @@ WINDOW xvt_vobj_get_parent(WINDOW win)
|
||||
char* xvt_vobj_get_title(WINDOW win, char *title, int sz_title)
|
||||
{
|
||||
CAST_WIN(win, w);
|
||||
strncpy(title, w.GetTitle(), sz_title);
|
||||
strncpy(title, w.GetLabel(), sz_title);
|
||||
title[sz_title-1] = '\0';
|
||||
return title;
|
||||
}
|
||||
@ -4870,7 +4879,7 @@ void xvt_vobj_set_palet(WINDOW win, XVT_PALETTE palet)
|
||||
void xvt_vobj_set_title(WINDOW win, const char* title)
|
||||
{
|
||||
CAST_WIN(win, w);
|
||||
w.SetTitle(title);
|
||||
w.SetLabel(title);
|
||||
}
|
||||
|
||||
void xvt_vobj_set_visible(WINDOW win, BOOLEAN show)
|
||||
@ -4936,9 +4945,9 @@ WINDOW xvt_win_create(WIN_TYPE wtype, const RCT* rct_p, const char* title, int m
|
||||
|
||||
w->_type = wtype;
|
||||
w->_app_data = app_data;
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
|
||||
w->SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Lo sfondo viene disegnato nella OnPaint
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
OsWin32_SetCaptionStyle(w->GetHWND(), wtype == W_DOC);
|
||||
@ -5040,11 +5049,11 @@ void xvt_win_set_caret_visible(WINDOW win, BOOLEAN on)
|
||||
void xvt_win_set_cursor(WINDOW win, CURSOR cursor)
|
||||
{
|
||||
CAST_WIN(win, w);
|
||||
wxCursor* cur = wxSTANDARD_CURSOR; // Dummy initilization
|
||||
const wxCursor* cur = wxSTANDARD_CURSOR; // Dummy initilization
|
||||
switch (cursor)
|
||||
{
|
||||
case CURSOR_ARROW: cur = wxSTANDARD_CURSOR; break;
|
||||
case CURSOR_CROSS: cur = wxCROSS_CURSOR; break;
|
||||
case CURSOR_CROCE: cur = wxCROSS_CURSOR; break;
|
||||
case CURSOR_WAIT : cur = wxHOURGLASS_CURSOR; break;
|
||||
default: cur = GetCursorResource(cursor); break; // Always succeeds
|
||||
}
|
||||
@ -5083,7 +5092,7 @@ const char* statbar_set_title(WINDOW win, const char* text)
|
||||
|
||||
if (text == NULL)
|
||||
text = _strDefaultStatbarText;
|
||||
char* tab = strchr(text, '\t');
|
||||
char* tab = (char*)strchr(text, '\t');
|
||||
if (tab)
|
||||
{
|
||||
w.SetStatusText(tab+1, 1);
|
||||
|
16
xvaga/xvt.h
16
xvaga/xvt.h
@ -1,6 +1,10 @@
|
||||
#ifndef XVT_INCL_XVT
|
||||
#define XVT_INCL_XVT
|
||||
|
||||
#if defined(WIN32)&&(_MSC_VER > 1300)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
#ifdef XVT_INCL_NATIVE
|
||||
#ifdef WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
@ -11,13 +15,13 @@
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if XVAGADLL == 1
|
||||
#define XVTDLL __declspec(dllexport)
|
||||
#ifdef XVAGADLL
|
||||
#define XVTDLL __declspec(dllexport)
|
||||
#else
|
||||
#define XVTDLL __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define XVTDLL __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define XVTDLL
|
||||
#define XVTDLL
|
||||
#endif
|
||||
|
||||
#define XVAGA 1
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Agreement with XVT Software.
|
||||
*
|
||||
* $RCSfile: xvt_defs.h,v $
|
||||
* $Revision: 1.7 $
|
||||
* $Revision: 1.8 $
|
||||
*
|
||||
* Purpose: Global XVT macro definitions.
|
||||
*
|
||||
@ -185,7 +185,7 @@
|
||||
---------------------------------------------------------------------------*/
|
||||
#define CURSOR_ARROW 0 /* arrow */
|
||||
#define CURSOR_IBEAM 1 /* I-beam */
|
||||
#define CURSOR_CROSS 2 /* cross hair */
|
||||
#define CURSOR_CROCE 2 /* cross hair (was CURSOR_CROSS)*/
|
||||
#define CURSOR_PLUS 3 /* plus sign (fatter than cross hair) */
|
||||
#define CURSOR_WAIT 4 /* waiting symbol (e.g., hourglass) */
|
||||
#define CURSOR_HELP 5 /* help system */
|
||||
|
@ -216,7 +216,7 @@ WC_RADIOBUTTON, /* radio button control */
|
||||
WC_CHECKBOX, /* check box control */
|
||||
WC_HSCROLL, /* horizontal scrollbar control */
|
||||
WC_VSCROLL, /* vertical scrollbar control */
|
||||
WC_EDIT, /* edit control */
|
||||
//WC_EDIT, /* edit control */ commentato perche' rompe le scatole
|
||||
WC_TEXT, /* static text control */
|
||||
WC_LBOX, /* list box control */
|
||||
WC_LISTBUTTON, /* button with list */
|
||||
@ -225,8 +225,7 @@ WC_LISTEDIT, /* edit with field list */
|
||||
WC_GROUPBOX, /* group box */
|
||||
WC_TEXTEDIT, /* text edit object */
|
||||
WC_ICON, /* icon control */
|
||||
|
||||
WO_TE, /* text edit */
|
||||
WO_TE /* text edit */
|
||||
} WIN_TYPE;
|
||||
|
||||
typedef enum {
|
||||
|
@ -552,13 +552,13 @@ void TwxPDFDC::DoDrawSpline( wxList *points )
|
||||
double a, b, c, d, x1, y1, x2, y2, x3, y3;
|
||||
wxPoint *p, *q;
|
||||
|
||||
wxNode *node = points->First();
|
||||
p = (wxPoint *)node->Data();
|
||||
wxNode *node = points->GetFirst();
|
||||
p = (wxPoint *)node->GetData();
|
||||
x1 = p->x;
|
||||
y1 = p->y;
|
||||
|
||||
node = node->Next();
|
||||
p = (wxPoint *)node->Data();
|
||||
node = node->GetNext();
|
||||
p = (wxPoint *)node->GetData();
|
||||
c = p->x;
|
||||
d = p->y;
|
||||
x3 = a = (double)(x1 + c) / 2;
|
||||
@ -571,9 +571,9 @@ void TwxPDFDC::DoDrawSpline( wxList *points )
|
||||
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
|
||||
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
|
||||
|
||||
while ((node = node->Next()) != NULL)
|
||||
while ((node = node->GetNext()) != NULL)
|
||||
{
|
||||
q = (wxPoint *)node->Data();
|
||||
q = (wxPoint *)node->GetData();
|
||||
|
||||
x1 = x3;
|
||||
y1 = y3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user