git-svn-id: svn://10.65.10.50/branches/R_10_00@23083 c028cbd2-c16b-5b4b-a496-9718f37d4682

This commit is contained in:
guy 2015-05-08 10:16:11 +00:00
parent b46459b21e
commit 1f2b50d0c3
7 changed files with 19 additions and 61 deletions

View File

@ -50,8 +50,8 @@
#define UPCASE(c) toupper(c)
#define LOWCASE(c) tolower(c)
#define LENGTH(s) strlen(s)
#define STREMPTY(s) (!(LENGTH(s)))
#define STRNOTEMPTY(s) (!STREMPTY(s))
#define STREMPTY(s) (!(s && *s))
#define STRNOTEMPTY(s) (s && *s)
#define STRCMP(s1,op,s2) (strcmp(s1,s2) op 0)
#define CSTR(n,s) sprintf((s), "%-d", (n))
#define CSTR4(n,s) sprintf((s), "%-ld", (n))

View File

@ -384,9 +384,7 @@ HIDDEN BOOLEAN CGetFirmDir()
BOOLEAN good = xvt_fsys_file_exists(prawin);
if (good)
{
int len = 0;
len = xvt_sys_get_profile_string(prawin, "Main", "Study", "", __ptprf, sizeof(__ptprf));
int len = xvt_sys_get_profile_string(prawin, "Main", "Study", "", __ptprf, sizeof(__ptprf));
good = len > 0;
if (good)
{
@ -401,8 +399,12 @@ HIDDEN BOOLEAN CGetFirmDir()
xvt_sys_get_profile_string(prawin, "Main", "Firm", "com", firm, sizeof(firm));
ditta = atol(firm);
if (ditta > 0) sprintf(firm, "%05lda", ditta);
if (ditta > 0)
sprintf(firm, "%05lda", ditta);
else
strcpy(firm, "com");
xvt_fsys_build_pathname(cprefix, NULL, __ptprf, firm, NULL, NULL);
good = xvt_fsys_dir_exists(cprefix);
}
}

View File

@ -1504,8 +1504,7 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create, bool
if (sz <= 64)
fatal_box("Impossibile aprire il file %s", (const char*)n);
const TDir dir(logicnum);
const long len = dir.len();
const long len = curr().len();
eod = eox = sz / len;
}
@ -1557,7 +1556,6 @@ int TIsamtempfile::open(
if (err != NOERR)
{
err = get_error(err);
// dalla 1.5 serve ? relisfd(_isamfile);
fatal_box("Can't create temp file '%s' num. %d: Error n. %d", (const char*)filename, num(), err);
}
}
@ -1577,7 +1575,7 @@ int TIsamtempfile::open(
if (err == NOERR)
{
_isam_handle = prefix().open_isamfile(_logicnum, filename);
_isam_handle = prefix().open_isamfile(_logicnum, filename, true);
TCodeb_handle fhnd = handle(_curr_key = 1);
if (fhnd < 0)
err = get_error(fhnd);

View File

@ -996,7 +996,7 @@ void TPrefix::set(
//
// @flag NULL | Chiude tutti i files
// @flag COM | Apre il direttorio con i dati comuni
// @flag DEF | Riapre la ditta indicata nel file prefix.txt
// @flag DEF | Riapre la ditta indicata nel file campo.ini
// @flag codice ditta | Apre la ditta indicata
{
if (name == NULL)

View File

@ -97,8 +97,8 @@ class TPrefix : public TObject
{
// @access:(INTERNAL) Private Member
// @cmember:(INTERNAL) Contenuto del file "prefix.txt"
TString _prefix;
// @cmember:(INTERNAL) Contenuto di Study in Campo.ini
TFilename _prefix;
// @cmember:(INTERNAL) Livello degli archivi
unsigned int _filelevel, _stdlevel;

View File

@ -335,7 +335,7 @@ bool TProgress_monitor::set_status(long n)
{
_pi = new TProgind(_total, _txt, _cancellable);
_pi->set_start_time(_start);
end_wait();
xvt_scr_reset_busy_cursor();
}
// Aggiorna la TProgind associata, sempre che esista
_status = min(n, _total);
@ -369,7 +369,7 @@ bool TProgress_monitor::is_cancelled() const
TProgress_monitor::TProgress_monitor(long items, const char* txt, bool cancancel)
: _total(items), _txt(txt), _status(0), _cancellable(cancancel), _pi(NULL), _start(clock())
{ begin_wait(); }
{ xvt_scr_set_busy_cursor(); }
TProgress_monitor::~TProgress_monitor()
{
@ -377,7 +377,7 @@ TProgress_monitor::~TProgress_monitor()
if (_pi != NULL)
delete _pi;
else
end_wait();
xvt_scr_reset_busy_cursor();
}
///////////////////////////////////////////////////////////
@ -390,7 +390,7 @@ static TIndwin* __indwin__p = NULL;
void progind_create(long m, const char* t, bool b, bool c)
{
CHECK(__indwin__p == NULL, "Cannot have more than one progress indicator");
__indwin__p = new TProgind(m, t, b, c, 60);
__indwin__p = new TProgind(m, t, b, c);
do_events();
}

View File

@ -772,53 +772,11 @@ COLOR trans_color(
return col;
}
// @doc INTERNAL
// @func HIDDEN void | set_cursor | Cambia il cursore del mouse
HIDDEN void set_wait_cursor(
bool w) // @parm Indica il tipo di cursore da utilizzare:
//
// @flag TRUE | Cursore a clessidra per le wait
// @flag FALSE | Cursore a frecca normale
{
static int _count = 0;
// static WINDOW _win = NULL_WIN;
if (w)
{
if (_count == 0)
{
/* _win = cur_win();
if (_win == NULL_WIN)
_win = TASK_WIN;
xvt_win_set_cursor(_win, CURSOR_WAIT);
*/
xvt_win_set_cursor(TASK_WIN, CURSOR_WAIT);
}
_count++;
}
else
{
_count--;
CHECK(_count >= 0, "end_wait without matching begin_wait");
if (_count == 0)
{
/*
WINDOW cur = cur_win();
if (cur == _win)
xvt_win_set_cursor(_win, CURSOR_ARROW);
else
xvt_win_set_cursor(TASK_WIN, CURSOR_ARROW);
*/
xvt_win_set_cursor(TASK_WIN, CURSOR_ARROW);
}
}
}
void begin_wait()
{ set_wait_cursor(true); }
{ xvt_scr_set_busy_cursor(); }
void end_wait()
{ set_wait_cursor(false); }
{ xvt_scr_reset_busy_cursor(); }
// @doc INTERNAL