diff --git a/include/viswin.cpp b/include/viswin.cpp index 4970ee011..614faf89d 100755 --- a/include/viswin.cpp +++ b/include/viswin.cpp @@ -837,30 +837,12 @@ void TViswin::paint_background( _images.add(i, id); } } - if (i && i->ok()) { - int delta = short(origin().x - x1); // Prima colonna sorgente - if (delta < 0) delta = 0; - - if (delta < x2) - { - const int scroll = (row == 1) ? 2 : 0; // Aggiungi un paio di pixel negli scroll - PNT p; p.h = delta*CHARX; p.v = y1*CHARY; - - RCT src; xvt_rect_set(&src, p.h, p.v, (x2-delta)*CHARX, min(p.v+CHARY, i->height())); - if (src.top < i->height()) - { - int px = int(x1-origin().x); - if (px < 0) px = 0; px += X_OFFSET; - RCT dst; - dst.left = tabx(px); - dst.top = taby(row); - dst.right = dst.left + tabx(x2-delta); - dst.bottom = dst.top + taby(1)+scroll; - i->draw(win(), dst, src); - } - } + RCT src; xvt_rect_set(&src, 0, y1*CHARY, i->width(), min((y1+1)*CHARY, i->height())); + RCT dst; xvt_rect_set(&dst, 0, 0, tabx(x2), taby(1)); + xvt_rect_offset(&dst, tabx(x1-origin().x+X_OFFSET), taby(row)); + i->draw(win(), dst, src); } } break; @@ -924,8 +906,6 @@ void TViswin::paint_image(int row, const char* cp) dx = int(img.width() / ratio); dy = int(img.height() / ratio); RCT dst; xvt_rect_set(&dst, x, y, x+dx, y+dy); - if (dst.bottom > clip.bottom) - dst.bottom = clip.bottom; img.draw(win(), dst); } else @@ -1440,14 +1420,17 @@ void TViswin::handler (WINDOW win, EVENT * ep) if (ep->v.timer.id == _timer) { xvt_timer_destroy (_timer); - _istimer = FALSE; + _timer = 0; } else if (ep->v.timer.id == _wtimer) { if (_showbuts) paint_waitbar (); if (!_isopen) + { xvt_timer_destroy (_wtimer); + _wtimer = 0; + } } break; case E_MOUSE_DBL: @@ -1876,13 +1859,11 @@ void TViswin::handler (WINDOW win, EVENT * ep) bool TViswin::on_key(KEY key) { - EVENT_TYPE type = E_USER; - - if (_istimer) + if (_timer) return TRUE; _timer = xvt_timer_create (win (), 50l); - _istimer = TRUE; - + + EVENT_TYPE type = E_USER; if (key == K_UP || key == K_DOWN || key == K_LEFT || key == K_RIGHT) if (_selflag) key += K_SHIFT; @@ -2351,7 +2332,10 @@ void TViswin::close_print () { _isopen = FALSE; if (_showbuts) + { xvt_timer_destroy (_wtimer); + _wtimer = 0; + } if (_toplevel) { xvt_menu_set_item_title(win(), M_VISWIN_QUIT, TR("Fine\tESC")); @@ -2555,7 +2539,7 @@ TViswin::TViswin(const char *fname, TField_window(x, y, width, height, parent, brwfld), _filename (fname), _islink (linkbutton), _isedit (editbutton), _isprint (printbutton), _iscross (FALSE), _selecting (FALSE), _isselection (FALSE), - _isbar (FALSE), _scrolling (FALSE), _istimer (FALSE), _selflag (FALSE), _sel_displayed (FALSE), + _isbar (FALSE), _scrolling (FALSE), _timer (0), _wtimer(0), _selflag (FALSE), _sel_displayed (FALSE), _link_displayed (FALSE), _cross_displayed (FALSE), _point_displayed (FALSE), _need_scroll (none), _txt (fname, BUFFERSIZE), _txt_to_find(64), _in_update(FALSE), _down_dir(TRUE), _case_sensitive(FALSE), _regexp(FALSE), _multiple (FALSE), diff --git a/include/viswin.h b/include/viswin.h index ab47a42ed..d95a786dd 100755 --- a/include/viswin.h +++ b/include/viswin.h @@ -59,8 +59,6 @@ class TViswin : public TField_window bool _isbar; // @cmember:(INTERNAL) Indica se in corso lo scrolling bool _scrolling; - // @cmember:(INTERNAL) Indica se il timer successivo e' attivo - bool _istimer; // @cmember:(INTERNAL) Indica se possono arrivare nuove linee bool _isopen; // @cmember:(INTERNAL) Indica se sono stati selezionati flag