[Mockpp-commits] mockpp/3party/cxxtest/cxxtest Win32Gui.h,1.3,1.4
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2006-01-04 19:56:29
|
Update of /cvsroot/mockpp/mockpp/3party/cxxtest/cxxtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22979/3party/cxxtest/cxxtest Modified Files: Win32Gui.h Log Message: workarounds bcb5 Index: Win32Gui.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/3party/cxxtest/cxxtest/Win32Gui.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Win32Gui.h 17 Dec 2005 18:38:44 -0000 1.3 +++ Win32Gui.h 4 Jan 2006 19:56:21 -0000 1.4 @@ -19,7 +19,7 @@ #include <cxxtest/Gui.h> -#include <windows.h> +#include <windows.h> #include <commctrl.h> namespace CxxTest @@ -106,7 +106,8 @@ void parseCommandLine( int argc, char **argv ) { _startMinimized = _keep = false; - _title = argv[0]; + if (argc != 0) + _title = argv[0]; for ( int i = 1; i < argc; ++ i ) { @@ -326,7 +327,7 @@ setUp( window, (LPCREATESTRUCT)lParam ); Win32Gui *that = (Win32Gui *)GetWindowLong( window, GWL_USERDATA ); - return that->handle( window, message, wParam, lParam ); + return handle_s(that, window, message, wParam, lParam ); } static void setUp( HWND window, LPCREATESTRUCT create ) @@ -334,20 +335,33 @@ SetWindowLong( window, GWL_USERDATA, (LONG)create->lpCreateParams ); } + static LRESULT handle_s(Win32Gui *self, HWND window, UINT message, WPARAM wParam, LPARAM lParam ) + { + if (self == 0) + return DefWindowProc( window, message, wParam, lParam ); + + return self->handle( window, message, wParam, lParam ); + } + LRESULT handle( HWND window, UINT message, WPARAM wParam, LPARAM lParam ) { switch ( message ) { - case WM_SIZE: resizeControls(); break; + case WM_SIZE: + resizeControls(); + break; - case WM_TIMER: updateTime(); break; + case WM_TIMER: + updateTime(); + break; case WM_CLOSE: case WM_DESTROY: case WM_QUIT: ExitProcess( 0 ); - default: return DefWindowProc( window, message, wParam, lParam ); + default: + return DefWindowProc( window, message, wParam, lParam ); } return 0; } |