From b4689f75e64da9d23867c5f408020c97ae16c429 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 12 May 2003 13:52:48 +0000 Subject: [PATCH] Patch level : 2.0 nopatch Files correlati : Ricompilazione Demo : [ ] Commento : Corretta gestione cambio studio (usato solamente da BA0) Eliminato sfarfallamento da barre di progresso Ricorretta centratura sheet git-svn-id: svn://10.65.10.50/trunk@11113 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/prefix.cpp | 3 +++ include/progind.cpp | 23 ++++++++++++++--------- include/progind.h | 2 -- include/sheet.cpp | 11 ++++++----- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/include/prefix.cpp b/include/prefix.cpp index 8af55a1f3..2aadd004e 100755 --- a/include/prefix.cpp +++ b/include/prefix.cpp @@ -1051,6 +1051,9 @@ bool TPrefix::set_studio(const char* study, long ditta) if (!dirtest.exist()) return FALSE; + // Chiudi tutti i files! + _manager.close_all(); + const TString old_study(__ptprf); const TString old_firm(_prefix); diff --git a/include/progind.cpp b/include/progind.cpp index 51bfbae2d..2c2a55002 100755 --- a/include/progind.cpp +++ b/include/progind.cpp @@ -26,7 +26,7 @@ word TIndwin::measure_text(TToken_string& s, word& maxlen) const // Certified 70% TIndwin::TIndwin(long max, const char* txt, bool cancel, bool bar, int div) - : _text(NULL), _cancel(NULL), _progress(NULL), _bar(0), + : _text(NULL), _cancel(NULL), _bar(0), _status(0L), _max(max), _flags(0x0) { if (_max <= 0) @@ -49,9 +49,6 @@ TIndwin::TIndwin(long max, const char* txt, bool cancel, bool bar, int div) { RCT r; _text->get_rect(r); _bar = r.bottom + CHARY; - - if (CAMPI_SCAVATI) - _progress = new TText_control(win(), DLG_NULL, 1, lines+3, hor-2, 1, "", ""); } if (cancel) @@ -95,7 +92,6 @@ TIndwin::~TIndwin() close_modal(); if (_cancel) delete _cancel; - if (_progress) delete _progress; if (_text) delete _text; } @@ -123,7 +119,7 @@ RCT* TIndwin::get_bar_rct(RCT& r) const r.left += CHARX; r.right -= CHARX; r.top = _bar; - r.bottom = r.top + ROWY; // 3*CHARY/2; + r.bottom = r.top + ROWY; return &r; } @@ -170,7 +166,7 @@ void TIndwin::update_bar() if (prc > 0) { - const unsigned long elapsed_time = (clock() - _start_time)/1000; + const unsigned long elapsed_time = (clock() - _start_time)/CLOCKS_PER_SEC; const unsigned long total_time = (unsigned long)(elapsed_time / prc); unsigned long ss = total_time - elapsed_time; const unsigned long hh = ss / 3600; @@ -178,8 +174,17 @@ void TIndwin::update_bar() const unsigned long mm = ss / 60; ss -= mm *60; TString80 n; - n.format("%d%% - Tempo residuo stimato %02lu:%02lu:%02lu", int(prc*100.0+0.5), hh, mm, ss); - _progress->set_caption(n); + n.format(FR("%d%% - Tempo residuo stimato %02lu:%02lu:%02lu"), int(prc*100.0+0.5), hh, mm, ss); + + b = r; + b.top = b.bottom+2; + b.bottom = b.top + CHARY; + + CBRUSH brush; brush.pat = PAT_SOLID; brush.color = MASK_BACK_COLOR; + xvt_dwin_set_cbrush(w, &brush); + xvt_dwin_set_std_cpen(w, TL_PEN_HOLLOW); + xvt_dwin_draw_rect(w, &b); + xvt_dwin_draw_text(w, r.left, r.bottom+CHARY, n, -1); } } else diff --git a/include/progind.h b/include/progind.h index 2d7ffc20e..6cf08adfc 100755 --- a/include/progind.h +++ b/include/progind.h @@ -36,8 +36,6 @@ class TIndwin : public TWindow TField_control* _text; // @cmember:(INTERNAL) Bottone "Annulla" TControl* _cancel; - // @cmember:(INTERNAL) Testo della percentuale - TControl* _progress; // @cmember:(INTERNAL) Movimento della barra e percentuale int _bar; // @cmember:(INTERNAL) ora inizio elaborazione diff --git a/include/sheet.cpp b/include/sheet.cpp index c925c0541..d3d0d1bfb 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -279,11 +279,12 @@ TSheet_control::TSheet_control( if (width < cli.right) { RCT out; xvt_vobj_get_outer_rect(parent, &out); - cli.left = (cli.right - width) / 2; - cli.right = cli.left + width; - cli.top += out.top; // cli had left = 0 and top = 0 - cli.bottom += out.top; - xvt_vobj_move(parent, &cli); + RCT rct; + rct.left = out.left + (cli.right - width) / 2; + rct.right = rct.left + width; + rct.top = out.top; // cli had left = 0 and top = 0 + rct.bottom = rct.top + cli.bottom; + xvt_vobj_move(parent, &rct); } }