git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@218
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
39 files changed:
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __DEBUGH__
-#define __DEBUGH__
+#ifndef __WXDEBUGH__
+#define __WXDEBUGH__
<BR>
<BR>
Extensive use of these macros is recommended! Remember that ASSERTs are
<BR>
<BR>
Extensive use of these macros is recommended! Remember that ASSERTs are
- disabled in final (without DEBUG defined) build, so they add strictly
+ disabled in final (without WXDEBUG defined) build, so they add strictly
nothing to your program's code. On the other hand, CHECK macros do stay
even in release builds, but in general are not much of a burden, while
a judicious use of them might increase your program's stability.
nothing to your program's code. On the other hand, CHECK macros do stay
even in release builds, but in general are not much of a burden, while
a judicious use of them might increase your program's stability.
/** @name Macros which are completely disabled in 'release' mode */
//@{
/** @name Macros which are completely disabled in 'release' mode */
//@{
/**
this function may be redefined to do something non trivial and is called
whenever one of debugging macros fails (i.e. condition is false in an
/**
this function may be redefined to do something non trivial and is called
whenever one of debugging macros fails (i.e. condition is false in an
// no more bugs ;-)
#define wxASSERT(cond)
#define wxASSERT_MSG(x, m)
// no more bugs ;-)
#define wxASSERT(cond)
#define wxASSERT_MSG(x, m)
/// special form of assert: always triggers it (in debug mode)
#define wxFAIL wxASSERT(0)
/// special form of assert: always triggers it (in debug mode)
#define wxFAIL wxASSERT(0)
void WXDLLEXPORT wxLogSysError(long lErrCode, wxTString strFormat, ...);
// debug functions do nothing in release mode
void WXDLLEXPORT wxLogSysError(long lErrCode, wxTString strFormat, ...);
// debug functions do nothing in release mode
// NB: debug functions don't translate their arguments
extern void WXDLLEXPORT wxLogDebug(const char *szFormat, ...);
// NB: debug functions don't translate their arguments
extern void WXDLLEXPORT wxLogDebug(const char *szFormat, ...);
// debug only logging functions: use them with API name and error code
// ----------------------------------------------------------------------------
// debug only logging functions: use them with API name and error code
// ----------------------------------------------------------------------------
#define wxLogApiError(api, rc) \
wxLogDebug("At %s(%d) '%s' failed with error %lx (%s).", \
__FILE__, __LINE__, api, \
#define wxLogApiError(api, rc) \
wxLogDebug("At %s(%d) '%s' failed with error %lx (%s).", \
__FILE__, __LINE__, api, \
info, or to be a straight call to the new operator.
*/
info, or to be a straight call to the new operator.
*/
-#if (DEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && USE_MEMORY_TRACING) || USE_WXDEBUG_CONTEXT
#define WXDEBUG_NEW new(__FILE__,__LINE__)
#endif
#define WXDEBUG_NEW new(__FILE__,__LINE__)
#endif
void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bool isVect = FALSE);
void wxDebugFree(void * buf, bool isVect = FALSE);
void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bool isVect = FALSE);
void wxDebugFree(void * buf, bool isVect = FALSE);
#define WXTRACE wxTrace
#define WXTRACELEVEL wxTraceLevel
#define WXTRACE wxTrace
#define WXTRACELEVEL wxTraceLevel
-#else // else part for the #if DEBUG
+#else // else part for the #if WXDEBUG
inline void wxTrace(const char *WXUNUSED(fmt)) {}
inline void wxTraceLevel(int WXUNUSED(level), const char *WXUNUSED(fmt)) {}
inline void wxTrace(const char *WXUNUSED(fmt)) {}
inline void wxTraceLevel(int WXUNUSED(level), const char *WXUNUSED(fmt)) {}
#define WXTRACELEVEL TRUE ? (void)0 : wxTraceLevel
#define WXDEBUG_NEW new
#define WXTRACELEVEL TRUE ? (void)0 : wxTraceLevel
#define WXDEBUG_NEW new
// Debugging support
// ============================================================================
// Debugging support
// ============================================================================
-#if defined(__DEBUG__) && defined(_MSC_VER) && (_MSC_VER > 1000)
+#if defined(__WXDEBUG__) && defined(_MSC_VER) && (_MSC_VER > 1000)
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
void wxLogAddRef (const char *szInterface, ULONG cRef);
void wxLogRelease(const char *szInterface, ULONG cRef);
void wxLogAddRef (const char *szInterface, ULONG cRef);
void wxLogRelease(const char *szInterface, ULONG cRef);
#define wxLogQueryInterface(szInterface, riid)
#define wxLogAddRef(szInterface, cRef)
#define wxLogRelease(szInterface, cRef)
#define wxLogQueryInterface(szInterface, riid)
#define wxLogAddRef(szInterface, cRef)
#define wxLogRelease(szInterface, cRef)
#endif //_OLEUTILS_H
\ No newline at end of file
#endif //_OLEUTILS_H
\ No newline at end of file
// NOW MANDATORY: don't change.
#define USE_MEMORY_TRACING 1
// If 1, enables debugging versions of wxObject::new and
// NOW MANDATORY: don't change.
#define USE_MEMORY_TRACING 1
// If 1, enables debugging versions of wxObject::new and
- // wxObject::delete *IF* DEBUG is also defined.
+ // wxObject::delete *IF* WXDEBUG is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
-#define USE_DEBUG_CONTEXT 1
+#define USE_WXDEBUG_CONTEXT 1
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
- // If DEBUG is not defined, will still use
+ // If WXDEBUG is not defined, will still use
// normal memory operators.
// It's recommended to set this to 1,
// since you may well need to output
// normal memory operators.
// It's recommended to set this to 1,
// since you may well need to output
bool IsKindOf(wxClassInfo *info);
bool IsKindOf(wxClassInfo *info);
-#if DEBUG && USE_MEMORY_TRACING
+#if WXDEBUG && USE_MEMORY_TRACING
void * operator new (size_t size, char * fileName = NULL, int lineNum = 0);
void operator delete (void * buf);
void * operator new (size_t size, char * fileName = NULL, int lineNum = 0);
void operator delete (void * buf);
-#if DEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || USE_WXDEBUG_CONTEXT
virtual void Dump(ostream& str);
#endif
virtual void Dump(ostream& str);
#endif
-#if DEBUG && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
#ifndef WXDEBUG_NEW
#define WXDEBUG_NEW new(__FILE__,__LINE__)
#endif
#ifndef WXDEBUG_NEW
#define WXDEBUG_NEW new(__FILE__,__LINE__)
#endif
-#if DEBUG && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
#define new WXDEBUG_NEW
#endif
#define new WXDEBUG_NEW
#endif
if test "$USE_DEBUG_FLAG" = 1 ; then
cat >> confdefs.h <<EOF
if test "$USE_DEBUG_FLAG" = 1 ; then
cat >> confdefs.h <<EOF
-#define DEBUG $USE_DEBUG_FLAG
+#define WXDEBUG $USE_DEBUG_FLAG
AC_SUBST(DEBUG)
if test "$USE_DEBUG_FLAG" = 1 ; then
AC_SUBST(DEBUG)
if test "$USE_DEBUG_FLAG" = 1 ; then
- AC_DEFINE_UNQUOTED(DEBUG,$USE_DEBUG_FLAG)
+ AC_DEFINE_UNQUOTED(WXDEBUG,$USE_DEBUG_FLAG)
fi
if test "$USE_MEM_TRACING" = 1 ; then
fi
if test "$USE_MEM_TRACING" = 1 ; then
-#if !DEBUG
-#error You must set DEBUG to 1 on the 'make' command line or make.env.
+#if !WXDEBUG
+#error You must set WXDEBUG to 1 on the 'make' command line or make.env.
#endif
#define new WXDEBUG_NEW
#endif
#define new WXDEBUG_NEW
#define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
void wxLog##level(const char *szFormat, ...) \
{ \
#define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
void wxLog##level(const char *szFormat, ...) \
{ \
case wxLOG_Trace:
case wxLOG_Debug:
case wxLOG_Trace:
case wxLOG_Debug:
#ifdef __WIN32__
// in addition to normal logging, also send the string to debugger
// (don't prepend "Debug" here: it will go to debug window anyhow)
#ifdef __WIN32__
// in addition to normal logging, also send the string to debugger
// (don't prepend "Debug" here: it will go to debug window anyhow)
case wxLOG_Trace:
case wxLOG_Debug:
case wxLOG_Trace:
case wxLOG_Debug:
#ifdef __WIN32__
OutputDebugString(szString);
OutputDebugString("\n\r");
#ifdef __WIN32__
OutputDebugString(szString);
OutputDebugString("\n\r");
// debug helper
// ----------------------------------------------------------------------------
// debug helper
// ----------------------------------------------------------------------------
// this function is called when an assert fails
void wxOnAssert(const char *szFile, int nLine, const char *szMsg)
// this function is called when an assert fails
void wxOnAssert(const char *szFile, int nLine, const char *szMsg)
#include "wx/defs.h"
#endif
#include "wx/defs.h"
#endif
-#if (DEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#ifdef __GNUG__
// #pragma implementation
#ifdef __GNUG__
// #pragma implementation
*/
bool wxDebugContext::PrintList (void)
{
*/
bool wxDebugContext::PrintList (void)
{
if (!HasStream())
return FALSE;
if (!HasStream())
return FALSE;
bool wxDebugContext::Dump(void)
{
bool wxDebugContext::Dump(void)
{
if (!HasStream())
return FALSE;
if (!HasStream())
return FALSE;
bool wxDebugContext::PrintStatistics(bool detailed)
{
bool wxDebugContext::PrintStatistics(bool detailed)
{
if (!HasStream())
return FALSE;
if (!HasStream())
return FALSE;
// We'll only do malloc and free for the moment: leave the interesting
// stuff for the wxObject versions.
// We'll only do malloc and free for the moment: leave the interesting
// stuff for the wxObject versions.
-#if DEBUG && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
-#else // USE_MEMORY_TRACING && DEBUG
+#else // USE_MEMORY_TRACING && WXDEBUG
void wxTrace(const char *WXUNUSED(fmt) ...)
{
}
void wxTrace(const char *WXUNUSED(fmt) ...)
{
}
#include <string.h>
#include <assert.h>
#include <string.h>
#include <assert.h>
-#if (DEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#include "wx/memory.h"
#endif
#include "wx/memory.h"
#endif
-#if DEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || USE_DEBUG_CONTEXT
// for wxObject::Dump
#include <iostream.h>
#endif
// for wxObject::Dump
#include <iostream.h>
#endif
-#if DEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || USE_DEBUG_CONTEXT
void wxObject::Dump(ostream& str)
{
if (GetClassInfo() && GetClassInfo()->GetClassName())
void wxObject::Dump(ostream& str)
{
if (GetClassInfo() && GetClassInfo()->GetClassName())
-#if DEBUG && USE_MEMORY_TRACING
+#if WXDEBUG && USE_MEMORY_TRACING
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
-/**************************** DEBUGGING FEATURES ****************************/
+/**************************** WXDEBUGGING FEATURES ****************************/
/* Compatibility with 1.66 API.
Level 0: no backward compatibility, all new features
/* Compatibility with 1.66 API.
Level 0: no backward compatibility, all new features
/*
* Enables debugging: memory tracing, assert, etc.
*/
/*
* Enables debugging: memory tracing, assert, etc.
*/
- * Enables debugging version of wxObject::new and wxObject::delete (IF DEBUG)
+ * Enables debugging version of wxObject::new and wxObject::delete (IF WXDEBUG)
* WARNING: this code may not work with all architectures, especially
* if alignment is an issue.
*/
* WARNING: this code may not work with all architectures, especially
* if alignment is an issue.
*/
s|*OS*|@OS@|g
s|*WXBASEDIR*|@WXBASEDIR@|g
s|*PROFILE*|@PROFILE@|g
s|*OS*|@OS@|g
s|*WXBASEDIR*|@WXBASEDIR@|g
s|*PROFILE*|@PROFILE@|g
s|*OPTIMISE*|@OPTIMISE@|g
s|*CC*|@CC@|g
s|*CFLAGS*|@CFLAGS@|g
s|*OPTIMISE*|@OPTIMISE@|g
s|*CC*|@CC@|g
s|*CFLAGS*|@CFLAGS@|g
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
-/**************************** DEBUGGING FEATURES ****************************/
+/**************************** WXDEBUGGING FEATURES ****************************/
/* Compatibility with 1.66 API.
Level 0: no backward compatibility, all new features
/* Compatibility with 1.66 API.
Level 0: no backward compatibility, all new features
/*
* Enables debugging: memory tracing, assert, etc.
*/
/*
* Enables debugging: memory tracing, assert, etc.
*/
- * Enables debugging version of wxObject::new and wxObject::delete (IF DEBUG)
+ * Enables debugging version of wxObject::new and wxObject::delete (IF WXDEBUG)
* WARNING: this code may not work with all architectures, especially
* if alignment is an issue.
*/
* WARNING: this code may not work with all architectures, especially
* if alignment is an issue.
*/
s|*OS*|@OS@|g
s|*WXBASEDIR*|@WXBASEDIR@|g
s|*PROFILE*|@PROFILE@|g
s|*OS*|@OS@|g
s|*WXBASEDIR*|@WXBASEDIR@|g
s|*PROFILE*|@PROFILE@|g
s|*OPTIMISE*|@OPTIMISE@|g
s|*CC*|@CC@|g
s|*CFLAGS*|@CFLAGS@|g
s|*OPTIMISE*|@OPTIMISE@|g
s|*CC*|@CC@|g
s|*CFLAGS*|@CFLAGS@|g
!if "$(FINAL)" == "0"
OPT = -Od
!if "$(FINAL)" == "0"
OPT = -Od
-DEBUG_FLAGS= -v -DDEBUG=1 -D__DEBUG__ -DUSE_DEFINE
+DEBUG_FLAGS= -v -DWXDEBUG=1 -D__WXDEBUG__ -DUSE_DEFINE
!else
OPT = -O2
DEBUG_FLAGS = -DUSE_DEFINE
!else
OPT = -O2
DEBUG_FLAGS = -DUSE_DEFINE
!if "$(FINAL)" == "0"
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
OPT = -Od
!if "$(FINAL)" == "0"
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
OPT = -Od
-DEBUG_FLAGS= -v -D__DEBUG__ -DDEBUG=1
+DEBUG_FLAGS= -v -D__WXDEBUG__ -DWXDEBUG=1
!else
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
OPT = -O2
!else
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
OPT = -O2
+!ifndef WXDEBUG
+WXDEBUG=0
!endif
all:
cd $(WXDIR)\src\msw
!endif
all:
cd $(WXDIR)\src\msw
- nmake -f makefile.dos FINAL=$(FINAL) DEBUG=$(DEBUG)
+ nmake -f makefile.dos FINAL=$(FINAL) WXDEBUG=$(WXDEBUG)
# to override makefile variables. See wx/install/install.txt.
# And you can override specific variables on the make command line, e.g.
#
# to override makefile variables. See wx/install/install.txt.
# And you can override specific variables on the make command line, e.g.
#
-# make -f makefile.unix DEBUG=''
+# make -f makefile.unix WXDEBUG=''
#
# You may prefer to use the GNU configure script than raw makefiles -
# see contrib/wxshlib.
#
# You may prefer to use the GNU configure script than raw makefiles -
# see contrib/wxshlib.
# Debugging information
# AIX: comment out.
# IRIX: -g3
# Debugging information
# AIX: comment out.
# IRIX: -g3
-DEBUGFLAGS = -ggdb -D__DEBUG__
+DEBUGFLAGS = -ggdb -D__WXDEBUG__
# Debug/trace mode. 1 or more for debugging.
# Debug/trace mode. 1 or more for debugging.
OBJDIR = objects$(GUISUFFIX)
# You shouldn't need to change these...
OBJDIR = objects$(GUISUFFIX)
# You shouldn't need to change these...
-CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT)
-CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT)
+CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEBUG)' $(WARN) $(OPT)
+CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEBUG)' $(WARN) $(OPT)
LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib
# Extra patch link for XView
LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib
# Extra patch link for XView
!if "$(DLL)" == "0"
PCH=WX.PCH
PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH)
!if "$(DLL)" == "0"
PCH=WX.PCH
PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH)
-CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DDEBUG=1 /D__DEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WINDOWS__ $(PRECOMP)
-CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DDEBUG=1 /D__DEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WINDOWS__
+CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WINDOWS__ $(PRECOMP)
+CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WINDOWS__
LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE
DUMMY=dummy
!else
LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE
DUMMY=dummy
!else
!ifneq NOPRECOMP 1
PRECOMP = /fh=$(WXDIR)\src\msw\watcom.pch
!ifneq NOPRECOMP 1
PRECOMP = /fh=$(WXDIR)\src\msw\watcom.pch
# The Watcom-recommended flags for optimum Pentium speed are:
# /oneatx /zp4 /5 /fpi87 /fp5
# The Watcom-recommended flags for optimum Pentium speed are:
# /oneatx /zp4 /5 /fpi87 /fp5
-OPTFLAGS=/ox /5r # /DDEBUG=1
+OPTFLAGS=/ox /5r # /DWXDEBUG=1
# /d1 for line numbers only: anything else produces an enormous wx32.lib
CPPFLAGS = /bt=nt /w1 /D__WIN32__ /zq $(OPTFLAGS) $(MODEL) $(PRECOMP) /d1 /d__WINDOWS__ $(EXTRACPPFLAGS)
# /d1 for line numbers only: anything else produces an enormous wx32.lib
CPPFLAGS = /bt=nt /w1 /D__WIN32__ /zq $(OPTFLAGS) $(MODEL) $(PRECOMP) /d1 /d__WINDOWS__ $(EXTRACPPFLAGS)
{
wxhInstance = (HINSTANCE) hInstance;
{
wxhInstance = (HINSTANCE) hInstance;
-#if (DEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
streambuf* sBuf = new wxDebugStreamBuf;
#if !defined(_WINDLL)
streambuf* sBuf = new wxDebugStreamBuf;
delete [] command[0] ;
delete [] command ;
delete [] command[0] ;
delete [] command ;
-#if (DEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
break;
}
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
break;
}
if (M_BRUSHDATA->m_hBrush==NULL) wxError("Cannot create brush","Internal error") ;
#endif
return TRUE;
if (M_BRUSHDATA->m_hBrush==NULL) wxError("Cannot create brush","Internal error") ;
#endif
return TRUE;
// DC.
void wxDC::SelectOldObjects(WXHDC dc)
{
// DC.
void wxDC::SelectOldObjects(WXHDC dc)
{
wxDebugMsg("wxDC::SelectOldObjects %X\n", this);
#endif
if (dc)
{
if (m_oldBitmap)
{
wxDebugMsg("wxDC::SelectOldObjects %X\n", this);
#endif
if (dc)
{
if (m_oldBitmap)
{
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HBITMAP %X\n", m_oldBitmap);
#endif
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HBITMAP %X\n", m_oldBitmap);
#endif
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
m_oldBitmap = 0 ;
if (m_oldPen)
{
m_oldBitmap = 0 ;
if (m_oldPen)
{
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HPEN %X\n", m_oldPen);
#endif
::SelectObject((HDC) dc, (HPEN) m_oldPen);
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HPEN %X\n", m_oldPen);
#endif
::SelectObject((HDC) dc, (HPEN) m_oldPen);
m_oldPen = 0 ;
if (m_oldBrush)
{
m_oldPen = 0 ;
if (m_oldBrush)
{
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HBRUSH %X\n", m_oldBrush);
#endif
::SelectObject((HDC) dc, (HBRUSH) m_oldBrush);
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HBRUSH %X\n", m_oldBrush);
#endif
::SelectObject((HDC) dc, (HBRUSH) m_oldBrush);
m_oldBrush = 0 ;
if (m_oldFont)
{
m_oldBrush = 0 ;
if (m_oldFont)
{
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HFONT %X\n", m_oldFont);
#endif
::SelectObject((HDC) dc, (HFONT) m_oldFont);
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HFONT %X\n", m_oldFont);
#endif
::SelectObject((HDC) dc, (HFONT) m_oldFont);
m_oldFont = 0 ;
if (m_oldPalette)
{
m_oldFont = 0 ;
if (m_oldPalette)
{
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HPALETTE %X\n", m_oldPalette);
#endif
::SelectPalette((HDC) dc, (HPALETTE) m_oldPalette, TRUE);
}
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HPALETTE %X\n", m_oldPalette);
#endif
::SelectPalette((HDC) dc, (HPALETTE) m_oldPalette, TRUE);
}
wxDebugMsg("wxDC::SelectOldObjects: Done.\n");
#endif
m_oldPalette = 0 ;
wxDebugMsg("wxDC::SelectOldObjects: Done.\n");
#endif
m_oldPalette = 0 ;
if (m_clipping && m_hDC)
{
HRGN rgn = CreateRectRgn(0, 0, 32000, 32000);
if (m_clipping && m_hDC)
{
HRGN rgn = CreateRectRgn(0, 0, 32000, 32000);
wxDebugMsg("wxDC::DestroyClippingRegion: Selecting HRGN %X\n", rgn);
#endif
SelectClipRgn((HDC) m_hDC, rgn);
wxDebugMsg("wxDC::DestroyClippingRegion: Selecting HRGN %X\n", rgn);
#endif
SelectClipRgn((HDC) m_hDC, rgn);
wxDebugMsg("wxDC::DestroyClippingRegion: Deleting HRGN %X\n", rgn);
#endif
DeleteObject(rgn);
wxDebugMsg("wxDC::DestroyClippingRegion: Deleting HRGN %X\n", rgn);
#endif
DeleteObject(rgn);
if (m_oldPalette)
{
::SelectPalette((HDC) m_hDC, (HPALETTE) m_oldPalette, TRUE);
if (m_oldPalette)
{
::SelectPalette((HDC) m_hDC, (HPALETTE) m_oldPalette, TRUE);
wxDebugMsg("wxDC::SetPalette: set old palette %X\n", m_oldPalette);
#endif
m_oldPalette = 0;
wxDebugMsg("wxDC::SetPalette: set old palette %X\n", m_oldPalette);
#endif
m_oldPalette = 0;
if (!m_oldPalette)
m_oldPalette = (WXHPALETTE) oldPal;
if (!m_oldPalette)
m_oldPalette = (WXHPALETTE) oldPal;
wxDebugMsg("wxDC::SetPalette %X: selected palette %X\n", this, m_palette.GetHPALETTE());
if (oldPal)
wxDebugMsg("wxDC::SetPalette: oldPal was palette %X\n", oldPal);
wxDebugMsg("wxDC::SetPalette %X: selected palette %X\n", this, m_palette.GetHPALETTE());
if (oldPal)
wxDebugMsg("wxDC::SetPalette: oldPal was palette %X\n", oldPal);
if (m_font.Ok() && m_font.GetResourceHandle())
{
if (m_font.Ok() && m_font.GetResourceHandle())
{
wxDebugMsg("wxDC::SetFont: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
wxDebugMsg("wxDC::SetFont: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
{
if (m_font.Ok() && m_font.GetResourceHandle())
{
{
if (m_font.Ok() && m_font.GetResourceHandle())
{
wxDebugMsg("wxDC::DrawText: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
wxDebugMsg("wxDC::DrawText: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
return;
m_selectedBitmap.SetSelectedInto(this);
return;
m_selectedBitmap.SetSelectedInto(this);
wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP());
#endif
HBITMAP bm = ::SelectObject((HDC) m_hDC, (HBITMAP) m_selectedBitmap.GetHBITMAP());
wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP());
#endif
HBITMAP bm = ::SelectObject((HDC) m_hDC, (HBITMAP) m_selectedBitmap.GetHBITMAP());
M_FONTDATA->m_hFont = (WXHFONT) CreateFont(nHeight, 0, 0, 0,ff_weight,ff_italic,(BYTE)ff_underline,
0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
PROOF_QUALITY, DEFAULT_PITCH | ff_family, (ff_face == "" ? NULL : (const char *)ff_face));
M_FONTDATA->m_hFont = (WXHFONT) CreateFont(nHeight, 0, 0, 0,ff_weight,ff_italic,(BYTE)ff_underline,
0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
PROOF_QUALITY, DEFAULT_PITCH | ff_family, (ff_face == "" ? NULL : (const char *)ff_face));
if (m_hFont==NULL) wxError("Cannot create font","Internal Error") ;
#endif
return (M_FONTDATA->m_hFont != (WXHFONT) NULL);
if (m_hFont==NULL) wxError("Cannot create font","Internal Error") ;
#endif
return (M_FONTDATA->m_hFont != (WXHFONT) NULL);
bool wxFrame::MSWOnPaint(void)
{
bool wxFrame::MSWOnPaint(void)
{
wxDebugMsg("wxFrameWnd::OnPaint %d\n", handle);
#endif
RECT rect;
wxDebugMsg("wxFrameWnd::OnPaint %d\n", handle);
#endif
RECT rect;
void wxFrame::MSWOnSize(int x, int y, WXUINT id)
{
void wxFrame::MSWOnSize(int x, int y, WXUINT id)
{
wxDebugMsg("wxFrameWnd::OnSize %d\n", m_hWnd);
#endif
switch (id)
wxDebugMsg("wxFrameWnd::OnSize %d\n", m_hWnd);
#endif
switch (id)
bool wxFrame::MSWOnClose(void)
{
bool wxFrame::MSWOnClose(void)
{
wxDebugMsg("wxFrameWnd::OnClose %d\n", handle);
#endif
return Close();
wxDebugMsg("wxFrameWnd::OnClose %d\n", handle);
#endif
return Close();
bool wxFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
bool wxFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
wxDebugMsg("wxFrameWnd::OnCommand %d\n", handle);
#endif
if (cmd == 0 || cmd == 1 ) // Can be either a menu command or an accelerator.
wxDebugMsg("wxFrameWnd::OnCommand %d\n", handle);
#endif
if (cmd == 0 || cmd == 1 ) // Can be either a menu command or an accelerator.
{
int client_x, client_y;
{
int client_x, client_y;
wxDebugMsg("wxFrame::OnSize: about to set the child's size.\n");
#endif
wxDebugMsg("wxFrame::OnSize: about to set the child's size.\n");
#endif
if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
!child->IsKindOf(CLASSINFO(wxDialog)))
{
if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
!child->IsKindOf(CLASSINFO(wxDialog)))
{
wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
#endif
child->SetFocus();
wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
#endif
child->SetFocus();
m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), "wxWindowMenu");
m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), "wxWindowMenu");
wxDebugMsg("Loaded m_windowMenu %d\n", m_windowMenu);
#endif
wxDebugMsg("Loaded m_windowMenu %d\n", m_windowMenu);
#endif
wxDebugMsg("wxMDIFrame::OnCommand %d: system command: calling default window proc\n", GetHWND());
#endif
return FALSE; // Get WndProc to call default proc
wxDebugMsg("wxMDIFrame::OnCommand %d: system command: calling default window proc\n", GetHWND());
#endif
return FALSE; // Get WndProc to call default proc
}
else if (m_currentChild && (id < wxFIRST_MDI_CHILD || id > wxLAST_MDI_CHILD))
{
}
else if (m_currentChild && (id < wxFIRST_MDI_CHILD || id > wxLAST_MDI_CHILD))
{
wxDebugMsg("wxMDIFrame::MSWOnCommand %d: calling child OnCommand\n", GetHWND());
#endif
return m_currentChild->MSWOnCommand(id, cmd, control);
wxDebugMsg("wxMDIFrame::MSWOnCommand %d: calling child OnCommand\n", GetHWND());
#endif
return m_currentChild->MSWOnCommand(id, cmd, control);
if (invalidHandle == (HWND) GetHWND())
{
if (invalidHandle == (HWND) GetHWND())
{
wxDebugMsg("wxMDIChildFrame::OnSize %d: invalid, so returning.\n", GetHWND());
#endif
return;
wxDebugMsg("wxMDIChildFrame::OnSize %d: invalid, so returning.\n", GetHWND());
#endif
return;
bool wxMDIChildFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
bool wxMDIChildFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
wxDebugMsg("wxMDIChildFrame::MSWOnCommand %d\n", GetHWND());
#endif
if ((cmd == 0) && GetHWND())
wxDebugMsg("wxMDIChildFrame::MSWOnCommand %d\n", GetHWND());
#endif
if ((cmd == 0) && GetHWND())
{
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
HMENU parent_menu = (HMENU) parent->GetWinMenu();
{
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
HMENU parent_menu = (HMENU) parent->GetWinMenu();
wxDebugMsg("Parent menu is %d\n", parent_menu);
#endif
HMENU child_menu = (HMENU) GetWinMenu();
wxDebugMsg("Parent menu is %d\n", parent_menu);
#endif
HMENU child_menu = (HMENU) GetWinMenu();
wxDebugMsg("Child menu is %d\n", child_menu);
#endif
wxDebugMsg("Child menu is %d\n", child_menu);
#endif
{
parent->m_parentFrameActive = FALSE;
HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
{
parent->m_parentFrameActive = FALSE;
HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
wxDebugMsg("Window submenu is %d\n", subMenu);
#endif
// HMENU subMenu = 0;
wxDebugMsg("Window submenu is %d\n", subMenu);
#endif
// HMENU subMenu = 0;
{
parent->m_parentFrameActive = TRUE;
HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
{
parent->m_parentFrameActive = TRUE;
HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
wxDebugMsg("Window submenu is %d\n", subMenu);
#endif
// HMENU subMenu = 0;
wxDebugMsg("Window submenu is %d\n", subMenu);
#endif
// HMENU subMenu = 0;
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
wxDebugMsg("Finished (de)activating\n");
#endif
return 0;
wxDebugMsg("Finished (de)activating\n");
#endif
return 0;
// destroyed.
HWND oldHandle = (HWND)GetHWND();
// destroyed.
HWND oldHandle = (HWND)GetHWND();
wxDebugMsg("*** About to DestroyWindow MDI child %d\n", oldHandle);
#endif
#ifdef __WIN32__
wxDebugMsg("*** About to DestroyWindow MDI child %d\n", oldHandle);
#endif
#ifdef __WIN32__
#else
SendMessage((HWND) parent->GetClientWindow()->GetHWND(), WM_MDIDESTROY, (HWND)oldHandle, 0);
#endif
#else
SendMessage((HWND) parent->GetClientWindow()->GetHWND(), WM_MDIDESTROY, (HWND)oldHandle, 0);
#endif
wxDebugMsg("*** Finished DestroyWindow MDI child %d\n", oldHandle);
#endif
invalidHandle = 0;
wxDebugMsg("*** Finished DestroyWindow MDI child %d\n", oldHandle);
#endif
invalidHandle = 0;
const char *wxDataObject::GetFormatName(wxDataFormat format)
{
const char *wxDataObject::GetFormatName(wxDataFormat format)
{
static char s_szBuf[128];
switch ( format ) {
case CF_TEXT: return "CF_TEXT";
static char s_szBuf[128];
switch ( format ) {
case CF_TEXT: return "CF_TEXT";
// Debug support
// ----------------------------------------------------------------------------
// Debug support
// ----------------------------------------------------------------------------
-#if defined(__DEBUG__) && defined(_MSC_VER) && (_MSC_VER > 1000)
+#if defined(__WXDEBUG__) && defined(_MSC_VER) && (_MSC_VER > 1000)
const char *GetIidName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
const char *GetIidName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
}
wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
}
#endif
// USE_DRAG_AND_DROP
#endif
// USE_DRAG_AND_DROP
#else
M_PENDATA->m_hPen = (WXHPEN) CreatePen(wx2msPenStyle(M_PENDATA->m_style), M_PENDATA->m_width, ms_colour);
#endif
#else
M_PENDATA->m_hPen = (WXHPEN) CreatePen(wx2msPenStyle(M_PENDATA->m_style), M_PENDATA->m_width, ms_colour);
#endif
if (M_PENDATA->m_hPen==0)
wxError("Cannot create pen","Internal error") ;
#endif
if (M_PENDATA->m_hPen==0)
wxError("Cannot create pen","Internal error") ;
#endif
#undef GetClassInfo
#endif
#undef GetClassInfo
#endif
static const char *GetMessageName(int message);
static const char *GetMessageName(int message);
#define WINDOW_MARGIN 3 // This defines sensitivity of Leave events
#define WINDOW_MARGIN 3 // This defines sensitivity of Leave events
wxWndHook = NULL;
wnd->m_hWnd = (WXHWND) hWnd;
}
wxWndHook = NULL;
wnd->m_hWnd = (WXHWND) hWnd;
}
wxDebugMsg("hWnd = %d, m_hWnd = %d, msg = %d\n", hWnd, m_hWnd, message);
#endif
// Stop right here if we don't have a valid handle
wxDebugMsg("hWnd = %d, m_hWnd = %d, msg = %d\n", hWnd, m_hWnd, message);
#endif
// Stop right here if we don't have a valid handle
// Main Windows 3 window proc
long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
// Main Windows 3 window proc
long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
wxLogTrace(wxTraceMessages, "Processing %s", GetMessageName(message));
wxLogTrace(wxTraceMessages, "Processing %s", GetMessageName(message));
HWND hWnd = (HWND)m_hWnd;
HWND hWnd = (HWND)m_hWnd;
wxDebugMsg("wxWindow::MSWDestroyWindow %d\n", handle);
#endif
MSWDetachWindowMenu();
wxDebugMsg("wxWindow::MSWDestroyWindow %d\n", handle);
#endif
MSWDetachWindowMenu();
wxWndHook = NULL;
wxWinHandleList->Append((long)m_hWnd, this);
wxWndHook = NULL;
wxWinHandleList->Append((long)m_hWnd, this);
wxDebugMsg("wxWindow::MSWCreate %d\n", m_hWnd);
#endif
}
wxDebugMsg("wxWindow::MSWCreate %d\n", m_hWnd);
#endif
}
bool wxWindow::MSWOnClose(void)
{
bool wxWindow::MSWOnClose(void)
{
wxDebugMsg("wxWindow::MSWOnClose %d\n", handle);
#endif
return FALSE;
wxDebugMsg("wxWindow::MSWOnClose %d\n", handle);
#endif
return FALSE;
bool wxWindow::MSWOnDestroy(void)
{
bool wxWindow::MSWOnDestroy(void)
{
wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
#endif
// delete our drop target if we've got one
wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
#endif
// delete our drop target if we've got one
void wxWindow::MSWOnMenuHighlight(WXWORD WXUNUSED(item), WXWORD WXUNUSED(flags), WXHMENU WXUNUSED(sysmenu))
{
void wxWindow::MSWOnMenuHighlight(WXWORD WXUNUSED(item), WXWORD WXUNUSED(flags), WXHMENU WXUNUSED(sysmenu))
{
wxDebugMsg("wxWindow::MSWOnMenuHighlight %d\n", handle);
#endif
}
wxDebugMsg("wxWindow::MSWOnMenuHighlight %d\n", handle);
#endif
}
bool wxWindow::MSWOnActivate(int state, bool WXUNUSED(minimized), WXHWND WXUNUSED(activate))
{
bool wxWindow::MSWOnActivate(int state, bool WXUNUSED(minimized), WXHWND WXUNUSED(activate))
{
wxDebugMsg("wxWindow::MSWOnActivate %d\n", handle);
#endif
wxDebugMsg("wxWindow::MSWOnActivate %d\n", handle);
#endif
bool wxWindow::MSWOnSetFocus(WXHWND WXUNUSED(hwnd))
{
bool wxWindow::MSWOnSetFocus(WXHWND WXUNUSED(hwnd))
{
wxDebugMsg("wxWindow::MSWOnSetFocus %d\n", m_hWnd);
#endif
// Deal with caret
wxDebugMsg("wxWindow::MSWOnSetFocus %d\n", m_hWnd);
#endif
// Deal with caret
bool wxWindow::MSWOnKillFocus(WXHWND WXUNUSED(hwnd))
{
bool wxWindow::MSWOnKillFocus(WXHWND WXUNUSED(hwnd))
{
wxDebugMsg("wxWindow::MSWOnKillFocus %d\n", m_hWnd);
#endif
// Deal with caret
wxDebugMsg("wxWindow::MSWOnKillFocus %d\n", m_hWnd);
#endif
// Deal with caret
void wxWindow::MSWOnDropFiles(WXWPARAM wParam)
{
void wxWindow::MSWOnDropFiles(WXWPARAM wParam)
{
wxDebugMsg("wxWindow::MSWOnDropFiles %d\n", m_hWnd);
#endif
wxDebugMsg("wxWindow::MSWOnDropFiles %d\n", m_hWnd);
#endif
WXHBRUSH wxWindow::MSWOnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
WXHBRUSH wxWindow::MSWOnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
wxDebugMsg("wxWindow::MSWOnCtlColour %d\n", m_hWnd);
#endif
if (nCtlColor == CTLCOLOR_DLG)
wxDebugMsg("wxWindow::MSWOnCtlColour %d\n", m_hWnd);
#endif
if (nCtlColor == CTLCOLOR_DLG)
if (m_lastMsg == 0)
return 0;
if (m_lastMsg == 0)
return 0;
wxLogTrace(wxTraceMessages, "Forwarding %s to DefWindowProc.",
GetMessageName(m_lastMsg));
wxLogTrace(wxTraceMessages, "Forwarding %s to DefWindowProc.",
GetMessageName(m_lastMsg));
return this->MSWDefWindowProc(m_lastMsg, m_lastWParam, m_lastLParam);
}
return this->MSWDefWindowProc(m_lastMsg, m_lastWParam, m_lastLParam);
}
long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate), WXHWND WXUNUSED(deactivate))
{
long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate), WXHWND WXUNUSED(deactivate))
{
wxDebugMsg("wxWindow::MSWOnMDIActivate %d\n", m_hWnd);
#endif
return 1;
wxDebugMsg("wxWindow::MSWOnMDIActivate %d\n", m_hWnd);
#endif
return 1;
wxDebugMsg("wxWindow::MSWOnSize %d\n", m_hWnd);
#endif
if (!m_hWnd)
wxDebugMsg("wxWindow::MSWOnSize %d\n", m_hWnd);
#endif
if (!m_hWnd)
// Deal with child commands from buttons etc.
bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control))
{
// Deal with child commands from buttons etc.
bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control))
{
wxDebugMsg("wxWindow::MSWOnCommand\n");
#endif
if (wxCurrentPopupMenu)
wxDebugMsg("wxWindow::MSWOnCommand\n");
#endif
if (wxCurrentPopupMenu)
bool succ = popupMenu->MSWCommand(cmd, id);
return succ;
}
bool succ = popupMenu->MSWCommand(cmd, id);
return succ;
}
char buf[80];
sprintf(buf, "Looking for item %d...\n", id);
wxDebugMsg(buf);
char buf[80];
sprintf(buf, "Looking for item %d...\n", id);
wxDebugMsg(buf);
if (item)
{
bool value = item->MSWCommand(cmd, id);
if (item)
{
bool value = item->MSWCommand(cmd, id);
if (value)
wxDebugMsg("MSWCommand succeeded\n");
else
if (value)
wxDebugMsg("MSWCommand succeeded\n");
else
wxDebugMsg("Could not find item!\n");
char buf[100];
wxDebugMsg("Item ids for this panel:\n");
wxDebugMsg("Could not find item!\n");
char buf[100];
wxDebugMsg("Item ids for this panel:\n");
HFONT was = 0;
if (the_font)
{
HFONT was = 0;
if (the_font)
{
wxDebugMsg("wxGetCharSize: Selecting HFONT %X\n", fnt);
#endif
// the_font->UseResource();
wxDebugMsg("wxGetCharSize: Selecting HFONT %X\n", fnt);
#endif
// the_font->UseResource();
GetTextMetrics(dc, &tm);
if (the_font && fnt && was)
{
GetTextMetrics(dc, &tm);
if (the_font && fnt && was)
{
wxDebugMsg("wxGetCharSize: Selecting old HFONT %X\n", was);
#endif
SelectObject(dc,was) ;
wxDebugMsg("wxGetCharSize: Selecting old HFONT %X\n", was);
#endif
SelectObject(dc,was) ;
return IsShown() && IsEnabled();
}
return IsShown() && IsEnabled();
}
static const char *GetMessageName(int message)
{
switch ( message ) {
static const char *GetMessageName(int message)
{
switch ( message ) {
uInt matches; /* number of string matches in current block */
int last_eob_len; /* bit length of EOB code for last block */
uInt matches; /* number of string matches in current block */
int last_eob_len; /* bit length of EOB code for last block */
ulg bits_sent; /* bit length of the compressed data */
#endif
ulg bits_sent; /* bit length of the compressed data */
#endif
/* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC)
/* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC)
#endif
/* Diagnostic functions */
#endif
/* Diagnostic functions */
# include <stdio.h>
extern int z_verbose;
extern void z_error OF((char *m));
# include <stdio.h>
extern int z_verbose;
extern void z_error OF((char *m));
#define DBG_POINT(p) cerr << #p << ": " << p.x << ',' << p.y << endl
#define TRACE(f) cerr << #f":" << endl;
#define DBG_POINT(p) cerr << #p << ": " << p.x << ',' << p.y << endl
#define TRACE(f) cerr << #f":" << endl;
static const char *_t[] = { "invalid", "text", "cmd", "icon",
"linebreak"};
static const char *_t[] = { "invalid", "text", "cmd", "icon",
"linebreak"};
position.y += baseLine-m_BaseLine;
if(draw)
dc.DrawText(m_Text,position.x,position.y);
position.y += baseLine-m_BaseLine;
if(draw)
dc.DrawText(m_Text,position.x,position.y);
// dc.DrawRectangle(position.x, position.y, m_Width, m_Height);
# endif
}
// dc.DrawRectangle(position.x, position.y, m_Width, m_Height);
# endif
}
void
wxLayoutObjectText::Debug(void)
{
void
wxLayoutObjectText::Debug(void)
{
void
wxLayoutList::Debug(void)
{
void
wxLayoutList::Debug(void)
{
CoordType width;
wxLayoutObjectList::iterator i;
CoordType width;
wxLayoutObjectList::iterator i;
cerr << "Looking for object at " << cpos.x << ',' << cpos.y <<
endl;
#endif
cerr << "Looking for object at " << cpos.x << ',' << cpos.y <<
endl;
#endif
if(offset)
*offset = cpos.x-(cursor.x-width); // 0==cursor before
// the object
if(offset)
*offset = cpos.x-(cursor.x-width); // 0==cursor before
// the object
cerr << " found object at " << cursor.x-width << ',' <<
cursor.y << ", type:" << _t[(*i)->GetType()] <<endl;
#endif
return i;
}
}
cerr << " found object at " << cursor.x-width << ',' <<
cursor.y << ", type:" << _t[(*i)->GetType()] <<endl;
#endif
return i;
}
}
cerr << " not found" << endl;
#endif
return end(); // not found
cerr << " not found" << endl;
#endif
return end(); // not found
if(m_CursorPosition.x > lineLength)
m_CursorPosition.x = lineLength;
if(m_CursorPosition.x > lineLength)
m_CursorPosition.x = lineLength;
i = FindCurrentObject(&offs);
cerr << "Cursor: "
<< m_CursorPosition.x << ','
i = FindCurrentObject(&offs);
cerr << "Cursor: "
<< m_CursorPosition.x << ','
i = FindCurrentObject(&offs);
if(i == end())
return;
i = FindCurrentObject(&offs);
if(i == end())
return;
cerr << "trying to delete: " << _t[(*i)->GetType()] << endl;
#endif
if((*i)->GetType() == WXLO_TYPE_LINEBREAK)
cerr << "trying to delete: " << _t[(*i)->GetType()] << endl;
#endif
if((*i)->GetType() == WXLO_TYPE_LINEBREAK)
if((*i)->GetType() == WXLO_TYPE_TEXT && offs != 0 && offs != (*i)->CountPositions())
{
wxLayoutObjectText *tobj = (wxLayoutObjectText *) *i;
if((*i)->GetType() == WXLO_TYPE_TEXT && offs != 0 && offs != (*i)->CountPositions())
{
wxLayoutObjectText *tobj = (wxLayoutObjectText *) *i;
cerr << "text: '" << tobj->GetText() << "'" << endl;
VAR(offs);
#endif
cerr << "text: '" << tobj->GetText() << "'" << endl;
VAR(offs);
#endif
-#ifndef DEBUG
-# define DEBUG
+#ifndef WXDEBUG
+# define WXDEBUG
wxLayoutObjectBase() { m_UserData = NULL; }
virtual ~wxLayoutObjectBase() {}
wxLayoutObjectBase() { m_UserData = NULL; }
virtual ~wxLayoutObjectBase() {}
virtual void Debug(void);
#endif
virtual void Debug(void);
#endif
align text objects.
*/
virtual wxPoint GetSize(CoordType *baseLine) const;
align text objects.
*/
virtual wxPoint GetSize(CoordType *baseLine) const;
virtual void Debug(void);
#endif
virtual void Debug(void);
#endif
wxLayoutObjectBase *Draw(wxDC &dc, bool findObject = false,
wxPoint const &coords = wxPoint(0,0));
wxLayoutObjectBase *Draw(wxDC &dc, bool findObject = false,
wxPoint const &coords = wxPoint(0,0));
m_FindPos.y = event.GetY();
m_FoundObject = NULL;
m_FindPos.y = event.GetY();
m_FoundObject = NULL;
cerr << "OnMouse: " << m_FindPos.x << ',' << m_FindPos.y << endl;
#endif
Refresh();
cerr << "OnMouse: " << m_FindPos.x << ',' << m_FindPos.y << endl;
#endif
Refresh();
case WXK_RETURN:
m_llist.LineBreak();
break;
case WXK_RETURN:
m_llist.LineBreak();
break;
case WXK_F1:
m_llist.Debug();
break;
case WXK_F1:
m_llist.Debug();
break;