git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59725
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
68 files changed:
// used like this:
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
// to turn on memory leak checks for programs compiled with Microsoft Visual
// used like this:
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
// 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_
#define _MSW_MSVCRT_H_
#ifndef _MSW_MSVCRT_H_
#define _MSW_MSVCRT_H_
// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
// builds
#undef wxUSE_VC_CRTDBG
// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
// builds
#undef wxUSE_VC_CRTDBG
-#if defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
+#if defined(_DEBUG) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
&& !defined(UNDER_CE)
// it doesn't combine well with wxWin own memory debugging methods
#if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
&& !defined(UNDER_CE)
// it doesn't combine well with wxWin own memory debugging methods
#if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
#endif
#ifdef wxUSE_VC_CRTDBG
#endif
#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
#ifdef new
#undef new
// Need to undef new if including crtdbg.h which may redefine new itself
#ifdef new
#undef new
unsigned wxDisplayFactoryMacOSX::GetCount()
{
CGDisplayCount count;
unsigned wxDisplayFactoryMacOSX::GetCount()
{
CGDisplayCount count;
-#ifdef __WXDEBUG__
- CGDisplayErr err =
-#endif
- CGGetActiveDisplayList(0, NULL, &count);
-
- wxASSERT(err == CGDisplayNoErr);
+ CGDisplayErr err = CGGetActiveDisplayList(0, NULL, &count);
+ wxCHECK_MSG( err != CGDisplayNoErr, 0, "CGGetActiveDisplayList() failed" );
CGDisplayCount theCount = GetCount();
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
CGDisplayCount theCount = GetCount();
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
-#ifdef __WXDEBUG__
- CGDisplayErr err =
-#endif
- CGGetActiveDisplayList(theCount, theIDs, &theCount);
+ CGDisplayErr err = CGGetActiveDisplayList(theCount, theIDs, &theCount);
+ wxCHECK_MSG( err != CGDisplayNoErr, NULL, "CGGetActiveDisplayList() failed" );
- wxASSERT( err == CGDisplayNoErr );
wxASSERT( n < theCount );
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
wxASSERT( n < theCount );
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
int fl)
{
// wxCMD_LINE_USAGE_TEXT uses only description, shortName and longName is empty
int fl)
{
// wxCMD_LINE_USAGE_TEXT uses only description, shortName and longName is empty
if ( k != wxCMD_LINE_USAGE_TEXT )
{
wxASSERT_MSG
if ( k != wxCMD_LINE_USAGE_TEXT )
{
wxASSERT_MSG
wxT("Long option contains invalid characters")
);
}
wxT("Long option contains invalid characters")
);
}
- #endif // __WXDEBUG__
-
{
// do some consistency checks: a required parameter can't follow an
// optional one and nothing should follow a parameter with MULTIPLE flag
{
// do some consistency checks: a required parameter can't follow an
// optional one and nothing should follow a parameter with MULTIPLE flag
if ( !m_data->m_paramDesc.IsEmpty() )
{
wxCmdLineParam& param = m_data->m_paramDesc.Last();
if ( !m_data->m_paramDesc.IsEmpty() )
{
wxCmdLineParam& param = m_data->m_paramDesc.Last();
_T("a required parameter can't follow an optional one") );
}
}
_T("a required parameter can't follow an optional one") );
}
}
wxCmdLineParam *param = new wxCmdLineParam(desc, type, flags);
wxCmdLineParam *param = new wxCmdLineParam(desc, type, flags);
// (i.e. JDN(Jan 1, 1970) = 2440587.5)
static const long EPOCH_JDN = 2440587l;
// (i.e. JDN(Jan 1, 1970) = 2440587.5)
static const long EPOCH_JDN = 2440587l;
-// used only in asserts
-#ifdef __WXDEBUG__
+// these values are only used in asserts so don't define them if asserts are
+// 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
// reference date for us) is Nov 24, 4714BC
static const int JDN_0_YEAR = -4713;
static const int JDN_0_MONTH = wxDateTime::Nov;
static const int JDN_0_DAY = 24;
// 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
static const int JDN_0_YEAR = -4713;
static const int JDN_0_MONTH = wxDateTime::Nov;
static const int JDN_0_DAY = 24;
// the constants used for JDN calculations
static const long JDN_OFFSET = 32046l;
// the constants used for JDN calculations
static const long JDN_OFFSET = 32046l;
// private functions
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
-// debugger helper: shows what the date really is
-#ifdef __WXDEBUG__
+// debugger helper: this function can be called from a debugger to show what
+// the date really is
extern const char *wxDumpDate(const wxDateTime* dt)
{
static char buf[128];
extern const char *wxDumpDate(const wxDateTime* dt)
{
static char buf[128];
// get the number of days in the given month of the given year
static inline
// get the number of days in the given month of the given year
static inline
wxString volume, path, name, ext;
bool hasExt;
wxString volume, path, name, ext;
bool hasExt;
- // do some consistency checks in debug mode: the name should be really just
- // the filename and the path should be really just a path
-#ifdef __WXDEBUG__
+ // do some consistency checks: the name should be really just the filename
+ // and the path should be really just a path
wxString volDummy, pathDummy, nameDummy, extDummy;
SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format);
wxString volDummy, pathDummy, nameDummy, extDummy;
SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format);
wxASSERT_MSG( nameDummy.empty() && extDummy.empty(),
_T("the path shouldn't contain file name nor extension") );
wxASSERT_MSG( nameDummy.empty() && extDummy.empty(),
_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);
}
+// 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
// ============================================================================
// don't show the passwords in the logs (even in debug ones)
wxString cmd, password;
if ( command.Upper().StartsWith(_T("PASS "), &password) )
// don't show the passwords in the logs (even in debug ones)
wxString cmd, password;
if ( command.Upper().StartsWith(_T("PASS "), &password) )
m_lastError = wxPROTO_NOERR;
return GetResult();
m_lastError = wxPROTO_NOERR;
return GetResult();
#include "wx/scopedptr.h"
#include "wx/except.h"
#include "wx/scopedptr.h"
#include "wx/except.h"
-#if defined(__WXMSW__) && defined(__WXDEBUG__)
#include "wx/msw/msvcrt.h"
#include "wx/msw/msvcrt.h"
- static struct EnableMemLeakChecking
- {
- EnableMemLeakChecking()
+ #ifdef wxCrtSetDbgFlag
+ static struct EnableMemLeakChecking
- // do check for memory leaks on program exit (another useful flag
- // is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free deallocated
- // memory which may be used to simulate low-memory condition)
- wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
- }
- } gs_enableLeakChecks;
-#endif // __WXMSW__ && __WXDEBUG__
+ EnableMemLeakChecking()
+ {
+ // check for memory leaks on program exit (another useful flag
+ // is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free deallocated
+ // memory which may be used to simulate low-memory condition)
+ wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
+ }
+ } gs_enableLeakChecks;
+ #endif // wxCrtSetDbgFlag
+#endif // __WXMSW__
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
// private classes
// 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);
namespace
static wxLocale *wxSetLocale(wxLocale *pLocale);
namespace
<< GetFullSearchPath(ExtractLang(szDirPrefix));
}
<< GetFullSearchPath(ExtractLang(szDirPrefix));
}
- // don't give translation errors here because the wxstd catalog might
- // not yet be loaded (and it's normal)
- //
- // (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());
+ wxLogTrace(TRACE_I18N, wxS("Looking for \"%s.mo\" in search path \"%s\""),
+ szName, searchPath);
wxFileName fn(szName);
fn.SetExt(wxS("mo"));
wxFileName fn(szName);
fn.SetExt(wxS("mo"));
-#ifdef __WXDEBUG__
- if ( !NoTransErr::Suppress() )
- {
- NoTransErr noTransErr;
-
- 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__
+ 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());
if (n == size_t(-1))
return GetUntranslatedString(origString);
if (n == size_t(-1))
return GetUntranslatedString(origString);
-#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+#if wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT
#include <stdarg.h>
#include <string.h>
#include <stdarg.h>
#include <string.h>
-#if wxUSE_THREADS && defined(__WXDEBUG__)
#define USE_THREADSAFE_MEMORY_ALLOCATION 1
#else
#define USE_THREADSAFE_MEMORY_ALLOCATION 0
#define USE_THREADSAFE_MEMORY_ALLOCATION 1
#else
#define USE_THREADSAFE_MEMORY_ALLOCATION 0
*/
bool wxDebugContext::PrintList (void)
{
*/
bool wxDebugContext::PrintList (void)
{
TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : NULL));
return true;
TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : NULL));
return true;
-#else
- return false;
-#endif
}
bool wxDebugContext::Dump(void)
{
}
bool wxDebugContext::Dump(void)
{
{
const wxChar* appName = wxT("application");
wxString appNameStr;
{
const wxChar* appName = wxT("application");
wxString appNameStr;
OutputDumpLine(wxEmptyString);
return true;
OutputDumpLine(wxEmptyString);
return true;
-#else
- return false;
-#endif
struct wxDebugStatsStruct
{
long instanceCount;
struct wxDebugStatsStruct
{
long instanceCount;
st->next = head;
return st;
}
st->next = head;
return st;
}
bool wxDebugContext::PrintStatistics(bool detailed)
{
bool wxDebugContext::PrintStatistics(bool detailed)
{
{
const wxChar* appName = wxT("application");
wxString appNameStr;
{
const wxChar* appName = wxT("application");
wxString appNameStr;
OutputDumpLine(wxEmptyString);
return true;
OutputDumpLine(wxEmptyString);
return true;
-#else
- (void)detailed;
- return false;
-#endif
}
bool wxDebugContext::PrintClasses(void)
}
bool wxDebugContext::PrintClasses(void)
#endif // USE_THREADSAFE_MEMORY_ALLOCATION
#endif // USE_THREADSAFE_MEMORY_ALLOCATION
#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
#if wxUSE_GLOBAL_MEMORY_OPERATORS
void * operator new (size_t size, wxChar * fileName, int lineNum)
#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
#if wxUSE_GLOBAL_MEMORY_OPERATORS
void * operator new (size_t size, wxChar * fileName, int lineNum)
// Trace: send output to the current debugging stream
void wxTrace(const wxChar * ...)
{
// Trace: send output to the current debugging stream
void wxTrace(const wxChar * ...)
{
// least one cleanup counter object
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One;
// least one cleanup counter object
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One;
-#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+#endif // wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT
-#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
#if defined(__VISAGECPP__)
#define DEBUG_PRINTF(NAME) { static int raz=0; \
printf( #NAME " %i\n",raz); fflush(stdout); raz++; }
#else
#define DEBUG_PRINTF(NAME)
#endif
#if defined(__VISAGECPP__)
#define DEBUG_PRINTF(NAME) { static int raz=0; \
printf( #NAME " %i\n",raz); fflush(stdout); raz++; }
#else
#define DEBUG_PRINTF(NAME)
#endif
-#endif // __WXDEBUG__ || wxUSE_DEBUG_CONTEXT
+#endif // wxUSE_DEBUG_CONTEXT
// we must disable optimizations for VC.NET because otherwise its too eager
// linker discards wxClassInfo objects in release build thus breaking many,
// we must disable optimizations for VC.NET because otherwise its too eager
// linker discards wxClassInfo objects in release build thus breaking many,
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 )
sm_classTable = classTable;
}
sm_classTable = classTable;
}
// reentrance guard - see note above
static int entry = 0;
wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance"));
// reentrance guard - see note above
static int entry = 0;
wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance"));
// Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
// link any object module twice mistakenly, or link twice against wx shared
// Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
// link any object module twice mistakenly, or link twice against wx shared
sm_classTable->Put(m_className, (wxObject *)this);
sm_classTable->Put(m_className, (wxObject *)this);
}
void wxClassInfo::Unregister()
}
void wxClassInfo::Unregister()
wxObject *wxCreateDynamicObject(const wxString& name)
{
wxObject *wxCreateDynamicObject(const wxString& name)
{
-#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
DEBUG_PRINTF(wxObject *wxCreateDynamicObject)
#endif
DEBUG_PRINTF(wxObject *wxCreateDynamicObject)
#endif
void wxObject::Ref(const wxObject& clone)
{
void wxObject::Ref(const wxObject& clone)
{
-#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
DEBUG_PRINTF(wxObject::Ref)
#endif
DEBUG_PRINTF(wxObject::Ref)
#endif
void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz)
{
void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz)
{
// 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
// can check that all indices in m_growableCols/Rows are valid (see also
// 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
// can check that all indices in m_growableCols/Rows are valid (see also
if ( (m_flexDirection & wxHORIZONTAL) || (m_growMode != wxFLEX_GROWMODE_NONE) )
if ( (m_flexDirection & wxHORIZONTAL) || (m_growMode != wxFLEX_GROWMODE_NONE) )
// 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
// 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
struct wxStrCacheDumper
{
struct wxStrCacheDumper
{
void wxDumpStrCache() { wxStrCacheDumper::ShowAll(); }
void wxDumpStrCache() { wxStrCacheDumper::ShowAll(); }
+#endif // wxDEBUG_LEVEL >= 2
#ifdef wxPROFILE_STRING_CACHE
#ifdef wxPROFILE_STRING_CACHE
// 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 };
// 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 };
// 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_leadMarkerVal[4] = { 0x00, 0xC0, 0xE0, 0xF0 };
// 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_leadMarkerVal[4] = { 0x00, 0xC0, 0xE0, 0xF0 };
{
m_validatorStyle = style;
{
m_validatorStyle = style;
int check;
check = (int)HasFlag(wxFILTER_ALPHA) + (int)HasFlag(wxFILTER_ALPHANUMERIC) +
(int)HasFlag(wxFILTER_DIGITS) + (int)HasFlag(wxFILTER_NUMERIC);
int check;
check = (int)HasFlag(wxFILTER_ALPHA) + (int)HasFlag(wxFILTER_ALPHANUMERIC) +
(int)HasFlag(wxFILTER_DIGITS) + (int)HasFlag(wxFILTER_NUMERIC);
(int)HasFlag(wxFILTER_EXCLUDE_LIST) + (int)HasFlag(wxFILTER_EXCLUDE_CHAR_LIST);
wxASSERT_MSG(check <= 1,
"Using both an include/exclude list may lead to unexpected results");
(int)HasFlag(wxFILTER_EXCLUDE_LIST) + (int)HasFlag(wxFILTER_EXCLUDE_CHAR_LIST);
wxASSERT_MSG(check <= 1,
"Using both an include/exclude list may lead to unexpected results");
}
bool wxTextValidator::Copy(const wxTextValidator& val)
}
bool wxTextValidator::Copy(const wxTextValidator& val)
SetEventHandler(handlerToPush);
SetEventHandler(handlerToPush);
// final checks of the operations done above:
wxASSERT_MSG( handlerToPush->GetPreviousHandler() == NULL,
// final checks of the operations done above:
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();
wxASSERT_MSG( pLast->GetNextHandler() == NULL,
pLast = pLast->GetNextHandler();
wxASSERT_MSG( pLast->GetNextHandler() == NULL,
- "the last handler of the wxWindow stack should have this window as next handler" );
-#endif
+ "the last handler of the wxWindow stack should "
+ "have this window as next handler" );
+#endif // wxDEBUG_LEVEL
}
wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler)
}
wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler)
//
static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos)
{
//
static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos)
{
-#if defined(__WXDEBUG__) && wxUSE_LOG
wxLogLevel level = wxLog::GetLogLevel();
wxLog::SetLogLevel(wxLOG_Debug - 1);
wxFileOffset result = stream.SeekI(pos);
wxLogLevel level = wxLog::GetLogLevel();
wxLog::SetLogLevel(wxLOG_Debug - 1);
wxFileOffset result = stream.SeekI(pos);
// blit the entire back buffer to front soon
m_isPainting = true;
// blit the entire back buffer to front soon
m_isPainting = true;
wxRect request;
while ( m_toPaint->GetNext(request) )
{
wxRect request;
while ( m_toPaint->GetNext(request) )
{
wxRect clipped(request);
clipped.Intersect(winRect);
if ( clipped.IsEmpty() )
wxRect clipped(request);
clipped.Intersect(winRect);
if ( clipped.IsEmpty() )
wxSize wxWizardSizer::GetMaxChildSize()
{
wxSize wxWizardSizer::GetMaxChildSize()
{
-#if !defined(__WXDEBUG__)
- if ( m_childSize.IsFullySpecified() )
- return m_childSize;
-#endif
-
wxSize maxOfMin;
for ( wxSizerItemList::compatibility_iterator childNode = m_children.GetFirst();
wxSize maxOfMin;
for ( wxSizerItemList::compatibility_iterator childNode = m_children.GetFirst();
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 )
{
m_childSize = maxOfMin;
if ( m_owner->m_started )
{
m_childSize = maxOfMin;
// it's not really a format, of course, but we can reuse its GetId() method
// to format this atom as string
wxDataFormat clip(selection_data->selection);
wxLogTrace( TRACE_CLIPBOARD,
wxT("Received available formats for clipboard %s"),
clip.GetId().c_str() );
// it's not really a format, of course, but we can reuse its GetId() method
// to format this atom as string
wxDataFormat clip(selection_data->selection);
wxLogTrace( TRACE_CLIPBOARD,
wxT("Received available formats for clipboard %s"),
clip.GetId().c_str() );
// the atoms we received, holding a list of targets (= formats)
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
// the atoms we received, holding a list of targets (= formats)
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
wxDataFormat format( selection_data->target );
wxDataFormat format( selection_data->target );
wxLogTrace(TRACE_CLIPBOARD,
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
format.GetId().c_str(),
wxLogTrace(TRACE_CLIPBOARD,
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
format.GetId().c_str(),
wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->selection))).c_str(),
GPOINTER_TO_UINT( signal_data )
);
wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->selection))).c_str(),
GPOINTER_TO_UINT( signal_data )
);
if ( !data->IsSupportedFormat( format ) )
return;
if ( !data->IsSupportedFormat( format ) )
return;
// it's not really a format, of course, but we can reuse its GetId() method
// to format this atom as string
wxDataFormat clip(selection_data->selection);
wxLogTrace( TRACE_CLIPBOARD,
wxT("Received available formats for clipboard %s"),
clip.GetId().c_str() );
// it's not really a format, of course, but we can reuse its GetId() method
// to format this atom as string
wxDataFormat clip(selection_data->selection);
wxLogTrace( TRACE_CLIPBOARD,
wxT("Received available formats for clipboard %s"),
clip.GetId().c_str() );
// the atoms we received, holding a list of targets (= formats)
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
// the atoms we received, holding a list of targets (= formats)
const GdkAtom * const atoms = (GdkAtom *)selection_data->data;
#include "wx/gtk/private/timer.h"
#include "wx/evtloop.h"
#include "wx/gtk/private/timer.h"
#include "wx/evtloop.h"
#include "wx/gtk/assertdlg_gtk.h"
#if wxUSE_STACKWALKER
#include "wx/stackwalk.h"
#endif // wxUSE_STACKWALKER
#include "wx/gtk/assertdlg_gtk.h"
#if wxUSE_STACKWALKER
#include "wx/stackwalk.h"
#endif // wxUSE_STACKWALKER
#include <stdarg.h>
#include <string.h>
#include <stdarg.h>
#include <string.h>
-#ifdef __WXDEBUG__
-
-#if wxUSE_STACKWALKER
+#if wxDEBUG_LEVEL && wxUSE_STACKWALKER
// private helper class
class StackDump : public wxStackWalker
// private helper class
class StackDump : public wxStackWalker
-#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+;
- // in fact we cannot use a dialog written using wxWidgets: it would need
- // the wxWidgets idle processing to work correctly!
+#if wxDEBUG_LEVEL
+ // under GTK2 we prefer to use a dialog widget written using directly in
+ // 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();
gtk_assert_dialog_set_message(GTK_ASSERT_DIALOG(dialog), msg.mb_str());
GtkWidget *dialog = gtk_assert_dialog_new();
gtk_assert_dialog_set_message(GTK_ASSERT_DIALOG(dialog), msg.mb_str());
gtk_widget_destroy(dialog);
return returnCode;
gtk_widget_destroy(dialog);
return returnCode;
+#else // !wxDEBUG_LEVEL
+ // this function is never called in this case
+ wxUnusedVar(msg);
+ return false;
+#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
wxString wxGUIAppTraits::GetDesktopEnvironment() const
{
wxString de = wxSystemOptions::GetOption(_T("gtk.desktop"));
wxString wxGUIAppTraits::GetDesktopEnvironment() const
{
wxString de = wxSystemOptions::GetOption(_T("gtk.desktop"));
wxDataFormat clip( selection_data->selection );
wxLogTrace( TRACE_CLIPBOARD,
wxT("selection received for targets, clipboard %s"),
clip.GetId().c_str() );
wxDataFormat clip( selection_data->selection );
wxLogTrace( TRACE_CLIPBOARD,
wxT("selection received for targets, clipboard %s"),
clip.GetId().c_str() );
// the atoms we received, holding a list of targets (= formats)
GdkAtom *atoms = (GdkAtom *)selection_data->data;
// the atoms we received, holding a list of targets (= formats)
GdkAtom *atoms = (GdkAtom *)selection_data->data;
wxDataFormat format( selection_data->target );
wxDataFormat format( selection_data->target );
wxLogTrace(TRACE_CLIPBOARD,
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
format.GetId().c_str(),
wxLogTrace(TRACE_CLIPBOARD,
_T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
format.GetId().c_str(),
wxString::FromAscii(gdk_atom_name(selection_data->selection)).c_str(),
GPOINTER_TO_UINT( signal_data )
);
wxString::FromAscii(gdk_atom_name(selection_data->selection)).c_str(),
GPOINTER_TO_UINT( signal_data )
);
if (!data->IsSupportedFormat( format )) return;
if (!data->IsSupportedFormat( format )) return;
// and this one also modifies all the other font data fields
void SetNativeFontInfo(const wxNativeFontInfo& info);
// and this one also modifies all the other font data fields
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:
// common part of all ctors
void Init(int pointSize,
protected:
// common part of all ctors
void Init(int pointSize,
m_selection = page;
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page );
m_selection = page;
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page );
-#ifdef __WXDEBUG__
- if ( !(flags & SetSelection_SendEvent) )
- {
- // gtk_notebook_set_current_page will emit the switch-page signal which will be
- // caught by our gtk_notebook_page_change_callback which should have reset the
- // flag to false:
- wxASSERT(!m_skipNextPageChangeEvent);
- }
-#endif // __WXDEBUG__
+ // gtk_notebook_set_current_page is supposed to emit the switch-page signal
+ // which should be caught by our gtk_notebook_page_change_callback which
+ // should have reset the flag to false, check it:
+ wxASSERT_LEVEL_2(
+ (flags & SetSelection_SendEvent) || !m_skipNextPageChangeEvent,
+ "internal error in selection events generation"
+ );
wxNotebookPage *client = GetPage(page);
if ( client )
wxNotebookPage *client = GetPage(page);
if ( client )
#include "wx/thread.h"
#endif
#include "wx/thread.h"
#endif
// debug
//-----------------------------------------------------------------------------
// debug
//-----------------------------------------------------------------------------
-# 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
# define DEBUG_MAIN_THREAD
#endif
#else
# define DEBUG_MAIN_THREAD
#endif
-#else
-#define DEBUG_MAIN_THREAD
-#endif // Debug
// the trace mask used for the focus debugging messages
#define TRACE_FOCUS _T("focus")
// the trace mask used for the focus debugging messages
#define TRACE_FOCUS _T("focus")
if ( !wxAppBase::OnInitGui() )
return false;
if ( !wxAppBase::OnInitGui() )
return false;
// 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;
if ( wxGetEnv(wxT("WXSTDERR"), &redirect) )
freopen(redirect.mb_str(), "wt", stderr);
wxString redirect;
if ( wxGetEnv(wxT("WXSTDERR"), &redirect) )
freopen(redirect.mb_str(), "wt", stderr);
wxLog *oldLog = wxLog::SetActiveTarget(new wxLogGui);
if ( oldLog ) delete oldLog;
wxLog *oldLog = wxLog::SetActiveTarget(new wxLogGui);
if ( oldLog ) delete oldLog;
// FIXME_MGL -- debugging stuff, to be removed!
static int debugPaintEvents = -1;
if ( debugPaintEvents == -1 )
// FIXME_MGL -- debugging stuff, to be removed!
static int debugPaintEvents = -1;
if ( debugPaintEvents == -1 )
dc->fillRect(-1000,-1000,2000,2000);
wxMilliSleep(50);
}
dc->fillRect(-1000,-1000,2000,2000);
wxMilliSleep(50);
}
+#endif // wxDEBUG_LEVEL >= 2
MGLRegion clip;
dc->getClipRegion(clip);
MGLRegion clip;
dc->getClipRegion(clip);
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
extern "C"
{
typedef int (*XErrorHandlerFunc)(Display *, XErrorEvent *);
extern "C"
{
typedef int (*XErrorHandlerFunc)(Display *, XErrorEvent *);
bool wxApp::Initialize(int& argc_, wxChar **argv_)
{
bool wxApp::Initialize(int& argc_, wxChar **argv_)
{
}
m_initialDisplay = (WXDisplay*) dpy;
}
m_initialDisplay = (WXDisplay*) dpy;
// install the X error handler
gs_pfnXErrorHandler = XSetErrorHandler(wxXErrorHandler);
// install the X error handler
gs_pfnXErrorHandler = XSetErrorHandler(wxXErrorHandler);
// Add general resize proc
XtActionsRec rec;
// Add general resize proc
XtActionsRec rec;
static wxString ParseWildCard( const wxString& wild )
{
static wxString ParseWildCard( const wxString& wild )
{
-#ifdef __WXDEBUG__
- static const wxChar* msg =
- _T("Motif file dialog does not understand this ")
- _T("wildcard syntax");
+#if wxDEBUG_LEVEL
+ static const char *msg =
+ "Motif file dialog does not understand this wildcard syntax";
#endif
wxArrayString wildDescriptions, wildFilters;
#endif
wxArrayString wildDescriptions, wildFilters;
wxString wxGetXEventName(XEvent& event)
{
#if wxUSE_NANOX
wxString wxGetXEventName(XEvent& event)
{
#if wxUSE_NANOX
// ----------------------------------------------------------------------------
// accelerators
// ----------------------------------------------------------------------------
// accelerators
wxDateTime wxCalendarCtrl::GetDate() const
{
wxDateTime wxCalendarCtrl::GetDate() const
{
SYSTEMTIME st;
if ( !MonthCal_GetCurSel(GetHwnd(), &st) )
{
SYSTEMTIME st;
if ( !MonthCal_GetCurSel(GetHwnd(), &st) )
{
wxDateTime dt(st);
wxASSERT_MSG( dt == m_date, "mismatch between data and control" );
wxDateTime dt(st);
wxASSERT_MSG( dt == m_date, "mismatch between data and control" );
// enumerate all explicit formats on the clipboard.
// note that this does not include implicit / synthetic (automatically
// converted) formats.
// enumerate all explicit formats on the clipboard.
// note that this does not include implicit / synthetic (automatically
// converted) formats.
// get the format enumerator
IEnumFORMATETC *pEnumFormatEtc = NULL;
hr = pDataObject->EnumFormatEtc(DATADIR_GET, &pEnumFormatEtc);
// get the format enumerator
IEnumFORMATETC *pEnumFormatEtc = NULL;
hr = pDataObject->EnumFormatEtc(DATADIR_GET, &pEnumFormatEtc);
pEnumFormatEtc->Release();
}
pEnumFormatEtc->Release();
}
+#endif // wxDEBUG_LEVEL >= 2
STGMEDIUM medium;
// stop at the first valid format found on the clipboard
STGMEDIUM medium;
// stop at the first valid format found on the clipboard
wxLogLastError(wxString::Format
(
_T("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"),
classname, style, exstyle
));
wxLogLastError(wxString::Format
(
_T("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"),
classname, style, exstyle
));
wxDateTime wxDatePickerCtrl::GetValue() const
{
wxDateTime wxDatePickerCtrl::GetValue() const
{
wxDateTime dt;
SYSTEMTIME st;
if ( DateTime_GetSystemtime(GetHwnd(), &st) == GDT_VALID )
wxDateTime dt;
SYSTEMTIME st;
if ( DateTime_GetSystemtime(GetHwnd(), &st) == GDT_VALID )
wxASSERT_MSG( m_date.IsValid() == dt.IsValid() &&
(!dt.IsValid() || dt == m_date),
_T("bug in wxDatePickerCtrl: m_date not in sync") );
wxASSERT_MSG( m_date.IsValid() == dt.IsValid() &&
(!dt.IsValid() || dt == m_date),
_T("bug in wxDatePickerCtrl: m_date not in sync") );
if (m_oldBitmap)
{
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
if (m_oldBitmap)
{
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
if (m_selectedBitmap.IsOk())
{
m_selectedBitmap.SetSelectedInto(NULL);
}
if (m_selectedBitmap.IsOk())
{
m_selectedBitmap.SetSelectedInto(NULL);
}
}
m_oldBitmap = 0;
if (m_oldPen)
}
m_oldBitmap = 0;
if (m_oldPen)
+#endif // wxHAS_PAINT_DEBUG
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() )
{
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() )
{
m_selectedBitmap.SetSelectedInto(NULL);
m_selectedBitmap.SetSelectedInto(NULL);
m_selectedBitmap = wxNullBitmap;
}
}
m_selectedBitmap = wxNullBitmap;
}
}
m_selectedBitmap.SetSelectedInto(GetOwner());
m_selectedBitmap.SetSelectedInto(GetOwner());
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp )
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp )
// fall through
case WAIT_FAILED:
// fall through
case WAIT_FAILED:
// using wxLogLastError() from here is dangerous: we risk to
// deadlock the main thread if wxLog sends output to GUI
DWORD err = GetLastError();
// using wxLogLastError() from here is dangerous: we risk to
// deadlock the main thread if wxLog sends output to GUI
DWORD err = GetLastError();
err,
wxSysErrorMsg(err)
);
err,
wxSysErrorMsg(err)
);
// no sense in continuing, who knows if the handles we're
// waiting for even exist yet...
// no sense in continuing, who knows if the handles we're
// waiting for even exist yet...
- // common dialog failed - why?
-#ifdef __WXDEBUG__
DWORD dwErr = CommDlgExtendedError();
if ( dwErr != 0 )
{
DWORD dwErr = CommDlgExtendedError();
if ( dwErr != 0 )
{
- // this msg is only for developers
- wxLogError(wxT("Common dialog failed with error code %0lx."),
- dwErr);
+ wxLogError(_("Common dialog failed with error code %0lx."), dwErr);
}
//else: it was just cancelled
}
//else: it was just cancelled
wstyle |= LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
wstyle |= LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
size_t nModes = 0;
#define MAP_MODE_STYLE(wx, ms) \
if ( style & (wx) ) { wstyle |= (ms); nModes++; }
size_t nModes = 0;
#define MAP_MODE_STYLE(wx, ms) \
if ( style & (wx) ) { wstyle |= (ms); nModes++; }
#define MAP_MODE_STYLE(wx, ms) \
if ( style & (wx) ) wstyle |= (ms);
#define MAP_MODE_STYLE(wx, ms) \
if ( style & (wx) ) wstyle |= (ms);
+#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
MAP_MODE_STYLE(wxLC_ICON, LVS_ICON)
MAP_MODE_STYLE(wxLC_SMALL_ICON, LVS_SMALLICON)
MAP_MODE_STYLE(wxLC_ICON, LVS_ICON)
MAP_MODE_STYLE(wxLC_SMALL_ICON, LVS_SMALLICON)
(WPARAM)hmenuFrame,
(LPARAM)hmenuWindow) )
{
(WPARAM)hmenuFrame,
(LPARAM)hmenuWindow) )
{
DWORD err = ::GetLastError();
if ( err )
wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
DWORD err = ::GetLastError();
if ( err )
wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
wxTimer* m_pTimer;
wxSize m_bestSize;
wxTimer* m_pTimer;
wxSize m_bestSize;
wxDynamicLibrary m_dllQuartz;
LPAMGETERRORTEXT m_lpAMGetErrorText;
wxString GetErrorString(HRESULT hrdsv);
wxDynamicLibrary m_dllQuartz;
LPAMGETERRORTEXT m_lpAMGetErrorText;
wxString GetErrorString(HRESULT hrdsv);
//---------------------------------------------------------------------------
// Usual debugging macros
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Usual debugging macros
//---------------------------------------------------------------------------
#define MAX_ERROR_TEXT_LEN 160
// Get the error string for Active Movie
#define MAX_ERROR_TEXT_LEN 160
// Get the error string for Active Movie
{
// First get the AMGetErrorText procedure in
// debug mode for more meaningful messages
{
// First get the AMGetErrorText procedure in
// debug mode for more meaningful messages
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
{
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
{
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
// Usual debugging macros for MCI returns
//---------------------------------------------------------------------------
// Usual debugging macros for MCI returns
//---------------------------------------------------------------------------
#define wxMCIVERIFY(arg) \
{ \
DWORD nRet; \
#define wxMCIVERIFY(arg) \
{ \
DWORD nRet; \
#endif
wxSize m_bestSize; // Cached size
#endif
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;
LPAMGETERRORTEXT m_lpAMGetErrorText;
wxString GetErrorString(HRESULT hrdsv);
wxDynamicLibrary m_dllQuartz;
LPAMGETERRORTEXT m_lpAMGetErrorText;
wxString GetErrorString(HRESULT hrdsv);
wxEvtHandler* m_evthandler;
friend class wxAMMediaEvtHandler;
wxEvtHandler* m_evthandler;
friend class wxAMMediaEvtHandler;
//---------------------------------------------------------------------------
// Usual debugging macros
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Usual debugging macros
//---------------------------------------------------------------------------
#define MAX_ERROR_TEXT_LEN 160
// Get the error string for Active Movie
#define MAX_ERROR_TEXT_LEN 160
// Get the error string for Active Movie
{
// First get the AMGetErrorText procedure in debug
// mode for more meaningful messages
{
// First get the AMGetErrorText procedure in debug
// mode for more meaningful messages
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
{
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
}
if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
{
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
}
}
// 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) \
- wxASSERT_MSG( SUCCEEDED(hr), \
+#define CHECK_HR(hr) \
+ wxASSERT_LEVEL_2_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
// functions
// ----------------------------------------------------------------------------
// functions
// ----------------------------------------------------------------------------
static const wxChar *GetTymedName(DWORD tymed);
static const wxChar *GetTymedName(DWORD tymed);
#define GetTymedName(tymed) wxEmptyString
#define GetTymedName(tymed) wxEmptyString
+#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
// ----------------------------------------------------------------------------
// wxIEnumFORMATETC interface implementation
// ----------------------------------------------------------------------------
// wxIEnumFORMATETC interface implementation
const wxChar *wxDataObject::GetFormatName(wxDataFormat format)
{
const wxChar *wxDataObject::GetFormatName(wxDataFormat format)
{
// ----------------------------------------------------------------------------
// wxBitmapDataObject supports CF_DIB format
// ----------------------------------------------------------------------------
// wxBitmapDataObject supports CF_DIB format
// private functions
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
static const wxChar *GetTymedName(DWORD tymed)
{
static const wxChar *GetTymedName(DWORD tymed)
{
const wxChar *wxDataObject::GetFormatName(wxDataFormat WXUNUSED(format))
{
return NULL;
}
const wxChar *wxDataObject::GetFormatName(wxDataFormat WXUNUSED(format))
{
return NULL;
}
// 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)
{
// an association between symbolic name and numeric value of an IID
static wxString GetIidName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
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)
-// For VC++ 4
-void wxLogQueryInterface(const char *szInterface, REFIID riid)
-{
- wxLogTrace("%s::QueryInterface", szInterface);
-}
+#endif // wxUSE_DRAG_AND_DROP
-void wxLogAddRef(const char *szInterface, ULONG cRef)
-{
- wxLogTrace("After %s::AddRef: m_cRef = %d", szInterface, cRef + 1);
-}
-
-void wxLogRelease(const char *szInterface, ULONG cRef)
-{
- wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
-}
-#endif // __WXDEBUG__
-
-#endif
- // wxUSE_DRAG_AND_DROP
-
-#endif
- // __CYGWIN10__
-
-#endif
- // wxUSE_OLE
-#if wxUSE_OLE && ( wxUSE_DRAG_AND_DROP || (defined(__WXDEBUG__) && wxUSE_DATAOBJ) )
+#if wxUSE_OLE && (wxUSE_DRAG_AND_DROP || wxUSE_DATAOBJ)
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
default:
lb.lbStyle = BS_SOLID;
default:
lb.lbStyle = BS_SOLID;
// this should be unnecessary (it's unused) but suppresses the
// Purify messages about uninitialized memory read
lb.lbHatch = 0;
// this should be unnecessary (it's unused) but suppresses the
// Purify messages about uninitialized memory read
lb.lbHatch = 0;
// wxWindowsPrintNativeData
//----------------------------------------------------------------------------
// wxWindowsPrintNativeData
//----------------------------------------------------------------------------
static wxString wxGetPrintDlgError()
{
DWORD err = CommDlgExtendedError();
static wxString wxGetPrintDlgError()
{
DWORD err = CommDlgExtendedError();
static HGLOBAL
wxCreateDevNames(const wxString& driverName,
static HGLOBAL
wxCreateDevNames(const wxString& driverName,
pd.hDevMode = NULL;
pd.hDevNames = NULL;
pd.hDevMode = NULL;
pd.hDevNames = NULL;
-#ifdef __WXDEBUG__
- wxString str(wxT("Printing error: "));
- str += wxGetPrintDlgError();
- wxLogDebug(str);
-#endif // __WXDEBUG__
+ wxLogDebug(wxT("Printing error: ") + wxGetPrintDlgError());
{
wxFileName fn(wxGetFullModuleName());
{
wxFileName fn(wxGetFullModuleName());
- // allow running the apps directly from build directory in debug builds
-#ifdef __WXDEBUG__
+ // allow running the apps directly from build directory in MSVC debug builds
+#ifdef _DEBUG
wxString lastdir;
if ( fn.GetDirCount() )
{
wxString lastdir;
if ( fn.GetDirCount() )
{
if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc*msw*")) )
fn.RemoveLastDir();
}
if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc*msw*")) )
fn.RemoveLastDir();
}
WPARAM wParam, LPARAM lParam);
WPARAM wParam, LPARAM lParam);
const wxChar *wxGetMessageName(int message);
const wxChar *wxGetMessageName(int message);
+#endif // wxDEBUG_LEVEL >= 2
void wxRemoveHandleAssociation(wxWindowMSW *win);
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
void wxRemoveHandleAssociation(wxWindowMSW *win);
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
HWND hWnd = GetHwnd();
wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
HWND hWnd = GetHwnd();
wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
-#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+#if !defined(__WXWINCE__)
::SetLastError(0);
#endif
if ( !::SetFocus(hWnd) )
{
::SetLastError(0);
#endif
if ( !::SetFocus(hWnd) )
{
-#if defined(__WXDEBUG__) && !defined(__WXMICROWIN__)
// was there really an error?
DWORD dwRes = ::GetLastError();
if ( dwRes )
// was there really an error?
DWORD dwRes = ::GetLastError();
if ( dwRes )
wxLogApiError(_T("SetFocus"), dwRes);
}
}
wxLogApiError(_T("SetFocus"), dwRes);
}
}
// Main window proc
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
// Main window proc
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- // trace all messages - useful for the debugging
-#ifdef __WXDEBUG__
+ // trace all messages: useful for the debugging but noticeably slows down
+ // the code so don't do it by default
+#if wxDEBUG_LEVEL >= 2
wxLogTrace(wxTraceMessages,
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
wxGetMessageName(message), hWnd, (long)wParam, lParam);
wxLogTrace(wxTraceMessages,
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
wxGetMessageName(message), hWnd, (long)wParam, lParam);
+#endif // wxDEBUG_LEVEL >= 2
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
wxLogTrace(wxTraceMessages, wxT("Forwarding %s to DefWindowProc."),
wxGetMessageName(message));
wxLogTrace(wxTraceMessages, wxT("Forwarding %s to DefWindowProc."),
wxGetMessageName(message));
+#endif // wxDEBUG_LEVEL >= 2
rc.result = MSWDefWindowProc(message, wParam, lParam);
}
rc.result = MSWDefWindowProc(message, wParam, lParam);
}
wxCHECK_RET( hwnd != (HWND)NULL,
wxT("attempt to add a NULL hwnd to window list ignored") );
wxCHECK_RET( hwnd != (HWND)NULL,
wxT("attempt to add a NULL hwnd to window list ignored") );
WindowHandles::const_iterator i = gs_windowHandles.find(hwnd);
if ( i != gs_windowHandles.end() )
{
if ( i->second != win )
{
WindowHandles::const_iterator i = gs_windowHandles.find(hwnd);
if ( i != gs_windowHandles.end() )
{
if ( i->second != win )
{
- wxLogDebug(wxT("HWND %p already associated with another window (%s)"),
- hwnd, win->GetClassInfo()->GetClassName());
+ wxFAIL_MSG(
+ 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
// with its HWND during creation (if we create it) and also when
// SubclassWin() is called later, this is ok
}
}
//else: this actually happens currently because we associate the window
// with its HWND during creation (if we create it) and also when
// SubclassWin() is called later, this is ok
}
gs_windowHandles[hwnd] = (wxWindow *)win;
}
gs_windowHandles[hwnd] = (wxWindow *)win;
}
#endif // !__WXMICROWIN__
#endif // !__WXMICROWIN__
const wxChar *wxGetMessageName(int message)
{
switch ( message )
const wxChar *wxGetMessageName(int message)
{
switch ( message )
return s_szBuf.c_str();
}
}
return s_szBuf.c_str();
}
}
+#endif // wxDEBUG_LEVEL >= 2
static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win)
{
static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win)
{
// Some people may wish to use this, but
// probably it shouldn't be here by default.
// Some people may wish to use this, but
// probably it shouldn't be here by default.
// wxRedirectIOToConsole();
// wxRedirectIOToConsole();
wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
wxLogError(wxT("Failed to create a control of class '%s'"), zClassname);
wxLogError(wxT("Failed to create a control of class '%s'"), zClassname);
wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") );
return;
}
wxFAIL_MSG( wxT("wxPaintDC may be created only in EVT_PAINT handler!") );
return;
}
+#endif // wxHAS_PAINT_DEBUG
DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacAppEventHandler )
#endif
DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacAppEventHandler )
#endif
-#if defined( __WXDEBUG__ ) && wxOSX_USE_COCOA_OR_CARBON
+#if wxDEBUG_LEVEL && wxOSX_USE_COCOA_OR_CARBON
pascal static void
wxMacAssertOutputHandler(OSType WXUNUSED(componentSignature),
pascal static void
wxMacAssertOutputHandler(OSType WXUNUSED(componentSignature),
extern "C" void macPostedEventCallback(void *WXUNUSED(unused))
{
extern "C" void macPostedEventCallback(void *WXUNUSED(unused))
{
-#if defined( __WXDEBUG__ ) && wxOSX_USE_COCOA_OR_CARBON
+#if wxDEBUG_LEVEL && wxOSX_USE_COCOA_OR_CARBON
InstallDebugAssertOutputHandler( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );
#endif
InstallDebugAssertOutputHandler( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );
#endif
m_critsect.Enter();
// check that the thread either exited or couldn't be created
m_critsect.Enter();
// check that the thread either exited or couldn't be created
wxDELETE( m_internal ) ;
}
wxDELETE( m_internal ) ;
}
unsigned wxDisplayFactoryMacOSX::GetCount()
{
CGDisplayCount count;
unsigned wxDisplayFactoryMacOSX::GetCount()
{
CGDisplayCount count;
-#ifdef __WXDEBUG__
- CGDisplayErr err =
-#endif
- CGGetActiveDisplayList(0, NULL, &count);
+ CGDisplayErr err = CGGetActiveDisplayList(0, NULL, &count);
- wxASSERT(err == CGDisplayNoErr);
+ wxCHECK_MSG( err != CGDisplayNoErr, 0, "CGGetActiveDisplayList() failed" );
CGDisplayCount theCount = GetCount();
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
CGDisplayCount theCount = GetCount();
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
-#ifdef __WXDEBUG__
- CGDisplayErr err =
-#endif
- CGGetActiveDisplayList(theCount, theIDs, &theCount);
+ CGDisplayErr err = CGGetActiveDisplayList(theCount, theIDs, &theCount);
+ wxCHECK_MSG( err != CGDisplayNoErr, NULL, "CGGetActiveDisplayList() failed" );
- wxASSERT( err == CGDisplayNoErr );
wxASSERT( n < theCount );
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
wxASSERT( n < theCount );
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
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
// ===========================================================================
{
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;
// do we have a DC for this window in the cache?
m_window = window;
// do we have a DC for this window in the cache?
int propagatedFlags = argFlags & (wxPG_REPORT_ERROR|wxPG_PROGRAMMATIC_VALUE);
int propagatedFlags = argFlags & (wxPG_REPORT_ERROR|wxPG_PROGRAMMATIC_VALUE);
-#ifdef __WXDEBUG__
- bool debug_print = false;
-#endif
-
-#ifdef __WXDEBUG__
- if ( debug_print )
- wxLogDebug(wxT(">> %s.StringToValue('%s')"),GetLabel().c_str(),text.c_str());
-#endif
+ wxLogTrace("propgrid",
+ wxT(">> %s.StringToValue('%s')"), GetLabel(), text);
wxString::const_iterator it = text.begin();
wxUniChar a;
wxString::const_iterator it = text.begin();
wxUniChar a;
wxVariant variant(child->GetValue());
wxString childName = child->GetBaseName();
wxVariant variant(child->GetValue());
wxString childName = child->GetBaseName();
- #ifdef __WXDEBUG__
- if ( debug_print )
- wxLogDebug(wxT("token = '%s', child = %s"),
- token.c_str(), childName.c_str());
- #endif
+ wxLogTrace("propgrid",
+ wxT("token = '%s', child = %s"),
+ token, childName);
// Add only if editable or setting programmatically
if ( (argFlags & wxPG_PROGRAMMATIC_VALUE) ||
// Add only if editable or setting programmatically
if ( (argFlags & wxPG_PROGRAMMATIC_VALUE) ||
wxPGRootProperty::wxPGRootProperty( const wxString& name )
: wxPGProperty()
{
wxPGRootProperty::wxPGRootProperty( const wxString& name )
: wxPGProperty()
{
m_name = name;
m_label = m_name;
m_name = name;
m_label = m_name;
-#else
- wxUnusedVar(name);
-#endif
SetParentalType(0);
m_depth = 0;
}
SetParentalType(0);
m_depth = 0;
}
m_tlp->RemoveEventHandler(handler);
delete handler;
m_tlp->RemoveEventHandler(handler);
delete handler;
-#ifdef __WXDEBUG__
- if ( IsEditorsValueModified() )
- ::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("wxPropertyGrid Debug Warning") );
-#endif
+ wxASSERT_MSG( !IsEditorsValueModified(),
+ wxS("Most recent change in property editor was lost!!! ")
+ wxS("(if you don't want this to happen, close your frames ")
+ wxS("and dialogs using Close(false).)") );
#if wxPG_DOUBLE_BUFFER
if ( m_doubleBuffer )
#if wxPG_DOUBLE_BUFFER
if ( m_doubleBuffer )
m_pState->EnsureVirtualHeight();
m_pState->EnsureVirtualHeight();
-#ifdef __WXDEBUG__
- int by1 = m_pState->GetVirtualHeight();
- int by2 = m_pState->GetActualVirtualHeight();
- if ( by1 != by2 )
- {
- wxString s = wxString::Format(wxT("VirtualHeight=%i, ActualVirtualHeight=%i, should match!"), by1, by2);
- wxFAIL_MSG(s.c_str());
- wxLogDebug(s);
- }
-#endif
+ wxASSERT_LEVEL_2_MSG(
+ m_pState->GetVirtualHeight() == m_pState->GetActualVirtualHeight(),
+ "VirtualHeight and ActualVirtualHeight should match"
+ );
m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE;
m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE;
wxPropertyGrid* pg = GetGrid();
wxPropertyGrid* pg = GetGrid();
-#ifdef __WXDEBUG__
- const bool debug = false;
-#endif
-
unsigned int i;
unsigned int lastColumn = m_colWidths.size() - 1;
int width = m_width;
unsigned int i;
unsigned int lastColumn = m_colWidths.size() - 1;
int width = m_width;
// Column to reduce, if needed. Take last one that exceeds minimum width.
int reduceCol = -1;
// Column to reduce, if needed. Take last one that exceeds minimum width.
int reduceCol = -1;
-#ifdef __WXDEBUG__
- if ( debug )
- wxLogDebug(wxT("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"), width, clientWidth);
-#endif
+ wxLogTrace("propgrid",
+ wxS("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"),
+ width, clientWidth);
for ( i=0; i<m_colWidths.size(); i++ )
colsWidth += m_colWidths[i];
for ( i=0; i<m_colWidths.size(); i++ )
colsWidth += m_colWidths[i];
-#ifdef __WXDEBUG__
- if ( debug )
- wxLogDebug(wxT(" HasVirtualWidth: %i colsWidth: %i"),(int)pg->HasVirtualWidth(),colsWidth);
-#endif
+ wxLogTrace("propgrid",
+ wxS(" HasVirtualWidth: %i colsWidth: %i"),
+ (int)pg->HasVirtualWidth(), colsWidth);
// Then mode-based requirement
if ( !pg->HasVirtualWidth() )
// Then mode-based requirement
if ( !pg->HasVirtualWidth() )
if ( colsWidth < width )
{
// Increase column
if ( colsWidth < width )
{
// Increase column
-#ifdef __WXDEBUG__
- if ( debug )
- wxLogDebug(wxT(" Adjust last column to %i"), m_colWidths[lastColumn] + widthHigher);
-#endif
+ wxLogTrace("propgrid",
+ wxS(" Adjust last column to %i"),
+ m_colWidths[lastColumn] + widthHigher);
m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher;
}
else if ( colsWidth > width )
m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher;
}
else if ( colsWidth > width )
// Reduce column
if ( reduceCol != -1 )
{
// Reduce column
if ( reduceCol != -1 )
{
- #ifdef __WXDEBUG__
- if ( debug )
- wxLogDebug(wxT(" Reduce column %i (by %i)"), reduceCol, -widthHigher);
- #endif
+ wxLogTrace("propgrid",
+ wxT(" Reduce column %i (by %i)"),
+ reduceCol, -widthHigher);
+
// Reduce widest column, and recheck
m_colWidths[reduceCol] = m_colWidths[reduceCol] + widthHigher;
CheckColumnWidths();
// Reduce widest column, and recheck
m_colWidths[reduceCol] = m_colWidths[reduceCol] + widthHigher;
CheckColumnWidths();
pg->RecalculateVirtualSize();
}
pg->RecalculateVirtualSize();
}
-#ifdef __WXDEBUG__
- if ( debug )
- for ( i=0; i<m_colWidths.size(); i++ )
- wxLogDebug(wxT("col%i: %i"),i,m_colWidths[i]);
-#endif
+ for ( i=0; i<m_colWidths.size(); i++ )
+ {
+ wxLogTrace("propgrid", wxS("col%i: %i"), i, m_colWidths[i]);
+ }
// Auto center splitter
if ( !(pg->GetInternalFlags() & wxPG_FL_DONT_CENTER_SPLITTER) &&
// Auto center splitter
if ( !(pg->GetInternalFlags() & wxPG_FL_DONT_CENTER_SPLITTER) &&
- #ifdef __WXDEBUG__
- if ( wxStrcmp(current->GetType(), p->GetValue().GetType()) != 0)
- {
- wxLogDebug(wxT("wxPropertyGridPageState::DoSetPropertyValues Warning: Setting value of property \"%s\" from variant"),
- p->GetName().c_str());
- }
- #endif
+ wxASSERT_LEVEL_2_MSG(
+ wxStrcmp(current->GetType(), p->GetValue().GetType()) == 0,
+ wxString::Format(
+ wxS("setting value of property \"%s\" from variant"),
+ p->GetName().c_str())
+ );
bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0);
// bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0);
bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0);
// bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0);
bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0);
#endif
bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0);
#endif
#include "wx/univ/inphand.h"
#include "wx/univ/theme.h"
#include "wx/univ/inphand.h"
#include "wx/univ/theme.h"
-#define WXDEBUG_SCROLLBAR
-
-#ifndef __WXDEBUG__
- #undef WXDEBUG_SCROLLBAR
-#endif // !__WXDEBUG__
+#if wxDEBUG_LEVEL >= 2
+ #define WXDEBUG_SCROLLBAR
+#endif
#if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
#include "wx/msw/private.h"
#if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
#include "wx/msw/private.h"
-// turn extra wxTextCtrl-specific debugging on/off
-#define WXDEBUG_TEXT
+#if wxDEBUG_LEVEL >= 2
+ // turn extra wxTextCtrl-specific debugging on/off
+ #define WXDEBUG_TEXT
-// turn wxTextCtrl::Replace() debugging on (slows down code a *lot*!)
-#define WXDEBUG_TEXT_REPLACE
-
-#ifndef __WXDEBUG__
- #undef WXDEBUG_TEXT
- #undef WXDEBUG_TEXT_REPLACE
-#endif
+ // turn wxTextCtrl::Replace() debugging on (slows down code a *lot*!)
+ #define WXDEBUG_TEXT_REPLACE
+#endif // wxDEBUG_LEVEL >= 2
// wxStringTokenize only needed for debug checks
#ifdef WXDEBUG_TEXT_REPLACE
// wxStringTokenize only needed for debug checks
#ifdef WXDEBUG_TEXT_REPLACE
// Ctrl-R refreshes the control in debug mode
else if ( event.ControlDown() && event.GetKeyCode() == 'r' )
Refresh();
// Ctrl-R refreshes the control in debug mode
else if ( event.ControlDown() && event.GetKeyCode() == 'r' )
Refresh();
+#endif // wxDEBUG_LEVEL >= 2
#include "wx/caret.h"
#endif // wxUSE_CARET
#include "wx/caret.h"
#endif // wxUSE_CARET
-// turn Refresh() debugging on/off
-#define WXDEBUG_REFRESH
-
-#ifndef __WXDEBUG__
- #undef WXDEBUG_REFRESH
+#if wxDEBUG_LEVEL >= 2
+ // turn Refresh() debugging on/off
+ #define WXDEBUG_REFRESH
#endif
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
#endif
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
m_critsect.Enter();
// check that the thread either exited or couldn't be created
m_critsect.Enter();
// check that the thread either exited or couldn't be created
M_BMPHANDLERDATA->m_bpp = bpp; // mono as well?
M_BMPHANDLERDATA->m_bpp = bpp; // mono as well?
unsigned int depthRet;
int xRet, yRet;
unsigned int widthRet, heightRet, borderWidthRet;
unsigned int depthRet;
int xRet, yRet;
unsigned int widthRet, heightRet, borderWidthRet;
&widthRet, &heightRet, &borderWidthRet, &depthRet);
wxASSERT_MSG( bpp == (int)depthRet, wxT("colour depth mismatch") );
&widthRet, &heightRet, &borderWidthRet, &depthRet);
wxASSERT_MSG( bpp == (int)depthRet, wxT("colour depth mismatch") );
XpmFreeAttributes(&xpmAttr);
XpmFreeAttributes(&xpmAttr);
if (!WM_STATE)
WM_STATE = XInternAtom(display, "WM_STATE", False);
if (!WM_STATE)
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;
wxEventLoop eventLoop;
sm_done = false;
wxEventLoop eventLoop;