Removed references to DEBUG and WXDEBUG; cured Motif font problem; removed

some warnings in OGL; fixed bug in wxChoice


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-11-09 11:57:05 +00:00
parent 605c9c8318
commit ea57084d10
47 changed files with 205 additions and 321 deletions

View File

@@ -24,7 +24,7 @@
#include "wx/defs.h"
#endif
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#ifdef __GNUG__
// #pragma implementation
@@ -635,7 +635,7 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from)
*/
bool wxDebugContext::PrintList (void)
{
#if WXDEBUG
#ifdef __WXDEBUG__
if (!HasStream())
return FALSE;
@@ -649,7 +649,7 @@ bool wxDebugContext::PrintList (void)
bool wxDebugContext::Dump(void)
{
#if WXDEBUG
#ifdef __WXDEBUG__
if (!HasStream())
return FALSE;
@@ -705,7 +705,7 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt
bool wxDebugContext::PrintStatistics(bool detailed)
{
#if WXDEBUG
#ifdef __WXDEBUG__
if (!HasStream())
return FALSE;
@@ -900,7 +900,7 @@ int wxDebugContext::CountObjectsLeft(void)
// We'll only do malloc and free for the moment: leave the interesting
// stuff for the wxObject versions.
#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
#if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS
#ifdef new
#undef new
@@ -1122,7 +1122,7 @@ void wxTraceLevel(int level, const char *fmt ...)
#endif
}
#else // wxUSE_MEMORY_TRACING && WXDEBUG
#else // wxUSE_MEMORY_TRACING && defined(__WXDEBUG__)
void wxTrace(const char *WXUNUSED(fmt) ...)
{
}

View File

@@ -31,11 +31,11 @@
#include <string.h>
#include <assert.h>
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#include "wx/memory.h"
#endif
#if WXDEBUG || wxUSE_DEBUG_CONTEXT
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
// for wxObject::Dump
#if wxUSE_IOSTREAMH
# include <iostream.h>
@@ -90,7 +90,7 @@ bool wxObject::IsKindOf(wxClassInfo *info) const
return FALSE;
}
#if WXDEBUG || wxUSE_DEBUG_CONTEXT
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
void wxObject::Dump(ostream& str)
{
if (GetClassInfo() && GetClassInfo()->GetClassName())
@@ -100,7 +100,7 @@ void wxObject::Dump(ostream& str)
}
#endif
#if WXDEBUG && wxUSE_MEMORY_TRACING
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
#ifdef new
#undef new

View File

@@ -362,7 +362,7 @@ int wxEntry( int argc, char *argv[] )
wxClassInfo::InitializeClasses();
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
@@ -452,7 +452,7 @@ int wxEntry( int argc, char *argv[] )
delete[] wxBuffer;
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
if (wxDebugContext::CountObjectsLeft() > 0)
{

View File

@@ -764,7 +764,7 @@ public:
inline int GetFamily(void) {return family;}
inline int GetId(void) {return id;}
inline bool IsRoman(void) {return isroman;}
#if WXDEBUG
#if defined(__WXDEBUG__)
void Dump(ostream& str);
#endif
@@ -795,7 +795,7 @@ wxFontNameItem::~wxFontNameItem(void)
name = (char *) NULL;
}
#if WXDEBUG
#if defined(__WXDEBUG__)
void wxFontNameItem::Dump(ostream& str)
{
str << "wxFontNameItem(" << name << ")";

View File

@@ -362,7 +362,7 @@ int wxEntry( int argc, char *argv[] )
wxClassInfo::InitializeClasses();
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
@@ -452,7 +452,7 @@ int wxEntry( int argc, char *argv[] )
delete[] wxBuffer;
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
if (wxDebugContext::CountObjectsLeft() > 0)
{

View File

@@ -764,7 +764,7 @@ public:
inline int GetFamily(void) {return family;}
inline int GetId(void) {return id;}
inline bool IsRoman(void) {return isroman;}
#if WXDEBUG
#if defined(__WXDEBUG__)
void Dump(ostream& str);
#endif
@@ -795,7 +795,7 @@ wxFontNameItem::~wxFontNameItem(void)
name = (char *) NULL;
}
#if WXDEBUG
#if defined(__WXDEBUG__)
void wxFontNameItem::Dump(ostream& str)
{
str << "wxFontNameItem(" << name << ")";

View File

@@ -35,7 +35,7 @@ GUISUFFIX = _stubs
########################## Compiler flags #############################
# Misc options
OPTIONS = -D__WXDEBUG__ -DWXDEBUG
OPTIONS = -D__WXDEBUG__ # -DDEBUG='$(DEBUG)' # -DWXDEBUG
COPTIONS =
DEBUGFLAGS = -ggdb
INCLUDE =
@@ -74,8 +74,8 @@ INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(COMPPATHS)
# Directory for object files
OBJDIR = objects$(GUISUFFIX)
CPPFLAGS = $(EXTRACPPFLAGS) $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT)
CFLAGS = $(EXTRACFLAGS) $(XINCLUDE) $(INC) $(COPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(CWARN) $(OPT)
CPPFLAGS = $(EXTRACPPFLAGS) $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT)
CFLAGS = $(EXTRACFLAGS) $(XINCLUDE) $(INC) $(COPTIONS) $(GUI) $(DEBUGFLAGS) $(CWARN) $(OPT)
LDFLAGS = $(EXTRALDFLAGS) $(XLIB) -L$(WXDIR)/lib
LDLIBS = $(EXTRALDLIBS) $(GUILDLIBS)

View File

@@ -67,7 +67,7 @@ bool wxApp::Initialize()
wxBuffer = new char[BUFSIZ + 512];
#endif
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
@@ -212,7 +212,7 @@ int wxEntry( int argc, char *argv[] )
delete wxTheApp;
wxTheApp = NULL;
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore

View File

@@ -40,6 +40,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
m_windowStyle = style;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowFont = parent->GetFont();
parent->AddChild((wxButton *)this);
@@ -53,6 +54,8 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
Widget parentWidget = (Widget) parent->GetClientWidget();
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
/*
* Patch Note (important)
* There is no major reason to put a defaultButtonThickness here.
@@ -65,6 +68,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("button",
xmPushButtonWidgetClass,
parentWidget,
XmNfontList, fontList,
XmNlabelString, text,
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
NULL);
@@ -74,9 +78,6 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
XtAddCallback ((Widget) m_mainWidget, XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
(XtPointer) this);
m_windowFont = parent->GetFont();
ChangeFont(FALSE);
SetCanAddEventHandler(TRUE);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);

View File

@@ -42,6 +42,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
m_windowStyle = style;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowFont = parent->GetFont();
if (parent) parent->AddChild(this);
@@ -54,9 +55,11 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
XmString text = XmStringCreateSimple (label1);
Widget parentWidget = (Widget) parent->GetClientWidget();
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("toggle",
xmToggleButtonWidgetClass, parentWidget,
XmNfontList, fontList,
XmNlabelString, text,
NULL);
XmStringFree (text);
@@ -66,9 +69,6 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
XmToggleButtonSetState ((Widget) m_mainWidget, FALSE, TRUE);
m_windowFont = parent->GetFont();
ChangeFont(FALSE);
SetCanAddEventHandler(TRUE);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);

View File

@@ -50,7 +50,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
{
SetName(name);
SetValidator(validator);
m_noStrings = n;
m_noStrings = 0; // Starts off with none, incremented in Append
m_windowStyle = style;
m_buttonWidget = (WXWidget) 0;
m_menuWidget = (WXWidget) 0;
@@ -66,6 +66,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowFont = parent->GetFont();
Widget parentWidget = (Widget) parent->GetClientWidget();
@@ -125,7 +126,6 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
m_windowFont = parent->GetFont();
ChangeFont(FALSE);
AttachWidget (parent, m_buttonWidget, m_formWidget, pos.x, pos.y, size.x, size.y);

View File

@@ -763,9 +763,6 @@ void wxFrame::OnActivate(wxActivateEvent& event)
if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
!child->IsKindOf(CLASSINFO(wxDialog)))
{
#if WXDEBUG > 1
wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
#endif
child->SetFocus();
return;
}

View File

@@ -59,6 +59,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
m_radioButtonLabels = (wxString*) NULL;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowFont = parent->GetFont();
SetName(name);
SetValidator(val);
@@ -93,6 +94,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
m_formWidget = (WXWidget) formWidget;
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
if (label1 != "")
{
text = XmStringCreateSimple ((char*) (const char*) label1);
@@ -104,16 +106,10 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
#else
xmLabelWidgetClass, formWidget,
#endif
XmNfontList, fontList,
XmNlabelString, text,
NULL);
/* TODO: change label font
if (labelFont)
XtVaSetValues (labelWidget,
XmNfontList, labelFont->GetInternalFont (XtDisplay(formWidget)),
NULL);
*/
XmStringFree (text);
}
@@ -159,16 +155,11 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
#else
xmToggleButtonWidgetClass, radioBoxWidget,
#endif
XmNfontList, fontList,
NULL);
XtAddCallback ((Widget) m_radioButtons[i], XmNvalueChangedCallback, (XtCallbackProc) wxRadioBoxCallback,
(XtCallbackProc) this);
/* TODO: set font
if (buttonFont)
XtVaSetValues ((Widget) m_radioButtons[i],
XmNfontList, buttonFont->GetInternalFont (XtDisplay(formWidget)),
NULL);
*/
}
SetSelection (0);

View File

@@ -47,6 +47,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
SetValidator(validator);
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowFont = parent->GetFont();
if (parent) parent->AddChild(this);
@@ -63,6 +64,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
Widget radioButtonWidget = XtVaCreateManagedWidget ("toggle",
#if wxUSE_GADGETS
@@ -70,6 +72,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
#else
xmToggleButtonWidgetClass, parentWidget,
#endif
XmNfontList, fontList,
XmNlabelString, text,
XmNfillOnSelect, True,
XmNindicatorType, XmONE_OF_MANY, // diamond-shape
@@ -81,9 +84,6 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
m_mainWidget = (WXWidget) radioButtonWidget;
m_windowFont = parent->GetFont();
ChangeFont(FALSE);
XtManageChild (radioButtonWidget);
SetCanAddEventHandler(TRUE);

View File

@@ -53,6 +53,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
m_labelWidget = (WXWidget) 0;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowFont = parent->GetFont();
SetName(name);
@@ -78,10 +79,13 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
if (hasLabel)
{
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
wxString label1(wxStripMenuCodes(label));
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
m_labelWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) label1,
xmLabelWidgetClass, formWidget,
XmNfontList, fontList,
XmNlabelString, text,
NULL);
XmStringFree (text);

View File

@@ -45,6 +45,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
m_windowId = id;
m_windowStyle = style;
m_windowFont = parent->GetFont();
char* label1 = (label.IsNull() ? "" : (char*) (const char*) label);
@@ -52,9 +53,12 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
XmString text = XmStringCreateSimple (label1);
XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
m_mainWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) name,
xmLabelWidgetClass,
parentWidget,
XmNfontList, fontList,
XmNlabelString, text,
XmNalignment,
((style & wxALIGN_RIGHT) ? XmALIGNMENT_END :
@@ -64,9 +68,6 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
XmStringFree (text);
m_windowFont = parent->GetFont();
ChangeFont(FALSE);
SetCanAddEventHandler(TRUE);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);

View File

@@ -2073,9 +2073,7 @@ void wxWidgetResizeProc(Widget w, XConfigureEvent *event, String args[], int *nu
bool wxAddWindowToTable(Widget w, wxWindow *win)
{
wxWindow *oldItem = NULL;
#if DEBUG
// printf("Adding widget %ld, name = %s\n", w, win->GetClassInfo()->GetClassName());
#endif
if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
{
char buf[300];

View File

@@ -125,7 +125,7 @@ bool wxApp::Initialize()
#endif // debug build under MS VC++
*/
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if defined(_WINDLL)
streambuf* sBuf = NULL;
#else // EXE
@@ -573,7 +573,7 @@ int wxEntry(WXHINSTANCE hInstance,
delete wxTheApp;
wxTheApp = NULL;
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore

View File

@@ -129,16 +129,10 @@ wxDC::~wxDC(void)
// DC.
void wxDC::SelectOldObjects(WXHDC dc)
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects %X\n", this);
#endif
if (dc)
{
if (m_oldBitmap)
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HBITMAP %X\n", m_oldBitmap);
#endif
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
if (m_selectedBitmap.Ok())
{
@@ -148,38 +142,23 @@ void wxDC::SelectOldObjects(WXHDC dc)
m_oldBitmap = 0 ;
if (m_oldPen)
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HPEN %X\n", m_oldPen);
#endif
::SelectObject((HDC) dc, (HPEN) m_oldPen);
}
m_oldPen = 0 ;
if (m_oldBrush)
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HBRUSH %X\n", m_oldBrush);
#endif
::SelectObject((HDC) dc, (HBRUSH) m_oldBrush);
}
m_oldBrush = 0 ;
if (m_oldFont)
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HFONT %X\n", m_oldFont);
#endif
::SelectObject((HDC) dc, (HFONT) m_oldFont);
}
m_oldFont = 0 ;
if (m_oldPalette)
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects: Selecting old HPALETTE %X\n", m_oldPalette);
#endif
::SelectPalette((HDC) dc, (HPALETTE) m_oldPalette, TRUE);
}
#if WXDEBUG > 1
wxDebugMsg("wxDC::SelectOldObjects: Done.\n");
#endif
m_oldPalette = 0 ;
}
@@ -216,13 +195,7 @@ void wxDC::DestroyClippingRegion(void)
if (m_clipping && m_hDC)
{
HRGN rgn = CreateRectRgn(0, 0, 32000, 32000);
#if WXDEBUG > 1
wxDebugMsg("wxDC::DestroyClippingRegion: Selecting HRGN %X\n", rgn);
#endif
SelectClipRgn((HDC) m_hDC, rgn);
#if WXDEBUG > 1
wxDebugMsg("wxDC::DestroyClippingRegion: Deleting HRGN %X\n", rgn);
#endif
DeleteObject(rgn);
}
m_clipping = FALSE;
@@ -266,9 +239,6 @@ void wxDC::SetPalette(const wxPalette& palette)
if (m_oldPalette)
{
::SelectPalette((HDC) m_hDC, (HPALETTE) m_oldPalette, TRUE);
#if WXDEBUG > 1
wxDebugMsg("wxDC::SetPalette: set old palette %X\n", m_oldPalette);
#endif
m_oldPalette = 0;
}
@@ -281,13 +251,6 @@ void wxDC::SetPalette(const wxPalette& palette)
if (!m_oldPalette)
m_oldPalette = (WXHPALETTE) oldPal;
#if WXDEBUG > 1
wxDebugMsg("wxDC::SetPalette %X: selected palette %X\n", this, m_palette.GetHPALETTE());
if (oldPal)
wxDebugMsg("wxDC::SetPalette: oldPal was palette %X\n", oldPal);
if (m_oldPalette)
wxDebugMsg("wxDC::SetPalette: m_oldPalette is palette %X\n", m_oldPalette);
#endif
::RealizePalette((HDC) m_hDC);
}
}
@@ -643,9 +606,6 @@ void wxDC::SetFont(const wxFont& the_font)
if (m_font.Ok() && m_font.GetResourceHandle())
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::SetFont: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
if (f == NULL)
{
@@ -723,9 +683,6 @@ void wxDC::DrawText(const wxString& text, long x, long y, bool use16bit)
#if 0
if (m_font.Ok() && m_font.GetResourceHandle())
{
#if WXDEBUG > 1
wxDebugMsg("wxDC::DrawText: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
if (!m_oldFont)
m_oldFont = (WXHFONT) f;

View File

@@ -101,9 +101,6 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
return;
m_selectedBitmap.SetSelectedInto(this);
#if WXDEBUG > 1
wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP());
#endif
HBITMAP bm = (HBITMAP) ::SelectObject((HDC) m_hDC, (HBITMAP) m_selectedBitmap.GetHBITMAP());
if (bm == ERROR)

View File

@@ -620,9 +620,6 @@ void wxFrame::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *
bool wxFrame::MSWOnPaint(void)
{
#if WXDEBUG > 1
wxDebugMsg("wxFrameWnd::OnPaint %d\n", handle);
#endif
RECT rect;
if (GetUpdateRect((HWND) GetHWND(), &rect, FALSE))
{
@@ -677,9 +674,6 @@ WXHICON wxFrame::MSWOnQueryDragIcon(void)
void wxFrame::MSWOnSize(int x, int y, WXUINT id)
{
#if WXDEBUG > 1
wxDebugMsg("wxFrameWnd::OnSize %d\n", m_hWnd);
#endif
switch (id)
{
case SIZENORMAL:
@@ -731,17 +725,11 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
bool wxFrame::MSWOnClose(void)
{
#if WXDEBUG > 1
wxDebugMsg("wxFrameWnd::OnClose %d\n", handle);
#endif
return Close();
}
bool wxFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
#if WXDEBUG > 1
wxDebugMsg("wxFrameWnd::OnCommand %d\n", handle);
#endif
if (cmd == 0 || cmd == 1 ) // Can be either a menu command or an accelerator.
{
// In case it's e.g. a toolbar.
@@ -850,9 +838,6 @@ void wxFrame::OnActivate(wxActivateEvent& event)
if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
!child->IsKindOf(CLASSINFO(wxDialog)))
{
#if WXDEBUG > 1
wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
#endif
child->SetFocus();
return;
}

View File

@@ -120,10 +120,6 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), "wxWindowMenu");
#if WXDEBUG > 1
wxDebugMsg("Loaded m_windowMenu %d\n", m_windowMenu);
#endif
DWORD msflags = WS_OVERLAPPED ;
if (style & wxMINIMIZE_BOX)
msflags |= WS_MINIMIZEBOX;
@@ -516,9 +512,6 @@ bool wxMDIParentFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
}
if (id >= 0xF000)
{
#if WXDEBUG > 1
wxDebugMsg("wxMDIFrame::OnCommand %d: system command: calling default window proc\n", GetHWND());
#endif
return FALSE; // Get WndProc to call default proc
}
@@ -529,9 +522,6 @@ bool wxMDIParentFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
}
else if (m_currentChild && (id < wxFIRST_MDI_CHILD || id > wxLAST_MDI_CHILD))
{
#if WXDEBUG > 1
wxDebugMsg("wxMDIFrame::MSWOnCommand %d: calling child OnCommand\n", GetHWND());
#endif
return m_currentChild->MSWOnCommand(id, cmd, control);
}
}
@@ -896,9 +886,6 @@ void wxMDIChildFrame::MSWOnSize(int x, int y, WXUINT id)
if (invalidHandle == (HWND) GetHWND())
{
#if WXDEBUG > 1
wxDebugMsg("wxMDIChildFrame::OnSize %d: invalid, so returning.\n", GetHWND());
#endif
return;
}
@@ -937,9 +924,6 @@ void wxMDIChildFrame::MSWOnSize(int x, int y, WXUINT id)
bool wxMDIChildFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
#if WXDEBUG > 1
wxDebugMsg("wxMDIChildFrame::MSWOnCommand %d\n", GetHWND());
#endif
// if ((cmd == 0) && GetHWND())
if (GetHWND())
{
@@ -998,13 +982,7 @@ long wxMDIChildFrame::MSWOnMDIActivate(long activate, WXHWND WXUNUSED(one), WXHW
{
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
HMENU parent_menu = (HMENU) parent->GetWinMenu();
#if WXDEBUG > 1
wxDebugMsg("Parent menu is %d\n", parent_menu);
#endif
HMENU child_menu = (HMENU) GetWinMenu();
#if WXDEBUG > 1
wxDebugMsg("Child menu is %d\n", child_menu);
#endif
if (activate)
{
@@ -1014,10 +992,6 @@ long wxMDIChildFrame::MSWOnMDIActivate(long activate, WXHWND WXUNUSED(one), WXHW
{
parent->m_parentFrameActive = FALSE;
HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
#if WXDEBUG > 1
wxDebugMsg("Window submenu is %d\n", subMenu);
#endif
// HMENU subMenu = 0;
#ifdef __WIN32__
::SendMessage((HWND) parent->GetClientWindow()->GetHWND(), WM_MDISETMENU,
(WPARAM)child_menu,
@@ -1047,10 +1021,6 @@ long wxMDIChildFrame::MSWOnMDIActivate(long activate, WXHWND WXUNUSED(one), WXHW
{
parent->m_parentFrameActive = TRUE;
HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
#if WXDEBUG > 1
wxDebugMsg("Window submenu is %d\n", subMenu);
#endif
// HMENU subMenu = 0;
#ifdef __WIN32__
::SendMessage((HWND) parent->GetClientWindow()->GetHWND(), WM_MDISETMENU,
(WPARAM)parent_menu,
@@ -1067,10 +1037,6 @@ long wxMDIChildFrame::MSWOnMDIActivate(long activate, WXHWND WXUNUSED(one), WXHW
wxActivateEvent event(wxEVT_ACTIVATE, flag, m_windowId);
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
#if WXDEBUG > 1
wxDebugMsg("Finished (de)activating\n");
#endif
return 0;
}
@@ -1087,16 +1053,10 @@ void wxMDIChildFrame::MSWDestroyWindow(void)
// destroyed.
HWND oldHandle = (HWND)GetHWND();
#if WXDEBUG > 1
wxDebugMsg("*** About to DestroyWindow MDI child %d\n", oldHandle);
#endif
#ifdef __WIN32__
SendMessage((HWND) parent->GetClientWindow()->GetHWND(), WM_MDIDESTROY, (WPARAM)oldHandle, (LPARAM)0);
#else
SendMessage((HWND) parent->GetClientWindow()->GetHWND(), WM_MDIDESTROY, (HWND)oldHandle, 0);
#endif
#if WXDEBUG > 1
wxDebugMsg("*** Finished DestroyWindow MDI child %d\n", oldHandle);
#endif
invalidHandle = 0;

View File

@@ -82,7 +82,7 @@
#ifdef __WXDEBUG__
const char *wxGetMessageName(int message);
#endif //WXDEBUG
#endif //__WXDEBUG__
#define WINDOW_MARGIN 3 // This defines sensitivity of Leave events
@@ -895,9 +895,8 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
wxWndHook = NULL;
wnd->m_hWnd = (WXHWND) hWnd;
}
#if (WXDEBUG > 1)
wxDebugMsg("hWnd = %d, m_hWnd = %d, msg = %d\n", hWnd, m_hWnd, message);
#endif
// wxDebugMsg("hWnd = %d, m_hWnd = %d, msg = %d\n", hWnd, m_hWnd, message);
// Stop right here if we don't have a valid handle
// in our wxWnd object.
if (wnd && !wnd->m_hWnd) {
@@ -936,7 +935,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages, "Processing %s(%lx, %lx)",
wxGetMessageName(message), wParam, lParam);
#endif // WXDEBUG
#endif // __WXDEBUG__
HWND hWnd = (HWND)m_hWnd;
@@ -1557,10 +1556,6 @@ void wxWindow::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow
wxWndHook = NULL;
wxWinHandleList->Append((long)m_hWnd, this);
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWCreate %d\n", m_hWnd);
#endif
}
void wxWindow::MSWOnCreate(WXLPCREATESTRUCT WXUNUSED(cs))
@@ -1569,9 +1564,6 @@ void wxWindow::MSWOnCreate(WXLPCREATESTRUCT WXUNUSED(cs))
bool wxWindow::MSWOnClose(void)
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnClose %d\n", handle);
#endif
return FALSE;
}
@@ -1614,9 +1606,6 @@ bool wxWindow::MSWOnEndSession(bool endSession, long logOff)
bool wxWindow::MSWOnDestroy(void)
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
#endif
// delete our drop target if we've got one
#if wxUSE_DRAG_AND_DROP
if ( m_pDropTarget != NULL ) {
@@ -1675,9 +1664,6 @@ bool wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
void wxWindow::MSWOnMenuHighlight(WXWORD WXUNUSED(item), WXWORD WXUNUSED(flags), WXHMENU WXUNUSED(sysmenu))
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnMenuHighlight %d\n", handle);
#endif
}
void wxWindow::MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem)
@@ -1686,10 +1672,6 @@ void wxWindow::MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem)
bool wxWindow::MSWOnActivate(int state, bool WXUNUSED(minimized), WXHWND WXUNUSED(activate))
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnActivate %d\n", handle);
#endif
wxActivateEvent event(wxEVT_ACTIVATE, ((state == WA_ACTIVE) || (state == WA_CLICKACTIVE)),
m_windowId);
event.SetEventObject(this);
@@ -1699,9 +1681,6 @@ bool wxWindow::MSWOnActivate(int state, bool WXUNUSED(minimized), WXHWND WXUNUSE
bool wxWindow::MSWOnSetFocus(WXHWND WXUNUSED(hwnd))
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnSetFocus %d\n", m_hWnd);
#endif
// Deal with caret
if (m_caretEnabled && (m_caretWidth > 0) && (m_caretHeight > 0))
{
@@ -1719,9 +1698,6 @@ bool wxWindow::MSWOnSetFocus(WXHWND WXUNUSED(hwnd))
bool wxWindow::MSWOnKillFocus(WXHWND WXUNUSED(hwnd))
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnKillFocus %d\n", m_hWnd);
#endif
// Deal with caret
if (m_caretEnabled)
{
@@ -1737,9 +1713,6 @@ bool wxWindow::MSWOnKillFocus(WXHWND WXUNUSED(hwnd))
void wxWindow::MSWOnDropFiles(WXWPARAM wParam)
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnDropFiles %d\n", m_hWnd);
#endif
HDROP hFilesInfo = (HDROP) wParam;
POINT dropPoint;
@@ -1830,9 +1803,6 @@ bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
WXHBRUSH wxWindow::MSWOnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnCtlColour %d\n", m_hWnd);
#endif
if (nCtlColor == CTLCOLOR_DLG)
{
return OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam);
@@ -1930,7 +1900,7 @@ long wxWindow::Default()
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages, "Forwarding %s to DefWindowProc.",
wxGetMessageName(m_lastMsg));
#endif // WXDEBUG
#endif // __WXDEBUG__
return this->MSWDefWindowProc(m_lastMsg, m_lastWParam, m_lastLParam);
}
@@ -2014,9 +1984,6 @@ bool wxWindow::MSWTranslateMessage(WXMSG* pMsg)
long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate), WXHWND WXUNUSED(deactivate))
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnMDIActivate %d\n", m_hWnd);
#endif
return 1;
}
@@ -2066,9 +2033,6 @@ void wxWindow::MSWOnSize(int w, int h, WXUINT WXUNUSED(flag))
if (m_inOnSize)
return;
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnSize %d\n", m_hWnd);
#endif
if (!m_hWnd)
return;
@@ -2090,9 +2054,6 @@ void wxWindow::MSWOnWindowPosChanging(void *WXUNUSED(lpPos))
// Deal with child commands from buttons etc.
bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnCommand\n");
#endif
if (wxCurrentPopupMenu)
{
wxMenu *popupMenu = wxCurrentPopupMenu;
@@ -2100,22 +2061,11 @@ bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
bool succ = popupMenu->MSWCommand(cmd, id);
return succ;
}
#if WXDEBUG > 1
char buf[80];
sprintf(buf, "Looking for item %d...\n", id);
wxDebugMsg(buf);
#endif
wxWindow *item = FindItem(id);
if (item)
{
bool value = item->MSWCommand(cmd, id);
#if WXDEBUG > 1
if (value)
wxDebugMsg("MSWCommand succeeded\n");
else
wxDebugMsg("MSWCommand failed\n");
#endif
return value;
}
else
@@ -2730,9 +2680,6 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font)
HFONT was = 0;
if (the_font)
{
#if WXDEBUG > 1
wxDebugMsg("wxGetCharSize: Selecting HFONT %X\n", fnt);
#endif
// the_font->UseResource();
// the_font->RealizeResource();
if ((fnt=(HFONT) the_font->GetResourceHandle()))
@@ -2741,9 +2688,6 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font)
GetTextMetrics(dc, &tm);
if (the_font && fnt && was)
{
#if WXDEBUG > 1
wxDebugMsg("wxGetCharSize: Selecting old HFONT %X\n", was);
#endif
SelectObject(dc,was) ;
}
ReleaseDC((HWND)wnd, dc);
@@ -4865,4 +4809,4 @@ const char *wxGetMessageName(int message)
return s_szBuf;
}
}
#endif //WXDEBUG
#endif //__WXDEBUG__

View File

@@ -122,7 +122,7 @@ OPTIONS=
!if "$(FINAL)" == "0"
OPT = /Od /Gy
# ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated
DEBUG_FLAGS= /Zi /D__WXDEBUG__ /DWXDEBUG=1 /DDEBUG=1 # /FR
DEBUG_FLAGS= /Zi /D__WXDEBUG__ # /DDEBUG=1 # /FR
LINK_DEBUG_FLAGS=-debug:full -debugtype:cv # /PDB:NONE
CRTFLAG=/MD
!else

View File

@@ -57,7 +57,7 @@ bool wxApp::Initialize()
wxBuffer = new char[BUFSIZ + 512];
#endif
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
@@ -177,7 +177,7 @@ int wxEntry( int argc, char *argv[] )
delete wxTheApp;
wxTheApp = NULL;
#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore

View File

@@ -358,9 +358,6 @@ void wxFrame::OnActivate(wxActivateEvent& event)
if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
!child->IsKindOf(CLASSINFO(wxDialog)))
{
#if WXDEBUG > 1
wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
#endif
child->SetFocus();
return;
}