Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv31009
Modified Files:
console.h console_linux.cpp console_win.cpp wolf.dsp
wolfpack.cpp
Log Message:
Trying out new console code.
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console.h 8 Sep 2003 23:38:49 -0000 1.2
--- console.h 9 Sep 2003 15:17:07 -0000 1.3
***************
*** 62,65 ****
--- 62,72 ----
};
+ enum eFontType
+ {
+ FONT_SERIF = 0,
+ FONT_NOSERIF,
+ FONT_FIXEDWIDTH
+ };
+
class cConsole
{
***************
*** 100,103 ****
--- 107,112 ----
virtual void poll();
virtual void stop();
+
+ void setAttributes( bool bold, bool italic, bool underlined, unsigned char r, unsigned char g, unsigned char b, unsigned char size, eFontType font );
private:
Index: console_linux.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_linux.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console_linux.cpp 9 Sep 2003 03:24:15 -0000 1.2
--- console_linux.cpp 9 Sep 2003 15:17:07 -0000 1.3
***************
*** 178,179 ****
--- 178,183 ----
}
}
+
+ void cConsole::setAttributes( bool bold, bool italic, unsigned char r, unsigned char g, unsigned char b, unsigned char size )
+ {
+ }
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** console_win.cpp 9 Sep 2003 11:17:56 -0000 1.4
--- console_win.cpp 9 Sep 2003 15:17:07 -0000 1.5
***************
*** 162,169 ****
return 1;
- case WM_SETFOCUS:
- SendMessage( inputWindow, WM_SETFOCUS, 0, 0 );
- return 1;
-
case WM_NOTIFY:
if( wparam == CONTROL_LOGWINDOW )
--- 162,165 ----
***************
*** 206,209 ****
--- 202,206 ----
case WM_DESTROY:
keeprun = 0;
+ PostQuitMessage( 0 );
return 0;
***************
*** 329,336 ****
MSG msg;
! while( GetMessage( &msg, mainWindow, 0, 0 ) > 0 )
{
! if( msg.message == WM_CHAR && msg.hwnd == inputWindow && msg.lParam == '\r' )
continue;
TranslateMessage( &msg );
--- 326,345 ----
MSG msg;
! while( GetMessage( &msg, 0, 0, 0 ) > 0 )
{
! if( msg.message == WM_CHAR && msg.hwnd == inputWindow && msg.wParam == '\r' )
! {
! if( serverState == RUNNING )
! {
! char command[512] = { 0, };
! GetWindowText( inputWindow, command, 512 );
! SetWindowText( inputWindow, "" );
!
! // Process Command
! Console::instance()->handleCommand( command );
! }
!
continue;
+ }
TranslateMessage( &msg );
***************
*** 341,345 ****
guiThread.wait();
- FreeLibrary( hRiched );
return guiThread.returnValue();
--- 350,353 ----
***************
*** 385,388 ****
--- 393,399 ----
}
+ // Place the Caret at the End of the Text
+
+
// process \b properly
if ( sMessage.contains("\b") )
***************
*** 404,410 ****
}
! range.cpMin = GetWindowTextLength( logWindow );
! range.cpMax = GetWindowTextLength( logWindow );
! SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM)&range );
// Now it will get right, even if the user had selected sth.
--- 415,420 ----
}
! unsigned int tLength = GetWindowTextLength( logWindow );
! SendMessage( logWindow, EM_SETSEL, tLength, tLength );
// Now it will get right, even if the user had selected sth.
***************
*** 413,419 ****
// And ofcourse if not some control is currently capturing the input
if( !GetCapture() )
! {
! SendMessage( logWindow, EM_LINESCROLL, 0, SendMessage( logWindow, EM_LINEFROMCHAR, ( ctrlLength + textLength ) - 1, 0 ) );
! }
}
--- 423,427 ----
// And ofcourse if not some control is currently capturing the input
if( !GetCapture() )
! SendMessage( logWindow, WM_VSCROLL, SB_BOTTOM, 0 );
}
***************
*** 455,457 ****
--- 463,521 ----
{
SetWindowText( mainWindow, data.latin1() );
+ }
+
+ // Extended Attributes
+ void cConsole::setAttributes( bool bold, bool italic, bool underlined, unsigned char r, unsigned char g, unsigned char b, unsigned char size, eFontType font )
+ {
+ CHARFORMAT cf;
+ ZeroMemory( &cf, sizeof( CHARFORMAT ) );
+ cf.cbSize = sizeof( CHARFORMAT );
+
+ SendMessage( logWindow, EM_GETCHARFORMAT, SCF_SELECTION, (WPARAM)&cf );
+
+ if( bold )
+ {
+ cf.dwMask |= CFM_BOLD;
+ cf.dwEffects |= CFE_BOLD;
+ }
+
+ if( italic )
+ {
+ cf.dwMask |= CFM_ITALIC;
+ cf.dwEffects |= CFE_ITALIC;
+ }
+
+ if( underlined )
+ {
+ cf.dwMask |= CFM_UNDERLINE;
+ cf.dwEffects |= CFE_UNDERLINE;
+ }
+
+ cf.dwMask |= CFM_COLOR;
+ cf.crTextColor = RGB( r, g, b );
+
+ if( size )
+ {
+ cf.dwMask |= CFM_SIZE;
+ cf.yHeight = size;
+ }
+
+ cf.dwMask |= CFM_FACE;
+
+ switch( font )
+ {
+ case FONT_SERIF:
+ strcpy( cf.szFaceName, "Courier" );
+ break;
+
+ case FONT_NOSERIF:
+ strcpy( cf.szFaceName, "Arial" );
+ break;
+
+ case FONT_FIXEDWIDTH:
+ strcpy( cf.szFaceName, "Fixedsys" );
+ break;
+ }
+
+ SendMessage( logWindow, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.222
retrieving revision 1.223
diff -C2 -d -r1.222 -r1.223
*** wolf.dsp 9 Sep 2003 03:24:16 -0000 1.222
--- wolf.dsp 9 Sep 2003 15:17:07 -0000 1.223
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 64,68 ****
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
! # PROP Output_Dir "c:\wolfpack"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
--- 64,68 ----
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
! # PROP Output_Dir "D:\wolfpack\"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
***************
*** 75,81 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"c:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"..\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.459
retrieving revision 1.460
diff -C2 -d -r1.459 -r1.460
*** wolfpack.cpp 8 Sep 2003 23:38:49 -0000 1.459
--- wolfpack.cpp 9 Sep 2003 15:17:07 -0000 1.460
***************
*** 330,333 ****
--- 330,334 ----
return 0;*/
+ Console::instance()->setAttributes( true, false, false, 0, 0, 255, 0, FONT_FIXEDWIDTH );
Console::instance()->send( QString( "\n%1 %2 %3 \n\n" ).arg( wp_version.productstring.c_str() ).arg( wp_version.betareleasestring.c_str() ).arg( wp_version.verstring.c_str() ) );
|