Patch level : 2.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Aggiunto supporto per il file c:\campo.stp contenente la lista delle installazioni.
Eliminato uso delle #define DOS e FOXPRO
Risolto il problema di scrollig delle anteprime di stampa


git-svn-id: svn://10.65.10.50/trunk@11087 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-05-07 13:06:50 +00:00
parent be28bb1345
commit dad5cc319a
12 changed files with 162 additions and 306 deletions

View File

@ -33,7 +33,7 @@ public:
void TInfo_mask::add_row(const char* prompt, const char* value) void TInfo_mask::add_row(const char* prompt, const char* value)
{ {
const int MASK_WIDTH = 72; const int MASK_WIDTH = 76;
const int PROMPT_WIDTH = 12; const int PROMPT_WIDTH = 12;
TString val(value); TString val(value);
@ -107,12 +107,12 @@ TInfo_mask::TInfo_mask()
add_row(TR("Protezione"), prot); add_row(TR("Protezione"), prot);
add_row(TR("Programma"), arg); add_row(TR("Programma"), arg);
add_row(TR("Utente"), user()); add_row(TR("Utente"), user());
add_row(TR("Config"), CGetPrawinName()); add_row(TR("Config"), CGetCampoIni());
add_row(TR("Studio"), firm2dir(-1)); add_row(TR("Studio"), firm2dir(-1));
add_row(TR("Ditta"), firm.codice()); add_row(TR("Ditta"), firm.codice());
add_row(TR("Valuta"), firm.codice_valuta()); add_row(TR("Valuta"), firm.codice_valuta());
add_row(TR("Stampante"), stampante); add_row(TR("Stampante"), stampante);
add_row(TR("Mb su disco"), xvt_fsys_get_disk_free_space("c:/", 'M')); add_row(TR("Mb su disco"), xvt_fsys_get_disk_free_space(firm2dir(-1), 'M'));
add_button(DLG_OK, 0, "", -11, -1, 10, 2); add_button(DLG_OK, 0, "", -11, -1, 10, 2);
} }

View File

@ -1,7 +1,7 @@
#ifndef __CCOMMON_H #ifndef __CCOMMON_H
#define __CCOMMON_H #define __CCOMMON_H
#ifdef DOS #ifdef WIN32
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#define _NO_STDIO #define _NO_STDIO
@ -43,7 +43,7 @@
#define CHR(c) (c) #define CHR(c) (c)
#define ORD(c) (c) #define ORD(c) (c)
#define ODD(c) (((c) % 2) != 0) #define ODD(c) (((c) % 2) != 0)
#ifdef DOS #ifdef WIN32
/* @(!) 2.3.01.316 modif. #define TMPFNAME(p,n) sprintf(p, "\\tmp\\%s.tmp", (n)); */ /* @(!) 2.3.01.316 modif. #define TMPFNAME(p,n) sprintf(p, "\\tmp\\%s.tmp", (n)); */
#define TMPFNAME(p,n) tmpfname((p),(n)) #define TMPFNAME(p,n) tmpfname((p),(n))
/* @(:) 2.3.01.316 */ /* @(:) 2.3.01.316 */
@ -112,7 +112,7 @@ extern "C" {
int CIOResult(void ); int CIOResult(void );
#ifdef DOS #ifdef WIN32
void tmpfname(char *,char *); void tmpfname(char *,char *);
#endif #endif
/* @(:) 2.3.01.316 */ /* @(:) 2.3.01.316 */

View File

@ -2,11 +2,11 @@
#include "checks.h" #include "checks.h"
#ifdef DOS #ifdef WIN32
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#include <sys/stat.h> #include <sys/stat.h>
#ifndef DOS #ifdef LINUX
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/sem.h> #include <sys/sem.h>
#include <unistd.h> #include <unistd.h>
@ -21,7 +21,7 @@
#define CalcPos(Rec, Len, Base) (((Rec) - 1) * ((RecNoType) (Len)) + ((RecNoType) (Base))) #define CalcPos(Rec, Len, Base) (((Rec) - 1) * ((RecNoType) (Len)) + ((RecNoType) (Base)))
#define LOCK_OFF 1200000000L #define LOCK_OFF 1200000000L
#ifndef DOS #ifdef LINUX
#define LOCKSEM "locksem" #define LOCKSEM "locksem"
/* extern long lseek(int, long, int);*/ /* extern long lseek(int, long, int);*/
@ -31,38 +31,13 @@ extern int lockf(int, int, long);
unsigned setlock(unsigned); unsigned setlock(unsigned);
int seeklk(SecDef *, long, unsigned, unsigned, long); int seeklk(SecDef *, long, unsigned, unsigned, long);
#ifndef DOS #ifdef LINUX
int semtran(char *); int semtran(char *);
static void semcall(int, int); static void semcall(int, int);
void PS(int); void PS(int);
void VS(int); void VS(int);
#endif #endif
/*
BOOLEAN test_share()
{
#ifdef DOS
static BOOLEAN share_active = 2;
if (share_active == 2)
{
share_active = CGetAut(MUAUT);
if (share_active)
{
int f = open("net.ini", O_RDONLY, SH_DENYNO, S_IREAD);
share_active = f != -1;
if (f != -1) close(f);
}
}
return share_active;
#else
return TRUE;
#endif
}
*/
/* /*
@($) setlock CUSTIO @($) setlock CUSTIO
@ -89,7 +64,7 @@ unsigned setlock(LockMode)
int lm; int lm;
LockMode &= RecLockTypes ; LockMode &= RecLockTypes ;
#ifdef DOS #ifdef WIN32
if (LockMode == ShareLock) lm = _LK_NBRLCK ; if (LockMode == ShareLock) lm = _LK_NBRLCK ;
else else
if (LockMode == Lock) lm = _LK_NBRLCK ; if (LockMode == Lock) lm = _LK_NBRLCK ;
@ -127,7 +102,7 @@ int seeklk(S, pos, lm, LockMode, rec)
{ {
if (LockMode != NoLock && S->LockMode != ExclLock) if (LockMode != NoLock && S->LockMode != ExclLock)
{ {
#ifdef DOS #ifdef WIN32
/* if (test_share()) */ /* if (test_share()) */
{ {
if (_lseek(S->F, LOCK_OFF + rec, SEEK_SET) == -1L) if (_lseek(S->F, LOCK_OFF + rec, SEEK_SET) == -1L)
@ -150,7 +125,7 @@ int seeklk(S, pos, lm, LockMode, rec)
if ((S->IOR = CIOResult()) != NoErr) return(-1) ; if ((S->IOR = CIOResult()) != NoErr) return(-1) ;
#endif #endif
} }
#ifdef DOS #ifdef WIN32
if (_lseek(S->F, pos, SEEK_SET) == -1L) if (_lseek(S->F, pos, SEEK_SET) == -1L)
#else #else
if (lseek(S->F, pos, SEEK_SET) == -1L) if (lseek(S->F, pos, SEEK_SET) == -1L)
@ -200,7 +175,7 @@ void CVerify(S, Name)
int junk ; int junk ;
S->IOR = NoErr; S->IOR = NoErr;
#ifdef DOS #ifdef WIN32
if ((S->F = sopen(Name, O_RDONLY | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE)) == -1) if ((S->F = sopen(Name, O_RDONLY | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE)) == -1)
#else #else
if ((S->F = open(Name, O_RDONLY, 0666)) == -1) if ((S->F = open(Name, O_RDONLY, 0666)) == -1)
@ -237,7 +212,7 @@ void COpen(S, Name, Len, Base, LockMode)
int junk; int junk;
S->IOR = NoErr; S->IOR = NoErr;
#ifdef DOS #ifdef WIN32
if ((S->F = sopen(Name, O_RDWR|O_BINARY, if ((S->F = sopen(Name, O_RDWR|O_BINARY,
/* test_share() && */ LockMode == ExclLock ? SH_DENYRW : /* test_share() && */ LockMode == ExclLock ? SH_DENYRW :
SH_DENYNO, S_IREAD|S_IWRITE)) == -1) SH_DENYNO, S_IREAD|S_IWRITE)) == -1)
@ -281,7 +256,7 @@ void CCreate(S, Name, Len, Base, MaxSec)
int junk; int junk;
S->IOR = NoErr; S->IOR = NoErr;
#ifdef DOS #ifdef WIN32
if ((S->F = sopen(Name, O_RDWR | O_CREAT, SH_DENYNO, S_IREAD | S_IWRITE)) == -1) if ((S->F = sopen(Name, O_RDWR | O_CREAT, SH_DENYNO, S_IREAD | S_IWRITE)) == -1)
#else #else
if ((S->F = open(Name, O_RDWR | O_CREAT, 0666)) == -1) if ((S->F = open(Name, O_RDWR | O_CREAT, 0666)) == -1)
@ -319,7 +294,7 @@ void CChsize(S, Name, Len, Base, MaxSec)
int junk; int junk;
S->IOR = NoErr; S->IOR = NoErr;
#ifdef DOS #ifdef WIN32
if ((S->F = sopen(Name, O_RDWR | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE)) == -1) if ((S->F = sopen(Name, O_RDWR | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE)) == -1)
#else #else
if ((S->F = open(Name, O_RDWR, 0666)) == -1) if ((S->F = open(Name, O_RDWR, 0666)) == -1)
@ -348,7 +323,7 @@ void CClose(S)
{ {
S->IOR = NoErr; S->IOR = NoErr;
#ifdef DOS #ifdef WIN32
if (close(S->F) == -1) S->IOR = CIOResult(); if (close(S->F) == -1) S->IOR = CIOResult();
#else #else
if (S->LockMode == AutoLock) if (S->LockMode == AutoLock)
@ -419,7 +394,7 @@ void CRead(S, RecBuf, Rec, LockMode)
{ {
S->IOR = NoErr; S->IOR = NoErr;
fpos = CalcPos(Rec, S->LenRec, S->BaseFil); fpos = CalcPos(Rec, S->LenRec, S->BaseFil);
#ifndef DOS #ifndef WIN32
if (S->LockMode == AutoLock) if (S->LockMode == AutoLock)
{ {
if (S->lpos != -1) if (S->lpos != -1)
@ -471,7 +446,7 @@ void CWrite(S, RecBuf, Rec, LockMode)
{ {
S->IOR = NoErr; S->IOR = NoErr;
fpos = CalcPos(Rec, S->LenRec, S->BaseFil); fpos = CalcPos(Rec, S->LenRec, S->BaseFil);
#ifndef DOS #ifndef WIN32
if (S->LockMode == AutoLock) if (S->LockMode == AutoLock)
{ {
if (S->lpos != -1) if (S->lpos != -1)
@ -544,7 +519,7 @@ BOOLEAN IRecIsDeleted(RecBuf)
@(FD) @(FD)
@(ISV) @(ISV)
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
*/ */
@ -556,7 +531,7 @@ BOOLEAN ITestLock(err)
return(TESTLOCK(err)) ; return(TESTLOCK(err)) ;
} }
#ifndef DOS #ifdef LINUX
struct lockdata struct lockdata
{ {
int users; int users;
@ -768,7 +743,7 @@ int excllock(name,excl)
int excl; /* se true deve fare il lock ex. altrimenti no */ int excl; /* se true deve fare il lock ex. altrimenti no */
{ {
#ifndef DOS #ifdef LINUX
char path[200], dir[200]; char path[200], dir[200];
int fd, junk, sid; int fd, junk, sid;
extern int errno; extern int errno;
@ -860,7 +835,7 @@ int exclunlock(name,excl)
int excl; /* se true esegue un unlock sul file */ int excl; /* se true esegue un unlock sul file */
{ {
#ifndef DOS #ifdef LINUX
int fd, junk, sid; int fd, junk, sid;
char path[200]; char path[200];

View File

@ -1,7 +1,7 @@
#ifndef __CCUSTIO_H #ifndef __CCUSTIO_H
#define __CCUSTIO_H #define __CCUSTIO_H
#ifndef DOS #ifdef LINUX
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#endif #endif
@ -45,7 +45,7 @@ typedef struct {
/* @(:) 2.3.01.325 */ /* @(:) 2.3.01.325 */
} SecDef ; } SecDef ;
#ifdef DOS #ifdef WIN32
#define TESTLOCK(x) ((x) == 13 || (x) == 11) #define TESTLOCK(x) ((x) == 13 || (x) == 11)
#define DEADLOCK(x) ((x) == EDEADLOCK) #define DEADLOCK(x) ((x) == EDEADLOCK)
#else #else
@ -54,7 +54,7 @@ typedef struct {
#endif #endif
#define BLOCKEXT(len,rec) (((((RecNoType) (len)) * ((RecNoType) (rec))) / BlockLenIO) + 1) #define BLOCKEXT(len,rec) (((((RecNoType) (len)) * ((RecNoType) (rec))) / BlockLenIO) + 1)
#ifdef DOS #ifdef WIN32
#pragma pack() #pragma pack()
#endif #endif
@ -78,7 +78,7 @@ extern "C" {
/* @(!) 2.3.01.325 modificata int exclunlock(char *,BOOLEAN);*/ /* @(!) 2.3.01.325 modificata int exclunlock(char *,BOOLEAN);*/
int excllock(char *,int); int excllock(char *,int);
int exclunlock(char *,int); int exclunlock(char *,int);
int sleep_dos(int); // int sleep_dos(int); // Killed by Guy
/* @(:) 2.3.01.325 */ /* @(:) 2.3.01.325 */
BOOLEAN test_share(void); BOOLEAN test_share(void);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1,16 +1,9 @@
#define __CFILES_C /* fv */ #define __CFILES_C /* fv */
#include <xvt.h> #include <xvt.h>
#include <checks.h>
#include "cfiles.h" #include "cfiles.h"
#include "fldtypes.h"
int hashfun(const char *);
void setdec(char *, int);
const char* prefname();
BOOLEAN dispferr = 1;
int dirfl[2] = {0, 0}, recfl[2] = {0, 0} ; int dirfl[2] = {0, 0}, recfl[2] = {0, 0} ;
PathSt __ptprf = ""; // Nome della directory con lo studio corrente PathSt __ptprf = ""; // Nome della directory con lo studio corrente
@ -24,7 +17,7 @@ PathSt __ptprf = ""; // Nome della directory con lo studio corrente
@(ISV) @(ISV)
name = percorso per il file di direttorio. name = percorso per il file di direttorio.
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
@(IN) @(IN)
@ -45,7 +38,11 @@ void COpenDir(lockmode, dirflg)
strcpy(name, CInsPref(directory, dirflg)) ; strcpy(name, CInsPref(directory, dirflg)) ;
COpen(&fdir[dirflg], name, sizeof(FileDes), 0, lockmode) ; COpen(&fdir[dirflg], name, sizeof(FileDes), 0, lockmode) ;
if (fdir[dirflg].IOR != NoErr) if (fdir[dirflg].IOR != NoErr)
fatal_box("Can't open Directory. Error number : %d (%s)", fdir[dirflg].IOR,name); {
char msg[256];
sprintf(msg, "Can't open Directory. Error number : %d (%s)", fdir[dirflg].IOR,name);
xvt_dm_post_fatal_exit(msg);
}
} }
/* /*
@ -56,7 +53,7 @@ void COpenDir(lockmode, dirflg)
@(FD) @(FD)
@(ISV) @(ISV)
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
@(IN) @(IN)
@ -66,11 +63,9 @@ void COpenDir(lockmode, dirflg)
@(FN) @(FN)
*/ */
void CCloseDir(dirflg) void CCloseDir(int dirflg) /* flag per file comuni */
int dirflg; /* flag per file comuni */
{ {
#ifndef DOS #ifdef LINUX
exclunlock(CInsPref(glockname, dirflg), (fdir[dirflg].LockMode == ExclLock)); exclunlock(CInsPref(glockname, dirflg), (fdir[dirflg].LockMode == ExclLock));
#endif #endif
if (dirfl[dirflg]) dirfl[dirflg]--; if (dirfl[dirflg]) dirfl[dirflg]--;
@ -91,7 +86,7 @@ void CCloseDir(dirflg)
w = descrittore finestra di attesa. w = descrittore finestra di attesa.
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
@(IN) @(IN)
@ -115,7 +110,11 @@ void COpenFile(logicname,filed,lockmode,dirflg)
CRead(&fdir[dirflg],(RecType) filed,(long) logicname, lockmode); CRead(&fdir[dirflg],(RecType) filed,(long) logicname, lockmode);
if (TESTLOCK(fdir[dirflg].IOR)) if (TESTLOCK(fdir[dirflg].IOR))
message_box("Sono in attesa della directory n.ro %d", logicname); {
char msg[256];
sprintf(msg, "Sono in attesa della directory n.ro %d", logicname);
xvt_dm_post_message(msg);
}
} while TESTLOCK(fdir[dirflg].IOR) ; } while TESTLOCK(fdir[dirflg].IOR) ;
strcpy(filed->SysName, CAddPref(filed->SysName)) ; strcpy(filed->SysName, CAddPref(filed->SysName)) ;
} }
@ -174,7 +173,7 @@ void CCloseFile(logicname,filed,dirflg)
w = descrittore finestra di attesa. w = descrittore finestra di attesa.
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
@(IN) @(IN)
@ -195,7 +194,12 @@ void CGetFile(logicname,filed,lockmode,dirflg)
{ {
CRead(&fdir[dirflg],(RecType) filed,(long) logicname, lockmode); CRead(&fdir[dirflg],(RecType) filed,(long) logicname, lockmode);
if (TESTLOCK(fdir[dirflg].IOR)) if (TESTLOCK(fdir[dirflg].IOR))
message_box("Sono in attesa della directory n.ro %d", logicname); {
char msg[256];
sprintf(msg, "Sono in attesa della directory n.ro %d", logicname);
xvt_dm_post_message(msg);
}
} }
while TESTLOCK(fdir[dirflg].IOR) ; while TESTLOCK(fdir[dirflg].IOR) ;
} }
@ -263,7 +267,7 @@ void zerofdes(d)
@(ISV) @(ISV)
name = nome dell'archivio dei Tracciati Record. name = nome dell'archivio dei Tracciati Record.
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
@(IN) @(IN)
@ -284,7 +288,11 @@ void COpenRecDir(lockmode,dirflg)
strcpy(name, CInsPref(ntrrec, dirflg)) ; strcpy(name, CInsPref(ntrrec, dirflg)) ;
COpen(&rdir[dirflg], name, sizeof(RecDes), 0, lockmode) ; COpen(&rdir[dirflg], name, sizeof(RecDes), 0, lockmode) ;
if (rdir[dirflg].IOR != NoErr) if (rdir[dirflg].IOR != NoErr)
fatal_box("Can't open record description file. Error number : %d (%s)", rdir[dirflg].IOR,name); {
char msg[256];
sprintf(msg, "Can't open record description file. Error number : %d (%s)", rdir[dirflg].IOR,name);
xvt_dm_post_fatal_exit(msg);
}
} }
@ -353,8 +361,7 @@ void CPutRec(logicname,recd,dirflg)
} }
/* /*
@($) CGetCampoIni FILES
@($) prefname FILES
@(ID) @(ID)
Restituisce il nome del file che contiene il prefisso corrente. Restituisce il nome del file che contiene il prefisso corrente.
@ -363,59 +370,74 @@ void CPutRec(logicname,recd,dirflg)
@(ISV) @(ISV)
s,s1 = stringhe di lavoro. s,s1 = stringhe di lavoro.
Versione DOS e XENIX. Versione WIN32 e LINUX.
@(FSV) @(FSV)
*/ */
const char* CGetCampoIni(void)
HIDDEN const char* prefname()
{
static char* s = NULL;
if (s == NULL)
{
#ifdef DOS
char *s1 = getenv("PREFPATH");
if (s1 == NULL)
s1 = "campo.ini";
s = strdup(s1);
#else
s = malloc(32);
sprintf(s, "campo%u.ini", getuid());
#endif
}
return s;
}
#ifdef DOS
const char* CGetPrawinName(void)
{ {
static char* prawin = NULL; static char* prawin = NULL;
if (prawin == NULL) if (prawin == NULL)
{ {
char drive[_MAX_DRIVE]; char exedir[_MAX_PATH], path[_MAX_PATH];
char path[_MAX_PATH]; DIRECTORY dir;
char tmp[_MAX_PATH]; BOOLEAN bFound = FALSE;
_splitpath(prefname(), drive, path, NULL, NULL); xvt_fsys_get_dir(&dir);
_makepath(tmp, drive, path, "campo", ".ini"); xvt_fsys_convert_dir_to_str(&dir, exedir, sizeof(exedir));
if (access(tmp, 0) != 0) // se non esiste ... #ifdef WIN32
// Nelle installazioni sfigate con programmi in rete cerca di stabilire il percorso locale di Campo.ini
if (xvt_fsys_is_network_drive(exedir))
{ {
FILE* pw = fopen(tmp, "w"); // ... lo creo int p;
fclose(pw); for (p = 1; ; p++)
{
int len = 0;
char para[4]; sprintf(para, "%d", p);
len = xvt_sys_get_profile_string("c:/campo.stp", para, "Program", "", path, sizeof(path));
if (len <= 0)
break;
if (path[len-1] == '\\' || path[len-1] == '/')
{
len--;
path[len] = '\0';
}
if (xvt_str_compare_ignoring_case(path, exedir) == 0)
{
xvt_sys_get_profile_string("c:/campo.stp", para, "CampoIni", "", path, sizeof(path));
bFound = TRUE;
break;
}
}
if (!bFound)
{
const char* pp = getenv("PREFPATH");
if (pp != NULL)
{
char dri[_MAX_DRIVE], dir[_MAX_PATH];
xvt_fsys_parse_pathname(pp, dri, dir, NULL, NULL, NULL);
xvt_fsys_build_pathname(path, dri, dir, "campo", "ini", NULL);
bFound = TRUE;
}
}
} }
prawin = malloc(_MAX_PATH); #endif
if (*path) if (!bFound)
strcpy(prawin,tmp); {
else #ifdef LINUX
_searchenv(tmp, NULL, prawin); char ininame[32];
sprintf(ininame, "campo%u", getuid());
xvt_fsys_build_pathname(path, NULL, exedir, ininame, "ini", NULL);
#else
xvt_fsys_build_pathname(path, NULL, exedir, "campo", "ini", NULL);
#endif
}
prawin = xvt_str_duplicate(path);
} }
return prawin; return prawin;
} }
HIDDEN BOOLEAN CGetPrawin() HIDDEN BOOLEAN CGetFirmDir()
{ {
const char* prawin = CGetPrawinName(); const char* prawin = CGetCampoIni();
BOOLEAN good = _access(prawin, 0x00) == 0; BOOLEAN good = _access(prawin, 0x00) == 0;
if (good) if (good)
{ {
@ -442,16 +464,14 @@ HIDDEN BOOLEAN CGetPrawin()
return good; return good;
} }
BOOLEAN CPutPrawin(const char* pref) BOOLEAN CPutFirmDir(const char* pref)
{ {
const char* prawin = CGetPrawinName(); const char* prawin = CGetCampoIni();
BOOLEAN good = xvt_sys_set_profile_string(prawin, "Main", "Firm", pref); BOOLEAN good = xvt_sys_set_profile_string(prawin, "Main", "Firm", pref);
xvt_sys_set_profile_string(prawin, "Main", "Study", __ptprf); xvt_sys_set_profile_string(prawin, "Main", "Study", __ptprf);
return good; return good;
} }
#endif
/* /*
@(#) CGetPref FILES @(#) CGetPref FILES
@ -472,10 +492,10 @@ BOOLEAN CPutPrawin(const char* pref)
const char* CGetPref() const char* CGetPref()
{ {
if (!CGetPrawin()) if (!CGetFirmDir())
{ {
strcpy(cprefix, "COM"); strcpy(cprefix, "COM");
CPutPrawin(cprefix); CPutFirmDir(cprefix);
} }
return cprefix; return cprefix;
} }
@ -501,7 +521,7 @@ const char* CGetPref()
void CPutPref(const char* pref) /* stringa contenente il nuovo prefisso */ void CPutPref(const char* pref) /* stringa contenente il nuovo prefisso */
{ {
CPutPrawin(pref); CPutFirmDir(pref);
} }
/* /*

View File

@ -76,7 +76,7 @@ SecDef rdir[2], fdir[2];
extern SecDef rdir[2], fdir[2]; extern SecDef rdir[2], fdir[2];
#endif #endif
#if XVT_OS == XVT_OS_WIN || XVT_OS_WIN32 #ifdef WIN32
#pragma pack() #pragma pack()
#endif #endif
@ -106,7 +106,7 @@ extern "C" {
/* @(!) 2.3.01.144 */ /* @(!) 2.3.01.144 */
char *CInsPref(char *, int); char *CInsPref(char *, int);
const char* CGetPrawinName(void); const char* CGetCampoIni(void);
#ifdef __cplusplus #ifdef __cplusplus
}; };

View File

@ -12,9 +12,7 @@
(S4FOX, S4MDX ecc.); nel caso si faccia uso della DLL non importa quale si e' definito. (S4FOX, S4MDX ecc.); nel caso si faccia uso della DLL non importa quale si e' definito.
E' importante solo in caso di utilizzo di una static Library. E' importante solo in caso di utilizzo di una static Library.
Per costruire l'aga.fll e' necessario togliere le funzioni progind* e definire S4DLL. */
*/
#define XVT_INCL_NATIVE #define XVT_INCL_NATIVE
#include <xvt.h> #include <xvt.h>
@ -33,11 +31,6 @@
#define S4WIN32 #define S4WIN32
#endif #endif
#ifdef FOXPRO
#define S4DLL
#define S4WIN16
#endif
#include <d4all.h> #include <d4all.h>
#include <codeb.h> #include <codeb.h>
@ -650,9 +643,7 @@ int DB_packfile(short vis, const char * filename, long eod)
{ {
strcpy(s,"Compattamento dati file : "); strcpy(s,"Compattamento dati file : ");
strcat(s,(char*)filename); strcat(s,(char*)filename);
#ifndef FOXPRO
progind_create(100L,s,0,0,60); progind_create(100L,s,0,0,60);
#endif
} }
if (eod < d4recCount(dbdata[handle])) if (eod < d4recCount(dbdata[handle]))
{ {
@ -660,11 +651,7 @@ int DB_packfile(short vis, const char * filename, long eod)
} else } else
rt=d4pack(dbdata[handle]); rt=d4pack(dbdata[handle]);
if (vis) if (vis)
{
#ifndef FOXPRO
progind_destroy(); progind_destroy();
#endif
}
DB_close(handle); DB_close(handle);
} }
else else
@ -690,17 +677,11 @@ int DB_packmemo(short vis, const char * filename)
{ {
strcpy(s,"Compattamento memo file : "); strcpy(s,"Compattamento memo file : ");
strcat(s,(char*)filename); strcat(s,(char*)filename);
#ifndef FOXPRO
progind_create(100L,s,0,0,60); progind_create(100L,s,0,0,60);
#endif
} }
rt=d4memoCompress(dbdata[handle]); rt=d4memoCompress(dbdata[handle]);
if (vis) if (vis)
{
#ifndef FOXPRO
progind_destroy(); progind_destroy();
#endif
}
DB_close(handle); DB_close(handle);
} }
else else
@ -736,10 +717,8 @@ int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
t = d4tagDefault(dbdata[handle]); t = d4tagDefault(dbdata[handle]);
lt = expr4len(t->tagFile->expr); lt = expr4len(t->tagFile->expr);
l = lt - 9; l = lt - 9;
#ifndef FOXPRO if (vis)
if (vis) progind_create(items,"Ricerca record duplicati",0,1,60);
progind_create(items,"Ricerca record duplicati",0,1,60);
#endif
rt = tfile4bottom(t->tagFile); rt = tfile4bottom(t->tagFile);
@ -747,10 +726,8 @@ int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
{ {
strncpy(s0, a4tagKey(dbdata[handle]), lt); strncpy(s0, a4tagKey(dbdata[handle]), lt);
#ifndef FOXPRO
if (vis) if (vis)
progind_set_status(++cnt); progind_set_status(++cnt);
#endif
if (!strncmp(s, s0, l)) if (!strncmp(s, s0, l))
{ {
@ -764,10 +741,8 @@ int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
} // while } // while
rt = code_base.errorCode; rt = code_base.errorCode;
#ifndef FOXPRO if (vis)
if (vis) progind_destroy();
progind_destroy();
#endif
i4close(w); i4close(w);
return rt; return rt;
@ -792,23 +767,19 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
{ {
int i; int i;
char *ff = find_slash_backslash((char *)filename); char *ff = find_slash_backslash((char *)filename);
#ifndef FOXPRO
if (vis) if (vis)
progind_create((long)r->NKeys,s,0,1,60); progind_create((long)r->NKeys,s,0,1,60);
#endif
if ((ff == NULL) || *ff == '\0') if ((ff == NULL) || *ff == '\0')
ff = (char *)filename; ff = (char *)filename;
else else
ff++; ff++;
do_key(ff,r,tags, r->NKeys); do_key(ff,r,tags, r->NKeys);
w = i4create(dbdata[handle],NULL,tags); w = i4create(dbdata[handle],NULL,tags);
#ifndef FOXPRO
if (vis) if (vis)
{ {
progind_set_status((long)r->NKeys); progind_set_status((long)r->NKeys);
progind_destroy(); progind_destroy();
} }
#endif
if (w == NULL) rt = code_base.errorCode; if (w == NULL) rt = code_base.errorCode;
if (rt == e4unique || rt == r4unique) if (rt == e4unique || rt == r4unique)
{ {
@ -819,19 +790,15 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
tags[0].unique = r4unique_continue; tags[0].unique = r4unique_continue;
if (rt == 0) if (rt == 0)
{ {
#ifndef FOXPRO
if (vis) if (vis)
progind_create((long)r->NKeys,s,0,1,60); progind_create((long)r->NKeys,s,0,1,60);
#endif
w = i4create(dbdata[handle],(char*)filename,tags); w = i4create(dbdata[handle],(char*)filename,tags);
if (w == NULL) rt = code_base.errorCode; if (w == NULL) rt = code_base.errorCode;
#ifndef FOXPRO
if (vis) if (vis)
{ {
progind_set_status((long)r->NKeys); progind_set_status((long)r->NKeys);
progind_destroy(); progind_destroy();
} }
#endif
} }
} }
if (rt == 0) if (rt == 0)
@ -1248,11 +1215,6 @@ int DB_memowrite( const int handle, const char * fieldname, const char * data )
#endif #endif
#endif #endif
#ifdef FOXPRO
#undef S4UNIX
#define S4DLL
#endif
#include <d4all.h> #include <d4all.h>
#include <codeb.h> #include <codeb.h>
@ -1938,9 +1900,7 @@ int DB_packfile(short vis, const char * filename, long eod)
{ {
strcpy(s, "Compattamento dati file : "); strcpy(s, "Compattamento dati file : ");
strcat(s, filename); strcat(s, filename);
#ifndef FOXPRO
progind_create(100L,s,0,0,60); progind_create(100L,s,0,0,60);
#endif
} }
if (eod < d4reccount(dbdata[handle])) if (eod < d4reccount(dbdata[handle]))
{ {
@ -1948,10 +1908,7 @@ int DB_packfile(short vis, const char * filename, long eod)
} else } else
rt=d4pack(dbdata[handle]); rt=d4pack(dbdata[handle]);
if (vis) if (vis)
{
#ifndef FOXPRO
progind_destroy(); progind_destroy();
#endif
} }
DB_close(handle); DB_close(handle);
} }
@ -1978,17 +1935,11 @@ int DB_packmemo(short vis, const char * filename)
{ {
strcpy(s,"Compattamento memo file : "); strcpy(s,"Compattamento memo file : ");
strcat(s,(char*)filename); strcat(s,(char*)filename);
#ifndef FOXPRO
progind_create(100L,s,0,0,60); progind_create(100L,s,0,0,60);
#endif
} }
rt=d4memo_compress(dbdata[handle]); rt=d4memo_compress(dbdata[handle]);
if (vis) if (vis)
{
#ifndef FOXPRO
progind_destroy(); progind_destroy();
#endif
}
DB_close(handle); DB_close(handle);
} }
else else
@ -2024,10 +1975,8 @@ int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
t = d4tag_default(dbdata[handle]); t = d4tag_default(dbdata[handle]);
lt = expr4key_len(t->expr); lt = expr4key_len(t->expr);
l = lt - 9; l = lt - 9;
#ifndef FOXPRO if (vis)
if (vis) progind_create(items,"Ricerca record duplicati",0,1,60);
progind_create(items,"Ricerca record duplicati",0,1,60);
#endif
rt = t4bottom(t); rt = t4bottom(t);
@ -2035,10 +1984,8 @@ int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
{ {
strncpy(s0, t4key(t), lt); strncpy(s0, t4key(t), lt);
#ifndef FOXPRO
if (vis) if (vis)
progind_set_status(++cnt); progind_set_status(++cnt);
#endif
if (!strncmp(s, s0, l)) if (!strncmp(s, s0, l))
{ {
@ -2052,10 +1999,8 @@ int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
} // while } // while
rt = code_base.error_code; rt = code_base.error_code;
#ifndef FOXPRO if (vis)
if (vis) progind_destroy();
progind_destroy();
#endif
i4close(w); i4close(w);
return rt; return rt;
@ -2081,23 +2026,19 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
{ {
int i; int i;
char *ff = find_slash_backslash((char *)filename); char *ff = find_slash_backslash((char *)filename);
#ifndef FOXPRO
if (vis) if (vis)
progind_create((long)r->NKeys,s,0,1,60); progind_create((long)r->NKeys,s,0,1,60);
#endif
if ((ff == NULL) || *ff == '\0') if ((ff == NULL) || *ff == '\0')
ff = (char *)filename; ff = (char *)filename;
else else
ff++; ff++;
do_key(ff,r,tags, r->NKeys); do_key(ff,r,tags, r->NKeys);
w = i4create(dbdata[handle],NULL,tags); w = i4create(dbdata[handle],NULL,tags);
#ifndef FOXPRO
if (vis) if (vis)
{ {
progind_set_status((long)r->NKeys); progind_set_status((long)r->NKeys);
progind_destroy(); progind_destroy();
} }
#endif
if (w == NULL) rt = code_base.error_code; if (w == NULL) rt = code_base.error_code;
if (rt == e4unique || rt == r4unique) if (rt == e4unique || rt == r4unique)
{ {
@ -2108,19 +2049,15 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
tags[0].unique = r4unique_continue; tags[0].unique = r4unique_continue;
if (rt == 0) if (rt == 0)
{ {
#ifndef FOXPRO
if (vis) if (vis)
progind_create((long)r->NKeys,s,0,1,60); progind_create((long)r->NKeys,s,0,1,60);
#endif
w = i4create(dbdata[handle],(char*)filename,tags); w = i4create(dbdata[handle],(char*)filename,tags);
if (w == NULL) rt = code_base.error_code; if (w == NULL) rt = code_base.error_code;
#ifndef FOXPRO
if (vis) if (vis)
{ {
progind_set_status((long)r->NKeys); progind_set_status((long)r->NKeys);
progind_destroy(); progind_destroy();
} }
#endif
} }
} }
if (rt == 0) if (rt == 0)

View File

@ -757,7 +757,7 @@ TConfig::TConfig(int which_config, const char* paragraph)
_file = "fconv.ini"; _file = "fconv.ini";
break; break;
case CONFIG_INSTALL: case CONFIG_INSTALL:
_file = CGetPrawinName(); _file = CGetCampoIni();
break; break;
case CONFIG_GODMODE: case CONFIG_GODMODE:
_file = firm2dir(0); _file = firm2dir(0);

View File

@ -5,18 +5,7 @@
#include <extctype.h> #include <extctype.h>
#endif #endif
/* @(:) 2.3.01.178 */ /* @DES Funzioni C esterne. */
#define MAXCKEY 5
#define MAXCLEN 10
#define MAXENTRYNAME 16
#define MAXTENTRY 48
/* @(!) 2.3.01.temp */
#define MAXENTRYSIZE 4096
/* @(:) 2.3.01.temp */
#define MAXDISPCOLS 4
#define CONFFILE "conf.gen"
/* @DES Funzioni C esterne. Sorgenti in /disk1/p.uno */
extern "C" { extern "C" {
@ -67,8 +56,8 @@ extern "C" {
void CPutRec(int, RecDes *, int); void CPutRec(int, RecDes *, int);
void zerordes(RecDes *); void zerordes(RecDes *);
word setrdes(RecDes *); word setrdes(RecDes *);
const char* CGetPrawinName(void);
char *CAddPref(char *); char *CAddPref(char *);
const char* CGetCampoIni(void);
const char* CGetPref(void); const char* CGetPref(void);
void CPutPref(const char *); void CPutPref(const char *);
char *CInsPref(char *, int); char *CInsPref(char *, int);

View File

@ -1556,9 +1556,6 @@ bool TPrinter::set()
mask.set_handler(MSK_PRINTERS, set_windows_print_device); mask.set_handler(MSK_PRINTERS, set_windows_print_device);
mask.set_handler(MSK_FONT, font_handler); mask.set_handler(MSK_FONT, font_handler);
// if (!_multiple_copies)
// mask.hide(MSK_NPAGES);
if (_printertype == fileprinter) if (_printertype == fileprinter)
mask.set (MSK_TYPE, "1"); mask.set (MSK_TYPE, "1");
else if (_printertype == screenvis) else if (_printertype == screenvis)
@ -1574,7 +1571,7 @@ bool TPrinter::set()
memcpy(oldrcd.get_buffer(), rcd, old_rcd_size); memcpy(oldrcd.get_buffer(), rcd, old_rcd_size);
KEY k; KEY k;
while ((k = mask.run ()) != K_ESC && k != K_ENTER && k != K_INS) while ((k = mask.run()) != K_ESC && k != K_ENTER && k != K_INS)
{ {
if (k == DLG_SETPRINT) if (k == DLG_SETPRINT)
{ {

View File

@ -21,9 +21,6 @@ int PRINT_HEIGHT = 10;
#define TEXTROWS (rows() - Y_OFFSET - BUTTONROW_SIZE) #define TEXTROWS (rows() - Y_OFFSET - BUTTONROW_SIZE)
#define TEXTCOLUMNS (columns() - X_OFFSET) #define TEXTCOLUMNS (columns() - X_OFFSET)
// Colore per righelli: perche' distinguere?
// #define BACKGROUND (_toplevel ? MASK_BACK_COLOR : COLOR_GRAY)
// #define FOREGROUND (_toplevel ? NORMAL_COLOR : COLOR_WHITE)
#define BACKGROUND MASK_BACK_COLOR #define BACKGROUND MASK_BACK_COLOR
#define FOREGROUND NORMAL_COLOR #define FOREGROUND NORMAL_COLOR
@ -247,7 +244,6 @@ void TViswin::exec_link()
set_focus(); set_focus();
_inside_linkexec = TRUE; _inside_linkexec = TRUE;
check_link(); check_link();
_need_update = TRUE;
force_update(); force_update();
do_events(); do_events();
check_link (&_point); check_link (&_point);
@ -638,7 +634,6 @@ void TViswin::open ()
repos_buttons(); repos_buttons();
TScroll_window::open(); TScroll_window::open();
show_buttons(_showbuts); show_buttons(_showbuts);
_need_update = TRUE;
force_update (); force_update ();
} }
@ -1252,45 +1247,34 @@ void TViswin::update ()
erase_point(); erase_point();
autoscroll(FALSE); autoscroll(FALSE);
set_mode(M_COPY); set_mode(M_COPY);
// if (_showbuts)
// { if (!_toplevel)
// set_brush (BACKGROUND); TField_window::update();
// bar ((X_OFFSET-1), rows()-BUTTONROW_SIZE, columns()+1, rows() + 1);
// } check_link();
if (_need_update) if (_isselection)
erase_selection ();
txt_clear(COLOR_WHITE);
set_brush (BACKGROUND);
if (_rulers)
{ {
if (!_toplevel) bar (0, 0, columns() + 1, 1);
TField_window::update(); bar (0, 0, 5, rows() + 1);
check_link();
if (_isselection)
erase_selection ();
txt_clear(COLOR_WHITE);
// set_mode (M_COPY);
set_brush (BACKGROUND);
// autoscroll (FALSE);
if (_rulers)
{
bar (0, 0, columns() + 1, 1);
bar (0, 0, 5, rows() + 1);
}
// if (_showbuts)
// bar ((X_OFFSET -1), rows()-BUTTONROW_SIZE, columns() + 1, rows() + 1); //**
if (_showbuts && _isopen)
paint_waitbar();
else
if (_showbuts) ((TImage&)_modules[4]).draw(win());
autoscroll (TRUE);
paint_screen();
paint_header();
if (_isselection)
display_selection();
} }
if (_showbuts && _isopen)
paint_waitbar();
else
if (_showbuts) ((TImage&)_modules[4]).draw(win());
autoscroll (TRUE);
paint_screen();
paint_header();
if (_isselection)
display_selection();
display_point(); display_point();
check_link(&_point); check_link(&_point);
autoscroll (TRUE); autoscroll (TRUE);
_need_update = TRUE;
_need_scroll = none; _need_scroll = none;
in_update = FALSE; in_update = FALSE;
} }
@ -1333,7 +1317,6 @@ void TViswin::on_button(short dlg)
case DLG_EDIT: case DLG_EDIT:
check_link(); check_link();
call_editor(); call_editor();
_need_update = TRUE;
update(); update();
check_link(&_point); check_link(&_point);
break; break;
@ -1375,10 +1358,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
if (need_paint_sel (FALSE)) if (need_paint_sel (FALSE))
display_selection (); display_selection ();
display_point (); display_point ();
if (_txt.lines () > 1l) force_update ();
_need_update = FALSE;
else
force_update ();
} }
autoscroll (FALSE); autoscroll (FALSE);
_textrows = TEXTROWS; _textrows = TEXTROWS;
@ -1690,7 +1670,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
autoscroll (TRUE); autoscroll (TRUE);
repos_buttons (); repos_buttons ();
display_point (); display_point ();
_need_update = TRUE;
force_update (); force_update ();
do_events (); do_events ();
check_link (&_point); check_link (&_point);
@ -1714,11 +1693,9 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_point.y = new_origin + kdiff; _point.y = new_origin + kdiff;
check_link (); check_link ();
update_thumb (origin ().x, new_origin); update_thumb (origin ().x, new_origin);
_need_update = TRUE;
update (); // ORRIIIBILE! update (); // ORRIIIBILE!
check_link (&_point); check_link (&_point);
_need_update = FALSE;
} }
else scroll_error(-1, 0); else scroll_error(-1, 0);
} }
@ -1732,11 +1709,8 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_point.x = new_origin + kdiff; _point.x = new_origin + kdiff;
check_link (); check_link ();
update_thumb(new_origin, origin().y); update_thumb(new_origin, origin().y);
_need_update = TRUE;
update (); // AAAARGH! update (); // AAAARGH!
check_link (&_point); check_link (&_point);
_need_update = FALSE;
} }
else scroll_error(0, -1); else scroll_error(0, -1);
} }
@ -1744,7 +1718,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
case SC_LINE_UP: case SC_LINE_UP:
if (ep->type == E_VSCROLL) if (ep->type == E_VSCROLL)
{ {
_need_update = FALSE;
if (origin ().y > 0l) if (origin ().y > 0l)
{ {
_point.y--; _point.y--;
@ -1758,7 +1731,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
} }
else else
{ {
_need_update = FALSE;
if (origin ().x > 0l) if (origin ().x > 0l)
{ {
if (need_paint_sel (FALSE)) if (need_paint_sel (FALSE))
@ -1783,11 +1755,9 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_point.y = new_origin + kdiff; _point.y = new_origin + kdiff;
check_link (); check_link ();
update_thumb (origin ().x, new_origin); update_thumb (origin ().x, new_origin);
_need_update = TRUE;
update (); // AAAARGH! update (); // AAAARGH!
check_link (&_point); check_link (&_point);
_need_update = FALSE;
} }
else scroll_error(-1, _txt.lines()-_textrows/*-1*/); else scroll_error(-1, _txt.lines()-_textrows/*-1*/);
} }
@ -1801,11 +1771,9 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_point.x = new_origin + kdiff; _point.x = new_origin + kdiff;
check_link (); check_link ();
update_thumb (new_origin, origin().y); update_thumb (new_origin, origin().y);
_need_update = TRUE;
update (); // AAAARGH! update (); // AAAARGH!
check_link (&_point); check_link (&_point);
_need_update = FALSE;
} }
else scroll_error(255-_textcolumns, -1); else scroll_error(255-_textcolumns, -1);
} }
@ -1813,7 +1781,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
case SC_LINE_DOWN: case SC_LINE_DOWN:
if (ep->type == E_VSCROLL) if (ep->type == E_VSCROLL)
{ {
_need_update = FALSE;
if ((origin().y + _textrows) < _txt.lines ()) if ((origin().y + _textrows) < _txt.lines ())
{ {
if (need_paint_sel ()) if (need_paint_sel ())
@ -1827,7 +1794,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
} }
else else
{ {
_need_update = FALSE;
if ((origin ().x + _textcolumns) < 256) if ((origin ().x + _textcolumns) < 256)
{ {
if (need_paint_sel (FALSE)) if (need_paint_sel (FALSE))
@ -1860,7 +1826,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
origin ().x + kdiff_x; origin ().x + kdiff_x;
_point.y = ep->type == E_HSCROLL ? origin ().y : _point.y = ep->type == E_HSCROLL ? origin ().y :
origin ().y + kdiff_y; origin ().y + kdiff_y;
_need_update = TRUE;
update (); update ();
check_link (&_point); check_link (&_point);
break; break;
@ -1881,8 +1846,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
} }
if (_need_scroll != none) if (_need_scroll != none)
{ {
_need_update = FALSE; const scroll tmp = _need_scroll;
scroll tmp = _need_scroll;
_need_scroll = none; _need_scroll = none;
shift_screen (tmp); shift_screen (tmp);
if (!_selecting) if (!_selecting)
@ -1893,10 +1857,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
if (_isselection) if (_isselection)
display_selection (); display_selection ();
} }
if (ep->type != E_UPDATE || _need_update) TWindow::handler (win, ep);
TWindow::handler (win, ep);
else if (ep->type == E_UPDATE)
update ();
} }
bool TViswin::on_key(KEY key) bool TViswin::on_key(KEY key)
@ -1930,7 +1891,6 @@ bool TViswin::on_key(KEY key)
check_link (); check_link ();
call_editor (); call_editor ();
set_focus (); set_focus ();
_need_update = TRUE;
update (); update ();
check_link (&_point); check_link (&_point);
} }
@ -1946,7 +1906,6 @@ bool TViswin::on_key(KEY key)
stop_run(CTRL_S); stop_run(CTRL_S);
break; break;
case CTRL_R: case CTRL_R:
_need_update = TRUE;
check_link (); check_link ();
force_update (); force_update ();
do_events (); do_events ();
@ -1974,7 +1933,6 @@ bool TViswin::on_key(KEY key)
case K_TAB: case K_TAB:
if (!is_running()) if (!is_running())
{ {
_need_update = TRUE;
update(); update();
} }
else else
@ -1996,20 +1954,14 @@ bool TViswin::on_key(KEY key)
case K_CTRL_ENTER: case K_CTRL_ENTER:
if (_linkID != -1) if (_linkID != -1)
exec_link(); exec_link();
/*
else if (_toplevel)
dispatch_e_char (_button[_curbut], K_SPACE);
*/
break; break;
case K_LHOME: case K_LHOME:
_need_update = TRUE;
update_thumb (0, 0); update_thumb (0, 0);
_point.set (0, 0); _point.set (0, 0);
check_link (&_point); check_link (&_point);
force_update(); force_update();
break; break;
case K_LEND: case K_LEND:
_need_update = TRUE;
update_thumb (0, _txt.lines () - _textrows); update_thumb (0, _txt.lines () - _textrows);
_point.set (0, _txt.lines () - 1); _point.set (0, _txt.lines () - 1);
check_link (&_point); check_link (&_point);
@ -2039,7 +1991,6 @@ bool TViswin::on_key(KEY key)
check_link (); check_link ();
erase_point (); erase_point ();
_isbar = !_isbar; _isbar = !_isbar;
_need_update = TRUE;
force_update (); force_update ();
do_events (); do_events ();
check_link (&_point); check_link (&_point);
@ -2051,7 +2002,6 @@ bool TViswin::on_key(KEY key)
if (PRINT_HEIGHT <= 14) if (PRINT_HEIGHT <= 14)
{ {
PRINT_HEIGHT += 2; PRINT_HEIGHT += 2;
_need_update = TRUE;
force_update(); force_update();
} }
break; break;
@ -2059,7 +2009,6 @@ bool TViswin::on_key(KEY key)
if (PRINT_HEIGHT >= 6) if (PRINT_HEIGHT >= 6)
{ {
PRINT_HEIGHT -= 2; PRINT_HEIGHT -= 2;
_need_update = TRUE;
force_update(); force_update();
} }
default: default:
@ -2101,7 +2050,6 @@ bool TViswin::on_key(KEY key)
break; break;
case K_UP: case K_UP:
case K_SHIFT_UP: case K_SHIFT_UP:
_need_update = FALSE;
if (key == K_SHIFT_UP) if (key == K_SHIFT_UP)
{ {
if (need_paint_sel (FALSE)) if (need_paint_sel (FALSE))
@ -2134,7 +2082,6 @@ bool TViswin::on_key(KEY key)
break; break;
case K_LEFT: case K_LEFT:
case K_SHIFT_LEFT: case K_SHIFT_LEFT:
_need_update = FALSE;
if (_point.x > 0l) if (_point.x > 0l)
{ {
if (key == K_SHIFT_LEFT) if (key == K_SHIFT_LEFT)
@ -2149,7 +2096,6 @@ bool TViswin::on_key(KEY key)
} }
if (_point.x == origin ().x) if (_point.x == origin ().x)
{ {
_need_update = FALSE;
if (need_paint_sel (FALSE)) if (need_paint_sel (FALSE))
erase_selection(); erase_selection();
update_thumb (--_point.x, origin ().y); update_thumb (--_point.x, origin ().y);
@ -2168,7 +2114,6 @@ bool TViswin::on_key(KEY key)
break; break;
case K_DOWN: case K_DOWN:
case K_SHIFT_DOWN: case K_SHIFT_DOWN:
_need_update = FALSE;
if (_point.y < (_txt.lines() - 1)) if (_point.y < (_txt.lines() - 1))
{ {
if (key == K_SHIFT_DOWN) if (key == K_SHIFT_DOWN)
@ -2202,7 +2147,6 @@ bool TViswin::on_key(KEY key)
break; break;
case K_RIGHT: case K_RIGHT:
case K_SHIFT_RIGHT: case K_SHIFT_RIGHT:
_need_update = FALSE;
if (_point.x < 256) if (_point.x < 256)
{ {
if (key == K_SHIFT_RIGHT) if (key == K_SHIFT_RIGHT)
@ -2239,7 +2183,6 @@ bool TViswin::on_key(KEY key)
} }
if (_need_scroll != none) if (_need_scroll != none)
{ {
_need_update = FALSE;
scroll tmp = _need_scroll; scroll tmp = _need_scroll;
_need_scroll = none; _need_scroll = none;
shift_screen (tmp); shift_screen (tmp);
@ -2247,8 +2190,7 @@ bool TViswin::on_key(KEY key)
if (_isselection) if (_isselection)
display_selection (); display_selection ();
check_link (&_point); check_link (&_point);
if (_need_update) force_update(); update();
else update();
} }
break; break;
default: default:
@ -2369,7 +2311,6 @@ void TViswin::close_print ()
_isopen = FALSE; _isopen = FALSE;
if (_showbuts) if (_showbuts)
xvt_timer_destroy (_wtimer); xvt_timer_destroy (_wtimer);
_need_update = TRUE;
if (_toplevel) if (_toplevel)
{ {
xvt_menu_set_item_title(win(), M_VISWIN_QUIT, "Chiudi\tESC"); xvt_menu_set_item_title(win(), M_VISWIN_QUIT, "Chiudi\tESC");
@ -2431,7 +2372,6 @@ void TViswin::goto_pos(
void TViswin::refresh() void TViswin::refresh()
{ {
_need_update = TRUE;
force_update(); force_update();
} }
@ -2574,7 +2514,7 @@ TViswin::TViswin(const char *fname,
_isprint (printbutton), _isbar (FALSE), _istimer (FALSE), _iscross (FALSE), _isprint (printbutton), _isbar (FALSE), _istimer (FALSE), _iscross (FALSE),
_isselection (FALSE), _sel_displayed (FALSE), _cross_displayed (FALSE), _isselection (FALSE), _sel_displayed (FALSE), _cross_displayed (FALSE),
_link_displayed (FALSE), _point_displayed (FALSE), _selecting (FALSE), _link_displayed (FALSE), _point_displayed (FALSE), _selecting (FALSE),
_scrolling (FALSE), _selflag (FALSE), _need_update (TRUE), _need_scroll (none), _scrolling (FALSE), _selflag (FALSE), _need_scroll (none),
_multiple (FALSE), _rulers(rulers), _txt_to_find(64), _multiple (FALSE), _rulers(rulers), _txt_to_find(64),
_frozen (FALSE), _brwfld(brwfld), _link_button(NULL), _print_button(NULL), _frozen (FALSE), _brwfld(brwfld), _link_button(NULL), _print_button(NULL),
_down_dir(TRUE), _showbuts(FALSE), _case_sensitive(FALSE), _down_dir(TRUE), _showbuts(FALSE), _case_sensitive(FALSE),

View File

@ -59,8 +59,6 @@ class TViswin : public TField_window
bool _isbar; bool _isbar;
// @cmember:(INTERNAL) Indica se in corso lo scrolling // @cmember:(INTERNAL) Indica se in corso lo scrolling
bool _scrolling; bool _scrolling;
// @cmember:(INTERNAL) Indica se e' necessario un update completo
bool _need_update;
// @cmember:(INTERNAL) Indica se il timer successivo e' attivo // @cmember:(INTERNAL) Indica se il timer successivo e' attivo
bool _istimer; bool _istimer;
// @cmember:(INTERNAL) Indica se possono arrivare nuove linee // @cmember:(INTERNAL) Indica se possono arrivare nuove linee