[wpdev-commits] wolfpack/win console_win.cpp,1.26,1.27
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-14 18:05:28
|
Update of /cvsroot/wpdev/wolfpack/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13940/win Modified Files: console_win.cpp Log Message: 0000309 Index: console_win.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/win/console_win.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** console_win.cpp 19 Aug 2004 01:59:16 -0000 1.26 --- console_win.cpp 14 Sep 2004 18:05:17 -0000 1.27 *************** *** 853,856 **** --- 853,870 ---- } + void cConsole::rollbackChars(unsigned int count) { + int length = GetWindowTextLength(logWindow); + + // Select the rest + CHARRANGE range; + SendMessage( logWindow, EM_EXGETSEL, 0, ( LPARAM ) & range ); + range.cpMin -= count; + SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM)&range ); + SendMessage( logWindow, EM_REPLACESEL, FALSE, ( LPARAM ) "" ); + + // Remove from the end of the linebuffer + linebuffer_.truncate(linebuffer_.length() - count); + } + void cConsole::send( const QString& sMessage ) { *************** *** 860,867 **** QString temp = progress; progress = QString::null; ! for ( uint i = 0; i < temp.length() + 4; ++i ) ! { ! send( "\b" ); ! } progress = temp; } --- 874,878 ---- QString temp = progress; progress = QString::null; ! rollbackChars(temp.length() + 4); progress = temp; } *************** *** 894,920 **** } - // process \b properly - if ( sMessage.contains( "\b" ) ) - { - // Split the message - uint pos = sMessage.find( "\b" ); - if ( pos > 0 ) - send( sMessage.right( pos ) ); - else - { - CHARRANGE range; - SendMessage( logWindow, EM_EXGETSEL, 0, ( LPARAM ) & range ); - range.cpMin -= 1; - SendMessage( logWindow, EM_EXSETSEL, 0, ( LPARAM ) & range ); - SendMessage( logWindow, EM_REPLACESEL, FALSE, 0 ); - - if ( sMessage.length() > 1 ) - { - send( sMessage.left( sMessage.length() - 1 ) ); - } - return; - } - } - unsigned int tLength = GetWindowTextLength( logWindow ); SendMessage( logWindow, EM_SETSEL, tLength, tLength ); --- 905,908 ---- *************** *** 930,949 **** SendMessage( logWindow, WM_VSCROLL, SB_BOTTOM, 0 ); ! // Update linebuffer_, so that web console works as well. ! if ( sMessage.contains( "\n" ) ) ! { ! incompleteLine_.append( sMessage ); // Split by \n ! QStringList lines = QStringList::split( "\n", incompleteLine_, true ); ! ! // Insert all except the last element ! for ( uint i = 0; i < lines.count() - 1; ++i ) ! linebuffer_.push_back( lines[i] ); ! ! incompleteLine_ = lines[lines.count() - 1]; ! } ! else ! { ! incompleteLine_.append( sMessage ); ! } // Resend the Progress message if neccesary. --- 918,923 ---- SendMessage( logWindow, WM_VSCROLL, SB_BOTTOM, 0 ); ! // Append to the linebuffer ! linebuffer_.append(sMessage); // Resend the Progress message if neccesary. |