From ea57084d103187771c0306a6e1684e32244d6101 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 9 Nov 1998 11:57:05 +0000 Subject: [PATCH 1/1] 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 --- distrib/msw/motif.rsp | 61 +++++++++++++++++++++++++++ docs/motif/install.txt | 15 ++++--- docs/motif/todo.txt | 32 +++++--------- include/wx/debug.h | 4 +- include/wx/defs.h | 4 +- include/wx/memory.h | 6 +-- include/wx/motif/window.h | 2 +- include/wx/object.h | 6 +-- include/wx/utils.h | 2 +- src/common/memory.cpp | 12 +++--- src/common/object.cpp | 8 ++-- src/gtk/app.cpp | 4 +- src/gtk/font.cpp | 4 +- src/gtk1/app.cpp | 4 +- src/gtk1/font.cpp | 4 +- src/make.env | 6 +-- src/motif/app.cpp | 4 +- src/motif/button.cpp | 7 +-- src/motif/checkbox.cpp | 6 +-- src/motif/choice.cpp | 4 +- src/motif/frame.cpp | 3 -- src/motif/radiobox.cpp | 17 ++------ src/motif/radiobut.cpp | 6 +-- src/motif/statbox.cpp | 4 ++ src/motif/stattext.cpp | 7 +-- src/motif/window.cpp | 2 - src/msw/app.cpp | 4 +- src/msw/dc.cpp | 43 ------------------- src/msw/dcmemory.cpp | 3 -- src/msw/frame.cpp | 15 ------- src/msw/mdi.cpp | 40 ------------------ src/msw/window.cpp | 68 +++--------------------------- src/ntwxwin.mak | 2 +- src/stubs/app.cpp | 4 +- src/stubs/frame.cpp | 3 -- utils/ogl/samples/ogledit/doc.cpp | 4 +- utils/ogl/samples/ogledit/view.cpp | 2 +- utils/ogl/src/basic.cpp | 18 ++++---- utils/ogl/src/basic2.cpp | 8 ++-- utils/ogl/src/bmpshape.cpp | 2 +- utils/ogl/src/canvas.cpp | 4 +- utils/ogl/src/composit.cpp | 4 +- utils/ogl/src/drawn.cpp | 4 +- utils/ogl/src/lines.cpp | 22 +++++----- utils/ogl/src/mfutils.cpp | 18 ++++---- utils/ogl/src/misc.cpp | 4 +- utils/ogl/src/ogldiag.cpp | 20 ++++----- 47 files changed, 205 insertions(+), 321 deletions(-) diff --git a/distrib/msw/motif.rsp b/distrib/msw/motif.rsp index 7aa2d240f8..489adf0ac0 100644 --- a/distrib/msw/motif.rsp +++ b/distrib/msw/motif.rsp @@ -1,3 +1,64 @@ +install-sh +Makefile +template.mak +configure.in +config.guess +config.sub +wx-config.in +mkinstalldirs +src/Makefile +src/Makefile.in +src/*.inc + +setup/*.in +setup/*.hin + +setup/general/createall +setup/general/jointar +setup/general/makeapp +setup/general/makedirs +setup/general/makedoc +setup/general/mygrep +setup/general/needed + +setup/rules/bin +setup/rules/bin2 +setup/rules/doc +setup/rules/gbin +setup/rules/gbin2 +setup/rules/glib +setup/rules/glibbin +setup/rules/glibgbin +setup/rules/gslib +setup/rules/lib +setup/rules/libbin +setup/rules/libgbin + +setup/rules/generic/bin1 +setup/rules/generic/bin1gen +setup/rules/generic/bin2 +setup/rules/generic/bin2gen +setup/rules/generic/depend +setup/rules/generic/globals +setup/rules/generic/lib +setup/rules/generic/needed +setup/rules/generic/obj +setup/rules/generic/slib +setup/rules/generic/sobj + +setup/shared/sharedAIX +setup/shared/sharedBsd +setup/shared/sharedDgux +setup/shared/sharedHpux +setup/shared/sharedIrix +setup/shared/sharedLinux +setup/shared/sharedOSF +setup/shared/sharedSolaris2 +setup/shared/sharedSunos4 +setup/shared/sharedSysV + +misc/afm/*.afm + src/motif/*.cpp src/motif/*.c src/motif/*.h diff --git a/docs/motif/install.txt b/docs/motif/install.txt index fde8d195ea..1e82044fcf 100644 --- a/docs/motif/install.txt +++ b/docs/motif/install.txt @@ -14,7 +14,9 @@ wxWindows 2.0 for Motif installation overwritten: they should be identical anyway. - Edit src/make.env to change options according to your local - environment. Later, there will be a better makefile system + environment. In particular, change WXDIR to where wxWindows is + found on your system. + Later, there will be a better makefile system and/or alternate make.env files as per wxWindows 1.68. Please feel free to contribute settings files for your environment. @@ -41,18 +43,19 @@ Notes: we should use something that can be made to work easily with applications outside the wxWindows hierarchy. +- Debugging mode is switched on by default. To compile in non-debug + mode, remove the -D__WXDEBUG__ switch in make.env. + - Some classes can be switched off in include/wx/motif/setup.h, if you are having trouble with a particular file. However, I'd prefer you to fix the problem and send the fix to me :-) or at least let me know about it. - Please send bug reports with a description of your environment, - compiler and the error message(s) to: - - julian.smart@ukonline.co.uk + compiler and the error message(s) to the wxwin-users mailing list at: - or the wxwin-developers mailing list at: + wxwin-users@wx.dent.med.uni-muenchen.de - wxwin-developers@wx.dent.med.uni-muenchen.de Julian Smart, November 1998. +julian.smart@ukonline.co.uk diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt index 3efb2ae282..4e8ade76ea 100644 --- a/docs/motif/todo.txt +++ b/docs/motif/todo.txt @@ -1,7 +1,7 @@ wxMotif TODO ------------ -Updated: 8/11/98 +Updated: 9/11/98 -------------------------------o------------------------- @@ -16,21 +16,12 @@ High Priority - Work out why XFreeFont in font.cpp produces a segv. This is currently commented out, which presumably causes a memory leak. -- Also work out why wxWindow::SetFont causes the widget to be shrunk - to fit its text, in dialogs. Uncomment the SetFont implementation and pop - up a dialog, e.g. an About box. Widgets are arranged - incorrectly. Seems to be OK for non-dialog panels, once the - size has been restored after the font setting. - In fact it seems OK for dialogs now!!! Weird. +- Colour setting in widgets (almost done). Should scrollbars take + on the background colour? Not right for e.g. wxScrolledWindows, + so maybe have wxSystemSettings value for scrollbar colour, and/or + ability to set scrollbar colour independently. -- ChangeFont should have an extra arg, to allow for not resizing - the window back to the original size after setting the font. - Also don't call SetFont from constructor, assign the font and - call ChangeFont so we can pass FALSE if the size has been passed - as the default (which means: wxWin should choose an appropriate - size, so Motif should expand/contract the widget as appropriate). - -- Colour setting in widgets (almost done). +- Make wxDialog OnPaint work. - Implementation of OnEraseBackground. How? Call OnEraseBackground just before OnPaint? Will duplicate Xlib's own erase of the background. @@ -43,10 +34,6 @@ High Priority - wxSpinButton -- A generic version of wxNotebook that can be used in wxMotif and - other toolkits that don't have a native control. Perhaps use wxTab as a - starting point. - - Tidy dialogs such as the colour and font selectors. - Use generic wxTreeCtrl, wxListCtrl: debug and enhance these. @@ -59,6 +46,8 @@ High Priority - wxThread (hopefully, similar to wxGTK) +- wxAcceleratorTable. + - Miscellaneous events. - Write makefiles for all samples and utilities. @@ -138,9 +127,8 @@ Low Priority - Blit scaling - Could eventually alter the MDI widgets to be more Windows-like - -- currently it's half-hearted. - -- Accelerators + -- currently it's half-hearted (menus are on children, whereas + they should replace the main parent frame menu). - Get ODBC classes and sample working. diff --git a/include/wx/debug.h b/include/wx/debug.h index 99758d1f7a..5ccea5af0f 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -31,7 +31,7 @@

Extensive use of these macros is recommended! Remember that ASSERTs are - disabled in final (without WXDEBUG defined) build, so they add strictly + disabled in final (without __WXDEBUG__ defined) build, so they add strictly nothing to your program's code. On the other hand, CHECK macros do stay even in release builds, but in general are not much of a burden, while a judicious use of them might increase your program's stability. @@ -62,7 +62,7 @@ // no more bugs ;-) #define wxASSERT(cond) #define wxASSERT_MSG(x, m) -#endif //WXDEBUG +#endif //__WXDEBUG__ /// special form of assert: always triggers it (in debug mode) #define wxFAIL wxASSERT(wxFalse) diff --git a/include/wx/defs.h b/include/wx/defs.h index 23efce8e35..f3eb99881e 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -290,8 +290,8 @@ WXDLLEXPORT_DATA(extern const bool) wxFalse; // where should i put this? we need to make sure of this as it breaks // the code. -#if !wxUSE_IOSTREAMH && WXDEBUG -#undef WXDEBUG +#if !wxUSE_IOSTREAMH && defined(__WXDEBUG__) +#undef __WXDEBUG__ #endif // Callback function type definition diff --git a/include/wx/memory.h b/include/wx/memory.h index 4a4117e410..0afeaf4ebd 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -23,7 +23,7 @@ info, or to be a straight call to the new operator. */ -#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT +#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #include @@ -39,7 +39,7 @@ #include "wx/string.h" -#if WXDEBUG +#ifdef __WXDEBUG__ // #ifndef WXDEBUG_NEW // #define WXDEBUG_NEW new(__FILE__,__LINE__) @@ -280,7 +280,7 @@ inline void wxTraceLevel(int WXUNUSED(level), const char *WXUNUSED(fmt)) {} #define WXTRACELEVEL TRUE ? (void)0 : wxTraceLevel // #define WXDEBUG_NEW new -#endif // WXDEBUG +#endif // __WXDEBUG__ #endif // _WX_MEMORYH__ diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index 4c8dc2b3b4..a21bff3a0e 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -402,7 +402,7 @@ public: // Does this window want to accept keyboard focus? virtual bool AcceptsFocus() const; - virtual void PrepareDC( wxDC &dc ) {}; + virtual void PrepareDC( wxDC & WXUNUSED(dc) ) {}; public: diff --git a/include/wx/object.h b/include/wx/object.h index bc9d5c480c..027d557aef 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -187,7 +187,7 @@ class WXDLLEXPORT wxObject bool IsKindOf(wxClassInfo *info) const; -#if WXDEBUG && wxUSE_MEMORY_TRACING +#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING void * operator new (size_t size, char * fileName = NULL, int lineNum = 0); void operator delete (void * buf); @@ -204,7 +204,7 @@ class WXDLLEXPORT wxObject #endif -#if WXDEBUG || wxUSE_DEBUG_CONTEXT +#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT virtual void Dump(ostream& str); #endif @@ -246,7 +246,7 @@ private: int m_count; }; -#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS +#if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS //#ifndef WXDEBUG_NEW //#define WXDEBUG_NEW new(__FILE__,__LINE__) //#endif diff --git a/include/wx/utils.h b/include/wx/utils.h index e92325e690..cebdd6c3dc 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -187,7 +187,7 @@ class WXDLLEXPORT wxDebugStreamBuf: public streambuf int sync(void); }; -// #if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS +// #if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS // #define new WXDEBUG_NEW // #endif diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 1d44a664e9..785bcde816 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -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) ...) { } diff --git a/src/common/object.cpp b/src/common/object.cpp index 704c124ba9..15e3f0fec0 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -31,11 +31,11 @@ #include #include -#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 @@ -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 diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 3db5bd03a7..f65ab8ecaf 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -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) { diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index e7685ea382..6a2d12c7af 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -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 << ")"; diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 3db5bd03a7..f65ab8ecaf 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -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) { diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index e7685ea382..6a2d12c7af 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -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 << ")"; diff --git a/src/make.env b/src/make.env index a3d6a48b49..b07e47c570 100644 --- a/src/make.env +++ b/src/make.env @@ -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) diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 0c10b96db0..bd0acfb2d8 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -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 diff --git a/src/motif/button.cpp b/src/motif/button.cpp index 6a2a632465..3ff312878a 100644 --- a/src/motif/button.cpp +++ b/src/motif/button.cpp @@ -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); diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index 7d40ee4330..ed697a0c19 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -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); diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index e21631b19a..d8c4b715f0 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -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); diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index 1de5a6a5cd..d7fe6aefac 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -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; } diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp index d1ec6278cd..a5e78b7638 100644 --- a/src/motif/radiobox.cpp +++ b/src/motif/radiobox.cpp @@ -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); diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp index 9e2ec2d427..d73b55569b 100644 --- a/src/motif/radiobut.cpp +++ b/src/motif/radiobut.cpp @@ -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); diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp index 7d9cbd0c8e..487d56710b 100644 --- a/src/motif/statbox.cpp +++ b/src/motif/statbox.cpp @@ -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); diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index c558bfe431..ed8ee2a9e6 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -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); diff --git a/src/motif/window.cpp b/src/motif/window.cpp index d19fdf801b..9fc441729c 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -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]; diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 1f4e55c3de..e67b404eed 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -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 diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 7e1e5a36af..0870dbb183 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -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; diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index b0e6a77f18..51cefba945 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -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) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index b4dfeb31e9..96d7733cac 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -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; } diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index d33807a73a..5d4fab3316 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -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; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 8994821ca3..c3969cdf30 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -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__ diff --git a/src/ntwxwin.mak b/src/ntwxwin.mak index f378ca7a99..34958c0c0b 100644 --- a/src/ntwxwin.mak +++ b/src/ntwxwin.mak @@ -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 diff --git a/src/stubs/app.cpp b/src/stubs/app.cpp index aac09eb02c..76f528db8f 100644 --- a/src/stubs/app.cpp +++ b/src/stubs/app.cpp @@ -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 diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp index 8d9ed813ad..b12097f5c4 100644 --- a/src/stubs/frame.cpp +++ b/src/stubs/frame.cpp @@ -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; } diff --git a/utils/ogl/samples/ogledit/doc.cpp b/utils/ogl/samples/ogledit/doc.cpp index e617c7eee7..5e11ad2d05 100644 --- a/utils/ogl/samples/ogledit/doc.cpp +++ b/utils/ogl/samples/ogledit/doc.cpp @@ -458,7 +458,7 @@ void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment dc.SetPen(dottedPen); double xp, yp; GetShape()->GetAttachmentPosition(attachment, &xp, &yp); - dc.DrawLine(xp, yp, x, y); + dc.DrawLine((long) xp, (long) yp, (long) x, (long) y); GetShape()->GetCanvas()->CaptureMouse(); } @@ -475,7 +475,7 @@ void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta dc.SetPen(dottedPen); double xp, yp; GetShape()->GetAttachmentPosition(attachment, &xp, &yp); - dc.DrawLine(xp, yp, x, y); + dc.DrawLine((long) xp, (long) yp, (long) x, (long) y); } void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) diff --git a/utils/ogl/samples/ogledit/view.cpp b/utils/ogl/samples/ogledit/view.cpp index 3dfb84f239..9690182a27 100644 --- a/utils/ogl/samples/ogledit/view.cpp +++ b/utils/ogl/samples/ogledit/view.cpp @@ -119,7 +119,7 @@ void DiagramView::OnDraw(wxDC *dc) // Set the scale and origin dc->SetUserScale (actualScale, actualScale); - dc->SetDeviceOrigin (posX, posY); + dc->SetDeviceOrigin ((long) posX, (long) posY); // This part was added to preform the print preview and printing functions diff --git a/utils/ogl/src/basic.cpp b/utils/ogl/src/basic.cpp index d93aa76a0c..4faa132925 100644 --- a/utils/ogl/src/basic.cpp +++ b/utils/ogl/src/basic.cpp @@ -297,11 +297,11 @@ wxShape::wxShape(wxShapeCanvas *can) m_parent = NULL; m_formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT; m_shadowMode = SHADOW_NONE; - m_shadowOffsetX = 6.0; - m_shadowOffsetY = 6.0; + m_shadowOffsetX = 6; + m_shadowOffsetY = 6; m_shadowBrush = wxBLACK_BRUSH; - m_textMarginX = 5.0; - m_textMarginY = 5.0; + m_textMarginX = 5; + m_textMarginY = 5; m_regionName = "0"; m_centreResize = TRUE; m_maintainAspectRatio = FALSE; @@ -1907,8 +1907,8 @@ void wxShape::ReadAttributes(wxExpr *clause) else if (string_expr->Type() == wxExprList) { wxExpr *first = string_expr->value.first; - wxExpr *second = first ? first->next : NULL; - wxExpr *third = second ? second->next : NULL; + wxExpr *second = first ? first->next : (wxExpr*) NULL; + wxExpr *third = second ? second->next : (wxExpr*) NULL; if (first && second && third && (first->Type() == wxExprReal || first->Type() == wxExprInteger) && @@ -2076,7 +2076,7 @@ void wxShape::ReadRegions(wxExpr *clause) m_formatted = TRUE; // Assume text is formatted unless we prove otherwise - while (regionExpr = clause->AttributeValue(regionNameBuf)) + while ((regionExpr = clause->AttributeValue(regionNameBuf))) { /* * Get the region information @@ -2200,8 +2200,8 @@ void wxShape::ReadRegions(wxExpr *clause) else if (string_expr->Type() == wxExprList) { wxExpr *first = string_expr->value.first; - wxExpr *second = first ? first->next : NULL; - wxExpr *third = second ? second->next : NULL; + wxExpr *second = first ? first->next : (wxExpr*) NULL; + wxExpr *third = second ? second->next : (wxExpr*) NULL; if (first && second && third && (first->Type() == wxExprReal || first->Type() == wxExprInteger) && diff --git a/utils/ogl/src/basic2.cpp b/utils/ogl/src/basic2.cpp index e3bf382081..b5bd83af21 100644 --- a/utils/ogl/src/basic2.cpp +++ b/utils/ogl/src/basic2.cpp @@ -1051,9 +1051,9 @@ void wxEllipseShape::OnDraw(wxDC& dc) if (m_shadowBrush) dc.SetBrush(m_shadowBrush); dc.SetPen(g_oglTransparentPen); - dc.DrawEllipse((m_xpos - GetWidth()/2) + m_shadowOffsetX, - (m_ypos - GetHeight()/2) + m_shadowOffsetY, - GetWidth(), GetHeight()); + dc.DrawEllipse((long) ((m_xpos - GetWidth()/2) + m_shadowOffsetX), + (long) ((m_ypos - GetHeight()/2) + m_shadowOffsetY), + (long) GetWidth(), (long) GetHeight()); } if (m_pen) @@ -1065,7 +1065,7 @@ void wxEllipseShape::OnDraw(wxDC& dc) } if (m_brush) dc.SetBrush(m_brush); - dc.DrawEllipse((m_xpos - GetWidth()/2), (m_ypos - GetHeight()/2), GetWidth(), GetHeight()); + dc.DrawEllipse((long) (m_xpos - GetWidth()/2), (long) (m_ypos - GetHeight()/2), (long) GetWidth(), (long) GetHeight()); } void wxEllipseShape::SetSize(double x, double y, bool recursive) diff --git a/utils/ogl/src/bmpshape.cpp b/utils/ogl/src/bmpshape.cpp index b7f7a0f370..a8715057d3 100644 --- a/utils/ogl/src/bmpshape.cpp +++ b/utils/ogl/src/bmpshape.cpp @@ -58,7 +58,7 @@ void wxBitmapShape::OnDraw(wxDC& dc) double x, y; x = WXROUND(m_xpos - m_bitmap.GetWidth() / 2.0); y = WXROUND(m_ypos - m_bitmap.GetHeight() / 2.0); - dc.Blit(x, y, m_bitmap.GetWidth(), m_bitmap.GetHeight(), &tempDC, 0, 0); + dc.Blit((long) x, (long) y, m_bitmap.GetWidth(), m_bitmap.GetHeight(), &tempDC, 0, 0); } void wxBitmapShape::SetSize(double w, double h, bool recursive) diff --git a/utils/ogl/src/canvas.cpp b/utils/ogl/src/canvas.cpp index 857a70e130..edc898be23 100644 --- a/utils/ogl/src/canvas.cpp +++ b/utils/ogl/src/canvas.cpp @@ -120,8 +120,8 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) // from, this may not be an intentional drag at all. if (dragging) { - int dx = abs(dc.LogicalToDeviceX(x - m_firstDragX)); - int dy = abs(dc.LogicalToDeviceY(y - m_firstDragY)); + int dx = abs(dc.LogicalToDeviceX((long) (x - m_firstDragX))); + int dy = abs(dc.LogicalToDeviceY((long) (y - m_firstDragY))); if (m_checkTolerance && (dx <= GetDiagram()->GetMouseTolerance()) && (dy <= GetDiagram()->GetMouseTolerance())) { return; diff --git a/utils/ogl/src/composit.cpp b/utils/ogl/src/composit.cpp index 1e8331b4f6..366777b25f 100644 --- a/utils/ogl/src/composit.cpp +++ b/utils/ogl/src/composit.cpp @@ -1733,8 +1733,8 @@ void wxDivisionShape::PopupMenu(double x, double y) wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); - int mouse_x = (int)(dc.LogicalToDeviceX(x - x1*unit_x)); - int mouse_y = (int)(dc.LogicalToDeviceY(y - y1*unit_y)); + int mouse_x = (int)(dc.LogicalToDeviceX((long)(x - x1*unit_x))); + int mouse_y = (int)(dc.LogicalToDeviceY((long)(y - y1*unit_y))); m_canvas->PopupMenu(oglPopupDivisionMenu, mouse_x, mouse_y); } diff --git a/utils/ogl/src/drawn.cpp b/utils/ogl/src/drawn.cpp index e5ea9c82ce..d602580b86 100644 --- a/utils/ogl/src/drawn.cpp +++ b/utils/ogl/src/drawn.cpp @@ -607,7 +607,7 @@ void wxOpSetClipping::Do(wxDC& dc, double xoffset, double yoffset) { case DRAWOP_SET_CLIPPING_RECT: { - dc.SetClippingRegion(m_x1 + xoffset, m_y1 + yoffset, m_x2 + xoffset, m_y2 + yoffset); + dc.SetClippingRegion((long)(m_x1 + xoffset), (long)(m_y1 + yoffset), (long)(m_x2 + xoffset), (long)(m_y2 + yoffset)); break; } case DRAWOP_DESTROY_CLIPPING_RECT: @@ -1208,7 +1208,7 @@ bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double intPoints[i].x = WXROUND (x_proportion * m_points[i].x); intPoints[i].y = WXROUND (y_proportion * m_points[i].y); } - dc.DrawPolygon(n, intPoints, x, y); + dc.DrawPolygon(n, intPoints, (long) x, (long) y); delete[] intPoints; return TRUE; } diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp index 2e390faea2..a44bb7d2c6 100644 --- a/utils/ogl/src/lines.cpp +++ b/utils/ogl/src/lines.cpp @@ -290,7 +290,7 @@ void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y // Now draw the text if (region->GetFont()) dc.SetFont(region->GetFont()); - dc.DrawRectangle((double)(xp - w/2.0), (double)(yp - h/2.0), (double)w, (double)h); + dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h); if (m_pen) dc.SetPen(m_pen); dc.SetTextForeground(* region->GetActualColourObject()); @@ -323,7 +323,7 @@ void wxLineShape::EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double dc.SetPen(g_oglWhiteBackgroundPen); dc.SetBrush(g_oglWhiteBackgroundBrush); - dc.DrawRectangle((double)(xp - w/2.0), (double)(yp - h/2.0), (double)w, (double)h); + dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h); } } @@ -722,10 +722,10 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p &side1_x, &side1_y, &side2_x, &side2_y); wxPoint points[4]; - points[0].x = tip_x; points[0].y = tip_y; - points[1].x = side1_x; points[1].y = side1_y; - points[2].x = side2_x; points[2].y = side2_y; - points[3].x = tip_x; points[3].y = tip_y; + points[0].x = (int) tip_x; points[0].y = (int) tip_y; + points[1].x = (int) side1_x; points[1].y = (int) side1_y; + points[2].x = (int) side2_x; points[2].y = (int) side2_y; + points[3].x = (int) tip_x; points[3].y = (int) tip_y; dc.SetPen(m_pen); dc.SetBrush(m_brush); @@ -754,7 +754,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p else dc.SetBrush(m_brush); - dc.DrawEllipse(x1, y1, diameter, diameter); + dc.DrawEllipse((long) x1, (long) y1, (long) diameter, (long) diameter); break; } case ARROW_SINGLE_OBLIQUE: @@ -831,8 +831,8 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p arrow->GetMetaFile()->GetBounds(&minX, &minY, &maxX, &maxY); // Make erasing rectangle slightly bigger or you get droppings. int extraPixels = 4; - dc.DrawRectangle((double)(deltaX + x + minX - (extraPixels/2.0)), (double)(deltaY + y + minY - (extraPixels/2.0)), - (double)(maxX - minX + extraPixels), (double)(maxY - minY + extraPixels)); + dc.DrawRectangle((long)(deltaX + x + minX - (extraPixels/2.0)), (long)(deltaY + y + minY - (extraPixels/2.0)), + (long)(maxX - minX + extraPixels), (long)(maxY - minY + extraPixels)); } else arrow->GetMetaFile()->Draw(dc, x+deltaX, y+deltaY); @@ -877,8 +877,8 @@ void wxLineShape::OnErase(wxDC& dc) // of 1. if (old_pen && (old_pen->GetWidth() > 1)) { - dc.DrawRectangle((double)(m_xpos - (bound_x/2.0) - 2.0), (double)(m_ypos - (bound_y/2.0) - 2.0), - (double)(bound_x+4.0), (double)(bound_y+4.0)); + dc.DrawRectangle((long)(m_xpos - (bound_x/2.0) - 2.0), (long)(m_ypos - (bound_y/2.0) - 2.0), + (long)(bound_x+4.0), (long)(bound_y+4.0)); } else { diff --git a/utils/ogl/src/mfutils.cpp b/utils/ogl/src/mfutils.cpp index 3497460961..c1d356b106 100644 --- a/utils/ogl/src/mfutils.cpp +++ b/utils/ogl/src/mfutils.cpp @@ -170,7 +170,7 @@ bool wxXMetaFile::ReadFile(char *file) // Read placeable metafile header, if any long key = getint(handle); - if (key == 0x9AC6CDD7) + if (key == (long) 0x9AC6CDD7) { long hmf = getshort(handle); int iLeft, iTop, iRight, iBottom; @@ -792,7 +792,7 @@ bool wxXMetaFile::Play(wxDC *dc) { long x1 = rec->param1; long y1 = rec->param2; - dc->DrawLine(lastX, lastY, (double)x1, (double)y1); + dc->DrawLine((long) lastX, (long) lastY, x1, y1); break; } case META_MOVETO: @@ -818,17 +818,17 @@ bool wxXMetaFile::Play(wxDC *dc) // case META_PIE: // DO!!! case META_RECTANGLE: { - dc->DrawRectangle((double)rec->param1, (double)rec->param2, - (double)rec->param3 - rec->param1, - (double)rec->param4 - rec->param2); + dc->DrawRectangle((long)rec->param1, (long)rec->param2, + (long)rec->param3 - rec->param1, + (long)rec->param4 - rec->param2); break; } case META_ROUNDRECT: { - dc->DrawRoundedRectangle((double)rec->param1, (double)rec->param2, - (double)rec->param3 - rec->param1, - (double)rec->param4 - rec->param2, - (double)rec->param5); + dc->DrawRoundedRectangle((long)rec->param1, (long)rec->param2, + (long)rec->param3 - rec->param1, + (long)rec->param4 - rec->param2, + (long)rec->param5); break; } // case META_PATBLT: diff --git a/utils/ogl/src/misc.cpp b/utils/ogl/src/misc.cpp index c55ca31103..4c0008ea14 100644 --- a/utils/ogl/src/misc.cpp +++ b/utils/ogl/src/misc.cpp @@ -518,8 +518,8 @@ void oglDrawFormattedText(wxDC& dc, wxList *text_list, yoffset = (double)(m_ypos - (height / 2.0)); dc.SetClippingRegion( - (double)(m_xpos - width/2.0), (double)(m_ypos - height/2.0), - (double)width, (double)height); + (long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0), + (long)width, (long)height); wxNode *current = text_list->First(); while (current) diff --git a/utils/ogl/src/ogldiag.cpp b/utils/ogl/src/ogldiag.cpp index 36b22e9cbc..86a2025290 100644 --- a/utils/ogl/src/ogldiag.cpp +++ b/utils/ogl/src/ogldiag.cpp @@ -191,20 +191,20 @@ void wxDiagram::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2 wxPoint points[5]; - points[0].x = x1; - points[0].y = y1; + points[0].x = (int) x1; + points[0].y = (int) y1; - points[1].x = x2; - points[1].y = y1; + points[1].x = (int) x2; + points[1].y = (int) y1; - points[2].x = x2; - points[2].y = y2; + points[2].x = (int) x2; + points[2].y = (int) y2; - points[3].x = x1; - points[3].y = y2; + points[3].x = (int) x1; + points[3].y = (int) y2; - points[4].x = x1; - points[4].y = y1; + points[4].x = (int) x1; + points[4].y = (int) y1; dc.DrawLines(5, points); } -- 2.45.2