replace more __WXDEBUG__ occurrences with wxDEBUG_LEVEL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -14,7 +14,8 @@
|
|||||||
// used like this:
|
// used like this:
|
||||||
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
|
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
|
||||||
// to turn on memory leak checks for programs compiled with Microsoft Visual
|
// to turn on memory leak checks for programs compiled with Microsoft Visual
|
||||||
// C++ (5.0+). The macro will expand to nothing under other compilers.
|
// C++ (5.0+). The macro will not be defined under other compilers or if it
|
||||||
|
// can't be used with MSVC for whatever reason.
|
||||||
|
|
||||||
#ifndef _MSW_MSVCRT_H_
|
#ifndef _MSW_MSVCRT_H_
|
||||||
#define _MSW_MSVCRT_H_
|
#define _MSW_MSVCRT_H_
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
|
// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
|
||||||
// builds
|
// builds
|
||||||
#undef wxUSE_VC_CRTDBG
|
#undef wxUSE_VC_CRTDBG
|
||||||
#if defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
|
#if defined(_DEBUG) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
|
||||||
&& !defined(UNDER_CE)
|
&& !defined(UNDER_CE)
|
||||||
// it doesn't combine well with wxWin own memory debugging methods
|
// it doesn't combine well with wxWin own memory debugging methods
|
||||||
#if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
|
#if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
|
||||||
@@ -31,11 +32,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef wxUSE_VC_CRTDBG
|
#ifdef wxUSE_VC_CRTDBG
|
||||||
// VC++ uses this macro as debug/release mode indicator
|
|
||||||
#ifndef _DEBUG
|
|
||||||
#define _DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Need to undef new if including crtdbg.h which may redefine new itself
|
// Need to undef new if including crtdbg.h which may redefine new itself
|
||||||
#ifdef new
|
#ifdef new
|
||||||
#undef new
|
#undef new
|
||||||
|
@@ -76,12 +76,8 @@ protected:
|
|||||||
unsigned wxDisplayFactoryMacOSX::GetCount()
|
unsigned wxDisplayFactoryMacOSX::GetCount()
|
||||||
{
|
{
|
||||||
CGDisplayCount count;
|
CGDisplayCount count;
|
||||||
#ifdef __WXDEBUG__
|
CGDisplayErr err = CGGetActiveDisplayList(0, NULL, &count);
|
||||||
CGDisplayErr err =
|
wxCHECK_MSG( err != CGDisplayNoErr, 0, "CGGetActiveDisplayList() failed" );
|
||||||
#endif
|
|
||||||
CGGetActiveDisplayList(0, NULL, &count);
|
|
||||||
|
|
||||||
wxASSERT(err == CGDisplayNoErr);
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -126,12 +122,9 @@ wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(unsigned n)
|
|||||||
CGDisplayCount theCount = GetCount();
|
CGDisplayCount theCount = GetCount();
|
||||||
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
|
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
CGDisplayErr err = CGGetActiveDisplayList(theCount, theIDs, &theCount);
|
||||||
CGDisplayErr err =
|
wxCHECK_MSG( err != CGDisplayNoErr, NULL, "CGGetActiveDisplayList() failed" );
|
||||||
#endif
|
|
||||||
CGGetActiveDisplayList(theCount, theIDs, &theCount);
|
|
||||||
|
|
||||||
wxASSERT( err == CGDisplayNoErr );
|
|
||||||
wxASSERT( n < theCount );
|
wxASSERT( n < theCount );
|
||||||
|
|
||||||
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
|
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
|
||||||
|
@@ -74,7 +74,6 @@ struct wxCmdLineOption
|
|||||||
int fl)
|
int fl)
|
||||||
{
|
{
|
||||||
// wxCMD_LINE_USAGE_TEXT uses only description, shortName and longName is empty
|
// wxCMD_LINE_USAGE_TEXT uses only description, shortName and longName is empty
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
if ( k != wxCMD_LINE_USAGE_TEXT )
|
if ( k != wxCMD_LINE_USAGE_TEXT )
|
||||||
{
|
{
|
||||||
wxASSERT_MSG
|
wxASSERT_MSG
|
||||||
@@ -95,8 +94,6 @@ struct wxCmdLineOption
|
|||||||
wxT("Long option contains invalid characters")
|
wxT("Long option contains invalid characters")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
|
|
||||||
kind = k;
|
kind = k;
|
||||||
|
|
||||||
@@ -450,7 +447,7 @@ void wxCmdLineParser::AddParam(const wxString& desc,
|
|||||||
{
|
{
|
||||||
// do some consistency checks: a required parameter can't follow an
|
// do some consistency checks: a required parameter can't follow an
|
||||||
// optional one and nothing should follow a parameter with MULTIPLE flag
|
// optional one and nothing should follow a parameter with MULTIPLE flag
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
if ( !m_data->m_paramDesc.IsEmpty() )
|
if ( !m_data->m_paramDesc.IsEmpty() )
|
||||||
{
|
{
|
||||||
wxCmdLineParam& param = m_data->m_paramDesc.Last();
|
wxCmdLineParam& param = m_data->m_paramDesc.Last();
|
||||||
@@ -464,7 +461,7 @@ void wxCmdLineParser::AddParam(const wxString& desc,
|
|||||||
_T("a required parameter can't follow an optional one") );
|
_T("a required parameter can't follow an optional one") );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // Debug
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
wxCmdLineParam *param = new wxCmdLineParam(desc, type, flags);
|
wxCmdLineParam *param = new wxCmdLineParam(desc, type, flags);
|
||||||
|
|
||||||
|
@@ -308,14 +308,15 @@ static const long MILLISECONDS_PER_DAY = 86400000l;
|
|||||||
// (i.e. JDN(Jan 1, 1970) = 2440587.5)
|
// (i.e. JDN(Jan 1, 1970) = 2440587.5)
|
||||||
static const long EPOCH_JDN = 2440587l;
|
static const long EPOCH_JDN = 2440587l;
|
||||||
|
|
||||||
// used only in asserts
|
// these values are only used in asserts so don't define them if asserts are
|
||||||
#ifdef __WXDEBUG__
|
// disabled to avoid warnings about unused static variables
|
||||||
|
#if wxDEBUG_LEVEL
|
||||||
// the date of JDN -0.5 (as we don't work with fractional parts, this is the
|
// the date of JDN -0.5 (as we don't work with fractional parts, this is the
|
||||||
// reference date for us) is Nov 24, 4714BC
|
// reference date for us) is Nov 24, 4714BC
|
||||||
static const int JDN_0_YEAR = -4713;
|
static const int JDN_0_YEAR = -4713;
|
||||||
static const int JDN_0_MONTH = wxDateTime::Nov;
|
static const int JDN_0_MONTH = wxDateTime::Nov;
|
||||||
static const int JDN_0_DAY = 24;
|
static const int JDN_0_DAY = 24;
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
// the constants used for JDN calculations
|
// the constants used for JDN calculations
|
||||||
static const long JDN_OFFSET = 32046l;
|
static const long JDN_OFFSET = 32046l;
|
||||||
@@ -350,8 +351,8 @@ wxDateTime::Country wxDateTime::ms_country = wxDateTime::Country_Unknown;
|
|||||||
// private functions
|
// private functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// debugger helper: shows what the date really is
|
// debugger helper: this function can be called from a debugger to show what
|
||||||
#ifdef __WXDEBUG__
|
// the date really is
|
||||||
extern const char *wxDumpDate(const wxDateTime* dt)
|
extern const char *wxDumpDate(const wxDateTime* dt)
|
||||||
{
|
{
|
||||||
static char buf[128];
|
static char buf[128];
|
||||||
@@ -363,7 +364,6 @@ extern const char *wxDumpDate(const wxDateTime* dt)
|
|||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif // Debug
|
|
||||||
|
|
||||||
// get the number of days in the given month of the given year
|
// get the number of days in the given month of the given year
|
||||||
static inline
|
static inline
|
||||||
|
@@ -472,9 +472,8 @@ void wxFileName::Assign(const wxString& fullpathOrig,
|
|||||||
wxString volume, path, name, ext;
|
wxString volume, path, name, ext;
|
||||||
bool hasExt;
|
bool hasExt;
|
||||||
|
|
||||||
// do some consistency checks in debug mode: the name should be really just
|
// do some consistency checks: the name should be really just the filename
|
||||||
// the filename and the path should be really just a path
|
// and the path should be really just a path
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxString volDummy, pathDummy, nameDummy, extDummy;
|
wxString volDummy, pathDummy, nameDummy, extDummy;
|
||||||
|
|
||||||
SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format);
|
SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format);
|
||||||
@@ -487,12 +486,6 @@ void wxFileName::Assign(const wxString& fullpathOrig,
|
|||||||
wxASSERT_MSG( nameDummy.empty() && extDummy.empty(),
|
wxASSERT_MSG( nameDummy.empty() && extDummy.empty(),
|
||||||
_T("the path shouldn't contain file name nor extension") );
|
_T("the path shouldn't contain file name nor extension") );
|
||||||
|
|
||||||
#else // !__WXDEBUG__
|
|
||||||
SplitPath(fullname, NULL /* no volume */, NULL /* no path */,
|
|
||||||
&name, &ext, &hasExt, format);
|
|
||||||
SplitPath(fullpath, &volume, &path, NULL, NULL, format);
|
|
||||||
#endif // __WXDEBUG__/!__WXDEBUG__
|
|
||||||
|
|
||||||
Assign(volume, path, name, ext, hasExt, format);
|
Assign(volume, path, name, ext, hasExt, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -45,6 +45,32 @@
|
|||||||
|
|
||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
|
|
||||||
|
// debugger helper: this function can be called from a debugger to show what
|
||||||
|
// the date really is
|
||||||
|
extern const char *wxDumpFont(const wxFont *font)
|
||||||
|
{
|
||||||
|
static char buf[256];
|
||||||
|
|
||||||
|
const wxFontWeight weight = font->GetWeight();
|
||||||
|
|
||||||
|
wxString s;
|
||||||
|
s.Printf(wxS("%s-%s-%s-%d-%d"),
|
||||||
|
font->GetFaceName(),
|
||||||
|
weight == wxFONTWEIGHT_NORMAL
|
||||||
|
? _T("normal")
|
||||||
|
: weight == wxFONTWEIGHT_BOLD
|
||||||
|
? _T("bold")
|
||||||
|
: _T("light"),
|
||||||
|
font->GetStyle() == wxFONTSTYLE_NORMAL
|
||||||
|
? _T("regular")
|
||||||
|
: _T("italic"),
|
||||||
|
font->GetPointSize(),
|
||||||
|
font->GetEncoding());
|
||||||
|
|
||||||
|
wxStrlcpy(buf, s, WXSIZEOF(buf));
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@@ -245,7 +245,6 @@ char wxFTP::SendCommand(const wxString& command)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// don't show the passwords in the logs (even in debug ones)
|
// don't show the passwords in the logs (even in debug ones)
|
||||||
wxString cmd, password;
|
wxString cmd, password;
|
||||||
if ( command.Upper().StartsWith(_T("PASS "), &password) )
|
if ( command.Upper().StartsWith(_T("PASS "), &password) )
|
||||||
@@ -258,7 +257,6 @@ char wxFTP::SendCommand(const wxString& command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogRequest(cmd);
|
LogRequest(cmd);
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
m_lastError = wxPROTO_NOERR;
|
m_lastError = wxPROTO_NOERR;
|
||||||
return GetResult();
|
return GetResult();
|
||||||
|
@@ -37,20 +37,22 @@
|
|||||||
#include "wx/scopedptr.h"
|
#include "wx/scopedptr.h"
|
||||||
#include "wx/except.h"
|
#include "wx/except.h"
|
||||||
|
|
||||||
#if defined(__WXMSW__) && defined(__WXDEBUG__)
|
#if defined(__WXMSW__)
|
||||||
#include "wx/msw/msvcrt.h"
|
#include "wx/msw/msvcrt.h"
|
||||||
|
|
||||||
static struct EnableMemLeakChecking
|
#ifdef wxCrtSetDbgFlag
|
||||||
{
|
static struct EnableMemLeakChecking
|
||||||
EnableMemLeakChecking()
|
|
||||||
{
|
{
|
||||||
// do check for memory leaks on program exit (another useful flag
|
EnableMemLeakChecking()
|
||||||
// is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free deallocated
|
{
|
||||||
// memory which may be used to simulate low-memory condition)
|
// check for memory leaks on program exit (another useful flag
|
||||||
wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
|
// is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free deallocated
|
||||||
}
|
// memory which may be used to simulate low-memory condition)
|
||||||
} gs_enableLeakChecks;
|
wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
|
||||||
#endif // __WXMSW__ && __WXDEBUG__
|
}
|
||||||
|
} gs_enableLeakChecks;
|
||||||
|
#endif // wxCrtSetDbgFlag
|
||||||
|
#endif // __WXMSW__
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private classes
|
// private classes
|
||||||
|
@@ -105,34 +105,6 @@ static const size_t LEN_FULL = LEN_LANG + 1 + LEN_SUBLANG; // 1 for '_'
|
|||||||
// global functions
|
// global functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
|
|
||||||
// small class to suppress the translation erros until exit from current scope
|
|
||||||
class NoTransErr
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NoTransErr() { ms_suppressCount++; }
|
|
||||||
~NoTransErr() { ms_suppressCount--; }
|
|
||||||
|
|
||||||
static bool Suppress() { return ms_suppressCount > 0; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
static size_t ms_suppressCount;
|
|
||||||
};
|
|
||||||
|
|
||||||
size_t NoTransErr::ms_suppressCount = 0;
|
|
||||||
|
|
||||||
#else // !Debug
|
|
||||||
|
|
||||||
class NoTransErr
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NoTransErr() { }
|
|
||||||
~NoTransErr() { }
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // Debug/!Debug
|
|
||||||
|
|
||||||
static wxLocale *wxSetLocale(wxLocale *pLocale);
|
static wxLocale *wxSetLocale(wxLocale *pLocale);
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@@ -1210,16 +1182,8 @@ bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
|
|||||||
<< GetFullSearchPath(ExtractLang(szDirPrefix));
|
<< GetFullSearchPath(ExtractLang(szDirPrefix));
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't give translation errors here because the wxstd catalog might
|
wxLogTrace(TRACE_I18N, wxS("Looking for \"%s.mo\" in search path \"%s\""),
|
||||||
// not yet be loaded (and it's normal)
|
szName, searchPath);
|
||||||
//
|
|
||||||
// (we're using an object because we have several return paths)
|
|
||||||
|
|
||||||
NoTransErr noTransErr;
|
|
||||||
wxLogVerbose(_("looking for catalog '%s' in path '%s'."),
|
|
||||||
szName, searchPath.c_str());
|
|
||||||
wxLogTrace(TRACE_I18N, wxS("Looking for \"%s.mo\" in \"%s\""),
|
|
||||||
szName, searchPath.c_str());
|
|
||||||
|
|
||||||
wxFileName fn(szName);
|
wxFileName fn(szName);
|
||||||
fn.SetExt(wxS("mo"));
|
fn.SetExt(wxS("mo"));
|
||||||
@@ -2442,18 +2406,11 @@ const wxString& wxLocale::GetString(const wxString& origString,
|
|||||||
|
|
||||||
if ( trans == NULL )
|
if ( trans == NULL )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace(TRACE_I18N,
|
||||||
if ( !NoTransErr::Suppress() )
|
wxS("string \"%s\"[%ld] not found in %slocale '%s'."),
|
||||||
{
|
origString, (long)n,
|
||||||
NoTransErr noTransErr;
|
wxString::Format(wxS("domain '%s' "), domain).c_str(),
|
||||||
|
m_strLocale.c_str());
|
||||||
wxLogTrace(TRACE_I18N,
|
|
||||||
wxS("string \"%s\"[%ld] not found in %slocale '%s'."),
|
|
||||||
origString, (long)n,
|
|
||||||
wxString::Format(wxS("domain '%s' "), domain).c_str(),
|
|
||||||
m_strLocale.c_str());
|
|
||||||
}
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
if (n == size_t(-1))
|
if (n == size_t(-1))
|
||||||
return GetUntranslatedString(origString);
|
return GetUntranslatedString(origString);
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
#if wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT
|
||||||
|
|
||||||
#include "wx/memory.h"
|
#include "wx/memory.h"
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if wxUSE_THREADS && defined(__WXDEBUG__)
|
#if wxUSE_THREADS
|
||||||
#define USE_THREADSAFE_MEMORY_ALLOCATION 1
|
#define USE_THREADSAFE_MEMORY_ALLOCATION 1
|
||||||
#else
|
#else
|
||||||
#define USE_THREADSAFE_MEMORY_ALLOCATION 0
|
#define USE_THREADSAFE_MEMORY_ALLOCATION 0
|
||||||
@@ -575,18 +575,13 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from)
|
|||||||
*/
|
*/
|
||||||
bool wxDebugContext::PrintList (void)
|
bool wxDebugContext::PrintList (void)
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : NULL));
|
TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : NULL));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDebugContext::Dump(void)
|
bool wxDebugContext::Dump(void)
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
{
|
{
|
||||||
const wxChar* appName = wxT("application");
|
const wxChar* appName = wxT("application");
|
||||||
wxString appNameStr;
|
wxString appNameStr;
|
||||||
@@ -608,12 +603,8 @@ bool wxDebugContext::Dump(void)
|
|||||||
OutputDumpLine(wxEmptyString);
|
OutputDumpLine(wxEmptyString);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
struct wxDebugStatsStruct
|
struct wxDebugStatsStruct
|
||||||
{
|
{
|
||||||
long instanceCount;
|
long instanceCount;
|
||||||
@@ -638,11 +629,9 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt
|
|||||||
st->next = head;
|
st->next = head;
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool wxDebugContext::PrintStatistics(bool detailed)
|
bool wxDebugContext::PrintStatistics(bool detailed)
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
{
|
{
|
||||||
const wxChar* appName = wxT("application");
|
const wxChar* appName = wxT("application");
|
||||||
wxString appNameStr;
|
wxString appNameStr;
|
||||||
@@ -729,10 +718,6 @@ bool wxDebugContext::PrintStatistics(bool detailed)
|
|||||||
OutputDumpLine(wxEmptyString);
|
OutputDumpLine(wxEmptyString);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
|
||||||
(void)detailed;
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDebugContext::PrintClasses(void)
|
bool wxDebugContext::PrintClasses(void)
|
||||||
@@ -902,7 +887,6 @@ static MemoryCriticalSection memLocker;
|
|||||||
#endif // USE_THREADSAFE_MEMORY_ALLOCATION
|
#endif // USE_THREADSAFE_MEMORY_ALLOCATION
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
|
#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
|
||||||
#if wxUSE_GLOBAL_MEMORY_OPERATORS
|
#if wxUSE_GLOBAL_MEMORY_OPERATORS
|
||||||
void * operator new (size_t size, wxChar * fileName, int lineNum)
|
void * operator new (size_t size, wxChar * fileName, int lineNum)
|
||||||
@@ -1049,8 +1033,6 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) )
|
|||||||
free((char *)st);
|
free((char *)st);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// Trace: send output to the current debugging stream
|
// Trace: send output to the current debugging stream
|
||||||
void wxTrace(const wxChar * ...)
|
void wxTrace(const wxChar * ...)
|
||||||
{
|
{
|
||||||
@@ -1167,4 +1149,4 @@ void wxDebugContextDumpDelayCounter::DoDump()
|
|||||||
// least one cleanup counter object
|
// least one cleanup counter object
|
||||||
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One;
|
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One;
|
||||||
|
|
||||||
#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
#endif // wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT
|
||||||
|
@@ -26,14 +26,14 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
|
#if wxUSE_DEBUG_CONTEXT
|
||||||
#if defined(__VISAGECPP__)
|
#if defined(__VISAGECPP__)
|
||||||
#define DEBUG_PRINTF(NAME) { static int raz=0; \
|
#define DEBUG_PRINTF(NAME) { static int raz=0; \
|
||||||
printf( #NAME " %i\n",raz); fflush(stdout); raz++; }
|
printf( #NAME " %i\n",raz); fflush(stdout); raz++; }
|
||||||
#else
|
#else
|
||||||
#define DEBUG_PRINTF(NAME)
|
#define DEBUG_PRINTF(NAME)
|
||||||
#endif
|
#endif
|
||||||
#endif // __WXDEBUG__ || wxUSE_DEBUG_CONTEXT
|
#endif // wxUSE_DEBUG_CONTEXT
|
||||||
|
|
||||||
// we must disable optimizations for VC.NET because otherwise its too eager
|
// we must disable optimizations for VC.NET because otherwise its too eager
|
||||||
// linker discards wxClassInfo objects in release build thus breaking many,
|
// linker discards wxClassInfo objects in release build thus breaking many,
|
||||||
@@ -103,7 +103,7 @@ bool wxObject::IsKindOf(const wxClassInfo *info) const
|
|||||||
return (thisInfo) ? thisInfo->IsKindOf(info) : false ;
|
return (thisInfo) ? thisInfo->IsKindOf(info) : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING && defined( new )
|
#if wxUSE_MEMORY_TRACING && defined( new )
|
||||||
#undef new
|
#undef new
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -225,11 +225,11 @@ void wxClassInfo::Register()
|
|||||||
sm_classTable = classTable;
|
sm_classTable = classTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
// reentrance guard - see note above
|
// reentrance guard - see note above
|
||||||
static int entry = 0;
|
static int entry = 0;
|
||||||
wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance"));
|
wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance"));
|
||||||
#endif
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
// Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
|
// Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
|
||||||
// link any object module twice mistakenly, or link twice against wx shared
|
// link any object module twice mistakenly, or link twice against wx shared
|
||||||
@@ -246,9 +246,9 @@ void wxClassInfo::Register()
|
|||||||
|
|
||||||
sm_classTable->Put(m_className, (wxObject *)this);
|
sm_classTable->Put(m_className, (wxObject *)this);
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
--entry;
|
--entry;
|
||||||
#endif
|
#endif // wxDEBUG_LEVEL
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxClassInfo::Unregister()
|
void wxClassInfo::Unregister()
|
||||||
@@ -266,7 +266,7 @@ void wxClassInfo::Unregister()
|
|||||||
|
|
||||||
wxObject *wxCreateDynamicObject(const wxString& name)
|
wxObject *wxCreateDynamicObject(const wxString& name)
|
||||||
{
|
{
|
||||||
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
|
#if wxUSE_DEBUG_CONTEXT
|
||||||
DEBUG_PRINTF(wxObject *wxCreateDynamicObject)
|
DEBUG_PRINTF(wxObject *wxCreateDynamicObject)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ void wxObjectRefData::DecRef()
|
|||||||
|
|
||||||
void wxObject::Ref(const wxObject& clone)
|
void wxObject::Ref(const wxObject& clone)
|
||||||
{
|
{
|
||||||
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
|
#if wxUSE_DEBUG_CONTEXT
|
||||||
DEBUG_PRINTF(wxObject::Ref)
|
DEBUG_PRINTF(wxObject::Ref)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1813,7 +1813,7 @@ DoAdjustForGrowables(int delta,
|
|||||||
|
|
||||||
void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz)
|
void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz)
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
// by the time this function is called, the sizer should be already fully
|
// by the time this function is called, the sizer should be already fully
|
||||||
// initialized and hence the number of its columns and rows is known and we
|
// initialized and hence the number of its columns and rows is known and we
|
||||||
// can check that all indices in m_growableCols/Rows are valid (see also
|
// can check that all indices in m_growableCols/Rows are valid (see also
|
||||||
@@ -1841,7 +1841,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
|
|
||||||
if ( (m_flexDirection & wxHORIZONTAL) || (m_growMode != wxFLEX_GROWMODE_NONE) )
|
if ( (m_flexDirection & wxHORIZONTAL) || (m_growMode != wxFLEX_GROWMODE_NONE) )
|
||||||
|
@@ -105,7 +105,7 @@ static wxStrCacheInitializer gs_stringCacheInit;
|
|||||||
|
|
||||||
// gdb seems to be unable to display thread-local variables correctly, at least
|
// gdb seems to be unable to display thread-local variables correctly, at least
|
||||||
// not my 6.4.98 version under amd64, so provide this debugging helper to do it
|
// not my 6.4.98 version under amd64, so provide this debugging helper to do it
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
struct wxStrCacheDumper
|
struct wxStrCacheDumper
|
||||||
{
|
{
|
||||||
@@ -130,7 +130,7 @@ struct wxStrCacheDumper
|
|||||||
|
|
||||||
void wxDumpStrCache() { wxStrCacheDumper::ShowAll(); }
|
void wxDumpStrCache() { wxStrCacheDumper::ShowAll(); }
|
||||||
|
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
#ifdef wxPROFILE_STRING_CACHE
|
#ifdef wxPROFILE_STRING_CACHE
|
||||||
|
|
||||||
|
@@ -272,7 +272,7 @@ wxStringOperationsUtf8::DecodeNonAsciiChar(wxStringImpl::const_iterator i)
|
|||||||
|
|
||||||
// mask to extract lead byte's value ('x' bits above), by sequence's length:
|
// mask to extract lead byte's value ('x' bits above), by sequence's length:
|
||||||
static const unsigned char s_leadValueMask[4] = { 0x7F, 0x1F, 0x0F, 0x07 };
|
static const unsigned char s_leadValueMask[4] = { 0x7F, 0x1F, 0x0F, 0x07 };
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
// mask and value of lead byte's most significant bits, by length:
|
// mask and value of lead byte's most significant bits, by length:
|
||||||
static const unsigned char s_leadMarkerMask[4] = { 0x80, 0xE0, 0xF0, 0xF8 };
|
static const unsigned char s_leadMarkerMask[4] = { 0x80, 0xE0, 0xF0, 0xF8 };
|
||||||
static const unsigned char s_leadMarkerVal[4] = { 0x00, 0xC0, 0xE0, 0xF0 };
|
static const unsigned char s_leadMarkerVal[4] = { 0x00, 0xC0, 0xE0, 0xF0 };
|
||||||
|
@@ -76,7 +76,7 @@ void wxTextValidator::SetStyle(long style)
|
|||||||
{
|
{
|
||||||
m_validatorStyle = style;
|
m_validatorStyle = style;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
int check;
|
int check;
|
||||||
check = (int)HasFlag(wxFILTER_ALPHA) + (int)HasFlag(wxFILTER_ALPHANUMERIC) +
|
check = (int)HasFlag(wxFILTER_ALPHA) + (int)HasFlag(wxFILTER_ALPHANUMERIC) +
|
||||||
(int)HasFlag(wxFILTER_DIGITS) + (int)HasFlag(wxFILTER_NUMERIC);
|
(int)HasFlag(wxFILTER_DIGITS) + (int)HasFlag(wxFILTER_NUMERIC);
|
||||||
@@ -93,7 +93,7 @@ void wxTextValidator::SetStyle(long style)
|
|||||||
(int)HasFlag(wxFILTER_EXCLUDE_LIST) + (int)HasFlag(wxFILTER_EXCLUDE_CHAR_LIST);
|
(int)HasFlag(wxFILTER_EXCLUDE_LIST) + (int)HasFlag(wxFILTER_EXCLUDE_CHAR_LIST);
|
||||||
wxASSERT_MSG(check <= 1,
|
wxASSERT_MSG(check <= 1,
|
||||||
"Using both an include/exclude list may lead to unexpected results");
|
"Using both an include/exclude list may lead to unexpected results");
|
||||||
#endif
|
#endif // wxDEBUG_LEVEL
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextValidator::Copy(const wxTextValidator& val)
|
bool wxTextValidator::Copy(const wxTextValidator& val)
|
||||||
|
@@ -1152,19 +1152,22 @@ void wxWindowBase::PushEventHandler(wxEvtHandler *handlerToPush)
|
|||||||
|
|
||||||
SetEventHandler(handlerToPush);
|
SetEventHandler(handlerToPush);
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
// final checks of the operations done above:
|
// final checks of the operations done above:
|
||||||
wxASSERT_MSG( handlerToPush->GetPreviousHandler() == NULL,
|
wxASSERT_MSG( handlerToPush->GetPreviousHandler() == NULL,
|
||||||
"the first handler of the wxWindow stack should have no previous handlers set" );
|
"the first handler of the wxWindow stack should "
|
||||||
|
"have no previous handlers set" );
|
||||||
wxASSERT_MSG( handlerToPush->GetNextHandler() != NULL,
|
wxASSERT_MSG( handlerToPush->GetNextHandler() != NULL,
|
||||||
"the first handler of the wxWindow stack should have non-NULL next handler" );
|
"the first handler of the wxWindow stack should "
|
||||||
|
"have non-NULL next handler" );
|
||||||
|
|
||||||
wxEvtHandler* pLast = handlerToPush;
|
wxEvtHandler* pLast = handlerToPush;
|
||||||
while (pLast && pLast != this)
|
while ( pLast && pLast != this )
|
||||||
pLast = pLast->GetNextHandler();
|
pLast = pLast->GetNextHandler();
|
||||||
wxASSERT_MSG( pLast->GetNextHandler() == NULL,
|
wxASSERT_MSG( pLast->GetNextHandler() == NULL,
|
||||||
"the last handler of the wxWindow stack should have this window as next handler" );
|
"the last handler of the wxWindow stack should "
|
||||||
#endif
|
"have this window as next handler" );
|
||||||
|
#endif // wxDEBUG_LEVEL
|
||||||
}
|
}
|
||||||
|
|
||||||
wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler)
|
wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler)
|
||||||
|
@@ -125,7 +125,7 @@ static inline wxUint16 CrackUint16(const char *m)
|
|||||||
//
|
//
|
||||||
static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos)
|
static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos)
|
||||||
{
|
{
|
||||||
#if defined(__WXDEBUG__) && wxUSE_LOG
|
#if wxUSE_LOG
|
||||||
wxLogLevel level = wxLog::GetLogLevel();
|
wxLogLevel level = wxLog::GetLogLevel();
|
||||||
wxLog::SetLogLevel(wxLOG_Debug - 1);
|
wxLog::SetLogLevel(wxLOG_Debug - 1);
|
||||||
wxFileOffset result = stream.SeekI(pos);
|
wxFileOffset result = stream.SeekI(pos);
|
||||||
|
@@ -301,16 +301,12 @@ void wxNonOwnedWindow::HandleQueuedPaintRequests()
|
|||||||
// blit the entire back buffer to front soon
|
// blit the entire back buffer to front soon
|
||||||
m_isPainting = true;
|
m_isPainting = true;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
int requestsCount = 0;
|
int requestsCount = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
wxRect request;
|
wxRect request;
|
||||||
while ( m_toPaint->GetNext(request) )
|
while ( m_toPaint->GetNext(request) )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
requestsCount++;
|
requestsCount++;
|
||||||
#endif
|
|
||||||
wxRect clipped(request);
|
wxRect clipped(request);
|
||||||
clipped.Intersect(winRect);
|
clipped.Intersect(winRect);
|
||||||
if ( clipped.IsEmpty() )
|
if ( clipped.IsEmpty() )
|
||||||
|
@@ -214,11 +214,6 @@ wxSize wxWizardSizer::CalcMin()
|
|||||||
|
|
||||||
wxSize wxWizardSizer::GetMaxChildSize()
|
wxSize wxWizardSizer::GetMaxChildSize()
|
||||||
{
|
{
|
||||||
#if !defined(__WXDEBUG__)
|
|
||||||
if ( m_childSize.IsFullySpecified() )
|
|
||||||
return m_childSize;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxSize maxOfMin;
|
wxSize maxOfMin;
|
||||||
|
|
||||||
for ( wxSizerItemList::compatibility_iterator childNode = m_children.GetFirst();
|
for ( wxSizerItemList::compatibility_iterator childNode = m_children.GetFirst();
|
||||||
@@ -230,21 +225,6 @@ wxSize wxWizardSizer::GetMaxChildSize()
|
|||||||
maxOfMin.IncTo(SiblingSize(child));
|
maxOfMin.IncTo(SiblingSize(child));
|
||||||
}
|
}
|
||||||
|
|
||||||
// No longer applicable since we may change sizes when size adaptation is done
|
|
||||||
#if 0
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
if ( m_childSize.IsFullySpecified() && m_childSize != maxOfMin )
|
|
||||||
{
|
|
||||||
wxFAIL_MSG( _T("Size changed in wxWizard::GetPageAreaSizer()")
|
|
||||||
_T("after RunWizard().\n")
|
|
||||||
_T("Did you forget to call GetSizer()->Fit(this) ")
|
|
||||||
_T("for some page?")) ;
|
|
||||||
|
|
||||||
return m_childSize;
|
|
||||||
}
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( m_owner->m_started )
|
if ( m_owner->m_started )
|
||||||
{
|
{
|
||||||
m_childSize = maxOfMin;
|
m_childSize = maxOfMin;
|
||||||
|
@@ -144,14 +144,12 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// it's not really a format, of course, but we can reuse its GetId() method
|
// it's not really a format, of course, but we can reuse its GetId() method
|
||||||
// to format this atom as string
|
// to format this atom as string
|
||||||
wxDataFormat clip(selection_data->selection);
|
wxDataFormat clip(selection_data->selection);
|
||||||
wxLogTrace( TRACE_CLIPBOARD,
|
wxLogTrace( TRACE_CLIPBOARD,
|
||||||
wxT("Received available formats for clipboard %s"),
|
wxT("Received available formats for clipboard %s"),
|
||||||
clip.GetId().c_str() );
|
clip.GetId().c_str() );
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// the atoms we received, holding a list of targets (= formats)
|
// the atoms we received, holding a list of targets (= formats)
|
||||||
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
|
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
|
||||||
@@ -283,7 +281,6 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
|||||||
|
|
||||||
wxDataFormat format( selection_data->target );
|
wxDataFormat format( selection_data->target );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxLogTrace(TRACE_CLIPBOARD,
|
wxLogTrace(TRACE_CLIPBOARD,
|
||||||
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
|
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
|
||||||
format.GetId().c_str(),
|
format.GetId().c_str(),
|
||||||
@@ -292,7 +289,6 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
|||||||
wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->selection))).c_str(),
|
wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->selection))).c_str(),
|
||||||
GPOINTER_TO_UINT( signal_data )
|
GPOINTER_TO_UINT( signal_data )
|
||||||
);
|
);
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
if ( !data->IsSupportedFormat( format ) )
|
if ( !data->IsSupportedFormat( format ) )
|
||||||
return;
|
return;
|
||||||
@@ -387,14 +383,12 @@ async_targets_selection_received( GtkWidget *WXUNUSED(widget),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// it's not really a format, of course, but we can reuse its GetId() method
|
// it's not really a format, of course, but we can reuse its GetId() method
|
||||||
// to format this atom as string
|
// to format this atom as string
|
||||||
wxDataFormat clip(selection_data->selection);
|
wxDataFormat clip(selection_data->selection);
|
||||||
wxLogTrace( TRACE_CLIPBOARD,
|
wxLogTrace( TRACE_CLIPBOARD,
|
||||||
wxT("Received available formats for clipboard %s"),
|
wxT("Received available formats for clipboard %s"),
|
||||||
clip.GetId().c_str() );
|
clip.GetId().c_str() );
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// the atoms we received, holding a list of targets (= formats)
|
// the atoms we received, holding a list of targets (= formats)
|
||||||
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
|
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
|
||||||
|
@@ -26,12 +26,12 @@
|
|||||||
#include "wx/gtk/private/timer.h"
|
#include "wx/gtk/private/timer.h"
|
||||||
#include "wx/evtloop.h"
|
#include "wx/evtloop.h"
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
#include "wx/gtk/assertdlg_gtk.h"
|
#include "wx/gtk/assertdlg_gtk.h"
|
||||||
#if wxUSE_STACKWALKER
|
#if wxUSE_STACKWALKER
|
||||||
#include "wx/stackwalk.h"
|
#include "wx/stackwalk.h"
|
||||||
#endif // wxUSE_STACKWALKER
|
#endif // wxUSE_STACKWALKER
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -328,9 +328,7 @@ void wxGUIAppTraits::SetLocale()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL && wxUSE_STACKWALKER
|
||||||
|
|
||||||
#if wxUSE_STACKWALKER
|
|
||||||
|
|
||||||
// private helper class
|
// private helper class
|
||||||
class StackDump : public wxStackWalker
|
class StackDump : public wxStackWalker
|
||||||
@@ -379,13 +377,15 @@ extern "C"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STACKWALKER
|
#endif // wxDEBUG_LEVEL && wxUSE_STACKWALKER
|
||||||
|
|
||||||
bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg)
|
bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg)
|
||||||
{
|
{
|
||||||
// under GTK2 we prefer to use a dialog widget written using directly GTK+;
|
#if wxDEBUG_LEVEL
|
||||||
// in fact we cannot use a dialog written using wxWidgets: it would need
|
// under GTK2 we prefer to use a dialog widget written using directly in
|
||||||
// the wxWidgets idle processing to work correctly!
|
// GTK+ as use a dialog written using wxWidgets would need the wxWidgets
|
||||||
|
// idle processing to work correctly which might not be the case when
|
||||||
|
// assert happens
|
||||||
GtkWidget *dialog = gtk_assert_dialog_new();
|
GtkWidget *dialog = gtk_assert_dialog_new();
|
||||||
gtk_assert_dialog_set_message(GTK_ASSERT_DIALOG(dialog), msg.mb_str());
|
gtk_assert_dialog_set_message(GTK_ASSERT_DIALOG(dialog), msg.mb_str());
|
||||||
|
|
||||||
@@ -426,10 +426,13 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg)
|
|||||||
|
|
||||||
gtk_widget_destroy(dialog);
|
gtk_widget_destroy(dialog);
|
||||||
return returnCode;
|
return returnCode;
|
||||||
|
#else // !wxDEBUG_LEVEL
|
||||||
|
// this function is never called in this case
|
||||||
|
wxUnusedVar(msg);
|
||||||
|
return false;
|
||||||
|
#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
wxString wxGUIAppTraits::GetDesktopEnvironment() const
|
wxString wxGUIAppTraits::GetDesktopEnvironment() const
|
||||||
{
|
{
|
||||||
wxString de = wxSystemOptions::GetOption(_T("gtk.desktop"));
|
wxString de = wxSystemOptions::GetOption(_T("gtk.desktop"));
|
||||||
|
@@ -92,12 +92,10 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
|
|||||||
g_free(atom_name);
|
g_free(atom_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxDataFormat clip( selection_data->selection );
|
wxDataFormat clip( selection_data->selection );
|
||||||
wxLogTrace( TRACE_CLIPBOARD,
|
wxLogTrace( TRACE_CLIPBOARD,
|
||||||
wxT("selection received for targets, clipboard %s"),
|
wxT("selection received for targets, clipboard %s"),
|
||||||
clip.GetId().c_str() );
|
clip.GetId().c_str() );
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// the atoms we received, holding a list of targets (= formats)
|
// the atoms we received, holding a list of targets (= formats)
|
||||||
GdkAtom *atoms = (GdkAtom *)selection_data->data;
|
GdkAtom *atoms = (GdkAtom *)selection_data->data;
|
||||||
@@ -266,7 +264,6 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
|||||||
|
|
||||||
wxDataFormat format( selection_data->target );
|
wxDataFormat format( selection_data->target );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxLogTrace(TRACE_CLIPBOARD,
|
wxLogTrace(TRACE_CLIPBOARD,
|
||||||
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
|
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
|
||||||
format.GetId().c_str(),
|
format.GetId().c_str(),
|
||||||
@@ -275,7 +272,6 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
|||||||
wxString::FromAscii(gdk_atom_name(selection_data->selection)).c_str(),
|
wxString::FromAscii(gdk_atom_name(selection_data->selection)).c_str(),
|
||||||
GPOINTER_TO_UINT( signal_data )
|
GPOINTER_TO_UINT( signal_data )
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!data->IsSupportedFormat( format )) return;
|
if (!data->IsSupportedFormat( format )) return;
|
||||||
|
|
||||||
|
@@ -97,26 +97,6 @@ public:
|
|||||||
// and this one also modifies all the other font data fields
|
// and this one also modifies all the other font data fields
|
||||||
void SetNativeFontInfo(const wxNativeFontInfo& info);
|
void SetNativeFontInfo(const wxNativeFontInfo& info);
|
||||||
|
|
||||||
// debugger helper: shows what the font really is
|
|
||||||
//
|
|
||||||
// VZ: I need this as my gdb either shows wildly wrong values or crashes
|
|
||||||
// when I ask it to "p fontRefData" :-(
|
|
||||||
#if defined(__WXDEBUG__)
|
|
||||||
void Dump() const
|
|
||||||
{
|
|
||||||
wxPrintf(_T("%s-%s-%s-%d-%d\n"),
|
|
||||||
m_faceName.c_str(),
|
|
||||||
m_weight == wxFONTWEIGHT_NORMAL
|
|
||||||
? _T("normal")
|
|
||||||
: m_weight == wxFONTWEIGHT_BOLD
|
|
||||||
? _T("bold")
|
|
||||||
: _T("light"),
|
|
||||||
m_style == wxFONTSTYLE_NORMAL ? _T("regular") : _T("italic"),
|
|
||||||
m_pointSize,
|
|
||||||
m_encoding);
|
|
||||||
}
|
|
||||||
#endif // Debug
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init(int pointSize,
|
void Init(int pointSize,
|
||||||
|
@@ -430,15 +430,13 @@ int wxNotebook::DoSetSelection( size_t page, int flags )
|
|||||||
m_selection = page;
|
m_selection = page;
|
||||||
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page );
|
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
// gtk_notebook_set_current_page is supposed to emit the switch-page signal
|
||||||
if ( !(flags & SetSelection_SendEvent) )
|
// which should be caught by our gtk_notebook_page_change_callback which
|
||||||
{
|
// should have reset the flag to false, check it:
|
||||||
// gtk_notebook_set_current_page will emit the switch-page signal which will be
|
wxASSERT_LEVEL_2(
|
||||||
// caught by our gtk_notebook_page_change_callback which should have reset the
|
(flags & SetSelection_SendEvent) || !m_skipNextPageChangeEvent,
|
||||||
// flag to false:
|
"internal error in selection events generation"
|
||||||
wxASSERT(!m_skipNextPageChangeEvent);
|
);
|
||||||
}
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
wxNotebookPage *client = GetPage(page);
|
wxNotebookPage *client = GetPage(page);
|
||||||
if ( client )
|
if ( client )
|
||||||
|
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
#include "wx/thread.h"
|
#include "wx/thread.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -236,16 +236,13 @@ extern bool g_mainThreadLocked;
|
|||||||
// debug
|
// debug
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
# define DEBUG_MAIN_THREAD if (wxThread::IsMain() && g_mainThreadLocked) printf("gui reentrance");
|
# define DEBUG_MAIN_THREAD \
|
||||||
|
wxASSERT_MSG( !g_mainThreadLocked || !wxThread::IsMain(), \
|
||||||
|
"GUI reentrancy detected" )
|
||||||
#else
|
#else
|
||||||
# define DEBUG_MAIN_THREAD
|
# define DEBUG_MAIN_THREAD
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#define DEBUG_MAIN_THREAD
|
|
||||||
#endif // Debug
|
|
||||||
|
|
||||||
// the trace mask used for the focus debugging messages
|
// the trace mask used for the focus debugging messages
|
||||||
#define TRACE_FOCUS _T("focus")
|
#define TRACE_FOCUS _T("focus")
|
||||||
|
@@ -202,13 +202,12 @@ bool wxApp::OnInitGui()
|
|||||||
if ( !wxAppBase::OnInitGui() )
|
if ( !wxAppBase::OnInitGui() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// MGL redirects stdout and stderr to physical console, so lets redirect
|
// MGL redirects stdout and stderr to physical console, so lets redirect
|
||||||
// it to file in debug build. Do it only when WXSTDERR environment variable is set
|
// it to file if WXSTDERR environment variable is set to be able to see
|
||||||
|
// wxLogDebug() output
|
||||||
wxString redirect;
|
wxString redirect;
|
||||||
if ( wxGetEnv(wxT("WXSTDERR"), &redirect) )
|
if ( wxGetEnv(wxT("WXSTDERR"), &redirect) )
|
||||||
freopen(redirect.mb_str(), "wt", stderr);
|
freopen(redirect.mb_str(), "wt", stderr);
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
wxLog *oldLog = wxLog::SetActiveTarget(new wxLogGui);
|
wxLog *oldLog = wxLog::SetActiveTarget(new wxLogGui);
|
||||||
if ( oldLog ) delete oldLog;
|
if ( oldLog ) delete oldLog;
|
||||||
|
@@ -1139,7 +1139,7 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL >= 2
|
||||||
// FIXME_MGL -- debugging stuff, to be removed!
|
// FIXME_MGL -- debugging stuff, to be removed!
|
||||||
static int debugPaintEvents = -1;
|
static int debugPaintEvents = -1;
|
||||||
if ( debugPaintEvents == -1 )
|
if ( debugPaintEvents == -1 )
|
||||||
@@ -1150,7 +1150,7 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
|
|||||||
dc->fillRect(-1000,-1000,2000,2000);
|
dc->fillRect(-1000,-1000,2000,2000);
|
||||||
wxMilliSleep(50);
|
wxMilliSleep(50);
|
||||||
}
|
}
|
||||||
#endif
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
MGLRegion clip;
|
MGLRegion clip;
|
||||||
dc->getClipRegion(clip);
|
dc->getClipRegion(clip);
|
||||||
|
@@ -68,7 +68,6 @@ wxHashTable *wxWidgetHashTable = NULL;
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
typedef int (*XErrorHandlerFunc)(Display *, XErrorEvent *);
|
typedef int (*XErrorHandlerFunc)(Display *, XErrorEvent *);
|
||||||
@@ -86,7 +85,6 @@ static int wxXErrorHandler(Display *dpy, XErrorEvent *xevent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
bool wxApp::Initialize(int& argc_, wxChar **argv_)
|
bool wxApp::Initialize(int& argc_, wxChar **argv_)
|
||||||
{
|
{
|
||||||
@@ -251,10 +249,8 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
|
|||||||
}
|
}
|
||||||
m_initialDisplay = (WXDisplay*) dpy;
|
m_initialDisplay = (WXDisplay*) dpy;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// install the X error handler
|
// install the X error handler
|
||||||
gs_pfnXErrorHandler = XSetErrorHandler(wxXErrorHandler);
|
gs_pfnXErrorHandler = XSetErrorHandler(wxXErrorHandler);
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// Add general resize proc
|
// Add general resize proc
|
||||||
XtActionsRec rec;
|
XtActionsRec rec;
|
||||||
|
@@ -88,10 +88,9 @@ void wxFileSelOk(Widget WXUNUSED(fs), XtPointer WXUNUSED(client_data), XmFileSel
|
|||||||
|
|
||||||
static wxString ParseWildCard( const wxString& wild )
|
static wxString ParseWildCard( const wxString& wild )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
static const wxChar* msg =
|
static const char *msg =
|
||||||
_T("Motif file dialog does not understand this ")
|
"Motif file dialog does not understand this wildcard syntax";
|
||||||
_T("wildcard syntax");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxArrayString wildDescriptions, wildFilters;
|
wxArrayString wildDescriptions, wildFilters;
|
||||||
|
@@ -375,7 +375,6 @@ void wxAllocColor(Display *d,Colormap cmp,XColor *xc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxString wxGetXEventName(XEvent& event)
|
wxString wxGetXEventName(XEvent& event)
|
||||||
{
|
{
|
||||||
#if wxUSE_NANOX
|
#if wxUSE_NANOX
|
||||||
@@ -401,7 +400,6 @@ wxString wxGetXEventName(XEvent& event)
|
|||||||
return str;
|
return str;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// accelerators
|
// accelerators
|
||||||
|
@@ -230,7 +230,7 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& dt)
|
|||||||
|
|
||||||
wxDateTime wxCalendarCtrl::GetDate() const
|
wxDateTime wxCalendarCtrl::GetDate() const
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
if ( !MonthCal_GetCurSel(GetHwnd(), &st) )
|
if ( !MonthCal_GetCurSel(GetHwnd(), &st) )
|
||||||
{
|
{
|
||||||
@@ -242,7 +242,7 @@ wxDateTime wxCalendarCtrl::GetDate() const
|
|||||||
wxDateTime dt(st);
|
wxDateTime dt(st);
|
||||||
|
|
||||||
wxASSERT_MSG( dt == m_date, "mismatch between data and control" );
|
wxASSERT_MSG( dt == m_date, "mismatch between data and control" );
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
return m_date;
|
return m_date;
|
||||||
}
|
}
|
||||||
|
@@ -770,7 +770,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
// enumerate all explicit formats on the clipboard.
|
// enumerate all explicit formats on the clipboard.
|
||||||
// note that this does not include implicit / synthetic (automatically
|
// note that this does not include implicit / synthetic (automatically
|
||||||
// converted) formats.
|
// converted) formats.
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL >= 2
|
||||||
// get the format enumerator
|
// get the format enumerator
|
||||||
IEnumFORMATETC *pEnumFormatEtc = NULL;
|
IEnumFORMATETC *pEnumFormatEtc = NULL;
|
||||||
hr = pDataObject->EnumFormatEtc(DATADIR_GET, &pEnumFormatEtc);
|
hr = pDataObject->EnumFormatEtc(DATADIR_GET, &pEnumFormatEtc);
|
||||||
@@ -803,7 +803,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
|
|
||||||
pEnumFormatEtc->Release();
|
pEnumFormatEtc->Release();
|
||||||
}
|
}
|
||||||
#endif // Debug
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
STGMEDIUM medium;
|
STGMEDIUM medium;
|
||||||
// stop at the first valid format found on the clipboard
|
// stop at the first valid format found on the clipboard
|
||||||
|
@@ -143,13 +143,11 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
|||||||
|
|
||||||
if ( !m_hWnd )
|
if ( !m_hWnd )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxLogLastError(wxString::Format
|
wxLogLastError(wxString::Format
|
||||||
(
|
(
|
||||||
_T("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"),
|
_T("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"),
|
||||||
classname, style, exstyle
|
classname, style, exstyle
|
||||||
));
|
));
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -205,7 +205,7 @@ void wxDatePickerCtrl::SetValue(const wxDateTime& dt)
|
|||||||
|
|
||||||
wxDateTime wxDatePickerCtrl::GetValue() const
|
wxDateTime wxDatePickerCtrl::GetValue() const
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
wxDateTime dt;
|
wxDateTime dt;
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
if ( DateTime_GetSystemtime(GetHwnd(), &st) == GDT_VALID )
|
if ( DateTime_GetSystemtime(GetHwnd(), &st) == GDT_VALID )
|
||||||
@@ -216,7 +216,7 @@ wxDateTime wxDatePickerCtrl::GetValue() const
|
|||||||
wxASSERT_MSG( m_date.IsValid() == dt.IsValid() &&
|
wxASSERT_MSG( m_date.IsValid() == dt.IsValid() &&
|
||||||
(!dt.IsValid() || dt == m_date),
|
(!dt.IsValid() || dt == m_date),
|
||||||
_T("bug in wxDatePickerCtrl: m_date not in sync") );
|
_T("bug in wxDatePickerCtrl: m_date not in sync") );
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
return m_date;
|
return m_date;
|
||||||
}
|
}
|
||||||
|
@@ -457,12 +457,10 @@ void wxMSWDCImpl::SelectOldObjects(WXHDC dc)
|
|||||||
if (m_oldBitmap)
|
if (m_oldBitmap)
|
||||||
{
|
{
|
||||||
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
|
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
if (m_selectedBitmap.IsOk())
|
if (m_selectedBitmap.IsOk())
|
||||||
{
|
{
|
||||||
m_selectedBitmap.SetSelectedInto(NULL);
|
m_selectedBitmap.SetSelectedInto(NULL);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
m_oldBitmap = 0;
|
m_oldBitmap = 0;
|
||||||
if (m_oldPen)
|
if (m_oldPen)
|
||||||
|
@@ -223,7 +223,7 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) :
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
#endif // wxHAS_PAINT_DEBUG
|
||||||
|
|
||||||
m_window = window;
|
m_window = window;
|
||||||
|
|
||||||
|
@@ -106,9 +106,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
|||||||
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
|
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
|
||||||
if ( m_selectedBitmap.Ok() )
|
if ( m_selectedBitmap.Ok() )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
m_selectedBitmap.SetSelectedInto(NULL);
|
m_selectedBitmap.SetSelectedInto(NULL);
|
||||||
#endif
|
|
||||||
m_selectedBitmap = wxNullBitmap;
|
m_selectedBitmap = wxNullBitmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,9 +121,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
|||||||
if ( !hBmp )
|
if ( !hBmp )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
m_selectedBitmap.SetSelectedInto(GetOwner());
|
m_selectedBitmap.SetSelectedInto(GetOwner());
|
||||||
#endif
|
|
||||||
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
|
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
|
||||||
|
|
||||||
if ( !hBmp )
|
if ( !hBmp )
|
||||||
|
@@ -1269,7 +1269,6 @@ static DWORD wxRasMonitorThread(wxRasThreadData *data)
|
|||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
case WAIT_FAILED:
|
case WAIT_FAILED:
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// using wxLogLastError() from here is dangerous: we risk to
|
// using wxLogLastError() from here is dangerous: we risk to
|
||||||
// deadlock the main thread if wxLog sends output to GUI
|
// deadlock the main thread if wxLog sends output to GUI
|
||||||
DWORD err = GetLastError();
|
DWORD err = GetLastError();
|
||||||
@@ -1280,7 +1279,6 @@ static DWORD wxRasMonitorThread(wxRasThreadData *data)
|
|||||||
err,
|
err,
|
||||||
wxSysErrorMsg(err)
|
wxSysErrorMsg(err)
|
||||||
);
|
);
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// no sense in continuing, who knows if the handles we're
|
// no sense in continuing, who knows if the handles we're
|
||||||
// waiting for even exist yet...
|
// waiting for even exist yet...
|
||||||
|
@@ -112,17 +112,12 @@ int wxFontDialog::ShowModal()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// common dialog failed - why?
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
DWORD dwErr = CommDlgExtendedError();
|
DWORD dwErr = CommDlgExtendedError();
|
||||||
if ( dwErr != 0 )
|
if ( dwErr != 0 )
|
||||||
{
|
{
|
||||||
// this msg is only for developers
|
wxLogError(_("Common dialog failed with error code %0lx."), dwErr);
|
||||||
wxLogError(wxT("Common dialog failed with error code %0lx."),
|
|
||||||
dwErr);
|
|
||||||
}
|
}
|
||||||
//else: it was just cancelled
|
//else: it was just cancelled
|
||||||
#endif
|
|
||||||
|
|
||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
}
|
}
|
||||||
|
@@ -402,15 +402,15 @@ WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
|||||||
|
|
||||||
wstyle |= LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
|
wstyle |= LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
size_t nModes = 0;
|
size_t nModes = 0;
|
||||||
|
|
||||||
#define MAP_MODE_STYLE(wx, ms) \
|
#define MAP_MODE_STYLE(wx, ms) \
|
||||||
if ( style & (wx) ) { wstyle |= (ms); nModes++; }
|
if ( style & (wx) ) { wstyle |= (ms); nModes++; }
|
||||||
#else // !__WXDEBUG__
|
#else // !wxDEBUG_LEVEL
|
||||||
#define MAP_MODE_STYLE(wx, ms) \
|
#define MAP_MODE_STYLE(wx, ms) \
|
||||||
if ( style & (wx) ) wstyle |= (ms);
|
if ( style & (wx) ) wstyle |= (ms);
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
|
||||||
|
|
||||||
MAP_MODE_STYLE(wxLC_ICON, LVS_ICON)
|
MAP_MODE_STYLE(wxLC_ICON, LVS_ICON)
|
||||||
MAP_MODE_STYLE(wxLC_SMALL_ICON, LVS_SMALLICON)
|
MAP_MODE_STYLE(wxLC_SMALL_ICON, LVS_SMALLICON)
|
||||||
|
@@ -1424,11 +1424,9 @@ void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
|
|||||||
(WPARAM)hmenuFrame,
|
(WPARAM)hmenuFrame,
|
||||||
(LPARAM)hmenuWindow) )
|
(LPARAM)hmenuWindow) )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
DWORD err = ::GetLastError();
|
DWORD err = ::GetLastError();
|
||||||
if ( err )
|
if ( err )
|
||||||
wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
|
wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
|
||||||
#endif // __WXDEBUG__
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1480,7 +1480,7 @@ public:
|
|||||||
wxTimer* m_pTimer;
|
wxTimer* m_pTimer;
|
||||||
wxSize m_bestSize;
|
wxSize m_bestSize;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
wxDynamicLibrary m_dllQuartz;
|
wxDynamicLibrary m_dllQuartz;
|
||||||
LPAMGETERRORTEXT m_lpAMGetErrorText;
|
LPAMGETERRORTEXT m_lpAMGetErrorText;
|
||||||
wxString GetErrorString(HRESULT hrdsv);
|
wxString GetErrorString(HRESULT hrdsv);
|
||||||
@@ -1942,7 +1942,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend, wxMediaBackend)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Usual debugging macros
|
// Usual debugging macros
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
#define MAX_ERROR_TEXT_LEN 160
|
#define MAX_ERROR_TEXT_LEN 160
|
||||||
|
|
||||||
// Get the error string for Active Movie
|
// Get the error string for Active Movie
|
||||||
@@ -2213,7 +2213,7 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
|
|||||||
{
|
{
|
||||||
// First get the AMGetErrorText procedure in
|
// First get the AMGetErrorText procedure in
|
||||||
// debug mode for more meaningful messages
|
// debug mode for more meaningful messages
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
|
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
|
||||||
{
|
{
|
||||||
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
|
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
|
||||||
@@ -2778,7 +2778,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend, wxMediaBackend)
|
|||||||
// Usual debugging macros for MCI returns
|
// Usual debugging macros for MCI returns
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
#define wxMCIVERIFY(arg) \
|
#define wxMCIVERIFY(arg) \
|
||||||
{ \
|
{ \
|
||||||
DWORD nRet; \
|
DWORD nRet; \
|
||||||
|
@@ -1478,11 +1478,12 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
wxSize m_bestSize; // Cached size
|
wxSize m_bestSize; // Cached size
|
||||||
|
|
||||||
#ifdef __WXDEBUG__ // Stuff for getting useful debugging strings
|
// Stuff for getting useful debugging strings
|
||||||
|
#if wxDEBUG_LEVEL
|
||||||
wxDynamicLibrary m_dllQuartz;
|
wxDynamicLibrary m_dllQuartz;
|
||||||
LPAMGETERRORTEXT m_lpAMGetErrorText;
|
LPAMGETERRORTEXT m_lpAMGetErrorText;
|
||||||
wxString GetErrorString(HRESULT hrdsv);
|
wxString GetErrorString(HRESULT hrdsv);
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
wxEvtHandler* m_evthandler;
|
wxEvtHandler* m_evthandler;
|
||||||
|
|
||||||
friend class wxAMMediaEvtHandler;
|
friend class wxAMMediaEvtHandler;
|
||||||
@@ -1527,7 +1528,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxAMMediaBackend, wxMediaBackend)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Usual debugging macros
|
// Usual debugging macros
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
#define MAX_ERROR_TEXT_LEN 160
|
#define MAX_ERROR_TEXT_LEN 160
|
||||||
|
|
||||||
// Get the error string for Active Movie
|
// Get the error string for Active Movie
|
||||||
@@ -1614,13 +1615,13 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
|
|||||||
{
|
{
|
||||||
// First get the AMGetErrorText procedure in debug
|
// First get the AMGetErrorText procedure in debug
|
||||||
// mode for more meaningful messages
|
// mode for more meaningful messages
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
|
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
|
||||||
{
|
{
|
||||||
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
|
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
|
||||||
m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
|
m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -904,13 +904,9 @@ wxActiveXContainer::~wxActiveXContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VZ: we might want to really report an error instead of just asserting here
|
// VZ: we might want to really report an error instead of just asserting here
|
||||||
#ifdef __WXDEBUG__
|
#define CHECK_HR(hr) \
|
||||||
#define CHECK_HR(hr) \
|
wxASSERT_LEVEL_2_MSG( SUCCEEDED(hr), \
|
||||||
wxASSERT_MSG( SUCCEEDED(hr), \
|
|
||||||
wxString::Format("HRESULT = %X", (unsigned)(hr)) )
|
wxString::Format("HRESULT = %X", (unsigned)(hr)) )
|
||||||
#else
|
|
||||||
#define CHECK_HR(hr) wxUnusedVar(hr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// wxActiveXContainer::CreateActiveX
|
// wxActiveXContainer::CreateActiveX
|
||||||
|
@@ -61,11 +61,11 @@
|
|||||||
// functions
|
// functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
static const wxChar *GetTymedName(DWORD tymed);
|
static const wxChar *GetTymedName(DWORD tymed);
|
||||||
#else // !Debug
|
#else // !wxDEBUG_LEVEL
|
||||||
#define GetTymedName(tymed) wxEmptyString
|
#define GetTymedName(tymed) wxEmptyString
|
||||||
#endif // Debug/!Debug
|
#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxIEnumFORMATETC interface implementation
|
// wxIEnumFORMATETC interface implementation
|
||||||
@@ -719,7 +719,7 @@ void* wxDataObject::SetSizeInBuffer( void* buffer, size_t size,
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
|
|
||||||
const wxChar *wxDataObject::GetFormatName(wxDataFormat format)
|
const wxChar *wxDataObject::GetFormatName(wxDataFormat format)
|
||||||
{
|
{
|
||||||
@@ -764,7 +764,7 @@ const wxChar *wxDataObject::GetFormatName(wxDataFormat format)
|
|||||||
#endif // VC++
|
#endif // VC++
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // Debug
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxBitmapDataObject supports CF_DIB format
|
// wxBitmapDataObject supports CF_DIB format
|
||||||
@@ -1264,7 +1264,7 @@ void wxURLDataObject::SetURL(const wxString& url)
|
|||||||
// private functions
|
// private functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
|
|
||||||
static const wxChar *GetTymedName(DWORD tymed)
|
static const wxChar *GetTymedName(DWORD tymed)
|
||||||
{
|
{
|
||||||
@@ -1305,12 +1305,10 @@ void wxDataObject::SetAutoDelete()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
const wxChar *wxDataObject::GetFormatName(wxDataFormat WXUNUSED(format))
|
const wxChar *wxDataObject::GetFormatName(wxDataFormat WXUNUSED(format))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
#endif // wxUSE_DATAOBJ
|
#endif // wxUSE_DATAOBJ
|
||||||
|
|
||||||
|
@@ -130,7 +130,7 @@ wxBasicString::~wxBasicString()
|
|||||||
// Debug support
|
// Debug support
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__WXDEBUG__) && ( ( defined(__VISUALC__) && (__VISUALC__ > 1000) ) || defined(__MWERKS__) )
|
#if wxDEBUG_LEVEL && ( ( defined(__VISUALC__) && (__VISUALC__ > 1000) ) || defined(__MWERKS__) )
|
||||||
static wxString GetIidName(REFIID riid)
|
static wxString GetIidName(REFIID riid)
|
||||||
{
|
{
|
||||||
// an association between symbolic name and numeric value of an IID
|
// an association between symbolic name and numeric value of an IID
|
||||||
@@ -258,31 +258,10 @@ void wxLogRelease(const wxChar *szInterface, ULONG cRef)
|
|||||||
wxLogTrace(wxTRACE_OleCalls, wxT("After %s::Release: m_cRef = %d"), szInterface, cRef - 1);
|
wxLogTrace(wxTRACE_OleCalls, wxT("After %s::Release: m_cRef = %d"), szInterface, cRef - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ <= 1000)
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
// For VC++ 4
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
void wxLogQueryInterface(const char *szInterface, REFIID riid)
|
|
||||||
{
|
|
||||||
wxLogTrace("%s::QueryInterface", szInterface);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxLogAddRef(const char *szInterface, ULONG cRef)
|
#endif // __CYGWIN10__
|
||||||
{
|
|
||||||
wxLogTrace("After %s::AddRef: m_cRef = %d", szInterface, cRef + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxLogRelease(const char *szInterface, ULONG cRef)
|
#endif // wxUSE_OLE
|
||||||
{
|
|
||||||
wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// wxUSE_DRAG_AND_DROP
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// __CYGWIN10__
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// wxUSE_OLE
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_OLE && ( wxUSE_DRAG_AND_DROP || (defined(__WXDEBUG__) && wxUSE_DATAOBJ) )
|
#if wxUSE_OLE && (wxUSE_DRAG_AND_DROP || wxUSE_DATAOBJ)
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/msw/wrapwin.h"
|
#include "wx/msw/wrapwin.h"
|
||||||
|
@@ -373,11 +373,9 @@ bool wxPenRefData::Alloc()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
lb.lbStyle = BS_SOLID;
|
lb.lbStyle = BS_SOLID;
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// this should be unnecessary (it's unused) but suppresses the
|
// this should be unnecessary (it's unused) but suppresses the
|
||||||
// Purify messages about uninitialized memory read
|
// Purify messages about uninitialized memory read
|
||||||
lb.lbHatch = 0;
|
lb.lbHatch = 0;
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,6 @@
|
|||||||
// wxWindowsPrintNativeData
|
// wxWindowsPrintNativeData
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
static wxString wxGetPrintDlgError()
|
static wxString wxGetPrintDlgError()
|
||||||
{
|
{
|
||||||
DWORD err = CommDlgExtendedError();
|
DWORD err = CommDlgExtendedError();
|
||||||
@@ -79,7 +78,6 @@ static wxString wxGetPrintDlgError()
|
|||||||
}
|
}
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
static HGLOBAL
|
static HGLOBAL
|
||||||
wxCreateDevNames(const wxString& driverName,
|
wxCreateDevNames(const wxString& driverName,
|
||||||
@@ -366,11 +364,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
|
|||||||
pd.hDevMode = NULL;
|
pd.hDevMode = NULL;
|
||||||
pd.hDevNames = NULL;
|
pd.hDevNames = NULL;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxLogDebug(wxT("Printing error: ") + wxGetPrintDlgError());
|
||||||
wxString str(wxT("Printing error: "));
|
|
||||||
str += wxGetPrintDlgError();
|
|
||||||
wxLogDebug(str);
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -250,8 +250,8 @@ wxString wxStandardPaths::GetAppDir()
|
|||||||
{
|
{
|
||||||
wxFileName fn(wxGetFullModuleName());
|
wxFileName fn(wxGetFullModuleName());
|
||||||
|
|
||||||
// allow running the apps directly from build directory in debug builds
|
// allow running the apps directly from build directory in MSVC debug builds
|
||||||
#ifdef __WXDEBUG__
|
#ifdef _DEBUG
|
||||||
wxString lastdir;
|
wxString lastdir;
|
||||||
if ( fn.GetDirCount() )
|
if ( fn.GetDirCount() )
|
||||||
{
|
{
|
||||||
@@ -260,7 +260,7 @@ wxString wxStandardPaths::GetAppDir()
|
|||||||
if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc*msw*")) )
|
if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc*msw*")) )
|
||||||
fn.RemoveLastDir();
|
fn.RemoveLastDir();
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
#endif // _DEBUG
|
||||||
|
|
||||||
return fn.GetPath();
|
return fn.GetPath();
|
||||||
}
|
}
|
||||||
|
@@ -222,9 +222,9 @@ LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
|
|||||||
WPARAM wParam, LPARAM lParam);
|
WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL >= 2
|
||||||
const wxChar *wxGetMessageName(int message);
|
const wxChar *wxGetMessageName(int message);
|
||||||
#endif //__WXDEBUG__
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
void wxRemoveHandleAssociation(wxWindowMSW *win);
|
void wxRemoveHandleAssociation(wxWindowMSW *win);
|
||||||
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
|
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
|
||||||
@@ -638,13 +638,12 @@ void wxWindowMSW::SetFocus()
|
|||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
|
wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
|
||||||
|
|
||||||
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
|
#if !defined(__WXWINCE__)
|
||||||
::SetLastError(0);
|
::SetLastError(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !::SetFocus(hWnd) )
|
if ( !::SetFocus(hWnd) )
|
||||||
{
|
{
|
||||||
#if defined(__WXDEBUG__) && !defined(__WXMICROWIN__)
|
|
||||||
// was there really an error?
|
// was there really an error?
|
||||||
DWORD dwRes = ::GetLastError();
|
DWORD dwRes = ::GetLastError();
|
||||||
if ( dwRes )
|
if ( dwRes )
|
||||||
@@ -655,7 +654,6 @@ void wxWindowMSW::SetFocus()
|
|||||||
wxLogApiError(_T("SetFocus"), dwRes);
|
wxLogApiError(_T("SetFocus"), dwRes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // Debug
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2655,12 +2653,13 @@ wxWindowCreationHook::~wxWindowCreationHook()
|
|||||||
// Main window proc
|
// Main window proc
|
||||||
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
// trace all messages - useful for the debugging
|
// trace all messages: useful for the debugging but noticeably slows down
|
||||||
#ifdef __WXDEBUG__
|
// the code so don't do it by default
|
||||||
|
#if wxDEBUG_LEVEL >= 2
|
||||||
wxLogTrace(wxTraceMessages,
|
wxLogTrace(wxTraceMessages,
|
||||||
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
|
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
|
||||||
wxGetMessageName(message), hWnd, (long)wParam, lParam);
|
wxGetMessageName(message), hWnd, (long)wParam, lParam);
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
|
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
|
||||||
|
|
||||||
@@ -3512,10 +3511,10 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
|||||||
|
|
||||||
if ( !processed )
|
if ( !processed )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL >= 2
|
||||||
wxLogTrace(wxTraceMessages, wxT("Forwarding %s to DefWindowProc."),
|
wxLogTrace(wxTraceMessages, wxT("Forwarding %s to DefWindowProc."),
|
||||||
wxGetMessageName(message));
|
wxGetMessageName(message));
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
rc.result = MSWDefWindowProc(message, wParam, lParam);
|
rc.result = MSWDefWindowProc(message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3539,20 +3538,24 @@ void wxAssociateWinWithHandle(HWND hwnd, wxWindowMSW *win)
|
|||||||
wxCHECK_RET( hwnd != (HWND)NULL,
|
wxCHECK_RET( hwnd != (HWND)NULL,
|
||||||
wxT("attempt to add a NULL hwnd to window list ignored") );
|
wxT("attempt to add a NULL hwnd to window list ignored") );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
WindowHandles::const_iterator i = gs_windowHandles.find(hwnd);
|
WindowHandles::const_iterator i = gs_windowHandles.find(hwnd);
|
||||||
if ( i != gs_windowHandles.end() )
|
if ( i != gs_windowHandles.end() )
|
||||||
{
|
{
|
||||||
if ( i->second != win )
|
if ( i->second != win )
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("HWND %p already associated with another window (%s)"),
|
wxFAIL_MSG(
|
||||||
hwnd, win->GetClassInfo()->GetClassName());
|
wxString::Format(
|
||||||
|
wxT("HWND %p already associated with another window (%s)"),
|
||||||
|
hwnd, win->GetClassInfo()->GetClassName()
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
//else: this actually happens currently because we associate the window
|
//else: this actually happens currently because we associate the window
|
||||||
// with its HWND during creation (if we create it) and also when
|
// with its HWND during creation (if we create it) and also when
|
||||||
// SubclassWin() is called later, this is ok
|
// SubclassWin() is called later, this is ok
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
gs_windowHandles[hwnd] = (wxWindow *)win;
|
gs_windowHandles[hwnd] = (wxWindow *)win;
|
||||||
}
|
}
|
||||||
@@ -6357,7 +6360,7 @@ void wxSetKeyboardHook(bool doIt)
|
|||||||
|
|
||||||
#endif // !__WXMICROWIN__
|
#endif // !__WXMICROWIN__
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL > =2
|
||||||
const wxChar *wxGetMessageName(int message)
|
const wxChar *wxGetMessageName(int message)
|
||||||
{
|
{
|
||||||
switch ( message )
|
switch ( message )
|
||||||
@@ -6826,7 +6829,7 @@ const wxChar *wxGetMessageName(int message)
|
|||||||
return s_szBuf.c_str();
|
return s_szBuf.c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //__WXDEBUG__
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win)
|
static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win)
|
||||||
{
|
{
|
||||||
|
@@ -235,9 +235,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
|
|
||||||
// Some people may wish to use this, but
|
// Some people may wish to use this, but
|
||||||
// probably it shouldn't be here by default.
|
// probably it shouldn't be here by default.
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// wxRedirectIOToConsole();
|
// wxRedirectIOToConsole();
|
||||||
#endif
|
|
||||||
|
|
||||||
wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
|
wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
|
||||||
|
|
||||||
|
@@ -147,9 +147,7 @@ bool wxControl::OS2CreateControl( const wxChar* zClassname,
|
|||||||
|
|
||||||
if ( !m_hWnd )
|
if ( !m_hWnd )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
wxLogError(wxT("Failed to create a control of class '%s'"), zClassname);
|
wxLogError(wxT("Failed to create a control of class '%s'"), zClassname);
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -314,7 +314,7 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *pCanvas) :
|
|||||||
wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") );
|
wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // __WXDEBUG__
|
#endif // wxHAS_PAINT_DEBUG
|
||||||
|
|
||||||
m_pCanvas = pCanvas;
|
m_pCanvas = pCanvas;
|
||||||
|
|
||||||
|
@@ -732,7 +732,7 @@ pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef eve
|
|||||||
DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacAppEventHandler )
|
DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacAppEventHandler )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( __WXDEBUG__ ) && wxOSX_USE_COCOA_OR_CARBON
|
#if wxDEBUG_LEVEL && wxOSX_USE_COCOA_OR_CARBON
|
||||||
|
|
||||||
pascal static void
|
pascal static void
|
||||||
wxMacAssertOutputHandler(OSType WXUNUSED(componentSignature),
|
wxMacAssertOutputHandler(OSType WXUNUSED(componentSignature),
|
||||||
@@ -778,7 +778,7 @@ wxMacAssertOutputHandler(OSType WXUNUSED(componentSignature),
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //__WXDEBUG__
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
extern "C" void macPostedEventCallback(void *WXUNUSED(unused))
|
extern "C" void macPostedEventCallback(void *WXUNUSED(unused))
|
||||||
{
|
{
|
||||||
@@ -789,7 +789,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
{
|
{
|
||||||
// Mac-specific
|
// Mac-specific
|
||||||
|
|
||||||
#if defined( __WXDEBUG__ ) && wxOSX_USE_COCOA_OR_CARBON
|
#if wxDEBUG_LEVEL && wxOSX_USE_COCOA_OR_CARBON
|
||||||
InstallDebugAssertOutputHandler( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );
|
InstallDebugAssertOutputHandler( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -848,7 +848,6 @@ wxThread::~wxThread()
|
|||||||
|
|
||||||
g_numberOfThreads--;
|
g_numberOfThreads--;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
m_critsect.Enter();
|
m_critsect.Enter();
|
||||||
|
|
||||||
// check that the thread either exited or couldn't be created
|
// check that the thread either exited or couldn't be created
|
||||||
@@ -861,7 +860,6 @@ wxThread::~wxThread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_critsect.Leave();
|
m_critsect.Leave();
|
||||||
#endif
|
|
||||||
|
|
||||||
wxDELETE( m_internal ) ;
|
wxDELETE( m_internal ) ;
|
||||||
}
|
}
|
||||||
|
@@ -86,12 +86,9 @@ protected:
|
|||||||
unsigned wxDisplayFactoryMacOSX::GetCount()
|
unsigned wxDisplayFactoryMacOSX::GetCount()
|
||||||
{
|
{
|
||||||
CGDisplayCount count;
|
CGDisplayCount count;
|
||||||
#ifdef __WXDEBUG__
|
CGDisplayErr err = CGGetActiveDisplayList(0, NULL, &count);
|
||||||
CGDisplayErr err =
|
|
||||||
#endif
|
|
||||||
CGGetActiveDisplayList(0, NULL, &count);
|
|
||||||
|
|
||||||
wxASSERT(err == CGDisplayNoErr);
|
wxCHECK_MSG( err != CGDisplayNoErr, 0, "CGGetActiveDisplayList() failed" );
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -136,12 +133,9 @@ wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(unsigned n)
|
|||||||
CGDisplayCount theCount = GetCount();
|
CGDisplayCount theCount = GetCount();
|
||||||
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
|
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
CGDisplayErr err = CGGetActiveDisplayList(theCount, theIDs, &theCount);
|
||||||
CGDisplayErr err =
|
wxCHECK_MSG( err != CGDisplayNoErr, NULL, "CGGetActiveDisplayList() failed" );
|
||||||
#endif
|
|
||||||
CGGetActiveDisplayList(theCount, theIDs, &theCount);
|
|
||||||
|
|
||||||
wxASSERT( err == CGDisplayNoErr );
|
|
||||||
wxASSERT( n < theCount );
|
wxASSERT( n < theCount );
|
||||||
|
|
||||||
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
|
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
|
||||||
|
@@ -55,22 +55,6 @@ struct WXDLLEXPORT wxPaintDCInfo
|
|||||||
|
|
||||||
WX_DEFINE_OBJARRAY(wxArrayDCInfo)
|
WX_DEFINE_OBJARRAY(wxArrayDCInfo)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// macros
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// global variables
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
// a global variable which we check to verify that wxPaintDC are only
|
|
||||||
// created in response to WM_PAINT message - doing this from elsewhere is a
|
|
||||||
// common programming error among wxWidgets programmers and might lead to
|
|
||||||
// very subtle and difficult to debug refresh/repaint bugs.
|
|
||||||
int g_isPainting = 0;
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -192,15 +176,6 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) :
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( window, wxT("NULL canvas in wxPaintDCImpl ctor") );
|
wxCHECK_RET( window, wxT("NULL canvas in wxPaintDCImpl ctor") );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
if ( g_isPainting <= 0 )
|
|
||||||
{
|
|
||||||
wxFAIL_MSG( wxT("wxPaintDCImpl may be created only in EVT_PAINT handler!") );
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
m_window = window;
|
m_window = window;
|
||||||
|
|
||||||
// do we have a DC for this window in the cache?
|
// do we have a DC for this window in the cache?
|
||||||
|
@@ -959,14 +959,8 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
|
|||||||
|
|
||||||
int propagatedFlags = argFlags & (wxPG_REPORT_ERROR|wxPG_PROGRAMMATIC_VALUE);
|
int propagatedFlags = argFlags & (wxPG_REPORT_ERROR|wxPG_PROGRAMMATIC_VALUE);
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace("propgrid",
|
||||||
bool debug_print = false;
|
wxT(">> %s.StringToValue('%s')"), GetLabel(), text);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
if ( debug_print )
|
|
||||||
wxLogDebug(wxT(">> %s.StringToValue('%s')"),GetLabel().c_str(),text.c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxString::const_iterator it = text.begin();
|
wxString::const_iterator it = text.begin();
|
||||||
wxUniChar a;
|
wxUniChar a;
|
||||||
@@ -998,11 +992,9 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
|
|||||||
wxVariant variant(child->GetValue());
|
wxVariant variant(child->GetValue());
|
||||||
wxString childName = child->GetBaseName();
|
wxString childName = child->GetBaseName();
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace("propgrid",
|
||||||
if ( debug_print )
|
wxT("token = '%s', child = %s"),
|
||||||
wxLogDebug(wxT("token = '%s', child = %s"),
|
token, childName);
|
||||||
token.c_str(), childName.c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Add only if editable or setting programmatically
|
// Add only if editable or setting programmatically
|
||||||
if ( (argFlags & wxPG_PROGRAMMATIC_VALUE) ||
|
if ( (argFlags & wxPG_PROGRAMMATIC_VALUE) ||
|
||||||
@@ -2505,12 +2497,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxPGRootProperty, wxPGProperty)
|
|||||||
wxPGRootProperty::wxPGRootProperty( const wxString& name )
|
wxPGRootProperty::wxPGRootProperty( const wxString& name )
|
||||||
: wxPGProperty()
|
: wxPGProperty()
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
m_name = name;
|
m_name = name;
|
||||||
m_label = m_name;
|
m_label = m_name;
|
||||||
#else
|
|
||||||
wxUnusedVar(name);
|
|
||||||
#endif
|
|
||||||
SetParentalType(0);
|
SetParentalType(0);
|
||||||
m_depth = 0;
|
m_depth = 0;
|
||||||
}
|
}
|
||||||
|
@@ -627,11 +627,10 @@ wxPropertyGrid::~wxPropertyGrid()
|
|||||||
m_tlp->RemoveEventHandler(handler);
|
m_tlp->RemoveEventHandler(handler);
|
||||||
delete handler;
|
delete handler;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxASSERT_MSG( !IsEditorsValueModified(),
|
||||||
if ( IsEditorsValueModified() )
|
wxS("Most recent change in property editor was lost!!! ")
|
||||||
::wxMessageBox(wxS("Most recent change in property editor was lost!!!\n\n(if you don't want this to happen, close your frames and dialogs using Close(false).)"),
|
wxS("(if you don't want this to happen, close your frames ")
|
||||||
wxS("wxPropertyGrid Debug Warning") );
|
wxS("and dialogs using Close(false).)") );
|
||||||
#endif
|
|
||||||
|
|
||||||
#if wxPG_DOUBLE_BUFFER
|
#if wxPG_DOUBLE_BUFFER
|
||||||
if ( m_doubleBuffer )
|
if ( m_doubleBuffer )
|
||||||
@@ -3749,16 +3748,10 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
|
|||||||
|
|
||||||
m_pState->EnsureVirtualHeight();
|
m_pState->EnsureVirtualHeight();
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxASSERT_LEVEL_2_MSG(
|
||||||
int by1 = m_pState->GetVirtualHeight();
|
m_pState->GetVirtualHeight() == m_pState->GetActualVirtualHeight(),
|
||||||
int by2 = m_pState->GetActualVirtualHeight();
|
"VirtualHeight and ActualVirtualHeight should match"
|
||||||
if ( by1 != by2 )
|
);
|
||||||
{
|
|
||||||
wxString s = wxString::Format(wxT("VirtualHeight=%i, ActualVirtualHeight=%i, should match!"), by1, by2);
|
|
||||||
wxFAIL_MSG(s.c_str());
|
|
||||||
wxLogDebug(s);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE;
|
m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE;
|
||||||
|
|
||||||
|
@@ -936,10 +936,6 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
|||||||
|
|
||||||
wxPropertyGrid* pg = GetGrid();
|
wxPropertyGrid* pg = GetGrid();
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
const bool debug = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int lastColumn = m_colWidths.size() - 1;
|
unsigned int lastColumn = m_colWidths.size() - 1;
|
||||||
int width = m_width;
|
int width = m_width;
|
||||||
@@ -949,10 +945,9 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
|||||||
// Column to reduce, if needed. Take last one that exceeds minimum width.
|
// Column to reduce, if needed. Take last one that exceeds minimum width.
|
||||||
int reduceCol = -1;
|
int reduceCol = -1;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace("propgrid",
|
||||||
if ( debug )
|
wxS("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"),
|
||||||
wxLogDebug(wxT("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"), width, clientWidth);
|
width, clientWidth);
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check min sizes
|
// Check min sizes
|
||||||
@@ -975,10 +970,9 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
|||||||
for ( i=0; i<m_colWidths.size(); i++ )
|
for ( i=0; i<m_colWidths.size(); i++ )
|
||||||
colsWidth += m_colWidths[i];
|
colsWidth += m_colWidths[i];
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace("propgrid",
|
||||||
if ( debug )
|
wxS(" HasVirtualWidth: %i colsWidth: %i"),
|
||||||
wxLogDebug(wxT(" HasVirtualWidth: %i colsWidth: %i"),(int)pg->HasVirtualWidth(),colsWidth);
|
(int)pg->HasVirtualWidth(), colsWidth);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Then mode-based requirement
|
// Then mode-based requirement
|
||||||
if ( !pg->HasVirtualWidth() )
|
if ( !pg->HasVirtualWidth() )
|
||||||
@@ -989,10 +983,9 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
|||||||
if ( colsWidth < width )
|
if ( colsWidth < width )
|
||||||
{
|
{
|
||||||
// Increase column
|
// Increase column
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace("propgrid",
|
||||||
if ( debug )
|
wxS(" Adjust last column to %i"),
|
||||||
wxLogDebug(wxT(" Adjust last column to %i"), m_colWidths[lastColumn] + widthHigher);
|
m_colWidths[lastColumn] + widthHigher);
|
||||||
#endif
|
|
||||||
m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher;
|
m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher;
|
||||||
}
|
}
|
||||||
else if ( colsWidth > width )
|
else if ( colsWidth > width )
|
||||||
@@ -1000,10 +993,10 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
|||||||
// Reduce column
|
// Reduce column
|
||||||
if ( reduceCol != -1 )
|
if ( reduceCol != -1 )
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
wxLogTrace("propgrid",
|
||||||
if ( debug )
|
wxT(" Reduce column %i (by %i)"),
|
||||||
wxLogDebug(wxT(" Reduce column %i (by %i)"), reduceCol, -widthHigher);
|
reduceCol, -widthHigher);
|
||||||
#endif
|
|
||||||
// Reduce widest column, and recheck
|
// Reduce widest column, and recheck
|
||||||
m_colWidths[reduceCol] = m_colWidths[reduceCol] + widthHigher;
|
m_colWidths[reduceCol] = m_colWidths[reduceCol] + widthHigher;
|
||||||
CheckColumnWidths();
|
CheckColumnWidths();
|
||||||
@@ -1025,11 +1018,10 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
|||||||
pg->RecalculateVirtualSize();
|
pg->RecalculateVirtualSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
for ( i=0; i<m_colWidths.size(); i++ )
|
||||||
if ( debug )
|
{
|
||||||
for ( i=0; i<m_colWidths.size(); i++ )
|
wxLogTrace("propgrid", wxS("col%i: %i"), i, m_colWidths[i]);
|
||||||
wxLogDebug(wxT("col%i: %i"),i,m_colWidths[i]);
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Auto center splitter
|
// Auto center splitter
|
||||||
if ( !(pg->GetInternalFlags() & wxPG_FL_DONT_CENTER_SPLITTER) &&
|
if ( !(pg->GetInternalFlags() & wxPG_FL_DONT_CENTER_SPLITTER) &&
|
||||||
@@ -1424,13 +1416,12 @@ void wxPropertyGridPageState::DoSetPropertyValues( const wxVariantList& list, wx
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
wxASSERT_LEVEL_2_MSG(
|
||||||
if ( wxStrcmp(current->GetType(), p->GetValue().GetType()) != 0)
|
wxStrcmp(current->GetType(), p->GetValue().GetType()) == 0,
|
||||||
{
|
wxString::Format(
|
||||||
wxLogDebug(wxT("wxPropertyGridPageState::DoSetPropertyValues Warning: Setting value of property \"%s\" from variant"),
|
wxS("setting value of property \"%s\" from variant"),
|
||||||
p->GetName().c_str());
|
p->GetName().c_str())
|
||||||
}
|
);
|
||||||
#endif
|
|
||||||
|
|
||||||
p->SetValue(*current);
|
p->SetValue(*current);
|
||||||
}
|
}
|
||||||
|
@@ -2854,7 +2854,7 @@ bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, co
|
|||||||
|
|
||||||
bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0);
|
bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0);
|
||||||
// bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0);
|
// bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0);
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0);
|
bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -40,11 +40,9 @@
|
|||||||
#include "wx/univ/inphand.h"
|
#include "wx/univ/inphand.h"
|
||||||
#include "wx/univ/theme.h"
|
#include "wx/univ/theme.h"
|
||||||
|
|
||||||
#define WXDEBUG_SCROLLBAR
|
#if wxDEBUG_LEVEL >= 2
|
||||||
|
#define WXDEBUG_SCROLLBAR
|
||||||
#ifndef __WXDEBUG__
|
#endif
|
||||||
#undef WXDEBUG_SCROLLBAR
|
|
||||||
#endif // !__WXDEBUG__
|
|
||||||
|
|
||||||
#if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
|
#if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
@@ -149,16 +149,13 @@
|
|||||||
|
|
||||||
#include "wx/cmdproc.h"
|
#include "wx/cmdproc.h"
|
||||||
|
|
||||||
// turn extra wxTextCtrl-specific debugging on/off
|
#if wxDEBUG_LEVEL >= 2
|
||||||
#define WXDEBUG_TEXT
|
// turn extra wxTextCtrl-specific debugging on/off
|
||||||
|
#define WXDEBUG_TEXT
|
||||||
|
|
||||||
// turn wxTextCtrl::Replace() debugging on (slows down code a *lot*!)
|
// turn wxTextCtrl::Replace() debugging on (slows down code a *lot*!)
|
||||||
#define WXDEBUG_TEXT_REPLACE
|
#define WXDEBUG_TEXT_REPLACE
|
||||||
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
#ifndef __WXDEBUG__
|
|
||||||
#undef WXDEBUG_TEXT
|
|
||||||
#undef WXDEBUG_TEXT_REPLACE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// wxStringTokenize only needed for debug checks
|
// wxStringTokenize only needed for debug checks
|
||||||
#ifdef WXDEBUG_TEXT_REPLACE
|
#ifdef WXDEBUG_TEXT_REPLACE
|
||||||
@@ -4765,11 +4762,11 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef __WXDEBUG__
|
#if wxDEBUG_LEVEL >= 2
|
||||||
// Ctrl-R refreshes the control in debug mode
|
// Ctrl-R refreshes the control in debug mode
|
||||||
else if ( event.ControlDown() && event.GetKeyCode() == 'r' )
|
else if ( event.ControlDown() && event.GetKeyCode() == 'r' )
|
||||||
Refresh();
|
Refresh();
|
||||||
#endif // __WXDEBUG__
|
#endif // wxDEBUG_LEVEL >= 2
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
@@ -45,11 +45,9 @@
|
|||||||
#include "wx/caret.h"
|
#include "wx/caret.h"
|
||||||
#endif // wxUSE_CARET
|
#endif // wxUSE_CARET
|
||||||
|
|
||||||
// turn Refresh() debugging on/off
|
#if wxDEBUG_LEVEL >= 2
|
||||||
#define WXDEBUG_REFRESH
|
// turn Refresh() debugging on/off
|
||||||
|
#define WXDEBUG_REFRESH
|
||||||
#ifndef __WXDEBUG__
|
|
||||||
#undef WXDEBUG_REFRESH
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
|
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
|
||||||
|
@@ -1624,7 +1624,6 @@ bool wxThread::TestDestroy()
|
|||||||
|
|
||||||
wxThread::~wxThread()
|
wxThread::~wxThread()
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
m_critsect.Enter();
|
m_critsect.Enter();
|
||||||
|
|
||||||
// check that the thread either exited or couldn't be created
|
// check that the thread either exited or couldn't be created
|
||||||
@@ -1636,7 +1635,6 @@ wxThread::~wxThread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_critsect.Leave();
|
m_critsect.Leave();
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
delete m_internal;
|
delete m_internal;
|
||||||
|
|
||||||
|
@@ -1475,7 +1475,7 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits,
|
|||||||
|
|
||||||
M_BMPHANDLERDATA->m_bpp = bpp; // mono as well?
|
M_BMPHANDLERDATA->m_bpp = bpp; // mono as well?
|
||||||
|
|
||||||
#if __WXDEBUG__
|
#if wxDEBUG_LEVEL
|
||||||
unsigned int depthRet;
|
unsigned int depthRet;
|
||||||
int xRet, yRet;
|
int xRet, yRet;
|
||||||
unsigned int widthRet, heightRet, borderWidthRet;
|
unsigned int widthRet, heightRet, borderWidthRet;
|
||||||
@@ -1483,7 +1483,7 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits,
|
|||||||
&widthRet, &heightRet, &borderWidthRet, &depthRet);
|
&widthRet, &heightRet, &borderWidthRet, &depthRet);
|
||||||
|
|
||||||
wxASSERT_MSG( bpp == (int)depthRet, wxT("colour depth mismatch") );
|
wxASSERT_MSG( bpp == (int)depthRet, wxT("colour depth mismatch") );
|
||||||
#endif
|
#endif // wxDEBUG_LEVEL
|
||||||
|
|
||||||
XpmFreeAttributes(&xpmAttr);
|
XpmFreeAttributes(&xpmAttr);
|
||||||
|
|
||||||
|
@@ -152,11 +152,6 @@ bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toRepar
|
|||||||
if (!WM_STATE)
|
if (!WM_STATE)
|
||||||
WM_STATE = XInternAtom(display, "WM_STATE", False);
|
WM_STATE = XInternAtom(display, "WM_STATE", False);
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
|
||||||
if (!windowName.empty())
|
|
||||||
wxLogDebug(_T("Waiting for window %s"), windowName.c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sm_done = false;
|
sm_done = false;
|
||||||
|
|
||||||
wxEventLoop eventLoop;
|
wxEventLoop eventLoop;
|
||||||
|
Reference in New Issue
Block a user