From da4951f05f0ddcac9600b5c747d4264a638961f5 Mon Sep 17 00:00:00 2001 From: Kostyantyn Ovechko Date: Thu, 12 Aug 2010 00:28:05 +0300 Subject: Fix tuiclient scrollwindow when there're no lines. --- tuiclient/mainwindow.cpp | 4 +++- tuiclient/scrollwindow.cpp | 8 ++++++-- tuiclient/tuiclient.cpp | 6 +++--- tuiclient/twindow.cpp | 9 +++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tuiclient/mainwindow.cpp b/tuiclient/mainwindow.cpp index 2493d81..57042e2 100644 --- a/tuiclient/mainwindow.cpp +++ b/tuiclient/mainwindow.cpp @@ -167,6 +167,8 @@ void Tmainwindow::init(){ distfiles_win.visible=true; error_log_win.init(" ERROR LOG ",12,50,5,5); disconnected(); - show(); + wclear(window); // sleep(1); + show(); + sleep(1); } diff --git a/tuiclient/scrollwindow.cpp b/tuiclient/scrollwindow.cpp index 3714f04..b0f7343 100644 --- a/tuiclient/scrollwindow.cpp +++ b/tuiclient/scrollwindow.cpp @@ -38,8 +38,12 @@ void Tscroll_window::compose(){ make_frame(); color_downloads(window); // screenlines[26]="Max_num:"+toString(max_received_screenline_num); - top_position=scroll_lines.size()-height+2; // +2 for border lines -// if (top_position<0) {top_position=0;}; +// top_position=; // +2 for border lines + if (scroll_lines.size()+2"+toString(bottom_screenline_num); +// sms="DOWN "+toString(top_position)+"------>"+toString(bottom_screenline_num); +// refresh(); } void Twindow::center(uint max_y, uint max_x){ @@ -103,7 +104,7 @@ void Twindow::resize(uint new_height, uint new_width, uint new_y, uint new_x){ } void Twindow::make_frame(){ - wclear(window); +// wclear(window); box(window, ACS_VLINE, ACS_HLINE); mvwaddstr(window,0,(width-caption.length())/2,caption.c_str()); // msg_short(0,width-20,"[Lines:"+toString(top_position+1)+"-"+toString(top_position+bottom_screenline_num)+"/"+toString(max_received_screenline_num)+"]"); -- cgit v1.2.3-65-gdbad