From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Fri, 25 Sep 1998 13:28:52 +0000 (+0000)
Subject: USE_xxx constants renamed to wxUSE_xxx. This is an incompatible change, you
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/47d67540a017101b3e46abe9ef0f55914d8de37e

USE_xxx constants renamed to wxUSE_xxx. This is an incompatible change, you
must recompile everything after upgrading!


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/include/wx/confbase.h b/include/wx/confbase.h
index 7cc1d07729..af05537a6c 100644
--- a/include/wx/confbase.h
+++ b/include/wx/confbase.h
@@ -23,9 +23,9 @@
 // ----------------------------------------------------------------------------
 
 // it won't compile without it anyhow
-#ifndef USE_CONFIG
-  #error "Please define USE_CONFIG or remove config.cpp from your makefile"
-#endif // USE_CONFIG
+#ifndef wxUSE_CONFIG
+  #error "Please define wxUSE_CONFIG or remove config.cpp from your makefile"
+#endif // wxUSE_CONFIG
 
 // ----------------------------------------------------------------------------
 // constants
diff --git a/include/wx/date.h b/include/wx/date.h
index d21a53eb00..48eb2ce8a4 100644
--- a/include/wx/date.h
+++ b/include/wx/date.h
@@ -20,7 +20,7 @@
 #include "wx/object.h"
 #include "wx/string.h"
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 
 enum wxdate_format_type {wxMDY, wxDAY, wxMONTH, wxFULL, wxEUROPEAN};
 
diff --git a/include/wx/docview.h b/include/wx/docview.h
index 6bc84b0f0a..dc25795242 100644
--- a/include/wx/docview.h
+++ b/include/wx/docview.h
@@ -21,7 +21,7 @@
 #include "wx/cmndata.h"
 #include "wx/string.h"
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 #include "wx/print.h"
 #endif
 
@@ -189,7 +189,7 @@ class WXDLLEXPORT wxView: public wxEvtHandler
 
   inline wxDocManager *GetDocumentManager(void) const { return m_viewDocument->GetDocumentManager(); }
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
   virtual wxPrintout *OnCreatePrintout(void);
 #endif
 
@@ -415,7 +415,7 @@ DECLARE_EVENT_TABLE()
  * Provide simple default printing facilities
  */
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 class WXDLLEXPORT wxDocPrintout: public wxPrintout
 {
   DECLARE_DYNAMIC_CLASS(wxDocPrintout)
diff --git a/include/wx/fileconf.h b/include/wx/fileconf.h
index 4b1dbceaaa..e17e8cae08 100644
--- a/include/wx/fileconf.h
+++ b/include/wx/fileconf.h
@@ -26,9 +26,9 @@
 // ----------------------------------------------------------------------------
 
 // it won't compile without it anyhow
-#ifndef USE_CONFIG
-  #error "Please define USE_CONFIG or remove fileconf.cpp from your makefile"
-#endif // USE_CONFIG
+#ifndef wxUSE_CONFIG
+  #error "Please define wxUSE_CONFIG or remove fileconf.cpp from your makefile"
+#endif // wxUSE_CONFIG
 
 // ----------------------------------------------------------------------------
 // wxFileConfig
diff --git a/include/wx/generic/helpxlp.h b/include/wx/generic/helpxlp.h
index 5c0b26d257..ec5aa7e174 100644
--- a/include/wx/generic/helpxlp.h
+++ b/include/wx/generic/helpxlp.h
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include "wx/wx.h"
 
-#if USE_HELP
+#if wxUSE_HELP
 
 #include "wx/helpbase.h"
 
@@ -122,6 +122,6 @@ class WXDLLEXPORT wxXLPHelpController: public wxHelpControllerBase
   wxXLPHelpClient		helpClient;
 };
 
-#endif // USE_HELP
+#endif // wxUSE_HELP
 #endif
     // __HELPXLPH__
diff --git a/include/wx/gtk/menuitem.h b/include/wx/gtk/menuitem.h
index 6536ac0805..9c912967f1 100644
--- a/include/wx/gtk/menuitem.h
+++ b/include/wx/gtk/menuitem.h
@@ -25,7 +25,7 @@
 // an exception to the general rule that a normal header doesn't include other
 // headers - only because ownerdrw.h is not always included and I don't want
 // to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 #include  "wx/ownerdrw.h"
 #endif
 
@@ -40,7 +40,7 @@
 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
 // ----------------------------------------------------------------------------
 class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
                             , public wxOwnerDrawn
 #endif
 {
@@ -79,7 +79,7 @@ private:
   bool        m_bEnabled,       // enabled or greyed?
               m_bChecked;       // checked? (only if checkable)
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   // wxOwnerDrawn base class already has these variables - nothing to do
 
 #else   //!owner drawn
diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h
index e4bdb022c3..29663cf0d0 100644
--- a/include/wx/gtk/textctrl.h
+++ b/include/wx/gtk/textctrl.h
@@ -21,7 +21,7 @@
 #include "wx/string.h"
 #include "wx/control.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/gtk1/menuitem.h b/include/wx/gtk1/menuitem.h
index 6536ac0805..9c912967f1 100644
--- a/include/wx/gtk1/menuitem.h
+++ b/include/wx/gtk1/menuitem.h
@@ -25,7 +25,7 @@
 // an exception to the general rule that a normal header doesn't include other
 // headers - only because ownerdrw.h is not always included and I don't want
 // to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 #include  "wx/ownerdrw.h"
 #endif
 
@@ -40,7 +40,7 @@
 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
 // ----------------------------------------------------------------------------
 class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
                             , public wxOwnerDrawn
 #endif
 {
@@ -79,7 +79,7 @@ private:
   bool        m_bEnabled,       // enabled or greyed?
               m_bChecked;       // checked? (only if checkable)
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   // wxOwnerDrawn base class already has these variables - nothing to do
 
 #else   //!owner drawn
diff --git a/include/wx/gtk1/textctrl.h b/include/wx/gtk1/textctrl.h
index e4bdb022c3..29663cf0d0 100644
--- a/include/wx/gtk1/textctrl.h
+++ b/include/wx/gtk1/textctrl.h
@@ -21,7 +21,7 @@
 #include "wx/string.h"
 #include "wx/control.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/helpbase.h b/include/wx/helpbase.h
index b1ee1c693b..ee38db1f10 100644
--- a/include/wx/helpbase.h
+++ b/include/wx/helpbase.h
@@ -18,7 +18,7 @@
 
 #include "wx/wx.h"
 
-#if USE_HELP
+#if wxUSE_HELP
 
 // Defines the API for help controllers
 class WXDLLEXPORT wxHelpControllerBase: public wxObject
@@ -46,6 +46,6 @@ class WXDLLEXPORT wxHelpControllerBase: public wxObject
   virtual void OnQuit(void) {};
 };
 
-#endif // USE_HELP
+#endif // wxUSE_HELP
 #endif
     // _WX_HELPBASEH__
diff --git a/include/wx/memory.h b/include/wx/memory.h
index 80b942505c..95d016c850 100644
--- a/include/wx/memory.h
+++ b/include/wx/memory.h
@@ -23,11 +23,11 @@
   info, or to be a straight call to the new operator.
 */
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
 #include <stddef.h>
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -48,7 +48,7 @@ void wxDebugFree(void * buf, bool isVect = FALSE);
 // Currently, these merely call malloc and free; only the wxObject
 // operators do something interesting. But this allows WXDEBUG_NEW to
 // work for all 'new's in a file.
-#if USE_GLOBAL_MEMORY_OPERATORS
+#if wxUSE_GLOBAL_MEMORY_OPERATORS
 
 #ifdef new
 #undef new
diff --git a/include/wx/motif/menuitem.h b/include/wx/motif/menuitem.h
index 2956987bd9..8fc4a7418a 100644
--- a/include/wx/motif/menuitem.h
+++ b/include/wx/motif/menuitem.h
@@ -25,7 +25,7 @@
 // an exception to the general rule that a normal header doesn't include other
 // headers - only because ownerdrw.h is not always included and I don't want
 // to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 #include  "wx/ownerdrw.h"
 #endif
 
@@ -40,7 +40,7 @@
 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
 // ----------------------------------------------------------------------------
 class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
                             , public wxOwnerDrawn
 #endif
 {
@@ -99,7 +99,7 @@ private:
   wxMenuBar*  m_menuBar;
   wxMenu*     m_topMenu;        // Top-level menu e.g. popup-menu
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   // wxOwnerDrawn base class already has these variables - nothing to do
 
 #else   //!owner drawn
diff --git a/include/wx/motif/setup.h b/include/wx/motif/setup.h
index 0d2f83035d..5b26b6c6be 100644
--- a/include/wx/motif/setup.h
+++ b/include/wx/motif/setup.h
@@ -17,9 +17,9 @@
  *
  */
 
-#define USE_CONSTRAINTS       1
+#define wxUSE_CONSTRAINTS       1
                                 // Use constraints mechanism
-#define USE_CONFIG           1
+#define wxUSE_CONFIG           1
                                 // Use wxConfig, with CreateConfig in wxApp
 #define _WX_GOODCOMPILER__
                                 // gcc can have problems, but Windows compilers
@@ -30,51 +30,51 @@
                                 // Level 1: wxDC, OnSize (etc.) compatibility, but
                                 //          some new features such as event tables
 
-#define USE_POSTSCRIPT  1
+#define wxUSE_POSTSCRIPT  1
                         	// 0 for no PostScript device context
-#define USE_AFM_FOR_POSTSCRIPT 0
+#define wxUSE_AFM_FOR_POSTSCRIPT 0
                                 // 1 to use font metric files in GetTextExtent
-#define USE_METAFILE    1
+#define wxUSE_METAFILE    1
                                 // 0 for no Metafile and metafile device context
-#define USE_IPC         1
+#define wxUSE_IPC         1
                                 // 0 for no interprocess comms
-#define USE_HELP        1
+#define wxUSE_HELP        1
                                 // 0 for no help facility
-#define USE_RESOURCES   1
+#define wxUSE_RESOURCES   1
                         	// 0 for no wxGetResource/wxWriteResource
-#define USE_CLIPBOARD   1
+#define wxUSE_CLIPBOARD   1
                         	// 0 for no clipboard functions
-#define USE_SPLINES     1
+#define wxUSE_SPLINES     1
                             	// 0 for no splines
-#define USE_XFIG_SPLINE_CODE  1
+#define wxUSE_XFIG_SPLINE_CODE  1
                            	// 1 for XFIG spline code, 0 for AIAI spline code.
 // AIAI spline code is slower, but freer of copyright issues.
                             	// 0 for no splines
 
-#define USE_TOOLBAR     1
+#define wxUSE_TOOLBAR     1
                             // Use toolbars
-#define USE_DRAG_AND_DROP 1
+#define wxUSE_DRAG_AND_DROP 1
                         	// 0 for no drag and drop
 
-#define USE_WX_RESOURCES        1
+#define wxUSE_WX_RESOURCES        1
                                   // Use .wxr resource mechanism (requires PrologIO library)
 
-#define USE_DOC_VIEW_ARCHITECTURE 1
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
                                   // Set to 0 to disable document/view architecture
-#define USE_PRINTING_ARCHITECTURE  1
+#define wxUSE_PRINTING_ARCHITECTURE  1
                                     // Set to 0 to disable print/preview architecture code
-#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
                                     // Set to 0 to disable PostScript print/preview architecture code
                                     // under Windows (just use Windows printing).
-#define USE_DYNAMIC_CLASSES     1
+#define wxUSE_DYNAMIC_CLASSES     1
                                   // If 1, enables provision of run-time type information.
                                   // NOW MANDATORY: don't change.
-#define USE_MEMORY_TRACING      1
+#define wxUSE_MEMORY_TRACING      1
                                   // If 1, enables debugging versions of wxObject::new and
                                   // wxObject::delete *IF* WXDEBUG is also defined.
                                   // WARNING: this code may not work with all architectures, especially
                                   // if alignment is an issue.
-#define USE_DEBUG_CONTEXT       1
+#define wxUSE_DEBUG_CONTEXT       1
                                   // If 1, enables wxDebugContext, for
                                   // writing error messages to file, etc. 
                                   // If WXDEBUG is not defined, will still use
@@ -83,7 +83,7 @@
                                   // since you may well need to output
                                   // an error log in a production
                                   // version (or non-debugging beta)
-#define USE_GLOBAL_MEMORY_OPERATORS 0
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
                                   // In debug mode, cause new and delete to be redefined globally.
                                   // If this causes problems (e.g. link errors), set this to 0.
 
@@ -91,18 +91,18 @@
                                   // Set this to 0 if your compiler can't cope
                                   // with omission of prototype parameters.
 
-#define USE_C_MAIN 0
+#define wxUSE_C_MAIN 0
                                   // Set to 1 to use main.c instead of main.cpp (UNIX only)
 
-#define USE_ODBC                   0
+#define wxUSE_ODBC                   0
                                     // Define 1 to use ODBC classes
 
-#define USE_IOSTREAMH     1
+#define wxUSE_IOSTREAMH     1
                                   // VC++ 4.2 and above allows <iostream> and <iostream.h>
                                   // but you can't mix them. Set to 1 for <iostream.h>,
                                   // 0 for <iostream>
 
-#define USE_WXCONFIG      1
+#define wxUSE_WXCONFIG      1
                                   // if enabled, compiles built-in OS independent wxConfig
                                   // class and it's file (any platform) and registry (Win)
                                   // based implementations
@@ -111,7 +111,7 @@
  *
  */
 
-#define USE_APPLE_IEEE	  1
+#define wxUSE_APPLE_IEEE	  1
 				// if enabled, the float codec written by Apple
 				// will be used to write, in a portable way,
 				// float on the disk
diff --git a/include/wx/motif/textctrl.h b/include/wx/motif/textctrl.h
index 6f0dc9923a..4556a46d82 100644
--- a/include/wx/motif/textctrl.h
+++ b/include/wx/motif/textctrl.h
@@ -18,7 +18,7 @@
 
 #include "wx/control.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h
index 031695ff67..0a24b42900 100644
--- a/include/wx/motif/window.h
+++ b/include/wx/motif/window.h
@@ -67,11 +67,11 @@ class WXDLLEXPORT wxIcon;
 class WXDLLEXPORT wxDC;
 class WXDLLEXPORT wxValidator;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 class WXDLLEXPORT wxDropTarget;
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 class WXDLLEXPORT wxResourceTable;
 class WXDLLEXPORT wxItemResource;
 #endif
@@ -193,7 +193,7 @@ public:
   // Enable or disable the window
   virtual void Enable(bool enable);
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   // Associate a drop target with this window (if the window already had a drop
   // target, it's deleted!) and return the current drop target (may be NULL).
   void          SetDropTarget(wxDropTarget *pDropTarget);
@@ -336,7 +336,7 @@ public:
   virtual void OnDefaultAction(wxControl *initiatingItem);
 
   // Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
   virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
 #endif
@@ -532,7 +532,7 @@ protected:
   wxColour              m_defaultForegroundColour;
   wxAcceleratorTable    m_acceleratorTable;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   wxDropTarget         *m_pDropTarget;    // the current drop target or NULL
 #endif  //USE_DRAG_AND_DROP
 
diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h
index 200f9705ee..2f01821ed7 100644
--- a/include/wx/msw/bitmap.h
+++ b/include/wx/msw/bitmap.h
@@ -130,7 +130,7 @@ public:
   // Initialize with raw data
   wxBitmap(const char bits[], int width, int height, int depth = 1);
 
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
   class wxItem;
   // Initialize with XPM data
   wxBitmap(const char **data, wxItem *anItem = NULL);
diff --git a/include/wx/msw/clipbrd.h b/include/wx/msw/clipbrd.h
index 6e816fab56..b556727098 100644
--- a/include/wx/msw/clipbrd.h
+++ b/include/wx/msw/clipbrd.h
@@ -19,7 +19,7 @@
 #include "wx/defs.h"
 #include "wx/setup.h"
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 
 #include "wx/list.h"
 
@@ -106,6 +106,6 @@ void WXDLLEXPORT wxInitClipboard(void);
 /* The clipboard */
 WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
 
-#endif // USE_CLIPBOARD
+#endif // wxUSE_CLIPBOARD
 #endif
     // _WX_CLIPBRD_H_
diff --git a/include/wx/msw/combobox.h b/include/wx/msw/combobox.h
index 0739774280..b3510ec208 100644
--- a/include/wx/msw/combobox.h
+++ b/include/wx/msw/combobox.h
@@ -18,7 +18,7 @@
 
 #include "wx/choice.h"
 
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
 
 WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
 WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
@@ -78,6 +78,6 @@ class WXDLLEXPORT wxComboBox: public wxChoice
   virtual bool MSWCommand(WXUINT param, WXWORD id);
 };
 
-#endif // USE_COMBOBOX
+#endif // wxUSE_COMBOBOX
 #endif
     // _WX_COMBOBOX_H_
diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h
index 94e313b973..983845e5a8 100644
--- a/include/wx/msw/dc.h
+++ b/include/wx/msw/dc.h
@@ -133,7 +133,7 @@ public:
     return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask);
   }
 
-#if USE_SPLINES
+#if wxUSE_SPLINES
   // Splines
   // 3-point spline
   virtual void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3);
diff --git a/include/wx/msw/helpwin.h b/include/wx/msw/helpwin.h
index 786155231f..308439b8b3 100644
--- a/include/wx/msw/helpwin.h
+++ b/include/wx/msw/helpwin.h
@@ -18,7 +18,7 @@
 
 #include "wx/wx.h"
 
-#if USE_HELP
+#if wxUSE_HELP
 
 #include "wx/helpbase.h"
 
@@ -49,6 +49,6 @@ protected:
   wxString m_helpFile;
 };
 
-#endif // USE_HELP
+#endif // wxUSE_HELP
 #endif
     // _WX_HELPWIN_H_
diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h
index b11df5edd3..fecc9b2fbc 100644
--- a/include/wx/msw/listbox.h
+++ b/include/wx/msw/listbox.h
@@ -20,7 +20,7 @@
 
 WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   class WXDLLEXPORT wxOwnerDrawn;
 
   // define the array of list box items
@@ -63,7 +63,7 @@ class WXDLLEXPORT wxListBox: public wxControl
 
   bool MSWCommand(WXUINT param, WXWORD id);
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
   bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
 
@@ -125,7 +125,7 @@ class WXDLLEXPORT wxListBox: public wxControl
   int m_noItems;
   int m_selected;
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   // control items
   wxListBoxItemsArray m_aItems;
 #endif
diff --git a/include/wx/msw/menuitem.h b/include/wx/msw/menuitem.h
index 6536ac0805..9c912967f1 100644
--- a/include/wx/msw/menuitem.h
+++ b/include/wx/msw/menuitem.h
@@ -25,7 +25,7 @@
 // an exception to the general rule that a normal header doesn't include other
 // headers - only because ownerdrw.h is not always included and I don't want
 // to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 #include  "wx/ownerdrw.h"
 #endif
 
@@ -40,7 +40,7 @@
 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
 // ----------------------------------------------------------------------------
 class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
                             , public wxOwnerDrawn
 #endif
 {
@@ -79,7 +79,7 @@ private:
   bool        m_bEnabled,       // enabled or greyed?
               m_bChecked;       // checked? (only if checkable)
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   // wxOwnerDrawn base class already has these variables - nothing to do
 
 #else   //!owner drawn
diff --git a/include/wx/msw/metafile.h b/include/wx/msw/metafile.h
index 60d3c1db50..f8ad981949 100644
--- a/include/wx/msw/metafile.h
+++ b/include/wx/msw/metafile.h
@@ -19,7 +19,7 @@
 
 #include "wx/setup.h"
 
-#if USE_METAFILE
+#if wxUSE_METAFILE
 #include "wx/dc.h"
 
 /*
@@ -99,6 +99,6 @@ bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, float scale =
 // Optional origin and extent
 bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
 
-#endif // USE_METAFILE
+#endif // wxUSE_METAFILE
 #endif
     // _WX_METAFIILE_H_
diff --git a/include/wx/msw/ole/dropsrc.h b/include/wx/msw/ole/dropsrc.h
index a43999498d..4ed544cf38 100644
--- a/include/wx/msw/ole/dropsrc.h
+++ b/include/wx/msw/ole/dropsrc.h
@@ -17,7 +17,7 @@
 #endif
 
 #if !USE_DRAG_AND_DROP
-  #error  "You should #define USE_DRAG_AND_DROP to 1 to compile this file!"
+  #error  "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
 #endif  //WX_DRAG_DROP
 
 // ----------------------------------------------------------------------------
diff --git a/include/wx/msw/ole/droptgt.h b/include/wx/msw/ole/droptgt.h
index cf990ef5a0..065d56c63f 100644
--- a/include/wx/msw/ole/droptgt.h
+++ b/include/wx/msw/ole/droptgt.h
@@ -20,7 +20,7 @@
 #endif
 
 #if !USE_DRAG_AND_DROP
-  #error  "You should #define USE_DRAG_AND_DROP to 1 to compile this file!"
+  #error  "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
 #endif  //WX_DRAG_DROP
 
 // ----------------------------------------------------------------------------
diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h
index 3f7506841b..6506dccbec 100644
--- a/include/wx/msw/private.h
+++ b/include/wx/msw/private.h
@@ -67,13 +67,13 @@ typedef signed short int SHORT ;
 #define DLGPROC FARPROC
 #endif
 
-#if USE_PENWIN
+#if wxUSE_PENWIN
 void WXDLLEXPORT wxRegisterPenWin(void);
 void WXDLLEXPORT wxCleanUpPenWin(void);
 void WXDLLEXPORT wxEnablePenAppHooks (bool hook);
 #endif
 
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
 #define IBS_HORZCAPTION    0x4000L
 #define IBS_VERTCAPTION    0x8000L
 
diff --git a/include/wx/msw/registry.h b/include/wx/msw/registry.h
index b5e504f829..62d2f9a3ca 100644
--- a/include/wx/msw/registry.h
+++ b/include/wx/msw/registry.h
@@ -19,7 +19,7 @@
 // ----------------------------------------------------------------------------
 // mutable hack (see also registry.cpp)
 // ----------------------------------------------------------------------------
-#if   USE_MUTABLE
+#if   wxUSE_MUTABLE
   #define MUTABLE mutable
 #else
   #define MUTABLE
diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h
index b75fcc9949..ff69ed94c6 100644
--- a/include/wx/msw/setup.h
+++ b/include/wx/msw/setup.h
@@ -17,7 +17,7 @@
  *
  */
 
-#define USE_CONFIG           1
+#define wxUSE_CONFIG           1
                                 // Use wxConfig, with CreateConfig in wxApp
 #define _WX_GOODCOMPILER__
                                 // gcc can have problems, but Windows compilers
@@ -28,75 +28,75 @@
                                 // Level 1: wxDC, OnSize (etc.) compatibility, but
                                 //          some new features such as event tables
 
-#define USE_AUTOTRANS	1
+#define wxUSE_AUTOTRANS	1
 								// Define wxTString
-#define USE_POSTSCRIPT  1
+#define wxUSE_POSTSCRIPT  1
                         	// 0 for no PostScript device context
-#define USE_AFM_FOR_POSTSCRIPT 0
+#define wxUSE_AFM_FOR_POSTSCRIPT 0
                                 // 1 to use font metric files in GetTextExtent
-#define USE_METAFILE    1
+#define wxUSE_METAFILE    1
                                 // 0 for no Metafile and metafile device context
-#define USE_FORM        0
+#define wxUSE_FORM        0
                                 // 0 for no wxForm
-#define USE_IPC         1
+#define wxUSE_IPC         1
                                 // 0 for no interprocess comms
 // Note: wxHELP uses IPC under X so these are interdependent!
-#define USE_HELP        1
+#define wxUSE_HELP        1
                                 // 0 for no help facility
-#define USE_RESOURCES   1
+#define wxUSE_RESOURCES   1
                         	// 0 for no wxGetResource/wxWriteResource
-#define USE_CONSTRAINTS 1
+#define wxUSE_CONSTRAINTS 1
                                 // 0 for no window layout constraint system
                                 
-#define USE_TIMEDATE    1
+#define wxUSE_TIMEDATE    1
                                 // 0 for no wxTime/wxDate classes
                                 
-#define USE_CLIPBOARD   1
+#define wxUSE_CLIPBOARD   1
                         	// 0 for no clipboard functions
-#define USE_SPLINES     1
+#define wxUSE_SPLINES     1
                             	// 0 for no splines
-#define USE_XFIG_SPLINE_CODE  1
+#define wxUSE_XFIG_SPLINE_CODE  1
                            	// 1 for XFIG spline code, 0 for AIAI spline code.
 // AIAI spline code is slower, but freer of copyright issues.
 
-#define USE_DRAG_AND_DROP 1
+#define wxUSE_DRAG_AND_DROP 1
                         	// 0 for no drag and drop
 
-#define USE_TOOLBAR       1
+#define wxUSE_TOOLBAR       1
                                     // Define 1 to use toolbar classes
-#define USE_BUTTONBAR     1
+#define wxUSE_BUTTONBAR     1
                                     // Define 1 to use buttonbar classes (enhanced toolbar
                                     // for MS Windows)
-#define USE_GAUGE         1
+#define wxUSE_GAUGE         1
                                     // Define 1 to use Microsoft's gauge (Windows)
                                     // or Bull's gauge (Motif) library (both in contrib).
-#define USE_COMBOBOX      1
+#define wxUSE_COMBOBOX      1
                                     // Define 1 to use COMBOXBOX control (Windows)
                                     // or FWW's ComboBox widget (Motif).
-#define USE_RADIOBUTTON   1
+#define wxUSE_RADIOBUTTON   1
                                     // Define 1 to use radio button control
 
-#define USE_SCROLLBAR   1
+#define wxUSE_SCROLLBAR   1
                                     // Define 1 to compile contributed wxScrollBar class
-#define USE_XPM_IN_X    1
-#define USE_XPM_IN_MSW  0
+#define wxUSE_XPM_IN_X    1
+#define wxUSE_XPM_IN_MSW  0
                                     // Define 1 to support the XPM package in wxBitmap,
                                     // separated by platform. If 1, you must link in
                                     // the XPM library to your applications.
-#define USE_IMAGE_LOADING_IN_X          1
+#define wxUSE_IMAGE_LOADING_IN_X          1
                                   // Use dynamic icon/bitmap loading/saving code in utils/image under X.
                                   // If this is 1, you will need to link your applications
                                   // with image_X.lib. where X is motif, ol, or hp.
 
-#define USE_IMAGE_LOADING_IN_MSW        1
+#define wxUSE_IMAGE_LOADING_IN_MSW        1
                                   // Use dynamic DIB loading/saving code in utils/dib under MSW.
-#define USE_RESOURCE_LOADING_IN_MSW     0
+#define wxUSE_RESOURCE_LOADING_IN_MSW     0
                                   // Use dynamic icon/cursor loading/saving code
                                   // under MSW.
-#define USE_WX_RESOURCES        1
+#define wxUSE_WX_RESOURCES        1
                                   // Use .wxr resource mechanism (requires PrologIO library)
 
-#define USE_GNU_WXSTRING        0
+#define wxUSE_GNU_WXSTRING        0
                                   // Define 1 to use modified GNU wxString class
                                   // from (stefan.hammes@urz.uni-heidelberg.de) in contrib\string
                                   // TODO: why does this give an unresolved 'wxRegex::Search'
@@ -104,22 +104,22 @@
 
 #define HAVE_SOCKET             1
                                   // Use WinSock if 1                                 
-#define USE_DOC_VIEW_ARCHITECTURE 1
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
                                   // Set to 0 to disable document/view architecture
-#define USE_PRINTING_ARCHITECTURE  1
+#define wxUSE_PRINTING_ARCHITECTURE  1
                                     // Set to 0 to disable print/preview architecture code
-#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
                                     // Set to 0 to disable PostScript print/preview architecture code
                                     // under Windows (just use Windows printing).
-#define USE_DYNAMIC_CLASSES     1
+#define wxUSE_DYNAMIC_CLASSES     1
                                   // If 1, enables provision of run-time type information.
                                   // NOW MANDATORY: don't change.
-#define USE_MEMORY_TRACING      1
+#define wxUSE_MEMORY_TRACING      1
                                   // If 1, enables debugging versions of wxObject::new and
                                   // wxObject::delete *IF* WXDEBUG is also defined.
                                   // WARNING: this code may not work with all architectures, especially
                                   // if alignment is an issue.
-#define USE_DEBUG_CONTEXT       1
+#define wxUSE_DEBUG_CONTEXT       1
                                   // If 1, enables wxDebugContext, for
                                   // writing error messages to file, etc. 
                                   // If WXDEBUG is not defined, will still use
@@ -128,7 +128,7 @@
                                   // since you may well need to output
                                   // an error log in a production
                                   // version (or non-debugging beta)
-#define USE_GLOBAL_MEMORY_OPERATORS 1
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
                                   // In debug mode, cause new and delete to be redefined globally.
                                   // If this causes problems (e.g. link errors), set this to 0.
 
@@ -136,18 +136,18 @@
                                   // Set this to 0 if your compiler can't cope
                                   // with omission of prototype parameters.
 
-#define USE_C_MAIN 0
+#define wxUSE_C_MAIN 0
                                   // Set to 1 to use main.c instead of main.cpp (UNIX only)
 
-#define USE_ODBC                   1
+#define wxUSE_ODBC                   1
                                     // Define 1 to use ODBC classes
 
-#define USE_IOSTREAMH     1
+#define wxUSE_IOSTREAMH     1
                                   // VC++ 4.2 and above allows <iostream> and <iostream.h>
                                   // but you can't mix them. Set to 1 for <iostream.h>,
                                   // 0 for <iostream>
 
-#define USE_WXCONFIG      1
+#define wxUSE_WXCONFIG      1
                                   // if enabled, compiles built-in OS independent wxConfig
                                   // class and it's file (any platform) and registry (Win)
                                   // based implementations
@@ -156,7 +156,7 @@
  *
  */
 
-#define USE_APPLE_IEEE	  1
+#define wxUSE_APPLE_IEEE	  1
 				// if enabled, the float codec written by Apple
 				// will be used to write, in a portable way,
 				// float on the disk
@@ -174,35 +174,35 @@
                                     // See note above about using FAFA and CTL3D.
 #endif
 
-#define USE_COMMON_DIALOGS         1
+#define wxUSE_COMMON_DIALOGS         1
                                     // On rare occasions (e.g. using DJGPP) may want
                                     // to omit common dialogs
                                     // (e.g. file selector, printer dialog).
                                     // Switching this off also switches off
                                     // the printing architecture and interactive
                                     // wxPrinterDC.
-#define USE_ITSY_BITSY             1
+#define wxUSE_ITSY_BITSY             1
                                     // Define 1 to use Microsoft's ItsyBitsy
                                     // small title bar library, for wxMiniFrame
-#define USE_BITMAP_MESSAGE         1
+#define wxUSE_BITMAP_MESSAGE         1
                                     // Define 1 to use bitmap messages.
-#define USE_PORTABLE_FONTS_IN_MSW  0
+#define wxUSE_PORTABLE_FONTS_IN_MSW  0
                                     // Define 1 to use new portable font scheme in Windows
                                     // (used by default under X)
 #define FONT_SIZE_COMPATIBILITY    0
                                     // Define 1 for font size to be backward compatible
                                     // to 1.63 and earlier. 1.64 and later define point
                                     // sizes to be compatible with Windows.
-#define USE_GENERIC_DIALOGS_IN_MSW 1
+#define wxUSE_GENERIC_DIALOGS_IN_MSW 1
                                     // Define 1 to use generic dialogs in Windows, even though
                                     // they duplicate native common dialog (e.g. wxColourDialog)
-#define USE_PENWINDOWS 0
+#define wxUSE_PENWINDOWS 0
                                     // Set to 1 to use PenWindows
 
-#define USE_OWNER_DRAWN             0
+#define wxUSE_OWNER_DRAWN             0
                                     // Owner-drawn menus and listboxes
 
-#define USE_NATIVE_STATUSBAR        1
+#define wxUSE_NATIVE_STATUSBAR        1
                                     // Set to 0 to use cross-platform wxStatusBar
 
 /*
@@ -210,7 +210,7 @@
  *
  */
 
-#define USE_TYPEDEFS               0
+#define wxUSE_TYPEDEFS               0
                                     // Use typedefs not classes for wxPoint
 				    // and others, to reduce overhead and avoid
 				    // MS C7 memory bug. Bounds checker
@@ -221,62 +221,62 @@
 // Can't use OLE drag and drop in Windows 3.1 because we don't know how
 // to implement UUIDs
 // GnuWin32 doesn't have appropriate headers for e.g. IUnknown.
-#undef USE_DRAG_AND_DROP
-#define USE_DRAG_AND_DROP 0
+#undef wxUSE_DRAG_AND_DROP
+#define wxUSE_DRAG_AND_DROP 0
 #endif
 
 // Only WIN32 supports wxStatusBar95
-#if !defined(__WIN32__) && USE_NATIVE_STATUSBAR
-#undef  USE_NATIVE_STATUSBAR
-#define USE_NATIVE_STATUSBAR 0
+#if !defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
+#undef  wxUSE_NATIVE_STATUSBAR
+#define wxUSE_NATIVE_STATUSBAR 0
 #endif
 
 // Minimal setup e.g. for compiling small utilities
 #define MINIMAL_WXWINDOWS_SETUP 0
 
 #if MINIMAL_WXWINDOWS_SETUP
-#undef USE_POSTSCRIPT
-# define USE_POSTSCRIPT 0
-#undef USE_PRINTING_ARCHITECTURE
-# define USE_PRINTING_ARCHITECTURE 0
-#undef USE_POSTSCRIPT_ARCHITECTURE_IN_MSW
-# define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
-#undef USE_METAFILE
-# define USE_METAFILE 0
-#undef USE_FORM
-# define USE_FORM 0
-#undef USE_SPLINES
-# define USE_SPLINES 0
-#undef USE_SCROLLBAR
-# define USE_SCROLLBAR 0
-#undef USE_COMBOBOX
-# define USE_COMBOBOX 0
-#undef USE_RADIOBUTTON
-# define USE_RADIOBUTTON 0
-#undef USE_XPM_IN_MSW
-# define USE_XPM_IN_MSW 0
-#undef USE_WX_RESOURCES
-# define USE_WX_RESOURCES 0
-#undef USE_DOC_VIEW_ARCHITECTURE
-# define USE_DOC_VIEW_ARCHITECTURE 0
-#undef USE_GNU_WXSTRING
-# define USE_GNU_WXSTRING 0
-#undef USE_ODBC
-# define USE_ODBC 0
-#undef USE_TIMEDATE
-# define USE_TIMEDATE 0
+#undef wxUSE_POSTSCRIPT
+# define wxUSE_POSTSCRIPT 0
+#undef wxUSE_PRINTING_ARCHITECTURE
+# define wxUSE_PRINTING_ARCHITECTURE 0
+#undef wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW
+# define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
+#undef wxUSE_METAFILE
+# define wxUSE_METAFILE 0
+#undef wxUSE_FORM
+# define wxUSE_FORM 0
+#undef wxUSE_SPLINES
+# define wxUSE_SPLINES 0
+#undef wxUSE_SCROLLBAR
+# define wxUSE_SCROLLBAR 0
+#undef wxUSE_COMBOBOX
+# define wxUSE_COMBOBOX 0
+#undef wxUSE_RADIOBUTTON
+# define wxUSE_RADIOBUTTON 0
+#undef wxUSE_XPM_IN_MSW
+# define wxUSE_XPM_IN_MSW 0
+#undef wxUSE_WX_RESOURCES
+# define wxUSE_WX_RESOURCES 0
+#undef wxUSE_DOC_VIEW_ARCHITECTURE
+# define wxUSE_DOC_VIEW_ARCHITECTURE 0
+#undef wxUSE_GNU_WXSTRING
+# define wxUSE_GNU_WXSTRING 0
+#undef wxUSE_ODBC
+# define wxUSE_ODBC 0
+#undef wxUSE_TIMEDATE
+# define wxUSE_TIMEDATE 0
 #undef CTL3D
 # define CTL3D 0
-#undef USE_ITSY_BITSY
-# define USE_ITSY_BITSY 0
-#undef USE_IMAGE_LOADING_IN_MSW
-# define USE_IMAGE_LOADING_IN_MSW 0
-#undef USE_GAUGE
-# define USE_GAUGE 0
-#undef USE_RESOURCE_LOADING_IN_MSW
-# define USE_RESOURCE_LOADING_IN_MSW 0
-#undef USE_DRAG_AND_DROP
-# define USE_DRAG_AND_DROP 0
+#undef wxUSE_ITSY_BITSY
+# define wxUSE_ITSY_BITSY 0
+#undef wxUSE_IMAGE_LOADING_IN_MSW
+# define wxUSE_IMAGE_LOADING_IN_MSW 0
+#undef wxUSE_GAUGE
+# define wxUSE_GAUGE 0
+#undef wxUSE_RESOURCE_LOADING_IN_MSW
+# define wxUSE_RESOURCE_LOADING_IN_MSW 0
+#undef wxUSE_DRAG_AND_DROP
+# define wxUSE_DRAG_AND_DROP 0
 #endif
 
 #endif
diff --git a/include/wx/msw/statbr95.h b/include/wx/msw/statbr95.h
index 4950dd85b8..ab844a5910 100644
--- a/include/wx/msw/statbr95.h
+++ b/include/wx/msw/statbr95.h
@@ -16,7 +16,7 @@
 #pragma interface "statbr95.h"
 #endif
 
-#if       USE_NATIVE_STATUSBAR
+#if       wxUSE_NATIVE_STATUSBAR
 
 class WXDLLEXPORT wxStatusBar95 : public wxStatusBar
 {
@@ -50,6 +50,6 @@ protected:
   void SetFieldsWidth();
 };
 
-#endif  // USE_NATIVE_STATUSBAR
+#endif  // wxUSE_NATIVE_STATUSBAR
 
 #endif  //_STATBR95_H
\ No newline at end of file
diff --git a/include/wx/msw/tbar95.h b/include/wx/msw/tbar95.h
index 2b9e0e2b45..6bbcc4a019 100644
--- a/include/wx/msw/tbar95.h
+++ b/include/wx/msw/tbar95.h
@@ -16,7 +16,7 @@
 #pragma interface "tbar95.h"
 #endif
 
-#if USE_BUTTONBAR && USE_TOOLBAR
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
 #include "wx/tbarbase.h"
 
 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
@@ -93,6 +93,6 @@ protected:
 DECLARE_EVENT_TABLE()
 };
 
-#endif // USE_TOOL/BUTTONBAR
+#endif // wxUSE_TOOL/BUTTONBAR
 #endif
     // _WX_TBAR95_H_
diff --git a/include/wx/msw/tbarmsw.h b/include/wx/msw/tbarmsw.h
index f39ee7bd71..96477a8d4e 100644
--- a/include/wx/msw/tbarmsw.h
+++ b/include/wx/msw/tbarmsw.h
@@ -16,7 +16,7 @@
 #pragma interface "tbarmsw.h"
 #endif
 
-#if USE_BUTTONBAR && USE_TOOLBAR
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
 #include "wx/tbarbase.h"
 
 WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr;
@@ -118,6 +118,6 @@ DECLARE_EVENT_TABLE()
 #define wxTBSTATE_HIDDEN          0x08    // button is hidden
 #define wxTBSTATE_INDETERMINATE   0x10    // button is indeterminate
 
-#endif // USE_TOOL/BUTTONBAR
+#endif // wxUSE_TOOL/BUTTONBAR
 #endif
     // _WX_TBARMSW_H_
diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h
index 44928ded07..edc0de5b32 100644
--- a/include/wx/msw/textctrl.h
+++ b/include/wx/msw/textctrl.h
@@ -18,7 +18,7 @@
 
 #include "wx/control.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h
index ed9fc7abde..252b53c7c7 100644
--- a/include/wx/msw/window.h
+++ b/include/wx/msw/window.h
@@ -67,11 +67,11 @@ class WXDLLEXPORT wxIcon;
 class WXDLLEXPORT wxDC;
 class WXDLLEXPORT wxValidator;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 class WXDLLEXPORT wxDropTarget;
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 class WXDLLEXPORT wxResourceTable;
 class WXDLLEXPORT wxItemResource;
 #endif
@@ -193,7 +193,7 @@ public:
   // Enable or disable the window
   virtual void Enable(bool enable);
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   // Associate a drop target with this window (if the window already had a drop
   // target, it's deleted!) and return the current drop target (may be NULL).
   void          SetDropTarget(wxDropTarget *pDropTarget);
@@ -357,7 +357,7 @@ public:
   virtual void OnDefaultAction(wxControl *initiatingItem);
 
   // Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
   virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
 #endif
@@ -633,7 +633,7 @@ protected:
   bool                  m_winCaptured;
   wxString              m_windowName;                            // Window name
 
-#if USE_EXTENDED_STATICS
+#if wxUSE_EXTENDED_STATICS
   wxList                m_staticItems;
 #endif
 
@@ -656,7 +656,7 @@ protected:
 
   bool                  m_mouseInWindow;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   wxDropTarget         *m_pDropTarget;    // the current drop target or NULL
 #endif  //USE_DRAG_AND_DROP
 
diff --git a/include/wx/object.h b/include/wx/object.h
index 26c175ef93..ffe51a481c 100644
--- a/include/wx/object.h
+++ b/include/wx/object.h
@@ -21,7 +21,7 @@
 
 class WXDLLEXPORT wxObject;
 
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
 
 #ifdef __GNUWIN32__
 #ifdef GetClassName
@@ -89,7 +89,7 @@ public:
 
 wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name);
 
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
 wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
 #endif
 
@@ -155,7 +155,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
 
 // Unfortunately Borland seems to need this include.
 #ifdef __BORLANDC__
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -178,7 +178,7 @@ class WXDLLEXPORT wxObject
 
   bool IsKindOf(wxClassInfo *info) const;
 
-#if WXDEBUG && USE_MEMORY_TRACING
+#if WXDEBUG && wxUSE_MEMORY_TRACING
   void * operator new (size_t size, char * fileName = NULL, int lineNum = 0);
   void operator delete (void * buf);
   
@@ -195,11 +195,11 @@ class WXDLLEXPORT wxObject
 
 #endif
 
-#if WXDEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || wxUSE_DEBUG_CONTEXT
   virtual void Dump(ostream& str);
 #endif
 
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
   virtual void StoreObject( wxObjectOutputStream &stream );
   virtual void LoadObject( wxObjectInputStream &stream );
 #endif
@@ -215,7 +215,7 @@ class WXDLLEXPORT wxObject
 
 protected:
   wxObjectRefData*      m_refData;
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
   wxObject_Serialize*   m_serialObj;
 #endif
 };
@@ -237,7 +237,7 @@ private:
     int m_count;
 };
 
-#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
 //#ifndef WXDEBUG_NEW
 //#define WXDEBUG_NEW new(__FILE__,__LINE__)
 //#endif
diff --git a/include/wx/odbc.h b/include/wx/odbc.h
index 5a3b3899a4..607bbcfa18 100644
--- a/include/wx/odbc.h
+++ b/include/wx/odbc.h
@@ -11,7 +11,7 @@
 
 #include "wx/setup.h"
 
-#if USE_ODBC
+#if wxUSE_ODBC
 
 #ifdef __GNUG__
 #pragma interface "odbc.h"
@@ -331,4 +331,4 @@ class WXDLLEXPORT wxRecordSet: public wxObject
 
 #endif
 
-#endif  // USE_ODBC
+#endif  // wxUSE_ODBC
diff --git a/include/wx/postscrp.h b/include/wx/postscrp.h
index 18c6fbc430..938bdc8779 100644
--- a/include/wx/postscrp.h
+++ b/include/wx/postscrp.h
@@ -19,7 +19,7 @@
 #include "wx/dc.h"
 #include "wx/dialog.h"
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 
 class WXDLLIMPORT ofstream;
 class WXDLLEXPORT wxPostScriptDC: public wxDC
@@ -294,6 +294,6 @@ class WXDLLEXPORT wxPrintPaperDatabase: public wxList
 
 WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase;
 
-#endif // USE_POSTSCRIPT
+#endif // wxUSE_POSTSCRIPT
 #endif
         // _WX_POSTSCRPH__
diff --git a/include/wx/qt/textctrl.h b/include/wx/qt/textctrl.h
index 7c3d7b1ac2..26fe6548a3 100644
--- a/include/wx/qt/textctrl.h
+++ b/include/wx/qt/textctrl.h
@@ -18,7 +18,7 @@
 
 #include "wx/control.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h
index c024635909..802f4d92fa 100644
--- a/include/wx/qt/window.h
+++ b/include/wx/qt/window.h
@@ -66,11 +66,11 @@ class WXDLLEXPORT wxIcon;
 class WXDLLEXPORT wxDC;
 class WXDLLEXPORT wxValidator;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 class WXDLLEXPORT wxDropTarget;
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 class WXDLLEXPORT wxResourceTable;
 class WXDLLEXPORT wxItemResource;
 #endif
@@ -192,7 +192,7 @@ public:
   // Enable or disable the window
   virtual void Enable(bool enable);
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   // Associate a drop target with this window (if the window already had a drop
   // target, it's deleted!) and return the current drop target (may be NULL).
   void          SetDropTarget(wxDropTarget *pDropTarget);
@@ -329,7 +329,7 @@ public:
   virtual void OnDefaultAction(wxControl *initiatingItem);
 
   // Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
   virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
 #endif
@@ -480,7 +480,7 @@ protected:
   wxColour              m_defaultBackgroundColour;
   wxColour              m_defaultForegroundColour;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   wxDropTarget         *m_pDropTarget;    // the current drop target or NULL
 #endif  //USE_DRAG_AND_DROP
 
diff --git a/include/wx/resource.h b/include/wx/resource.h
index 38771607ce..9492193a47 100644
--- a/include/wx/resource.h
+++ b/include/wx/resource.h
@@ -18,7 +18,7 @@
 
 #include "wx/setup.h"
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include <stdio.h>
 
 // A few further types not in wx_types.h
diff --git a/include/wx/stream.h b/include/wx/stream.h
index b6862e4f7f..13bd256293 100644
--- a/include/wx/stream.h
+++ b/include/wx/stream.h
@@ -106,7 +106,7 @@ class WXDLLEXPORT wxInputStream {
   wxInputStream& operator>>(int& i);
   wxInputStream& operator>>(long& i);
   wxInputStream& operator>>(float& i);
-#if USE_SERIAL
+#if wxUSE_SERIAL
   wxInputStream& operator>>(wxObject *& obj);
 #endif
 
@@ -160,7 +160,7 @@ class WXDLLEXPORT wxOutputStream {
   wxOutputStream& operator<<(int i);
   wxOutputStream& operator<<(long i);
   wxOutputStream& operator<<(double f);
-#if USE_SERIAL
+#if wxUSE_SERIAL
   wxOutputStream& operator<<(wxObject& obj);
 #endif
 
diff --git a/include/wx/string.h b/include/wx/string.h
index 3b2512c3dd..44d6803a1b 100644
--- a/include/wx/string.h
+++ b/include/wx/string.h
@@ -254,13 +254,13 @@ public:
   /** @name generic attributes & operations */
   //@{
     /// as standard strlen()
-  size_t Len() const { return GetStringData() ? GetStringData()->nDataLength : 0; }
+  size_t Len() const { return GetStringData()->nDataLength; }
     /// string contains any characters?
   bool IsEmpty() const { return Len() == 0; }
     /// reinitialize string (and free data!)
   void Empty()
   {
-    if ( GetStringData() && GetStringData()->nDataLength != 0 )
+    if ( GetStringData()->nDataLength != 0 )
       Reinit();
 
     wxASSERT( GetStringData()->nDataLength == 0 );
diff --git a/include/wx/stubs/menuitem.h b/include/wx/stubs/menuitem.h
index 6536ac0805..9c912967f1 100644
--- a/include/wx/stubs/menuitem.h
+++ b/include/wx/stubs/menuitem.h
@@ -25,7 +25,7 @@
 // an exception to the general rule that a normal header doesn't include other
 // headers - only because ownerdrw.h is not always included and I don't want
 // to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 #include  "wx/ownerdrw.h"
 #endif
 
@@ -40,7 +40,7 @@
 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
 // ----------------------------------------------------------------------------
 class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
                             , public wxOwnerDrawn
 #endif
 {
@@ -79,7 +79,7 @@ private:
   bool        m_bEnabled,       // enabled or greyed?
               m_bChecked;       // checked? (only if checkable)
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   // wxOwnerDrawn base class already has these variables - nothing to do
 
 #else   //!owner drawn
diff --git a/include/wx/stubs/setup.h b/include/wx/stubs/setup.h
index 864edf23a9..7f86b00cf2 100644
--- a/include/wx/stubs/setup.h
+++ b/include/wx/stubs/setup.h
@@ -17,9 +17,9 @@
  *
  */
 
-#define USE_CONSTRAINTS       1
+#define wxUSE_CONSTRAINTS       1
                                 // Use constraints mechanism
-#define USE_CONFIG           1
+#define wxUSE_CONFIG           1
                                 // Use wxConfig, with CreateConfig in wxApp
 #define _WX_GOODCOMPILER__
                                 // gcc can have problems, but Windows compilers
@@ -30,51 +30,51 @@
                                 // Level 1: wxDC, OnSize (etc.) compatibility, but
                                 //          some new features such as event tables
 
-#define USE_POSTSCRIPT  1
+#define wxUSE_POSTSCRIPT  1
                         	// 0 for no PostScript device context
-#define USE_AFM_FOR_POSTSCRIPT 0
+#define wxUSE_AFM_FOR_POSTSCRIPT 0
                                 // 1 to use font metric files in GetTextExtent
-#define USE_METAFILE    1
+#define wxUSE_METAFILE    1
                                 // 0 for no Metafile and metafile device context
-#define USE_IPC         1
+#define wxUSE_IPC         1
                                 // 0 for no interprocess comms
-#define USE_HELP        1
+#define wxUSE_HELP        1
                                 // 0 for no help facility
-#define USE_RESOURCES   1
+#define wxUSE_RESOURCES   1
                         	// 0 for no wxGetResource/wxWriteResource
-#define USE_CLIPBOARD   1
+#define wxUSE_CLIPBOARD   1
                         	// 0 for no clipboard functions
-#define USE_SPLINES     1
+#define wxUSE_SPLINES     1
                             	// 0 for no splines
-#define USE_XFIG_SPLINE_CODE  1
+#define wxUSE_XFIG_SPLINE_CODE  1
                            	// 1 for XFIG spline code, 0 for AIAI spline code.
 // AIAI spline code is slower, but freer of copyright issues.
                             	// 0 for no splines
 
-#define USE_TOOLBAR     1
+#define wxUSE_TOOLBAR     1
                             // Use toolbars
-#define USE_DRAG_AND_DROP 1
+#define wxUSE_DRAG_AND_DROP 1
                         	// 0 for no drag and drop
 
-#define USE_WX_RESOURCES        1
+#define wxUSE_WX_RESOURCES        1
                                   // Use .wxr resource mechanism (requires PrologIO library)
 
-#define USE_DOC_VIEW_ARCHITECTURE 1
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
                                   // Set to 0 to disable document/view architecture
-#define USE_PRINTING_ARCHITECTURE  1
+#define wxUSE_PRINTING_ARCHITECTURE  1
                                     // Set to 0 to disable print/preview architecture code
-#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
                                     // Set to 0 to disable PostScript print/preview architecture code
                                     // under Windows (just use Windows printing).
-#define USE_DYNAMIC_CLASSES     1
+#define wxUSE_DYNAMIC_CLASSES     1
                                   // If 1, enables provision of run-time type information.
                                   // NOW MANDATORY: don't change.
-#define USE_MEMORY_TRACING      1
+#define wxUSE_MEMORY_TRACING      1
                                   // If 1, enables debugging versions of wxObject::new and
                                   // wxObject::delete *IF* WXDEBUG is also defined.
                                   // WARNING: this code may not work with all architectures, especially
                                   // if alignment is an issue.
-#define USE_DEBUG_CONTEXT       1
+#define wxUSE_DEBUG_CONTEXT       1
                                   // If 1, enables wxDebugContext, for
                                   // writing error messages to file, etc. 
                                   // If WXDEBUG is not defined, will still use
@@ -83,7 +83,7 @@
                                   // since you may well need to output
                                   // an error log in a production
                                   // version (or non-debugging beta)
-#define USE_GLOBAL_MEMORY_OPERATORS 0
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
                                   // In debug mode, cause new and delete to be redefined globally.
                                   // If this causes problems (e.g. link errors), set this to 0.
 
@@ -91,18 +91,18 @@
                                   // Set this to 0 if your compiler can't cope
                                   // with omission of prototype parameters.
 
-#define USE_C_MAIN 0
+#define wxUSE_C_MAIN 0
                                   // Set to 1 to use main.c instead of main.cpp (UNIX only)
 
-#define USE_ODBC                   0
+#define wxUSE_ODBC                   0
                                     // Define 1 to use ODBC classes
 
-#define USE_IOSTREAMH     1
+#define wxUSE_IOSTREAMH     1
                                   // VC++ 4.2 and above allows <iostream> and <iostream.h>
                                   // but you can't mix them. Set to 1 for <iostream.h>,
                                   // 0 for <iostream>
 
-#define USE_WXCONFIG      1
+#define wxUSE_WXCONFIG      1
                                   // if enabled, compiles built-in OS independent wxConfig
                                   // class and it's file (any platform) and registry (Win)
                                   // based implementations
@@ -111,7 +111,7 @@
  *
  */
 
-#define USE_APPLE_IEEE	  1
+#define wxUSE_APPLE_IEEE	  1
 				// if enabled, the float codec written by Apple
 				// will be used to write, in a portable way,
 				// float on the disk
diff --git a/include/wx/stubs/textctrl.h b/include/wx/stubs/textctrl.h
index 2ed500aafe..253491eaa0 100644
--- a/include/wx/stubs/textctrl.h
+++ b/include/wx/stubs/textctrl.h
@@ -18,7 +18,7 @@
 
 #include "wx/control.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/stubs/window.h b/include/wx/stubs/window.h
index cec262e872..be71083d4a 100644
--- a/include/wx/stubs/window.h
+++ b/include/wx/stubs/window.h
@@ -67,11 +67,11 @@ class WXDLLEXPORT wxIcon;
 class WXDLLEXPORT wxDC;
 class WXDLLEXPORT wxValidator;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 class WXDLLEXPORT wxDropTarget;
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 class WXDLLEXPORT wxResourceTable;
 class WXDLLEXPORT wxItemResource;
 #endif
@@ -193,7 +193,7 @@ public:
   // Enable or disable the window
   virtual void Enable(bool enable);
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   // Associate a drop target with this window (if the window already had a drop
   // target, it's deleted!) and return the current drop target (may be NULL).
   void          SetDropTarget(wxDropTarget *pDropTarget);
@@ -336,7 +336,7 @@ public:
   virtual void OnDefaultAction(wxControl *initiatingItem);
 
   // Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
   virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
 #endif
@@ -486,7 +486,7 @@ protected:
   wxColour              m_defaultForegroundColour;
   wxAcceleratorTable    m_acceleratorTable;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
   wxDropTarget         *m_pDropTarget;    // the current drop target or NULL
 #endif  //USE_DRAG_AND_DROP
 
diff --git a/include/wx/tbarsmpl.h b/include/wx/tbarsmpl.h
index 5094b665d9..2e4911aee1 100644
--- a/include/wx/tbarsmpl.h
+++ b/include/wx/tbarsmpl.h
@@ -18,7 +18,7 @@
 
 #include "wx/defs.h"
 
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
 
 #include "wx/bitmap.h"
 #include "wx/list.h"
@@ -75,7 +75,7 @@ DECLARE_EVENT_TABLE()
 
 };
 
-#endif // USE_TOOLBAR
+#endif // wxUSE_TOOLBAR
 #endif
     // _WX_TBARSMPLH__
 
diff --git a/include/wx/time.h b/include/wx/time.h
index 74461c55af..22fff97f9c 100644
--- a/include/wx/time.h
+++ b/include/wx/time.h
@@ -14,7 +14,7 @@
 
 #include "wx/object.h"
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 
 #ifdef __GNUG__
 #pragma interface "time.h"
@@ -91,7 +91,7 @@ public:
 };
 
 #endif
-  // USE_TIMEDATE
+  // wxUSE_TIMEDATE
 #endif
     // _WX_TIMEH__
 
diff --git a/include/wx/utils.h b/include/wx/utils.h
index 040d689fe3..0f60931085 100644
--- a/include/wx/utils.h
+++ b/include/wx/utils.h
@@ -23,7 +23,7 @@
 #include "wx/filefn.h"
 #include "wx/process.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -182,7 +182,7 @@ class WXDLLEXPORT wxDebugStreamBuf: public streambuf
     int sync(void);
 };
 
-// #if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
+// #if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
 // #define new WXDEBUG_NEW
 // #endif
 
@@ -237,7 +237,7 @@ WXDLLEXPORT_DATA(extern const char*) wxFatalErrorStr;
 void WXDLLEXPORT wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
 
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
 bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = "");
 bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = "");
 bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = "");
@@ -247,7 +247,7 @@ bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, c
 bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = "");
 bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = "");
 bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = "");
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
 
 // Get current Home dir and copy to dest (returns pstr->c_str())
 const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr);
diff --git a/include/wx/variant.h b/include/wx/variant.h
index e165f87168..5c565aba18 100644
--- a/include/wx/variant.h
+++ b/include/wx/variant.h
@@ -21,7 +21,7 @@
 #include "wx/string.h"
 #include "wx/list.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/include/wx/wx.h b/include/wx/wx.h
index 98c80c43ed..ff42680734 100644
--- a/include/wx/wx.h
+++ b/include/wx/wx.h
@@ -65,7 +65,7 @@
 #include "wx/dirdlg.h"
 #include "wx/cmndata.h"
 #include "wx/intl.h"
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
 #include "wx/objstrm.h"
 #include "wx/serbase.h"
 #endif
diff --git a/include/wx/wxexpr.h b/include/wx/wxexpr.h
index 480ecbc2a4..01e0d6d375 100644
--- a/include/wx/wxexpr.h
+++ b/include/wx/wxexpr.h
@@ -21,7 +21,7 @@
 #include "wx/defs.h"
 #include "wx/string.h"
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp
index 1c624e29bb..42a2dc00c1 100644
--- a/samples/dialogs/dialogs.cpp
+++ b/samples/dialogs/dialogs.cpp
@@ -31,7 +31,7 @@
 #include <wx/fontdlg.h>
 #include <wx/choicdlg.h>
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include <wx/generic/colrdlgg.h>
 #include <wx/generic/fontdlgg.h>
 #endif
@@ -60,14 +60,14 @@ bool MyApp::OnInit(void)
 
   file_menu->Append(DIALOGS_CHOOSE_COLOUR, "&Choose colour");
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
   file_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, "Choose colour (&generic)");
 #endif
 
   file_menu->AppendSeparator();
   file_menu->Append(DIALOGS_CHOOSE_FONT, "Choose &font");
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
   file_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, "Choose f&ont (generic)");
 
 #endif
@@ -147,7 +147,7 @@ void MyFrame::ChooseFont(wxCommandEvent& WXUNUSED(event) )
       dialog->Close();
 }
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 void MyFrame::ChooseColourGeneric(wxCommandEvent& WXUNUSED(event))
 {
       wxColourData data;
@@ -292,7 +292,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 	EVT_MENU(DIALOGS_FILE_OPEN,					MyFrame::FileOpen)
 	EVT_MENU(DIALOGS_FILE_SAVE,					MyFrame::FileSave)
 	EVT_MENU(DIALOGS_DIR_CHOOSE,				MyFrame::DirChoose)
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 	EVT_MENU(DIALOGS_CHOOSE_COLOUR_GENERIC,		MyFrame::ChooseColourGeneric)
 	EVT_MENU(DIALOGS_CHOOSE_FONT_GENERIC,		MyFrame::ChooseFontGeneric)
 #endif
diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h
index d3745c423c..aa5e5543ea 100644
--- a/samples/dialogs/dialogs.h
+++ b/samples/dialogs/dialogs.h
@@ -37,7 +37,7 @@ class MyFrame: public wxFrame
     void FileSave(wxCommandEvent& event);
     void DirChoose(wxCommandEvent& event);
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 	void ChooseColourGeneric(wxCommandEvent& event);
 	void ChooseFontGeneric(wxCommandEvent& event);
 #endif
diff --git a/samples/docview/doc.cpp b/samples/docview/doc.cpp
index f8a7206faf..aef8d1fbb1 100644
--- a/samples/docview/doc.cpp
+++ b/samples/docview/doc.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "doc.h"
diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp
index 1d814fd140..ad25a56a7b 100644
--- a/samples/docview/docview.cpp
+++ b/samples/docview/docview.cpp
@@ -32,7 +32,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "wx/docview.h"
diff --git a/samples/docview/view.cpp b/samples/docview/view.cpp
index b56acd402a..3bc8460649 100644
--- a/samples/docview/view.cpp
+++ b/samples/docview/view.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "docview.h"
diff --git a/samples/docvwmdi/doc.cpp b/samples/docvwmdi/doc.cpp
index f8a7206faf..aef8d1fbb1 100644
--- a/samples/docvwmdi/doc.cpp
+++ b/samples/docvwmdi/doc.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "doc.h"
diff --git a/samples/docvwmdi/docview.cpp b/samples/docvwmdi/docview.cpp
index ca69f2be7c..f2b9c29345 100644
--- a/samples/docvwmdi/docview.cpp
+++ b/samples/docvwmdi/docview.cpp
@@ -30,7 +30,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "docview.h"
diff --git a/samples/docvwmdi/view.cpp b/samples/docvwmdi/view.cpp
index ab94cf73c7..9dd8bbbb79 100644
--- a/samples/docvwmdi/view.cpp
+++ b/samples/docvwmdi/view.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "docview.h"
diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp
index 31229f5a88..f6f6724f19 100644
--- a/samples/layout/layout.cpp
+++ b/samples/layout/layout.cpp
@@ -21,7 +21,7 @@
 #endif
 
 #if !USE_CONSTRAINTS
-#error You must set USE_CONSTRAINTS to 1 in wx_setup.h!
+#error You must set wxUSE_CONSTRAINTS to 1 in wx_setup.h!
 #endif
 
 #include <ctype.h>
diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp
index fd0b5a4130..e83ec9a08d 100644
--- a/samples/minimal/minimal.cpp
+++ b/samples/minimal/minimal.cpp
@@ -70,6 +70,9 @@ public:
     void OnQuit(wxCommandEvent& event);
     void OnAbout(wxCommandEvent& event);
 
+    void OnPopupMenu(wxCommandEvent& event);
+    void OnRightDown(wxMouseEvent& event);
+
 private:
     // any class wishing to process wxWindows events must use this macro
     DECLARE_EVENT_TABLE()
@@ -85,6 +88,8 @@ enum
     // menu items
     Minimal_Quit = 1,
     Minimal_About,
+    Minimal_Test1,
+    Minimal_Test2,
 
     // controls start here (the numbers are, of course, arbitrary)
     Minimal_Text = 1000,
@@ -100,6 +105,10 @@ enum
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(Minimal_Quit,  MyFrame::OnQuit)
     EVT_MENU(Minimal_About, MyFrame::OnAbout)
+
+    EVT_MENU_RANGE(Minimal_Test1, Minimal_Test2, MyFrame::OnPopupMenu)
+
+    EVT_RIGHT_DOWN(MyFrame::OnRightDown)
 END_EVENT_TABLE()
 
 // Create a new application object: this macro will allow wxWindows to create
@@ -161,17 +170,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     SetMenuBar(menuBar);
 
     // create a status bar just for fun (by default with 1 pane only)
-    CreateStatusBar();
+    CreateStatusBar(2);
     SetStatusText("Welcome to wxWindows!");
-
-    // now create some controls
-
-    // a panel first - if there were several controls, it would allow us to
-    // navigate between them from the keyboard
-    wxPanel *panel = new wxPanel(this, -1, wxPoint(0, 0), wxSize(400, 200));
-
-    // and a static control whose parent is the panel
-    (void)new wxStaticText(panel, -1, "Hello, world!", wxPoint(10, 10));
 }
 
 
@@ -188,3 +188,28 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
     wxMessageBox("This is a minimal sample\nA second line in the message box",
                  "About Minimal", wxOK | wxICON_INFORMATION, this);
 }
+
+void MyFrame::OnPopupMenu(wxCommandEvent& event)
+{
+  wxString str;
+  str.Printf("Test%d clicked.", event.GetId() == Minimal_Test1 ? 1 : 2);
+  SetStatusText(str, 1);
+}
+
+void MyFrame::OnRightDown(wxMouseEvent& event)
+{
+  class MyMenu : public wxMenu
+  {
+  public:
+    MyMenu()
+    {
+      Append(Minimal_Test1, "Test&1");
+      AppendSeparator();
+      Append(Minimal_Test2, "Test&2");
+    }
+
+    ~MyMenu() { printf("menu destroyed"); }
+  } *menu = new MyMenu;
+
+  PopupMenu(menu, event.GetX(), event.GetY());
+}
diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp
index 02f5594865..3d5284831a 100644
--- a/samples/printing/printing.cpp
+++ b/samples/printing/printing.cpp
@@ -26,7 +26,7 @@
 #endif
 
 #if !USE_PRINTING_ARCHITECTURE
-#error You must set USE_PRINTING_ARCHITECTURE to 1 in wx_setup.h to compile this demo.
+#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in wx_setup.h to compile this demo.
 #endif
 
 #include <ctype.h>
diff --git a/samples/toolbar/test.cpp b/samples/toolbar/test.cpp
index 07ebd62085..0274aefac2 100644
--- a/samples/toolbar/test.cpp
+++ b/samples/toolbar/test.cpp
@@ -161,7 +161,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(wxID_HELP, MyFrame::OnAbout)
     EVT_CLOSE(MyFrame::OnCloseWindow)
     EVT_TOOL_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolLeftClick)
-    EVT_TOOL_ENTER(ID_TOOLBAR, MyFrame::OnToolEnter)
+    EVT_TOOL_ENTER(wxID_OPEN, MyFrame::OnToolEnter)
 END_EVENT_TABLE()
 
 // Define my frame constructor
diff --git a/src/common/date.cpp b/src/common/date.cpp
index bda79ab3a2..1097624d59 100644
--- a/src/common/date.cpp
+++ b/src/common/date.cpp
@@ -28,7 +28,7 @@
 
 #include "wx/setup.h"
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 
 #include "wx/date.h"
 #include <wx/intl.h>
@@ -37,7 +37,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp
index 8056bdaded..495885e418 100644
--- a/src/common/datstrm.cpp
+++ b/src/common/datstrm.cpp
@@ -74,7 +74,7 @@ extern "C" double ConvertFromIeeeExtended(const unsigned char *bytes);
 
 double wxDataInputStream::ReadDouble()
 {
-#if USE_APPLE_IEEE
+#if wxUSE_APPLE_IEEE
   char buf[10];
 
   Read(buf, 10);
@@ -192,7 +192,7 @@ void wxDataOutputStream::WriteDouble(double d)
 {
   char buf[10];
 
-#if USE_APPLE_IEEE
+#if wxUSE_APPLE_IEEE
   ConvertToIeeeExtended(d, (unsigned char *)buf);
 #else
 #  pragma warning "wxDataStream::WriteDouble() not using IeeeExtended - will not work!"
diff --git a/src/common/db.cpp b/src/common/db.cpp
index 7d04ee2f3e..ea5baaed3c 100644
--- a/src/common/db.cpp
+++ b/src/common/db.cpp
@@ -43,7 +43,7 @@
   #include  <wx/wx.h>
 #endif //WX_PRECOMP
 
-#if USE_ODBC
+#if wxUSE_ODBC
 
 #include <wx/db.h>
 
@@ -1317,4 +1317,4 @@ bool GetDataSource(HENV henv, char *Dsn, SWORD DsnMax, char *DsDesc, SWORD DsDes
 }  // GetDataSource()
 
 #endif
-    // USE_ODBC
+    // wxUSE_ODBC
diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp
index 32c7895396..64d6bb674b 100644
--- a/src/common/dbtable.cpp
+++ b/src/common/dbtable.cpp
@@ -39,7 +39,7 @@
   #include  <wx/wx.h>
 #endif //WX_PRECOMP
 
-#if USE_ODBC
+#if wxUSE_ODBC
 
 #include <wx/dbtable.h>
 
@@ -1442,4 +1442,4 @@ bool wxTable::Refresh(void)
 }  // wxTable::Refresh()
 
 #endif
-    // USE_ODBC
+    // wxUSE_ODBC
diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp
index a0de68f3d4..4aba2cb488 100644
--- a/src/common/docmdi.cpp
+++ b/src/common/docmdi.cpp
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
 
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
@@ -149,5 +149,5 @@ bool wxDocMDIChildFrame::OnClose(void)
 }
 
 #endif
-    // USE_DOC_VIEW_ARCHITECTURE
+    // wxUSE_DOC_VIEW_ARCHITECTURE
 
diff --git a/src/common/docview.cpp b/src/common/docview.cpp
index b54ea6d75b..81ec15a123 100644
--- a/src/common/docview.cpp
+++ b/src/common/docview.cpp
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
 
 #ifndef WX_PRECOMP
 #include "wx/string.h"
@@ -53,7 +53,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -68,7 +68,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
 IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
 IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
 #endif
 IMPLEMENT_CLASS(wxCommand, wxObject)
@@ -535,7 +535,7 @@ bool wxView::OnClose(bool WXUNUSED(deleteWindow))
   return GetDocument() ? GetDocument()->Close() : TRUE;
 }
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 wxPrintout *wxView::OnCreatePrintout(void)
 {
   return new wxDocPrintout(this);
@@ -1447,7 +1447,7 @@ bool wxDocParentFrame::OnClose(void)
   return m_docManager->Clear(FALSE);
 }
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 
 wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title):
   wxPrintout(WXSTRINGCAST title)
@@ -1940,4 +1940,4 @@ bool wxTransferStreamToFile(istream& stream, const wxString& filename)
 }
 
 #endif
-  // End USE_DOC_VIEW_ARCHITECTURE
+  // End wxUSE_DOC_VIEW_ARCHITECTURE
diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp
index 1177370dfc..21cdbf640d 100644
--- a/src/common/fileconf.cpp
+++ b/src/common/fileconf.cpp
@@ -28,18 +28,19 @@
 #endif  //__BORLANDC__
 
 #ifndef   WX_PRECOMP
-  #include  <wx/string.h>
-  #include  <wx/intl.h>
+  #include  "wx/string.h"
+  #include  "wx/intl.h"
 #endif  //WX_PRECOMP
 
-#include  <wx/app.h>
-#include  <wx/dynarray.h>
-#include  <wx/file.h>
-#include  <wx/log.h>
-#include  <wx/textfile.h>
-#include  <wx/config.h>
-#include  <wx/fileconf.h>
-#include  <wx/utils.h>
+#include  "wx/app.h"
+#include  "wx/dynarray.h"
+#include  "wx/file.h"
+#include  "wx/log.h"
+#include  "wx/textfile.h"
+#include  "wx/config.h"
+#include  "wx/fileconf.h"
+
+#include  "wx/utils.h"    // for wxGetHomeDir
 
 // _WINDOWS_ is defined when windows.h is included,
 // __WXMSW__ is defined for MS Windows compilation
diff --git a/src/common/helpbase.cpp b/src/common/helpbase.cpp
index b10db8b4c1..da1d222c58 100644
--- a/src/common/helpbase.cpp
+++ b/src/common/helpbase.cpp
@@ -26,10 +26,10 @@
 
 #include "wx/helpbase.h"
 
-#if USE_HELP
+#if wxUSE_HELP
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_CLASS(wxHelpControllerBase, wxObject)
 #endif
 
-#endif // USE_HELP
+#endif // wxUSE_HELP
diff --git a/src/common/layout.cpp b/src/common/layout.cpp
index 81effab44a..7c8b0ab7cb 100644
--- a/src/common/layout.cpp
+++ b/src/common/layout.cpp
@@ -22,7 +22,7 @@
 
 #include "wx/defs.h"
 
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
 
 #ifndef WX_PRECOMP
 #include "wx/window.h"
diff --git a/src/common/memory.cpp b/src/common/memory.cpp
index 8f42be65a2..304e9ce1ec 100644
--- a/src/common/memory.cpp
+++ b/src/common/memory.cpp
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
 #ifdef __GNUG__
 // #pragma implementation
@@ -37,7 +37,7 @@
 
 #include <stdlib.h>
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -888,7 +888,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 && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
 
 #ifdef new
 #undef new
@@ -1110,7 +1110,7 @@ void wxTraceLevel(int level, const char *fmt ...)
 #endif
 }
 
-#else // USE_MEMORY_TRACING && WXDEBUG
+#else // wxUSE_MEMORY_TRACING && WXDEBUG
 void wxTrace(const char *WXUNUSED(fmt) ...)
 {
 }
diff --git a/src/common/object.cpp b/src/common/object.cpp
index 52d95152bb..d5afed37de 100644
--- a/src/common/object.cpp
+++ b/src/common/object.cpp
@@ -22,7 +22,7 @@
 
 #ifndef WX_PRECOMP
 #include "wx/hash.h"
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
 #include "wx/objstrm.h"
 #include "wx/serbase.h"
 #endif
@@ -31,11 +31,11 @@
 #include <string.h>
 #include <assert.h>
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 #include "wx/memory.h"
 #endif
 
-#if WXDEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || wxUSE_DEBUG_CONTEXT
   // for wxObject::Dump
   #include <iostream.h>
 #endif
@@ -53,7 +53,7 @@ wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
 wxObject::wxObject(void)
 {
   m_refData = (wxObjectRefData *) NULL;
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
   m_serialObj = (wxObject_Serialize *)NULL;
 #endif
 }
@@ -61,7 +61,7 @@ wxObject::wxObject(void)
 wxObject::~wxObject(void)
 {
 	UnRef();
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
 	if (m_serialObj)
 	  delete m_serialObj;
 #endif
@@ -83,7 +83,7 @@ bool wxObject::IsKindOf(wxClassInfo *info) const
     return FALSE;
 }
 
-#if WXDEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || wxUSE_DEBUG_CONTEXT
 void wxObject::Dump(ostream& str)
 {
   if (GetClassInfo() && GetClassInfo()->GetClassName())
@@ -93,7 +93,7 @@ void wxObject::Dump(ostream& str)
 }
 #endif
 
-#if WXDEBUG && USE_MEMORY_TRACING
+#if WXDEBUG && wxUSE_MEMORY_TRACING
 
 #ifdef new
 #undef new
@@ -258,7 +258,7 @@ wxObject *wxCreateDynamicObject(const char *name)
     return (wxObject*) NULL;
 }
 
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
 
 #include "wx/serbase.h"
 #include "wx/dynlib.h"
diff --git a/src/common/objstrm.cpp b/src/common/objstrm.cpp
index ca069bdb68..2d916d629f 100644
--- a/src/common/objstrm.cpp
+++ b/src/common/objstrm.cpp
@@ -24,7 +24,7 @@
 #include "wx/setup.h"
 #endif
 
-#if USE_SERIAL
+#if wxUSE_SERIAL
 
 #include "wx/object.h"
 #include "wx/objstrm.h"
diff --git a/src/common/odbc.cpp b/src/common/odbc.cpp
index 3e921cc2e7..84b145c36f 100644
--- a/src/common/odbc.cpp
+++ b/src/common/odbc.cpp
@@ -23,7 +23,7 @@
 
 #include "wx/defs.h"
 
-#if USE_ODBC
+#if wxUSE_ODBC
 
 #ifndef WX_PRECOMP
 #include "wx/utils.h"
@@ -1827,4 +1827,4 @@ bool wxQueryField::IsDirty(void) {
   return dirty;
 }
 
-#endif // USE_ODBC
+#endif // wxUSE_ODBC
diff --git a/src/common/postscrp.cpp b/src/common/postscrp.cpp
index d332f426f7..4e981b1fd3 100644
--- a/src/common/postscrp.cpp
+++ b/src/common/postscrp.cpp
@@ -24,7 +24,7 @@
 
 #include "wx/defs.h"
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 
 #ifndef WX_PRECOMP
 #include "wx/intl.h"
@@ -48,7 +48,7 @@
 #include "wx/msw/private.h"
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
@@ -127,7 +127,7 @@ double UnderlineThickness = 0.0F;
 #define _MAXPATHLEN 500
 
 /* See "wxspline.inc" and "xfspline.inc" */
-#if USE_XFIG_SPLINE_CODE
+#if wxUSE_XFIG_SPLINE_CODE
 static const char *wxPostScriptHeaderSpline = " \
 /DrawSplineSection {\n\
 	/y3 exch def\n\
@@ -148,7 +148,7 @@ static const char *wxPostScriptHeaderSpline = " \
 // No extra PS header for this spline implementation.
 static const char *wxPostScriptHeaderSpline = (char *) NULL;
 
-#endif /* USE_XFIG_SPLINE_CODE */
+#endif /* wxUSE_XFIG_SPLINE_CODE */
 
 // steve, 05.09.94
 // VMS has a bug in the ofstream class.
diff --git a/src/common/resource.cpp b/src/common/resource.cpp
index 10da526e29..3104e89a8f 100644
--- a/src/common/resource.cpp
+++ b/src/common/resource.cpp
@@ -38,7 +38,7 @@
 #include "wx/checkbox.h"
 #include "wx/slider.h"
 #include "wx/statbox.h"
-#if USE_GAUGE
+#if wxUSE_GAUGE
 #include "wx/gauge.h"
 #endif
 #include "wx/textctrl.h"
@@ -46,11 +46,11 @@
 #include "wx/intl.h"
 #endif
 
-#if USE_SCROLLBAR
+#if wxUSE_SCROLLBAR
 #include "wx/scrolbar.h"
 #endif
 
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
 #include "wx/combobox.h"
 #endif
 
@@ -58,7 +58,7 @@
 
 #include "wx/log.h"
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 
 #include <ctype.h>
 #include <math.h>
@@ -389,7 +389,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe
             bitmap = wxResourceCreateBitmap(childResource->GetValue4(), (wxResourceTable *)this);
             childResource->SetBitmap(bitmap);
           }
-#if USE_BITMAP_MESSAGE
+#if wxUSE_BITMAP_MESSAGE
           if (bitmap)
            control = new wxStaticBitmap(parent, id, *bitmap,
              wxPoint(childResource->GetX(), childResource->GetY()),
@@ -421,7 +421,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe
 
         ((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0));
       }
-#if USE_GAUGE
+#if wxUSE_GAUGE
    else if (itemType == wxString("wxGauge"))
       {
         control = new wxGauge(parent, id, (int)childResource->GetValue2(),
@@ -432,7 +432,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe
         ((wxGauge *)control)->SetValue((int)childResource->GetValue1());
       }
 #endif
-#if USE_RADIOBUTTON
+#if wxUSE_RADIOBUTTON
    else if (itemType == wxString("wxRadioButton"))
       {
         control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(),
@@ -441,7 +441,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe
            childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
       }
 #endif
-#if USE_SCROLLBAR
+#if wxUSE_SCROLLBAR
    else if (itemType == wxString("wxScrollBar"))
       {
         control = new wxScrollBar(parent, id,
@@ -521,7 +521,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, wxItemResource *childRe
         if (strings)
           delete[] strings;
       }
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
    else if (itemType == wxString("wxComboBox"))
       {
         wxStringList *stringList = childResource->GetStringValues();
@@ -890,7 +890,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e
         controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
     }
   }
-#if USE_RADIOBUTTON
+#if wxUSE_RADIOBUTTON
   else if (controlType == "wxRadioButton")
   {
     // Check for default value
@@ -1089,7 +1089,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e
      }
    }
   }
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
   else if (controlType == "wxComboBox")
   {
     PrologExpr *textValue = expr->Nth(count);
@@ -2189,7 +2189,7 @@ wxBitmap *wxResourceCreateBitmap(char *resource, wxResourceTable *table)
       }
       case wxBITMAP_TYPE_XPM_DATA:
       {
-#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
         wxItemResource *item = table->FindResource(name);
         if (!item)
         {
@@ -2358,7 +2358,7 @@ wxIcon *wxResourceCreateIcon(char *resource, wxResourceTable *table)
       {
       // *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
 /*
-#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
         wxItemResource *item = table->FindResource(name);
         if (!item)
         {
@@ -2938,4 +2938,4 @@ wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxResource
   return table->CreateItem((wxWindow *)this, (wxItemResource *)resource);
 }
 
-#endif // USE_WX_RESOURCES
+#endif // wxUSE_WX_RESOURCES
diff --git a/src/common/stream.cpp b/src/common/stream.cpp
index 82bbb35e15..3c038e14d9 100644
--- a/src/common/stream.cpp
+++ b/src/common/stream.cpp
@@ -363,7 +363,7 @@ wxInputStream& wxInputStream::operator>>(float& f)
   return *this;
 }
 
-#if USE_SERIAL
+#if wxUSE_SERIAL
 wxInputStream& wxInputStream::operator>>(wxObject *& obj)
 {
   wxObjectInputStream obj_s(*this);
@@ -544,7 +544,7 @@ wxOutputStream& wxOutputStream::operator<<(double f)
   return Write(strfloat, strfloat.Len());
 }
 
-#if USE_SERIAL
+#if wxUSE_SERIAL
 wxOutputStream& wxOutputStream::operator<<(wxObject& obj)
 {
   wxObjectOutputStream obj_s(*this);
diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp
index aac6b6ae94..dedda6cf6b 100644
--- a/src/common/tbarbase.cpp
+++ b/src/common/tbarbase.cpp
@@ -29,7 +29,7 @@
 #include <windows.h>
 #endif
 
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
 
 #include "wx/tbarbase.h"
 
@@ -615,7 +615,7 @@ void wxToolBarBase::AdjustScrollbars(void)
 // Default OnSize resets scrollbars, if any
 void wxToolBarBase::OnSize(wxSizeEvent& event)
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
   if (GetAutoLayout())
     Layout();
 #endif
diff --git a/src/common/tbarsmpl.cpp b/src/common/tbarsmpl.cpp
index c7eceb5eed..1d052c8889 100644
--- a/src/common/tbarsmpl.cpp
+++ b/src/common/tbarsmpl.cpp
@@ -24,7 +24,7 @@
 #include "wx/wx.h"
 #endif
 
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
 
 #include "wx/tbarsmpl.h"
 
diff --git a/src/common/time.cpp b/src/common/time.cpp
index 01eed9a495..ecd30b9ac0 100644
--- a/src/common/time.cpp
+++ b/src/common/time.cpp
@@ -27,14 +27,14 @@ seconds since January 1, 1901, GMT.
 
 #include "wx/setup.h"
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 
 #include "wx/time.h"
 #include "wx/date.h"
 #include "wx/utils.h"
 #include <wx/intl.h>
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp
index 37d62161f6..14b9bae187 100644
--- a/src/common/utilscmn.cpp
+++ b/src/common/utilscmn.cpp
@@ -28,7 +28,7 @@
 #include "wx/frame.h"
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp
index 6e12f51835..d12a8a9e1b 100644
--- a/src/generic/gridg.cpp
+++ b/src/generic/gridg.cpp
@@ -33,9 +33,9 @@
 
 // Set to zero to use no double-buffering
 #ifdef __WXMSW__
-#define USE_DOUBLE_BUFFERING 1
+#define wxUSE_DOUBLE_BUFFERING 1
 #else
-#define USE_DOUBLE_BUFFERING 0
+#define wxUSE_DOUBLE_BUFFERING 0
 #endif
 
 #define wxGRID_DRAG_NONE       0
@@ -418,7 +418,7 @@ void wxGenericGrid::OnPaint(wxPaintEvent& WXUNUSED(event))
   int w, h;
   GetClientSize(&w, &h);
 
-  bool useDoubleBuffering = (bool) USE_DOUBLE_BUFFERING;
+  bool useDoubleBuffering = (bool) wxUSE_DOUBLE_BUFFERING;
   if (useDoubleBuffering)
   {
     // Reuse the old bitmap if possible
diff --git a/src/generic/helpxlp.cpp b/src/generic/helpxlp.cpp
index 7cf6872a82..4fd7ed0a2f 100644
--- a/src/generic/helpxlp.cpp
+++ b/src/generic/helpxlp.cpp
@@ -26,7 +26,7 @@
 
 #include "wx/generic/helpxlp.h"
 
-#if USE_HELP
+#if wxUSE_HELP
 #include <time.h>
 
 #ifdef __X__
@@ -263,4 +263,4 @@ bool wxXLPHelpConnection::OnDisconnect(void)
   return TRUE;
 }
 
-#endif // USE_HELP
+#endif // wxUSE_HELP
diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp
index 4305d4a866..563365f3ba 100644
--- a/src/generic/scrolwin.cpp
+++ b/src/generic/scrolwin.cpp
@@ -333,7 +333,7 @@ void wxScrolledWindow::AdjustScrollbars(void)
 // Default OnSize resets scrollbars, if any
 void wxScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
   if (GetAutoLayout())
     Layout();
 #endif
diff --git a/src/gtk.inc b/src/gtk.inc
index dba0d140a5..f8c321921e 100644
--- a/src/gtk.inc
+++ b/src/gtk.inc
@@ -175,20 +175,4 @@ LIB_C_SRC=\
  gdk_imlib/misc.c \
  gdk_imlib/rend.c \
  gdk_imlib/save.c \
- gdk_imlib/utils.c \
- \
-  iodbc/dlf.c \
-  iodbc/dlproc.c \
-  iodbc/herr.c \
-  iodbc/henv.c \
-  iodbc/hdbc.c \
-  iodbc/hstmt.c \
-  iodbc/connect.c \
-  iodbc/prepare.c \
-  iodbc/result.c \
-  iodbc/execute.c \
-  iodbc/fetch.c \
-  iodbc/info.c \
-  iodbc/catalog.c \
-  iodbc/misc.c \
-  iodbc/itrace.c
+ gdk_imlib/utils.c
diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp
index d2acce935a..501e625977 100644
--- a/src/gtk/app.cpp
+++ b/src/gtk/app.cpp
@@ -25,7 +25,7 @@
 
 #include "unistd.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
@@ -243,7 +243,7 @@ void wxApp::CommonInit(void)
 {
 
 /*
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
   (void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
 #endif
 */
@@ -262,7 +262,7 @@ void wxApp::CommonInit(void)
   wxInitializeResourceSystem();
 
   // For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData();
   wxThePrintPaperDatabase = new wxPrintPaperDatabase;
   wxThePrintPaperDatabase->CreateDatabase();
@@ -310,7 +310,7 @@ int wxEntry( int argc, char *argv[] )
 
   wxClassInfo::InitializeClasses();
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
   streambuf* sBuf = new wxDebugStreamBuf;
   ostream* oStr = new ostream(sBuf) ;
@@ -352,7 +352,7 @@ int wxEntry( int argc, char *argv[] )
   
   gtk_init( &argc, &argv );
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   gdk_imlib_init();
 
@@ -393,7 +393,7 @@ int wxEntry( int argc, char *argv[] )
   
   delete[] wxBuffer;
   
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
   
   if (wxDebugContext::CountObjectsLeft() > 0)
   {
diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp
index e000d6ab3f..07519ea19f 100644
--- a/src/gtk/bitmap.cpp
+++ b/src/gtk/bitmap.cpp
@@ -16,7 +16,7 @@
 #include "wx/icon.h"
 #include "gdk/gdkprivate.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
 #include "../gdk_imlib/gdk_imlib.h"
 #include "gdk/gdkx.h"        // GDK_DISPLAY
@@ -50,7 +50,7 @@ wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
 
 wxMask::~wxMask(void)
 {
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   // do not delete the mask, gdk_imlib does it for you
 #else
   if (m_bitmap) gdk_bitmap_unref( m_bitmap );
@@ -80,7 +80,7 @@ class wxBitmapRefData: public wxObjectRefData
     int             m_width;
     int             m_height;
     int             m_bpp;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
     GdkImlibImage  *m_image;
 #endif
     wxPalette      *m_palette;
@@ -95,14 +95,14 @@ wxBitmapRefData::wxBitmapRefData(void)
   m_height = 0;
   m_bpp = 0;
   m_palette = (wxPalette *) NULL;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   m_image = (GdkImlibImage *) NULL;
 #endif
 }
 
 wxBitmapRefData::~wxBitmapRefData(void)
 {
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   if (m_pixmap) gdk_imlib_free_pixmap( m_pixmap );
   if (m_image) gdk_imlib_kill_image( m_image );
 #else
@@ -141,7 +141,7 @@ wxBitmap::wxBitmap( char **bits )
 {
   m_refData = new wxBitmapRefData();
 
-#ifndef USE_GDK_IMLIB
+#ifndef wxUSE_GDK_IMLIB
 
   GdkBitmap *mask = NULL;
   
@@ -323,7 +323,7 @@ void wxBitmap::Resize( int height, int width )
     return;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   
   if (M_BMPDATA->m_bitmap)
   {
@@ -360,7 +360,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
     return FALSE;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   if (M_BMPDATA->m_bitmap)
   {
@@ -383,7 +383,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
 
 bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
 {
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   UnRef();
   m_refData = new wxBitmapRefData();
@@ -465,7 +465,7 @@ void wxBitmap::RecreateImage(void)
     return;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   DestroyImage();
   
@@ -520,7 +520,7 @@ void wxBitmap::Render(void)
     return;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   if (!M_BMPDATA->m_image) RecreateImage();
   
diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp
index 5b465727f8..13f981ebf2 100644
--- a/src/gtk/colour.cpp
+++ b/src/gtk/colour.cpp
@@ -15,7 +15,7 @@
 
 #include "wx/gdicmn.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
@@ -208,7 +208,7 @@ void wxColour::CalcPixel( GdkColormap *cmap )
   if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
   M_COLDATA->FreeColour();
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   int r = M_COLDATA->m_color.red >> SHIFT;
   int g = M_COLDATA->m_color.green >> SHIFT;
diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp
index a03c6f6f1f..96bce38d00 100644
--- a/src/gtk/data.cpp
+++ b/src/gtk/data.cpp
@@ -168,7 +168,7 @@ const char *wxUserResourceStr = "TEXT";
 #endif
 
 
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
 /*
  * For wxWindows to be made into a dynamic library (e.g. Sun),
  * all IMPLEMENT_... macros must be in one place.
@@ -192,13 +192,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
 #include "wx/choice.h"
 IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 #include "wx/clipbrd.h"
 IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
 #endif
 
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
 #include "wx/combobox.h"
 IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
 #endif
@@ -238,7 +238,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintData, wxObject)
 #include "wx/colordlg.h"
 #include "wx/fontdlg.h"
 
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include "wx/generic/colordlg.h"
 #include "wx/generic/fontdlg.h"
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
@@ -273,7 +273,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxIntPoint, wxObject)
 #endif
 */
 
-#if defined(wx_x) || (defined(wx_msw) && USE_PORTABLE_FONTS_IN_MSW)
+#if defined(wx_x) || (defined(wx_msw) && wxUSE_PORTABLE_FONTS_IN_MSW)
 IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
 #endif
 
@@ -289,7 +289,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNode, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 #include "wx/print.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
 IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
@@ -306,7 +306,7 @@ IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
 IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
 #endif
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 #include "wx/postscrp.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
@@ -315,7 +315,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
@@ -352,12 +352,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxList)
 #include "wx/process.h"
 IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 #include "wx/date.h"
 IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
 #endif
 
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
 #include "wx/docview.h"
 //IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
@@ -366,7 +366,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
 IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
 IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
 #endif
 IMPLEMENT_CLASS(wxCommand, wxObject)
@@ -374,7 +374,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
 #endif
 
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
 #include "wx/layout.h"
 IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
@@ -382,7 +382,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSizer, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
 #endif
 
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
 #include "wx/tbarbase.h"
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
@@ -453,7 +453,7 @@ BEGIN_EVENT_TABLE(wxStatusBar, wxWindow)
     EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
 END_EVENT_TABLE()
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 #include "wx/time.h"
 IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
 #endif
@@ -491,7 +491,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxBitmapHandler)
 #include "wx/statbox.h"
 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
 
-#if USE_IPC
+#if wxUSE_IPC
 #include "wx/dde.h"
 IMPLEMENT_ABSTRACT_CLASS(wxDDEObject, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxDDEObject)
@@ -516,7 +516,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
 
-#if USE_METAFILE
+#if wxUSE_METAFILE
 #include "wx/metafile.h"
 IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
@@ -568,7 +568,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
 #include "wx/dirdlg.h"
 #include "wx/choicdlg.h"
 
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include "wx/generic/msgdlgg.h"
 IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
 #endif
@@ -582,7 +582,7 @@ IMPLEMENT_CLASS(wxDirDialog, wxDialog)
 IMPLEMENT_CLASS(wxMessageDialog)
 #endif
 
-#if USE_GAUGE
+#if wxUSE_GAUGE
 #ifdef wx_motif
 #include "../../contrib/xmgauge/gauge.h"
 #endif
@@ -705,7 +705,7 @@ BEGIN_EVENT_TABLE(wxControl, wxWindow)
   EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
 END_EVENT_TABLE()
 
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
 BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
   EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
   EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
diff --git a/src/gtk/dcmemory.cpp b/src/gtk/dcmemory.cpp
index 4b19f89c29..84a6e144e7 100644
--- a/src/gtk/dcmemory.cpp
+++ b/src/gtk/dcmemory.cpp
@@ -14,7 +14,7 @@
 
 #include "wx/dcmemory.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
@@ -28,7 +28,7 @@ wxMemoryDC::wxMemoryDC(void)
 {
   m_ok = FALSE;
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   m_cmap = gdk_imlib_get_colormap();
 #else
   m_cmap = gdk_colormap_get_system();
@@ -39,7 +39,7 @@ wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
 {
   m_ok = FALSE;
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   m_cmap = gdk_imlib_get_colormap();
 #else
   m_cmap = gdk_colormap_get_system();
diff --git a/src/gtk/palette.cpp b/src/gtk/palette.cpp
index 5657c4355e..9f49402c61 100644
--- a/src/gtk/palette.cpp
+++ b/src/gtk/palette.cpp
@@ -94,13 +94,22 @@ bool wxPalette::Ok(void) const
 
 bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
 {
+  wxFAIL_MSG("not implemented");
+
+  return FALSE;
 };
 
 int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const
 {
+  wxFAIL_MSG("not implemented");
+
+  return 0;
 };
 
 bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const
 {
+  wxFAIL_MSG("not implemented");
+
+  return 0;
 };
 
diff --git a/src/gtk/treectrl.cpp b/src/gtk/treectrl.cpp
index 3ae18cf4f6..c31078e3cd 100644
--- a/src/gtk/treectrl.cpp
+++ b/src/gtk/treectrl.cpp
@@ -16,7 +16,7 @@
 #include "wx/settings.h"
 #include "wx/log.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp
index e382126ada..a76a068ebd 100644
--- a/src/gtk/window.cpp
+++ b/src/gtk/window.cpp
@@ -43,12 +43,12 @@
    I have been asked several times about writing some documentation about
    the GTK port of wxWindows, especially its internal structures. Obviously,
    you cannot understand wxGTK without knowing a little about the GTK, but
-   some more information about what the wxWindow, which is the base class 
+   some more information about what the wxWindow, which is the base class
    for all other window classes, does seems required as well.
-   
+
    What does wxWindow do? It contains the common interface for the following
    jobs of its descentants:
-   
+
    1) Define the rudimentary behaviour common to all window classes, such as
    resizing, intercepting user input so as to make it possible to use these
    events for special purposes in a derived class, window names etc.
@@ -57,20 +57,20 @@
    class is allowed to contain children, which holds true for those window
    classes, which do not display a native GTK widget. To name them, these
    classes are wxPanel, wxScrolledWindow, wxDialog, wxFrame. The MDI frame-
-   work classes are a special case and are handled a bit differently from 
+   work classes are a special case and are handled a bit differently from
    the rest.
-   
+
    3) Provide the possibility to draw into a client area of a window. This,
    too, only holds true for classes that do not display a native GTK widget
    as above.
-   
+
    4) Provide the entire mechanism for scrolling widgets. This actaul inter-
    face for this is usually in wxScrolledWidget, but the GTK implementation
    is in this class.
-   
+
    5) A multitude of helper or extra methods for special purposes, such as
    Drag'n'Drop, managing validators etc.
-   
+
    Normally one might expect, that one wxWindows class would always contain
    one GTK widget. Under GTK, there is no such allround widget that has all
    the functionality. Moreover, the GTK defines a client area as a different
@@ -81,7 +81,7 @@
    represent a client area in the sense of wxWindows capable to do the jobs
    2), 3) and 4). I have written this class and it resides in win_gtk.c of
    this directory.
-   
+
    All windows must have a widget, with which they interact with other under-
    lying GTK widget. It is this widget, e.g. that has to be resized etc and
    thw wxWindow class has a member variable called m_widget which holds a
@@ -95,14 +95,14 @@
    and all other widgets must be children of this widget on the GTK level.
    The top-most widget, which also represents the client area, must be in
    the m_wxwindow field and must be of the type GtkMyFixed.
-   
+
    As I said, the window classes that display a GTK native widget only have
    one widget, so in the case of e.g. the wxButton class m_widget holds a
    pointer to a GtkButton widget. But windows with client areas (for drawing
    and children) have a m_widget field that is a pointer to a GtkScrolled-
    Window and a m_wxwindow field that is pointer to a GtkMyFixed and this
    one is (in the GTK sense) a child of the GtkScrolledWindow.
-   
+
    If the m_wxwindow field is set, then all input to this widget is inter-
    cepted and sent to the wxWindows class. If not, all input to the widget
    that gets pointed to by m_widget gets intercepted and sent to the class.
@@ -116,22 +116,26 @@
 extern wxList wxPendingDelete;
 extern wxList wxTopLevelWindows;
 extern bool   g_blockEventsOnDrag;
-       bool   g_capturing = FALSE;
+static bool   g_capturing = FALSE;
+
+// hack: we need something to pass to gtk_menu_popup, so we store the time of
+// the last click here
+static guint32 gs_timeLastClick = 0;
 
 //-----------------------------------------------------------------------------
 // "expose_event" (of m_wxwindow, not of m_widget)
 //-----------------------------------------------------------------------------
 
 static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->HasVMT()) return;
   if (g_blockEventsOnDrag) return;
-  
+
   win->m_updateRegion.Union( gdk_event->area.x,
                              gdk_event->area.y,
-    	                     gdk_event->area.width,
+                             gdk_event->area.width,
                              gdk_event->area.height );
-           
+
   if (gdk_event->count > 0) return;
 
 /*
@@ -144,7 +148,7 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
   wxPaintEvent event( win->GetId() );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
-  
+
   win->m_updateRegion.Clear();
 }
 
@@ -153,16 +157,16 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
 //-----------------------------------------------------------------------------
 
 static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win )
-{ 
+{
   if (!win->HasVMT()) return;
   if (g_blockEventsOnDrag) return;
-  
+
   win->m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
-           
+
   wxPaintEvent event( win->GetId() );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
-  
+
   win->m_updateRegion.Clear();
 }
 
@@ -171,7 +175,7 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
 //-----------------------------------------------------------------------------
 
 static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->HasVMT()) return FALSE;
   if (g_blockEventsOnDrag) return FALSE;
 
@@ -255,13 +259,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
     case GDK_F12:           key_code = WXK_F12;         break;
     default:
     {
-      if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF)) 
+      if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
         key_code = gdk_event->keyval;
     }
   }
 
   if (!key_code) return FALSE;
-  
+
   wxKeyEvent event( wxEVT_CHAR );
   event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
   event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
@@ -271,31 +275,31 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
   event.m_x = 0;
   event.m_y = 0;
   event.SetEventObject( win );
-  
+
   bool ret = win->GetEventHandler()->ProcessEvent( event );
-  
+
   if (!ret)
   {
     wxWindow *ancestor = win;
     while (ancestor)
-    {    
+    {
       int command = ancestor->GetAcceleratorTable()->GetCommand( event );
       if (command != -1)
       {
         wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
         ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
-	break;
+    break;
       }
       ancestor = ancestor->GetParent();
     }
   }
-  
+
   if (ret)
   {
-    if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF)) 
+    if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
       gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
   }
-  
+
   return ret;
 }
 
@@ -306,7 +310,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
 static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
 {
   if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
 
   if (win->m_wxwindow)
@@ -314,17 +318,17 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
     if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) )
     {
       gtk_widget_grab_focus (win->m_wxwindow);
-      
+
 /*
       printf( "GrabFocus from " );
       if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
         printf( win->GetClassInfo()->GetClassName() );
       printf( ".\n" );
 */
-      
+
     }
   }
-    
+
   if (!win->HasVMT()) return TRUE;
 
 /*
@@ -335,7 +339,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 */
 
   wxEventType event_type = wxEVT_LEFT_DOWN;
-  
+
   if (gdk_event->button == 1)
   {
     switch (gdk_event->type)
@@ -363,7 +367,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
       default:  break;
     }
   }
-  
+
   wxMouseEvent event( event_type );
   event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
   event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
@@ -372,13 +376,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
   event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
   event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
   event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-  
+
   event.m_x = (long)gdk_event->x;
   event.m_y = (long)gdk_event->y;
-  
+
   // Some control don't have their own X window and thus cannot get
-  // any events. 
-  
+  // any events.
+
   if (!g_capturing)
   {
     wxNode *node = win->GetChildren()->First();
@@ -387,8 +391,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
       wxWindow *child = (wxWindow*)node->Data();
       if ((child->m_x <= event.m_x) &&
           (child->m_y <= event.m_y) &&
-	  (child->m_x+child->m_width  >= event.m_x) &&
-	  (child->m_y+child->m_height >= event.m_y))
+      (child->m_x+child->m_width  >= event.m_x) &&
+      (child->m_y+child->m_height >= event.m_y))
       {
         win = child;
         event.m_x -= child->m_x;
@@ -398,12 +402,14 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
       node = node->Next();
     }
   }
-  
+
   event.SetEventObject( win );
-  
+
+  gs_timeLastClick = gdk_event->time;
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
-  
+
   return TRUE;
 }
 
@@ -412,22 +418,22 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 //-----------------------------------------------------------------------------
 
 static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
 
   if (!win->HasVMT()) return TRUE;
- 
+
 /*
   printf( "OnButtonRelease from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   wxEventType event_type = wxEVT_NULL;
-  
+
   switch (gdk_event->button)
   {
     case 1: event_type = wxEVT_LEFT_UP; break;
@@ -445,10 +451,10 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
   event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
   event.m_x = (long)gdk_event->x;
   event.m_y = (long)gdk_event->y;
-  
+
   // Some control don't have their own X window and thus cannot get
-  // any events. 
-  
+  // any events.
+
   if (!g_capturing)
   {
     wxNode *node = win->GetChildren()->First();
@@ -457,8 +463,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
       wxWindow *child = (wxWindow*)node->Data();
       if ((child->m_x <= event.m_x) &&
           (child->m_y <= event.m_y) &&
-	  (child->m_x+child->m_width  >= event.m_x) &&
-	  (child->m_y+child->m_height >= event.m_y))
+      (child->m_x+child->m_width  >= event.m_x) &&
+      (child->m_y+child->m_height >= event.m_y))
       {
         win = child;
         event.m_x -= child->m_x;
@@ -468,12 +474,12 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
       node = node->Next();
     }
   }
-  
+
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
-  
+
   return TRUE;
 }
 
@@ -482,20 +488,20 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
 //-----------------------------------------------------------------------------
 
 static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
 
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnMotion from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   wxMouseEvent event( wxEVT_MOTION );
   event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
   event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
@@ -504,13 +510,13 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
   event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
   event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
   event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-  
+
   event.m_x = (long)gdk_event->x;
   event.m_y = (long)gdk_event->y;
-  
+
   // Some control don't have their own X window and thus cannot get
-  // any events. 
-  
+  // any events.
+
   if (!g_capturing)
   {
     wxNode *node = win->GetChildren()->First();
@@ -519,8 +525,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
       wxWindow *child = (wxWindow*)node->Data();
       if ((child->m_x <= event.m_x) &&
           (child->m_y <= event.m_y) &&
-	  (child->m_x+child->m_width  >= event.m_x) &&
-	  (child->m_y+child->m_height >= event.m_y))
+      (child->m_x+child->m_width  >= event.m_x) &&
+      (child->m_y+child->m_height >= event.m_y))
       {
         win = child;
         event.m_x -= child->m_x;
@@ -530,12 +536,12 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
       node = node->Next();
     }
   }
-  
+
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "motion_notify_event" );
-  
+
   return TRUE;
 }
 
@@ -551,7 +557,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(
     if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
     {
       GTK_WIDGET_SET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
-/*      
+/*
       printf( "SetFocus flag from " );
       if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
         printf( win->GetClassInfo()->GetClassName() );
@@ -559,9 +565,9 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(
 */
     }
   }
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnSetFocus from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -570,13 +576,13 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(
   printf( WXSTRINGCAST win->GetLabel() );
   printf( ".\n" );
 */
-  
+
   wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
-  
+
   return TRUE;
 }
 
@@ -592,19 +598,19 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
     if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
       GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
   }
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnKillFocus from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
 
@@ -618,30 +624,30 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
 static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
 {
   if (widget->window != gdk_event->window) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnEnter from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if ((widget->window) && (win->m_cursor))
     gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
-    
+
   wxMouseEvent event( wxEVT_ENTER_WINDOW );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
-  
+
   return TRUE;
 }
-    
+
 //-----------------------------------------------------------------------------
 // "leave_notify_event"
 //-----------------------------------------------------------------------------
@@ -649,30 +655,30 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
 static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
 {
   if (widget->window != gdk_event->window) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnLeave from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if ((widget->window) && (win->m_cursor))
     gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
-    
+
   wxMouseEvent event( wxEVT_LEAVE_WINDOW );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
-  
+
   return TRUE;
 }
-    
+
 //-----------------------------------------------------------------------------
 // "value_changed" from m_vAdjust
 //-----------------------------------------------------------------------------
@@ -687,23 +693,23 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-  
+
   float diff = win->m_vAdjust->value - win->m_oldVerticalPos;
   if (fabs(diff) < 0.2) return;
-  
+
   wxEventType command = wxEVT_NULL;
-  
+
   float line_step = win->m_vAdjust->step_increment;
   float page_step = win->m_vAdjust->page_increment;
-  
+
   if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
   else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
   else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
   else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
   else command = wxEVT_SCROLL_THUMBTRACK;
-      
+
   int value = (int)(win->m_vAdjust->value+0.5);
 
   wxScrollEvent event( command, win->GetId(), value, wxVERTICAL );
@@ -716,26 +722,26 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
 //-----------------------------------------------------------------------------
 
 static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{ 
+{
   if (g_blockEventsOnDrag) return;
-  
+
 /*
   printf( "OnHScroll from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-    
+
   float diff = win->m_hAdjust->value - win->m_oldHorizontalPos;
   if (fabs(diff) < 0.2) return;
-  
+
   wxEventType command = wxEVT_NULL;
-  
+
   float line_step = win->m_hAdjust->step_increment;
   float page_step = win->m_hAdjust->page_increment;
-  
+
   if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
   else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
   else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
@@ -743,7 +749,7 @@ static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
   else command = wxEVT_SCROLL_THUMBTRACK;
 
   int value = (int)(win->m_hAdjust->value+0.5);
-      
+
   wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
@@ -763,9 +769,9 @@ static void gtk_window_vscroll_change_callback( GtkWidget *WXUNUSED(widget), wxW
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-  
+
   wxEventType command = wxEVT_SCROLL_THUMBTRACK;
   int value = (int)(win->m_vAdjust->value+0.5);
 
@@ -779,21 +785,21 @@ static void gtk_window_vscroll_change_callback( GtkWidget *WXUNUSED(widget), wxW
 //-----------------------------------------------------------------------------
 
 static void gtk_window_hscroll_change_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{ 
+{
   if (g_blockEventsOnDrag) return;
-  
+
 /*
   printf( "OnHScroll change from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-    
+
   wxEventType command = wxEVT_SCROLL_THUMBTRACK;
   int value = (int)(win->m_hAdjust->value+0.5);
-      
+
   wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
@@ -808,7 +814,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget, GdkEventButto
   if (gdk_event->window != widget->slider) return FALSE;
 
   win->m_isScrolling = TRUE;
-  
+
   return FALSE;
 }
 
@@ -821,14 +827,14 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget, GdkEventBut
   if (gdk_event->window != widget->slider) return FALSE;
 
   GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(win->m_widget);
- 
+
   if (widget == GTK_RANGE(s_window->vscrollbar))
     gtk_signal_emit_by_name( GTK_OBJECT(win->m_hAdjust), "value_changed" );
-  else  
+  else
     gtk_signal_emit_by_name( GTK_OBJECT(win->m_vAdjust), "value_changed" );
-      
+
   win->m_isScrolling = FALSE;
-  
+
   return FALSE;
 }
 
@@ -839,7 +845,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget, GdkEventBut
 static void gtk_window_drop_callback( GtkWidget *widget, GdkEvent *event, wxWindow *win )
 {
   if (!win->HasVMT()) return;
-  
+
   if (win->GetDropTarget())
   {
     int x = 0;
@@ -847,7 +853,7 @@ static void gtk_window_drop_callback( GtkWidget *widget, GdkEvent *event, wxWind
     gdk_window_get_pointer( widget->window, &x, &y, (GdkModifierType *) NULL );
     win->GetDropTarget()->Drop( event, x, y );
   }
-  
+
 /*
   g_free (event->dropdataavailable.data);
   g_free (event->dropdataavailable.data_type);
@@ -917,16 +923,16 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   m_isShown = FALSE;
   m_isEnabled = TRUE;
   m_needParent = TRUE;
-  
+
   m_cursor = (wxCursor *) NULL;
-  
+
   PreCreation( parent, id, pos, size, style, name );
-  
+
   m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
   m_hasScrolling = TRUE;
-  
+
   GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
- 
+
   gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
           (GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
 
@@ -941,27 +947,27 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
 
   GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
   scroll_class->scrollbar_spacing = 0;
-  
+
   gtk_scrolled_window_set_policy( s_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-    
+
   m_oldHorizontalPos = 0.0;
   m_oldVerticalPos = 0.0;
- 
+
   m_hAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->hscrollbar) );
   m_vAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->vscrollbar) );
-  
+
   gtk_signal_connect( GTK_OBJECT(m_hAdjust), "value_changed",
           (GtkSignalFunc) gtk_window_hscroll_callback, (gpointer) this );
   gtk_signal_connect( GTK_OBJECT(m_vAdjust), "value_changed",
           (GtkSignalFunc) gtk_window_vscroll_callback, (gpointer) this );
-          
+
   gtk_signal_connect( GTK_OBJECT(m_hAdjust), "changed",
           (GtkSignalFunc) gtk_window_hscroll_change_callback, (gpointer) this );
   gtk_signal_connect(GTK_OBJECT(m_vAdjust), "changed",
           (GtkSignalFunc) gtk_window_vscroll_change_callback, (gpointer) this );
-  
+
   GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-  
+
   if (m_windowStyle & wxRAISED_BORDER)
   {
     gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_OUT );
@@ -974,11 +980,11 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   {
     gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE );
   }
-    
+
   m_wxwindow = gtk_myfixed_new();
-  
+
   if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-    
+
   if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
     GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
   else
@@ -989,8 +995,8 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   // shut the viewport up
   gtk_viewport_set_hadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
   gtk_viewport_set_vadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
-  
-  // I _really_ don't want scrollbars in the beginning    
+
+  // I _really_ don't want scrollbars in the beginning
   m_vAdjust->lower = 0.0;
   m_vAdjust->upper = 1.0;
   m_vAdjust->value = 0.0;
@@ -1005,31 +1011,31 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   m_hAdjust->page_increment = 1.0;
   m_hAdjust->page_size = 5.0;
   gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
-  
+
   gtk_widget_show( m_wxwindow );
-  
+
   PostCreation();
-  
+
   Show( TRUE );
 
-  return TRUE;  
+  return TRUE;
 }
 
 wxWindow::~wxWindow(void)
 {
   m_hasVMT = FALSE;
-  
+
   if (m_pDropTarget) delete m_pDropTarget;
-  
+
   if (m_parent) m_parent->RemoveChild( this );
   if (m_widget) Show( FALSE );
 
   DestroyChildren();
-  
+
   if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
-    
+
   if (m_widget) gtk_widget_destroy( m_widget );
-  
+
   wxDELETE(m_cursor);
 
   DeleteRelatedConstraints();
@@ -1058,7 +1064,7 @@ wxWindow::~wxWindow(void)
   // wxWindow::LoadNativeDialog but we weren't a dialog
   // class
   wxTopLevelWindows.DeleteObject(this);
-    
+
   if (m_windowValidator) delete m_windowValidator;
 }
 
@@ -1110,28 +1116,28 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
 void wxWindow::PostCreation(void)
 {
   if (m_parent) m_parent->AddChild( this );
-  
+
   if (m_wxwindow)
   {
-    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event", 
+    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
       GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
-      
-    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", 
+
+    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
       GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
   }
-  
+
   ConnectWidget( GetConnectWidget() );
-  
+
   if (m_widget && m_parent) gtk_widget_realize( m_widget );
-  
+
   if (m_wxwindow)
   {
     gtk_widget_realize( m_wxwindow );
     gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
   }
-  
+
   SetCursor( *wxSTANDARD_CURSOR );
-  
+
   m_hasVMT = TRUE;
 }
 
@@ -1142,23 +1148,23 @@ void wxWindow::ConnectWidget( GtkWidget *widget )
 
   gtk_signal_connect( GTK_OBJECT(widget), "button_press_event",
     GTK_SIGNAL_FUNC(gtk_window_button_press_callback), (gpointer)this );
-    
+
   gtk_signal_connect( GTK_OBJECT(widget), "button_release_event",
     GTK_SIGNAL_FUNC(gtk_window_button_release_callback), (gpointer)this );
-    
+
   gtk_signal_connect( GTK_OBJECT(widget), "motion_notify_event",
     GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
-    
-  gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event", 
+
+  gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
     GTK_SIGNAL_FUNC(gtk_window_focus_in_callback), (gpointer)this );
 
-  gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event", 
+  gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event",
     GTK_SIGNAL_FUNC(gtk_window_focus_out_callback), (gpointer)this );
 
-  gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event", 
+  gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event",
     GTK_SIGNAL_FUNC(gtk_window_enter_callback), (gpointer)this );
-    
-  gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event", 
+
+  gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
     GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
 }
 
@@ -1170,7 +1176,7 @@ bool wxWindow::HasVMT(void)
 bool wxWindow::Close( bool force )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
   event.SetEventObject(this);
   event.SetForce(force);
@@ -1181,7 +1187,7 @@ bool wxWindow::Close( bool force )
 bool wxWindow::Destroy(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_hasVMT = FALSE;
   delete this;
   return TRUE;
@@ -1189,13 +1195,13 @@ bool wxWindow::Destroy(void)
 
 bool wxWindow::DestroyChildren(void)
 {
-  if (GetChildren()) 
+  if (GetChildren())
   {
     wxNode *node;
-    while ((node = GetChildren()->First()) != (wxNode *)NULL) 
+    while ((node = GetChildren()->First()) != (wxNode *)NULL)
     {
       wxWindow *child;
-      if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) 
+      if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
       {
         delete child;
         if (GetChildren()->Member(child)) delete node;
@@ -1211,7 +1217,7 @@ void wxWindow::PrepareDC( wxDC &WXUNUSED(dc) )
 }
 
 void wxWindow::ImplementSetSize(void)
-{ 
+{
   if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
   if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
   if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
@@ -1227,31 +1233,31 @@ void wxWindow::ImplementSetPosition(void)
       gtk_widget_set_uposition( m_widget, m_x, m_y );
     return;
   }
-  
+
   if (!m_parent)
   {
     wxFAIL_MSG( "wxWindow::SetSize error.\n" );
     return;
   }
-  
+
   if ((m_parent) && (m_parent->m_wxwindow))
     gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y );
-    
-  // Don't do anything for children of wxNotebook and wxMDIChildFrame   
+
+  // Don't do anything for children of wxNotebook and wxMDIChildFrame
 }
 
 void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_resizing) return; // I don't like recursions
   m_resizing = TRUE;
-  
+
   int newX = x;
   int newY = y;
   int newW = width;
   int newH = height;
-  
+
   if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING)
   {
     if (newX == -1) newX = m_x;
@@ -1259,17 +1265,17 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
     if (newW == -1) newW = m_width;
     if (newH == -1) newH = m_height;
   }
-  
+
   if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH)
   {
     if (newW == -1) newW = 80;
   }
-  
+
   if ((sizeFlags & wxSIZE_AUTO_HEIGHT) == wxSIZE_AUTO_HEIGHT)
   {
     if (newH == -1) newH = 26;
   }
-  
+
   if ((m_x != newX) || (m_y != newY) || (!m_sizeSet))
   {
     m_x = newX;
@@ -1283,11 +1289,11 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
     ImplementSetSize();
   }
   m_sizeSet = TRUE;
-  
+
   wxSizeEvent event( wxSize(m_width,m_height), GetId() );
   event.SetEventObject( this );
   ProcessEvent( event );
-  
+
   m_resizing = FALSE;
 }
 
@@ -1304,7 +1310,7 @@ void wxWindow::Move( int x, int y )
 void wxWindow::GetSize( int *width, int *height ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (width) (*width) = m_width;
   if (height) (*height) = m_height;
 }
@@ -1312,7 +1318,7 @@ void wxWindow::GetSize( int *width, int *height ) const
 void wxWindow::SetClientSize( int width, int height )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_wxwindow)
   {
     SetSize( width, height );
@@ -1321,14 +1327,14 @@ void wxWindow::SetClientSize( int width, int height )
   {
     int dw = 0;
     int dh = 0;
-    
+
     if (!m_hasScrolling)
     {
 /*
       do we have sunken dialogs ?
-      
+
       GtkStyleClass *window_class = m_wxwindow->style->klass;
-    
+
       dw += 2 * window_class->xthickness;
       dh += 2 * window_class->ythickness;
 */
@@ -1337,33 +1343,33 @@ void wxWindow::SetClientSize( int width, int height )
     {
       GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
       GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-    
+
       GtkWidget *viewport = scroll_window->viewport;
       GtkStyleClass *viewport_class = viewport->style->klass;
-    
+
       GtkWidget *hscrollbar = scroll_window->hscrollbar;
       GtkWidget *vscrollbar = scroll_window->vscrollbar;
-    
+
       if ((m_windowStyle & wxRAISED_BORDER) ||
           (m_windowStyle & wxSUNKEN_BORDER))
       {
         dw += 2 * viewport_class->xthickness;
         dh += 2 * viewport_class->ythickness;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(vscrollbar))
       {
         dw += vscrollbar->allocation.width;
         dw += scroll_class->scrollbar_spacing;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(hscrollbar))
       {
         dh += hscrollbar->allocation.height;
         dw += scroll_class->scrollbar_spacing;
       }
     }
-    
+
     SetSize( width+dw, height+dh );
   }
 }
@@ -1371,7 +1377,7 @@ void wxWindow::SetClientSize( int width, int height )
 void wxWindow::GetClientSize( int *width, int *height ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_wxwindow)
   {
     if (width) (*width) = m_width;
@@ -1381,14 +1387,14 @@ void wxWindow::GetClientSize( int *width, int *height ) const
   {
     int dw = 0;
     int dh = 0;
-    
+
     if (!m_hasScrolling)
     {
 /*
       do we have sunken dialogs ?
-      
+
       GtkStyleClass *window_class = m_wxwindow->style->klass;
-    
+
       dw += 2 * window_class->xthickness;
       dh += 2 * window_class->ythickness;
 */
@@ -1397,27 +1403,27 @@ void wxWindow::GetClientSize( int *width, int *height ) const
     {
       GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
       GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-    
+
       GtkWidget *viewport = scroll_window->viewport;
       GtkStyleClass *viewport_class = viewport->style->klass;
-    
+
       GtkWidget *hscrollbar = scroll_window->hscrollbar;
       GtkWidget *vscrollbar = scroll_window->vscrollbar;
-    
+
       if ((m_windowStyle & wxRAISED_BORDER) ||
           (m_windowStyle & wxSUNKEN_BORDER))
       {
         dw += 2 * viewport_class->xthickness;
         dh += 2 * viewport_class->ythickness;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(vscrollbar))
       {
 //        dw += vscrollbar->allocation.width;
         dw += 15;                               // range.slider_width = 11 + 2*2pts edge
         dw += scroll_class->scrollbar_spacing;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(hscrollbar))
       {
 //        dh += hscrollbar->allocation.height;
@@ -1425,7 +1431,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
         dh += scroll_class->scrollbar_spacing;
       }
     }
-    
+
     if (width) (*width) = m_width - dw;
     if (height) (*height) = m_height - dh;
   }
@@ -1434,7 +1440,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
 void wxWindow::GetPosition( int *x, int *y ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (x) (*x) = m_x;
   if (y) (*y) = m_y;
 }
@@ -1442,61 +1448,61 @@ void wxWindow::GetPosition( int *x, int *y ) const
 void wxWindow::ClientToScreen( int *x, int *y )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GdkWindow *source = (GdkWindow *) NULL;
   if (m_wxwindow)
     source = m_wxwindow->window;
   else
     source = m_widget->window;
-    
+
   int org_x = 0;
   int org_y = 0;
   gdk_window_get_origin( source, &org_x, &org_y );
 
   if (!m_wxwindow)
-  {  
+  {
     if (GTK_WIDGET_NO_WINDOW (m_widget))
     {
       org_x += m_widget->allocation.x;
       org_y += m_widget->allocation.y;
     }
   }
-  
-  if (x) *x += org_x;  
-  if (y) *y += org_y;  
+
+  if (x) *x += org_x;
+  if (y) *y += org_y;
 }
 
 void wxWindow::ScreenToClient( int *x, int *y )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GdkWindow *source = (GdkWindow *) NULL;
   if (m_wxwindow)
     source = m_wxwindow->window;
   else
     source = m_widget->window;
-    
+
   int org_x = 0;
   int org_y = 0;
   gdk_window_get_origin( source, &org_x, &org_y );
 
   if (!m_wxwindow)
-  {  
+  {
     if (GTK_WIDGET_NO_WINDOW (m_widget))
     {
       org_x += m_widget->allocation.x;
       org_y += m_widget->allocation.y;
     }
   }
-  
-  if (x) *x -= org_x;  
-  if (y) *y -= org_y;  
+
+  if (x) *x -= org_x;
+  if (y) *y -= org_y;
 }
 
 void wxWindow::Centre( int direction )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (IS_KIND_OF(this,wxDialog) || IS_KIND_OF(this,wxFrame))
   {
     if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (gdk_screen_width () - m_width) / 2;
@@ -1520,7 +1526,7 @@ void wxWindow::Centre( int direction )
 void wxWindow::Fit(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   int maxX = 0;
   int maxY = 0;
   wxNode *node = GetChildren()->First();
@@ -1543,7 +1549,7 @@ void wxWindow::Fit(void)
 void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_minWidth = minW;
   m_minHeight = minH;
   m_maxWidth = maxW;
@@ -1558,19 +1564,19 @@ void wxWindow::OnSize( wxSizeEvent &WXUNUSED(event) )
 bool wxWindow::Show( bool show )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (show)
     gtk_widget_show( m_widget );
   else
     gtk_widget_hide( m_widget );
-  m_isShown = show;  
+  m_isShown = show;
   return TRUE;
 }
 
 void wxWindow::Enable( bool enable )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_isEnabled = enable;
   gtk_widget_set_sensitive( m_widget, enable );
   if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
@@ -1579,13 +1585,13 @@ void wxWindow::Enable( bool enable )
 int wxWindow::GetCharHeight(void) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_font.Ok())
   {
     wxFAIL_MSG( "invalid font" );
     return -1;
   }
-  
+
   GdkFont *font = m_font.GetInternalFont( 1.0 );
   return font->ascent + font->descent;
 }
@@ -1593,13 +1599,13 @@ int wxWindow::GetCharHeight(void) const
 int wxWindow::GetCharWidth(void) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_font.Ok())
   {
     wxFAIL_MSG( "invalid font" );
     return -1;
   }
-  
+
   GdkFont *font = m_font.GetInternalFont( 1.0 );
   return gdk_string_width( font, "H" );
 }
@@ -1608,17 +1614,17 @@ void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
   int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxFont fontToUse = m_font;
   if (theFont) fontToUse = *theFont;
-  
+
   if (!fontToUse.Ok())
   {
     wxFAIL_MSG( "invalid font" );
     return;
   }
   wxASSERT_MSG( (m_font.Ok()), "invalid font" );
-  
+
   GdkFont *font = fontToUse.GetInternalFont( 1.0 );
   if (x) (*x) = gdk_string_width( font, string );
   if (y) (*y) = font->ascent + font->descent;
@@ -1647,7 +1653,7 @@ void wxWindow::MakeModal( bool modal )
 void wxWindow::SetFocus(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GtkWidget *connect_widget = GetConnectWidget();
   if (connect_widget)
   {
@@ -1669,68 +1675,68 @@ void wxWindow::AddChild( wxWindow *child )
   wxASSERT_MSG( (m_wxwindow != NULL), "window need client area" );
   wxASSERT_MSG( (child != NULL), "invalid child" );
   wxASSERT_MSG( (child->m_widget != NULL), "invalid child" );
-  
+
   // Addchild is (often) called before the program
   // has left the parents constructor so that no
   // virtual tables work yet. The approach below
   // practically imitates virtual tables, i.e. it
   // implements a different AddChild() behaviour
-  // for wxFrame, wxDialog, wxWindow and 
+  // for wxFrame, wxDialog, wxWindow and
   // wxMDIParentFrame.
 
   // wxFrame and wxDialog as children aren't placed into the parents
-  
+
   if (( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog) ) &&
       (!IS_KIND_OF(child,wxMDIChildFrame)))
   {
     m_children.Append( child );
-    
+
     if ((child->m_x != -1) && (child->m_y != -1))
       gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
-      
+
     return;
   }
-  
-  // In the case of an wxMDIChildFrame descendant, we use the 
+
+  // In the case of an wxMDIChildFrame descendant, we use the
   // client windows's AddChild()
-  
+
   if (IS_KIND_OF(this,wxMDIParentFrame))
   {
     if (IS_KIND_OF(child,wxMDIChildFrame))
     {
       wxMDIClientWindow *client = ((wxMDIParentFrame*)this)->GetClientWindow();
       if (client)
-      { 
+      {
         client->AddChild( child );
         return;
       }
     }
   }
-  
+
   // wxNotebook is very special, so it has a private AddChild()
-  
+
   if (IS_KIND_OF(this,wxNotebook))
   {
     wxNotebook *tab = (wxNotebook*)this;
     tab->AddChild( child );
     return;
   }
-  
+
   // wxFrame has a private AddChild
-  
+
   if (IS_KIND_OF(this,wxFrame) && !IS_KIND_OF(this,wxMDIChildFrame))
   {
     wxFrame *frame = (wxFrame*)this;
     frame->AddChild( child );
     return;
   }
-  
+
   // All the rest
-  
+
   m_children.Append( child );
-  if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, 
+  if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
     child->m_x, child->m_y );
-  
+
   gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
 }
 
@@ -1759,14 +1765,14 @@ int wxWindow::GetReturnCode(void)
 void wxWindow::Raise(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_widget) gdk_window_raise( m_widget->window );
 }
 
 void wxWindow::Lower(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_widget) gdk_window_lower( m_widget->window );
 }
 
@@ -1836,13 +1842,13 @@ wxWindowID wxWindow::GetId(void)
 void wxWindow::SetCursor( const wxCursor &cursor )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_cursor == NULL)
   {
     wxFAIL_MSG( "wxWindow::SetCursor m_cursor == NULL" );
     m_cursor = new wxCursor( wxCURSOR_ARROW );
   }
-    
+
   if (cursor.Ok())
   {
     if (*((wxCursor*)&cursor) == m_cursor) return;
@@ -1855,7 +1861,7 @@ void wxWindow::SetCursor( const wxCursor &cursor )
 
   if ((m_widget) && (m_widget->window))
     gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
-    
+
   if ((m_wxwindow) && (m_wxwindow->window))
     gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
 }
@@ -1863,17 +1869,17 @@ void wxWindow::SetCursor( const wxCursor &cursor )
 void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (eraseBackground && m_wxwindow && m_wxwindow->window)
   {
     if (rect)
-      gdk_window_clear_area( m_wxwindow->window, 
-        rect->x, 
-        rect->y, 
-        rect->width, 
+      gdk_window_clear_area( m_wxwindow->window,
+        rect->x,
+        rect->y,
+        rect->width,
         rect->height );
     else
-      Clear(); 
+      Clear();
   }
   if (!rect)
   {
@@ -1882,7 +1888,7 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
       int w = 0;
       int h = 0;
       GetClientSize( &w, &h );
-      
+
       GdkRectangle gdk_rect;
       gdk_rect.x = 0;
       gdk_rect.y = 0;
@@ -1898,7 +1904,7 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
     gdk_rect.y = rect->y;
     gdk_rect.width = rect->width;
     gdk_rect.height = rect->height;
-    
+
     if (m_wxwindow)
       gtk_widget_draw( m_wxwindow, &gdk_rect );
     else
@@ -1934,7 +1940,7 @@ bool wxWindow::IsExposed( const wxRect& rect ) const
 void wxWindow::Clear(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
 }
 
@@ -1946,7 +1952,7 @@ wxColour wxWindow::GetBackgroundColour(void) const
 void wxWindow::SetBackgroundColour( const wxColour &colour )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_backgroundColour = colour;
   if (m_wxwindow)
   {
@@ -1970,12 +1976,12 @@ void wxWindow::SetForegroundColour( const wxColour &colour )
 bool wxWindow::Validate(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxNode *node = GetChildren()->First();
   while (node)
   {
     wxWindow *child = (wxWindow *)node->Data();
-    if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this)) 
+    if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this))
       { return FALSE; }
     node = node->Next();
   }
@@ -1985,7 +1991,7 @@ bool wxWindow::Validate(void)
 bool wxWindow::TransferDataToWindow(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxNode *node = GetChildren()->First();
   while (node)
   {
@@ -2004,7 +2010,7 @@ bool wxWindow::TransferDataToWindow(void)
 bool wxWindow::TransferDataFromWindow(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxNode *node = GetChildren()->First();
   while (node)
   {
@@ -2029,7 +2035,7 @@ void wxWindow::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) )
 void wxWindow::InitDialog(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxInitDialogEvent event(GetId());
   event.SetEventObject( this );
   GetEventHandler()->ProcessEvent(event);
@@ -2051,23 +2057,31 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
 bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   SetInvokingWindow( menu, this );
-  gtk_menu_popup( GTK_MENU(menu->m_menu), (GtkWidget *) NULL, (GtkWidget *) NULL, (GtkMenuPositionFunc) NULL, NULL, 0, 0 );
+  gtk_menu_popup(
+                  GTK_MENU(menu->m_menu),
+                  (GtkWidget *)NULL,          // parent menu shell
+                  (GtkWidget *)NULL,          // parent menu item
+                  (GtkMenuPositionFunc)NULL,
+                  NULL,                       // client data
+                  0,                          // button used to activate it
+                  0//gs_timeLastClick            // the time of activation
+                );
   return TRUE;
 }
 
 void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GtkWidget *dnd_widget = GetConnectWidget();
-  
+
   DisconnectDnDWidget( dnd_widget );
-  
+
   if (m_pDropTarget) delete m_pDropTarget;
   m_pDropTarget = dropTarget;
-  
+
   ConnectDnDWidget( dnd_widget );
 }
 
@@ -2079,9 +2093,9 @@ wxDropTarget *wxWindow::GetDropTarget() const
 void wxWindow::ConnectDnDWidget( GtkWidget *widget )
 {
   if (!m_pDropTarget) return;
-  
+
   m_pDropTarget->RegisterWidget( widget );
-    
+
   gtk_signal_connect( GTK_OBJECT(widget), "drop_data_available_event",
     GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
 }
@@ -2089,10 +2103,10 @@ void wxWindow::ConnectDnDWidget( GtkWidget *widget )
 void wxWindow::DisconnectDnDWidget( GtkWidget *widget )
 {
   if (!m_pDropTarget) return;
-  
+
   gtk_signal_disconnect_by_func( GTK_OBJECT(widget),
     GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
-  
+
   m_pDropTarget->UnregisterWidget( widget );
 }
 
@@ -2100,10 +2114,10 @@ GtkWidget* wxWindow::GetConnectWidget(void)
 {
   GtkWidget *connect_widget = m_widget;
   if (m_wxwindow) connect_widget = m_wxwindow;
-  
+
   return connect_widget;
 }
-  
+
 bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
 {
   if (m_wxwindow) return (window == m_wxwindow->window);
@@ -2113,7 +2127,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
 void wxWindow::SetFont( const wxFont &font )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (((wxFont*)&font)->Ok())
     m_font = font;
   else
@@ -2129,10 +2143,10 @@ void wxWindow::SetFont( const wxFont &font )
   {
     style = gtk_widget_get_style( m_widget );
   }
-  
+
   gdk_font_unref( style->font );
   style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
-  
+
   gtk_widget_set_style( m_widget, style );
 }
 
@@ -2154,16 +2168,16 @@ long wxWindow::GetWindowStyleFlag(void) const
 void wxWindow::CaptureMouse(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (g_capturing == FALSE), "CaptureMouse called twice" );
-  
+
   GtkWidget *connect_widget = GetConnectWidget();
   gtk_grab_add( connect_widget );
   gdk_pointer_grab ( connect_widget->window, FALSE,
                     (GdkEventMask)
-        (GDK_BUTTON_PRESS_MASK | 
+        (GDK_BUTTON_PRESS_MASK |
         GDK_BUTTON_RELEASE_MASK |
-        GDK_POINTER_MOTION_MASK), 
+        GDK_POINTER_MOTION_MASK),
         (GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
   g_capturing = TRUE;
 }
@@ -2171,9 +2185,9 @@ void wxWindow::CaptureMouse(void)
 void wxWindow::ReleaseMouse(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (g_capturing == TRUE), "ReleaseMouse called twice" );
-  
+
   GtkWidget *connect_widget = GetConnectWidget();
   gtk_grab_remove( connect_widget );
   gdk_pointer_ungrab ( GDK_CURRENT_TIME );
@@ -2246,9 +2260,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
       int range, bool refresh )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return;
 
   if (orient == wxHORIZONTAL)
@@ -2256,16 +2270,16 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     float fpos = (float)pos;
     float frange = (float)range;
     float fthumb = (float)thumbVisible;
-    
+
     if ((fabs(frange-m_hAdjust->upper) < 0.2) &&
         (fabs(fthumb-m_hAdjust->page_size) < 0.2))
     {
       SetScrollPos( orient, pos, refresh );
       return;
     }
-      
+
     m_oldHorizontalPos = fpos;
-    
+
     m_hAdjust->lower = 0.0;
     m_hAdjust->upper = frange;
     m_hAdjust->value = fpos;
@@ -2278,16 +2292,16 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     float fpos = (float)pos;
     float frange = (float)range;
     float fthumb = (float)thumbVisible;
-    
+
     if ((fabs(frange-m_vAdjust->upper) < 0.2) &&
         (fabs(fthumb-m_vAdjust->page_size) < 0.2))
     {
       SetScrollPos( orient, pos, refresh );
       return;
     }
-    
+
     m_oldVerticalPos = fpos;
-      
+
     m_vAdjust->lower = 0.0;
     m_vAdjust->upper = frange;
     m_vAdjust->value = fpos;
@@ -2295,14 +2309,14 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     m_vAdjust->page_increment = (float)(wxMax(fthumb,0));
     m_vAdjust->page_size = fthumb;
   }
-  
+
   if (m_wxwindow->window)
   {
     if (orient == wxHORIZONTAL)
       gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
     else
       gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
-      
+
     gtk_widget_set_usize( m_widget, m_width, m_height );
   }
 }
@@ -2310,11 +2324,11 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
 void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return;
-  
+
   if (orient == wxHORIZONTAL)
   {
     float fpos = (float)pos;
@@ -2330,14 +2344,14 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
     if (fabs(fpos-m_vAdjust->value) < 0.2) return;
     m_vAdjust->value = fpos;
   }
-  
+
   if (!m_isScrolling)
   {
     if (m_wxwindow->window)
-    {  
+    {
       if (orient == wxHORIZONTAL)
         gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "value_changed" );
-      else  
+      else
         gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "value_changed" );
     }
   }
@@ -2346,9 +2360,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
 int wxWindow::GetScrollThumb( int orient ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return 0;
 
   if (orient == wxHORIZONTAL)
@@ -2360,9 +2374,9 @@ int wxWindow::GetScrollThumb( int orient ) const
 int wxWindow::GetScrollPos( int orient ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return 0;
 
   if (orient == wxHORIZONTAL)
@@ -2374,9 +2388,9 @@ int wxWindow::GetScrollPos( int orient ) const
 int wxWindow::GetScrollRange( int orient ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return 0;
 
   if (orient == wxHORIZONTAL)
@@ -2388,15 +2402,15 @@ int wxWindow::GetScrollRange( int orient ) const
 void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return;
 
     int cw = 0;
     int ch = 0;
     GetClientSize( &cw, &ch );
-    
+
     int w = cw - abs(dx);
     int h = ch - abs(dy);
     if ((h < 0) || (w < 0))
@@ -2414,13 +2428,13 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     if (dy > 0) d_y = dy;
     gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
       m_wxwindow->window, s_x, s_y, w, h );
-      
+
     wxRect rect;
     if (dx < 0) rect.x = cw+dx; else rect.x = 0;
     if (dy < 0) rect.y = ch+dy; else rect.y = 0;
     if (dy != 0) rect.width = cw; else rect.width = abs(dx);
     if (dx != 0) rect.height = ch; else rect.height = abs(dy);
-  
+
     Refresh( TRUE, &rect );
 }
 
@@ -2584,7 +2598,7 @@ bool wxWindow::Layout(void)
     GetConstraints()->width.SetValue(w);
     GetConstraints()->height.SetValue(h);
   }
-  
+
   // If top level (one sizer), evaluate the sizer's constraints.
   if (GetSizer())
   {
@@ -2625,7 +2639,7 @@ bool wxWindow::LayoutPhase1(int *noChanges)
 bool wxWindow::LayoutPhase2(int *noChanges)
 {
   *noChanges = 0;
-  
+
   // Layout children
   DoPhase(1);
   DoPhase(2);
@@ -2766,7 +2780,7 @@ void wxWindow::TransformSizerToActual(int *x, int *y) const
   if (!m_sizerParent || m_sizerParent->IsKindOf(CLASSINFO(wxDialog)) ||
          m_sizerParent->IsKindOf(CLASSINFO(wxFrame)) )
     return;
-    
+
   int xp, yp;
   m_sizerParent->GetPosition(&xp, &yp);
   m_sizerParent->TransformSizerToActual(&xp, &yp);
diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp
index d2acce935a..501e625977 100644
--- a/src/gtk1/app.cpp
+++ b/src/gtk1/app.cpp
@@ -25,7 +25,7 @@
 
 #include "unistd.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
@@ -243,7 +243,7 @@ void wxApp::CommonInit(void)
 {
 
 /*
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
   (void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
 #endif
 */
@@ -262,7 +262,7 @@ void wxApp::CommonInit(void)
   wxInitializeResourceSystem();
 
   // For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData();
   wxThePrintPaperDatabase = new wxPrintPaperDatabase;
   wxThePrintPaperDatabase->CreateDatabase();
@@ -310,7 +310,7 @@ int wxEntry( int argc, char *argv[] )
 
   wxClassInfo::InitializeClasses();
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
   streambuf* sBuf = new wxDebugStreamBuf;
   ostream* oStr = new ostream(sBuf) ;
@@ -352,7 +352,7 @@ int wxEntry( int argc, char *argv[] )
   
   gtk_init( &argc, &argv );
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   gdk_imlib_init();
 
@@ -393,7 +393,7 @@ int wxEntry( int argc, char *argv[] )
   
   delete[] wxBuffer;
   
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
   
   if (wxDebugContext::CountObjectsLeft() > 0)
   {
diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp
index e000d6ab3f..07519ea19f 100644
--- a/src/gtk1/bitmap.cpp
+++ b/src/gtk1/bitmap.cpp
@@ -16,7 +16,7 @@
 #include "wx/icon.h"
 #include "gdk/gdkprivate.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
 #include "../gdk_imlib/gdk_imlib.h"
 #include "gdk/gdkx.h"        // GDK_DISPLAY
@@ -50,7 +50,7 @@ wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
 
 wxMask::~wxMask(void)
 {
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   // do not delete the mask, gdk_imlib does it for you
 #else
   if (m_bitmap) gdk_bitmap_unref( m_bitmap );
@@ -80,7 +80,7 @@ class wxBitmapRefData: public wxObjectRefData
     int             m_width;
     int             m_height;
     int             m_bpp;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
     GdkImlibImage  *m_image;
 #endif
     wxPalette      *m_palette;
@@ -95,14 +95,14 @@ wxBitmapRefData::wxBitmapRefData(void)
   m_height = 0;
   m_bpp = 0;
   m_palette = (wxPalette *) NULL;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   m_image = (GdkImlibImage *) NULL;
 #endif
 }
 
 wxBitmapRefData::~wxBitmapRefData(void)
 {
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   if (m_pixmap) gdk_imlib_free_pixmap( m_pixmap );
   if (m_image) gdk_imlib_kill_image( m_image );
 #else
@@ -141,7 +141,7 @@ wxBitmap::wxBitmap( char **bits )
 {
   m_refData = new wxBitmapRefData();
 
-#ifndef USE_GDK_IMLIB
+#ifndef wxUSE_GDK_IMLIB
 
   GdkBitmap *mask = NULL;
   
@@ -323,7 +323,7 @@ void wxBitmap::Resize( int height, int width )
     return;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   
   if (M_BMPDATA->m_bitmap)
   {
@@ -360,7 +360,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
     return FALSE;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   if (M_BMPDATA->m_bitmap)
   {
@@ -383,7 +383,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
 
 bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
 {
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   UnRef();
   m_refData = new wxBitmapRefData();
@@ -465,7 +465,7 @@ void wxBitmap::RecreateImage(void)
     return;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   DestroyImage();
   
@@ -520,7 +520,7 @@ void wxBitmap::Render(void)
     return;
   }
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   if (!M_BMPDATA->m_image) RecreateImage();
   
diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp
index 5b465727f8..13f981ebf2 100644
--- a/src/gtk1/colour.cpp
+++ b/src/gtk1/colour.cpp
@@ -15,7 +15,7 @@
 
 #include "wx/gdicmn.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
@@ -208,7 +208,7 @@ void wxColour::CalcPixel( GdkColormap *cmap )
   if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
   M_COLDATA->FreeColour();
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 
   int r = M_COLDATA->m_color.red >> SHIFT;
   int g = M_COLDATA->m_color.green >> SHIFT;
diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp
index a03c6f6f1f..96bce38d00 100644
--- a/src/gtk1/data.cpp
+++ b/src/gtk1/data.cpp
@@ -168,7 +168,7 @@ const char *wxUserResourceStr = "TEXT";
 #endif
 
 
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
 /*
  * For wxWindows to be made into a dynamic library (e.g. Sun),
  * all IMPLEMENT_... macros must be in one place.
@@ -192,13 +192,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
 #include "wx/choice.h"
 IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 #include "wx/clipbrd.h"
 IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
 #endif
 
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
 #include "wx/combobox.h"
 IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
 #endif
@@ -238,7 +238,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintData, wxObject)
 #include "wx/colordlg.h"
 #include "wx/fontdlg.h"
 
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include "wx/generic/colordlg.h"
 #include "wx/generic/fontdlg.h"
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
@@ -273,7 +273,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxIntPoint, wxObject)
 #endif
 */
 
-#if defined(wx_x) || (defined(wx_msw) && USE_PORTABLE_FONTS_IN_MSW)
+#if defined(wx_x) || (defined(wx_msw) && wxUSE_PORTABLE_FONTS_IN_MSW)
 IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
 #endif
 
@@ -289,7 +289,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNode, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 #include "wx/print.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
 IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
@@ -306,7 +306,7 @@ IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
 IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
 #endif
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 #include "wx/postscrp.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
@@ -315,7 +315,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
@@ -352,12 +352,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxList)
 #include "wx/process.h"
 IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 #include "wx/date.h"
 IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
 #endif
 
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
 #include "wx/docview.h"
 //IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
@@ -366,7 +366,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
 IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
 IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
 #endif
 IMPLEMENT_CLASS(wxCommand, wxObject)
@@ -374,7 +374,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
 #endif
 
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
 #include "wx/layout.h"
 IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
@@ -382,7 +382,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSizer, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
 #endif
 
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
 #include "wx/tbarbase.h"
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
@@ -453,7 +453,7 @@ BEGIN_EVENT_TABLE(wxStatusBar, wxWindow)
     EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
 END_EVENT_TABLE()
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 #include "wx/time.h"
 IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
 #endif
@@ -491,7 +491,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxBitmapHandler)
 #include "wx/statbox.h"
 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
 
-#if USE_IPC
+#if wxUSE_IPC
 #include "wx/dde.h"
 IMPLEMENT_ABSTRACT_CLASS(wxDDEObject, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxDDEObject)
@@ -516,7 +516,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
 
-#if USE_METAFILE
+#if wxUSE_METAFILE
 #include "wx/metafile.h"
 IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
@@ -568,7 +568,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
 #include "wx/dirdlg.h"
 #include "wx/choicdlg.h"
 
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include "wx/generic/msgdlgg.h"
 IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
 #endif
@@ -582,7 +582,7 @@ IMPLEMENT_CLASS(wxDirDialog, wxDialog)
 IMPLEMENT_CLASS(wxMessageDialog)
 #endif
 
-#if USE_GAUGE
+#if wxUSE_GAUGE
 #ifdef wx_motif
 #include "../../contrib/xmgauge/gauge.h"
 #endif
@@ -705,7 +705,7 @@ BEGIN_EVENT_TABLE(wxControl, wxWindow)
   EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
 END_EVENT_TABLE()
 
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
 BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
   EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
   EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
diff --git a/src/gtk1/dcmemory.cpp b/src/gtk1/dcmemory.cpp
index 4b19f89c29..84a6e144e7 100644
--- a/src/gtk1/dcmemory.cpp
+++ b/src/gtk1/dcmemory.cpp
@@ -14,7 +14,7 @@
 
 #include "wx/dcmemory.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
@@ -28,7 +28,7 @@ wxMemoryDC::wxMemoryDC(void)
 {
   m_ok = FALSE;
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   m_cmap = gdk_imlib_get_colormap();
 #else
   m_cmap = gdk_colormap_get_system();
@@ -39,7 +39,7 @@ wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
 {
   m_ok = FALSE;
   
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
   m_cmap = gdk_imlib_get_colormap();
 #else
   m_cmap = gdk_colormap_get_system();
diff --git a/src/gtk1/palette.cpp b/src/gtk1/palette.cpp
index 5657c4355e..9f49402c61 100644
--- a/src/gtk1/palette.cpp
+++ b/src/gtk1/palette.cpp
@@ -94,13 +94,22 @@ bool wxPalette::Ok(void) const
 
 bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
 {
+  wxFAIL_MSG("not implemented");
+
+  return FALSE;
 };
 
 int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const
 {
+  wxFAIL_MSG("not implemented");
+
+  return 0;
 };
 
 bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const
 {
+  wxFAIL_MSG("not implemented");
+
+  return 0;
 };
 
diff --git a/src/gtk1/treectrl.cpp b/src/gtk1/treectrl.cpp
index 3ae18cf4f6..c31078e3cd 100644
--- a/src/gtk1/treectrl.cpp
+++ b/src/gtk1/treectrl.cpp
@@ -16,7 +16,7 @@
 #include "wx/settings.h"
 #include "wx/log.h"
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "../gdk_imlib/gdk_imlib.h"
 #endif
 
diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp
index e382126ada..a76a068ebd 100644
--- a/src/gtk1/window.cpp
+++ b/src/gtk1/window.cpp
@@ -43,12 +43,12 @@
    I have been asked several times about writing some documentation about
    the GTK port of wxWindows, especially its internal structures. Obviously,
    you cannot understand wxGTK without knowing a little about the GTK, but
-   some more information about what the wxWindow, which is the base class 
+   some more information about what the wxWindow, which is the base class
    for all other window classes, does seems required as well.
-   
+
    What does wxWindow do? It contains the common interface for the following
    jobs of its descentants:
-   
+
    1) Define the rudimentary behaviour common to all window classes, such as
    resizing, intercepting user input so as to make it possible to use these
    events for special purposes in a derived class, window names etc.
@@ -57,20 +57,20 @@
    class is allowed to contain children, which holds true for those window
    classes, which do not display a native GTK widget. To name them, these
    classes are wxPanel, wxScrolledWindow, wxDialog, wxFrame. The MDI frame-
-   work classes are a special case and are handled a bit differently from 
+   work classes are a special case and are handled a bit differently from
    the rest.
-   
+
    3) Provide the possibility to draw into a client area of a window. This,
    too, only holds true for classes that do not display a native GTK widget
    as above.
-   
+
    4) Provide the entire mechanism for scrolling widgets. This actaul inter-
    face for this is usually in wxScrolledWidget, but the GTK implementation
    is in this class.
-   
+
    5) A multitude of helper or extra methods for special purposes, such as
    Drag'n'Drop, managing validators etc.
-   
+
    Normally one might expect, that one wxWindows class would always contain
    one GTK widget. Under GTK, there is no such allround widget that has all
    the functionality. Moreover, the GTK defines a client area as a different
@@ -81,7 +81,7 @@
    represent a client area in the sense of wxWindows capable to do the jobs
    2), 3) and 4). I have written this class and it resides in win_gtk.c of
    this directory.
-   
+
    All windows must have a widget, with which they interact with other under-
    lying GTK widget. It is this widget, e.g. that has to be resized etc and
    thw wxWindow class has a member variable called m_widget which holds a
@@ -95,14 +95,14 @@
    and all other widgets must be children of this widget on the GTK level.
    The top-most widget, which also represents the client area, must be in
    the m_wxwindow field and must be of the type GtkMyFixed.
-   
+
    As I said, the window classes that display a GTK native widget only have
    one widget, so in the case of e.g. the wxButton class m_widget holds a
    pointer to a GtkButton widget. But windows with client areas (for drawing
    and children) have a m_widget field that is a pointer to a GtkScrolled-
    Window and a m_wxwindow field that is pointer to a GtkMyFixed and this
    one is (in the GTK sense) a child of the GtkScrolledWindow.
-   
+
    If the m_wxwindow field is set, then all input to this widget is inter-
    cepted and sent to the wxWindows class. If not, all input to the widget
    that gets pointed to by m_widget gets intercepted and sent to the class.
@@ -116,22 +116,26 @@
 extern wxList wxPendingDelete;
 extern wxList wxTopLevelWindows;
 extern bool   g_blockEventsOnDrag;
-       bool   g_capturing = FALSE;
+static bool   g_capturing = FALSE;
+
+// hack: we need something to pass to gtk_menu_popup, so we store the time of
+// the last click here
+static guint32 gs_timeLastClick = 0;
 
 //-----------------------------------------------------------------------------
 // "expose_event" (of m_wxwindow, not of m_widget)
 //-----------------------------------------------------------------------------
 
 static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->HasVMT()) return;
   if (g_blockEventsOnDrag) return;
-  
+
   win->m_updateRegion.Union( gdk_event->area.x,
                              gdk_event->area.y,
-    	                     gdk_event->area.width,
+                             gdk_event->area.width,
                              gdk_event->area.height );
-           
+
   if (gdk_event->count > 0) return;
 
 /*
@@ -144,7 +148,7 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
   wxPaintEvent event( win->GetId() );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
-  
+
   win->m_updateRegion.Clear();
 }
 
@@ -153,16 +157,16 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
 //-----------------------------------------------------------------------------
 
 static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win )
-{ 
+{
   if (!win->HasVMT()) return;
   if (g_blockEventsOnDrag) return;
-  
+
   win->m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
-           
+
   wxPaintEvent event( win->GetId() );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
-  
+
   win->m_updateRegion.Clear();
 }
 
@@ -171,7 +175,7 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
 //-----------------------------------------------------------------------------
 
 static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->HasVMT()) return FALSE;
   if (g_blockEventsOnDrag) return FALSE;
 
@@ -255,13 +259,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
     case GDK_F12:           key_code = WXK_F12;         break;
     default:
     {
-      if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF)) 
+      if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
         key_code = gdk_event->keyval;
     }
   }
 
   if (!key_code) return FALSE;
-  
+
   wxKeyEvent event( wxEVT_CHAR );
   event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
   event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
@@ -271,31 +275,31 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
   event.m_x = 0;
   event.m_y = 0;
   event.SetEventObject( win );
-  
+
   bool ret = win->GetEventHandler()->ProcessEvent( event );
-  
+
   if (!ret)
   {
     wxWindow *ancestor = win;
     while (ancestor)
-    {    
+    {
       int command = ancestor->GetAcceleratorTable()->GetCommand( event );
       if (command != -1)
       {
         wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
         ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
-	break;
+    break;
       }
       ancestor = ancestor->GetParent();
     }
   }
-  
+
   if (ret)
   {
-    if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF)) 
+    if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
       gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
   }
-  
+
   return ret;
 }
 
@@ -306,7 +310,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
 static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
 {
   if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
 
   if (win->m_wxwindow)
@@ -314,17 +318,17 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
     if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) )
     {
       gtk_widget_grab_focus (win->m_wxwindow);
-      
+
 /*
       printf( "GrabFocus from " );
       if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
         printf( win->GetClassInfo()->GetClassName() );
       printf( ".\n" );
 */
-      
+
     }
   }
-    
+
   if (!win->HasVMT()) return TRUE;
 
 /*
@@ -335,7 +339,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 */
 
   wxEventType event_type = wxEVT_LEFT_DOWN;
-  
+
   if (gdk_event->button == 1)
   {
     switch (gdk_event->type)
@@ -363,7 +367,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
       default:  break;
     }
   }
-  
+
   wxMouseEvent event( event_type );
   event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
   event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
@@ -372,13 +376,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
   event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
   event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
   event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-  
+
   event.m_x = (long)gdk_event->x;
   event.m_y = (long)gdk_event->y;
-  
+
   // Some control don't have their own X window and thus cannot get
-  // any events. 
-  
+  // any events.
+
   if (!g_capturing)
   {
     wxNode *node = win->GetChildren()->First();
@@ -387,8 +391,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
       wxWindow *child = (wxWindow*)node->Data();
       if ((child->m_x <= event.m_x) &&
           (child->m_y <= event.m_y) &&
-	  (child->m_x+child->m_width  >= event.m_x) &&
-	  (child->m_y+child->m_height >= event.m_y))
+      (child->m_x+child->m_width  >= event.m_x) &&
+      (child->m_y+child->m_height >= event.m_y))
       {
         win = child;
         event.m_x -= child->m_x;
@@ -398,12 +402,14 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
       node = node->Next();
     }
   }
-  
+
   event.SetEventObject( win );
-  
+
+  gs_timeLastClick = gdk_event->time;
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
-  
+
   return TRUE;
 }
 
@@ -412,22 +418,22 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 //-----------------------------------------------------------------------------
 
 static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
 
   if (!win->HasVMT()) return TRUE;
- 
+
 /*
   printf( "OnButtonRelease from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   wxEventType event_type = wxEVT_NULL;
-  
+
   switch (gdk_event->button)
   {
     case 1: event_type = wxEVT_LEFT_UP; break;
@@ -445,10 +451,10 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
   event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
   event.m_x = (long)gdk_event->x;
   event.m_y = (long)gdk_event->y;
-  
+
   // Some control don't have their own X window and thus cannot get
-  // any events. 
-  
+  // any events.
+
   if (!g_capturing)
   {
     wxNode *node = win->GetChildren()->First();
@@ -457,8 +463,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
       wxWindow *child = (wxWindow*)node->Data();
       if ((child->m_x <= event.m_x) &&
           (child->m_y <= event.m_y) &&
-	  (child->m_x+child->m_width  >= event.m_x) &&
-	  (child->m_y+child->m_height >= event.m_y))
+      (child->m_x+child->m_width  >= event.m_x) &&
+      (child->m_y+child->m_height >= event.m_y))
       {
         win = child;
         event.m_x -= child->m_x;
@@ -468,12 +474,12 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
       node = node->Next();
     }
   }
-  
+
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
-  
+
   return TRUE;
 }
 
@@ -482,20 +488,20 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
 //-----------------------------------------------------------------------------
 
 static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
-{ 
+{
   if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
 
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnMotion from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   wxMouseEvent event( wxEVT_MOTION );
   event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
   event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
@@ -504,13 +510,13 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
   event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
   event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
   event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-  
+
   event.m_x = (long)gdk_event->x;
   event.m_y = (long)gdk_event->y;
-  
+
   // Some control don't have their own X window and thus cannot get
-  // any events. 
-  
+  // any events.
+
   if (!g_capturing)
   {
     wxNode *node = win->GetChildren()->First();
@@ -519,8 +525,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
       wxWindow *child = (wxWindow*)node->Data();
       if ((child->m_x <= event.m_x) &&
           (child->m_y <= event.m_y) &&
-	  (child->m_x+child->m_width  >= event.m_x) &&
-	  (child->m_y+child->m_height >= event.m_y))
+      (child->m_x+child->m_width  >= event.m_x) &&
+      (child->m_y+child->m_height >= event.m_y))
       {
         win = child;
         event.m_x -= child->m_x;
@@ -530,12 +536,12 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
       node = node->Next();
     }
   }
-  
+
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "motion_notify_event" );
-  
+
   return TRUE;
 }
 
@@ -551,7 +557,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(
     if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
     {
       GTK_WIDGET_SET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
-/*      
+/*
       printf( "SetFocus flag from " );
       if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
         printf( win->GetClassInfo()->GetClassName() );
@@ -559,9 +565,9 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(
 */
     }
   }
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnSetFocus from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -570,13 +576,13 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(
   printf( WXSTRINGCAST win->GetLabel() );
   printf( ".\n" );
 */
-  
+
   wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
-  
+
   return TRUE;
 }
 
@@ -592,19 +598,19 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
     if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
       GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
   }
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnKillFocus from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
 
@@ -618,30 +624,30 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED
 static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
 {
   if (widget->window != gdk_event->window) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnEnter from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if ((widget->window) && (win->m_cursor))
     gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
-    
+
   wxMouseEvent event( wxEVT_ENTER_WINDOW );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
-  
+
   return TRUE;
 }
-    
+
 //-----------------------------------------------------------------------------
 // "leave_notify_event"
 //-----------------------------------------------------------------------------
@@ -649,30 +655,30 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
 static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
 {
   if (widget->window != gdk_event->window) return TRUE;
-  
+
   if (g_blockEventsOnDrag) return TRUE;
-  
+
   if (!win->HasVMT()) return TRUE;
-  
+
 /*
   printf( "OnLeave from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if ((widget->window) && (win->m_cursor))
     gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
-    
+
   wxMouseEvent event( wxEVT_LEAVE_WINDOW );
   event.SetEventObject( win );
-  
+
   if (win->GetEventHandler()->ProcessEvent( event ))
     gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
-  
+
   return TRUE;
 }
-    
+
 //-----------------------------------------------------------------------------
 // "value_changed" from m_vAdjust
 //-----------------------------------------------------------------------------
@@ -687,23 +693,23 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-  
+
   float diff = win->m_vAdjust->value - win->m_oldVerticalPos;
   if (fabs(diff) < 0.2) return;
-  
+
   wxEventType command = wxEVT_NULL;
-  
+
   float line_step = win->m_vAdjust->step_increment;
   float page_step = win->m_vAdjust->page_increment;
-  
+
   if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
   else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
   else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
   else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
   else command = wxEVT_SCROLL_THUMBTRACK;
-      
+
   int value = (int)(win->m_vAdjust->value+0.5);
 
   wxScrollEvent event( command, win->GetId(), value, wxVERTICAL );
@@ -716,26 +722,26 @@ static void gtk_window_vscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
 //-----------------------------------------------------------------------------
 
 static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{ 
+{
   if (g_blockEventsOnDrag) return;
-  
+
 /*
   printf( "OnHScroll from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-    
+
   float diff = win->m_hAdjust->value - win->m_oldHorizontalPos;
   if (fabs(diff) < 0.2) return;
-  
+
   wxEventType command = wxEVT_NULL;
-  
+
   float line_step = win->m_hAdjust->step_increment;
   float page_step = win->m_hAdjust->page_increment;
-  
+
   if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
   else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
   else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
@@ -743,7 +749,7 @@ static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *
   else command = wxEVT_SCROLL_THUMBTRACK;
 
   int value = (int)(win->m_hAdjust->value+0.5);
-      
+
   wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
@@ -763,9 +769,9 @@ static void gtk_window_vscroll_change_callback( GtkWidget *WXUNUSED(widget), wxW
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-  
+
   wxEventType command = wxEVT_SCROLL_THUMBTRACK;
   int value = (int)(win->m_vAdjust->value+0.5);
 
@@ -779,21 +785,21 @@ static void gtk_window_vscroll_change_callback( GtkWidget *WXUNUSED(widget), wxW
 //-----------------------------------------------------------------------------
 
 static void gtk_window_hscroll_change_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{ 
+{
   if (g_blockEventsOnDrag) return;
-  
+
 /*
   printf( "OnHScroll change from " );
   if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
     printf( win->GetClassInfo()->GetClassName() );
   printf( ".\n" );
 */
-  
+
   if (!win->HasVMT()) return;
-    
+
   wxEventType command = wxEVT_SCROLL_THUMBTRACK;
   int value = (int)(win->m_hAdjust->value+0.5);
-      
+
   wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
   event.SetEventObject( win );
   win->GetEventHandler()->ProcessEvent( event );
@@ -808,7 +814,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget, GdkEventButto
   if (gdk_event->window != widget->slider) return FALSE;
 
   win->m_isScrolling = TRUE;
-  
+
   return FALSE;
 }
 
@@ -821,14 +827,14 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget, GdkEventBut
   if (gdk_event->window != widget->slider) return FALSE;
 
   GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(win->m_widget);
- 
+
   if (widget == GTK_RANGE(s_window->vscrollbar))
     gtk_signal_emit_by_name( GTK_OBJECT(win->m_hAdjust), "value_changed" );
-  else  
+  else
     gtk_signal_emit_by_name( GTK_OBJECT(win->m_vAdjust), "value_changed" );
-      
+
   win->m_isScrolling = FALSE;
-  
+
   return FALSE;
 }
 
@@ -839,7 +845,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget, GdkEventBut
 static void gtk_window_drop_callback( GtkWidget *widget, GdkEvent *event, wxWindow *win )
 {
   if (!win->HasVMT()) return;
-  
+
   if (win->GetDropTarget())
   {
     int x = 0;
@@ -847,7 +853,7 @@ static void gtk_window_drop_callback( GtkWidget *widget, GdkEvent *event, wxWind
     gdk_window_get_pointer( widget->window, &x, &y, (GdkModifierType *) NULL );
     win->GetDropTarget()->Drop( event, x, y );
   }
-  
+
 /*
   g_free (event->dropdataavailable.data);
   g_free (event->dropdataavailable.data_type);
@@ -917,16 +923,16 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   m_isShown = FALSE;
   m_isEnabled = TRUE;
   m_needParent = TRUE;
-  
+
   m_cursor = (wxCursor *) NULL;
-  
+
   PreCreation( parent, id, pos, size, style, name );
-  
+
   m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
   m_hasScrolling = TRUE;
-  
+
   GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
- 
+
   gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
           (GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
 
@@ -941,27 +947,27 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
 
   GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
   scroll_class->scrollbar_spacing = 0;
-  
+
   gtk_scrolled_window_set_policy( s_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-    
+
   m_oldHorizontalPos = 0.0;
   m_oldVerticalPos = 0.0;
- 
+
   m_hAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->hscrollbar) );
   m_vAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->vscrollbar) );
-  
+
   gtk_signal_connect( GTK_OBJECT(m_hAdjust), "value_changed",
           (GtkSignalFunc) gtk_window_hscroll_callback, (gpointer) this );
   gtk_signal_connect( GTK_OBJECT(m_vAdjust), "value_changed",
           (GtkSignalFunc) gtk_window_vscroll_callback, (gpointer) this );
-          
+
   gtk_signal_connect( GTK_OBJECT(m_hAdjust), "changed",
           (GtkSignalFunc) gtk_window_hscroll_change_callback, (gpointer) this );
   gtk_signal_connect(GTK_OBJECT(m_vAdjust), "changed",
           (GtkSignalFunc) gtk_window_vscroll_change_callback, (gpointer) this );
-  
+
   GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-  
+
   if (m_windowStyle & wxRAISED_BORDER)
   {
     gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_OUT );
@@ -974,11 +980,11 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   {
     gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE );
   }
-    
+
   m_wxwindow = gtk_myfixed_new();
-  
+
   if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-    
+
   if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
     GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
   else
@@ -989,8 +995,8 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   // shut the viewport up
   gtk_viewport_set_hadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
   gtk_viewport_set_vadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
-  
-  // I _really_ don't want scrollbars in the beginning    
+
+  // I _really_ don't want scrollbars in the beginning
   m_vAdjust->lower = 0.0;
   m_vAdjust->upper = 1.0;
   m_vAdjust->value = 0.0;
@@ -1005,31 +1011,31 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   m_hAdjust->page_increment = 1.0;
   m_hAdjust->page_size = 5.0;
   gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
-  
+
   gtk_widget_show( m_wxwindow );
-  
+
   PostCreation();
-  
+
   Show( TRUE );
 
-  return TRUE;  
+  return TRUE;
 }
 
 wxWindow::~wxWindow(void)
 {
   m_hasVMT = FALSE;
-  
+
   if (m_pDropTarget) delete m_pDropTarget;
-  
+
   if (m_parent) m_parent->RemoveChild( this );
   if (m_widget) Show( FALSE );
 
   DestroyChildren();
-  
+
   if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
-    
+
   if (m_widget) gtk_widget_destroy( m_widget );
-  
+
   wxDELETE(m_cursor);
 
   DeleteRelatedConstraints();
@@ -1058,7 +1064,7 @@ wxWindow::~wxWindow(void)
   // wxWindow::LoadNativeDialog but we weren't a dialog
   // class
   wxTopLevelWindows.DeleteObject(this);
-    
+
   if (m_windowValidator) delete m_windowValidator;
 }
 
@@ -1110,28 +1116,28 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
 void wxWindow::PostCreation(void)
 {
   if (m_parent) m_parent->AddChild( this );
-  
+
   if (m_wxwindow)
   {
-    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event", 
+    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
       GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
-      
-    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", 
+
+    gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
       GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
   }
-  
+
   ConnectWidget( GetConnectWidget() );
-  
+
   if (m_widget && m_parent) gtk_widget_realize( m_widget );
-  
+
   if (m_wxwindow)
   {
     gtk_widget_realize( m_wxwindow );
     gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
   }
-  
+
   SetCursor( *wxSTANDARD_CURSOR );
-  
+
   m_hasVMT = TRUE;
 }
 
@@ -1142,23 +1148,23 @@ void wxWindow::ConnectWidget( GtkWidget *widget )
 
   gtk_signal_connect( GTK_OBJECT(widget), "button_press_event",
     GTK_SIGNAL_FUNC(gtk_window_button_press_callback), (gpointer)this );
-    
+
   gtk_signal_connect( GTK_OBJECT(widget), "button_release_event",
     GTK_SIGNAL_FUNC(gtk_window_button_release_callback), (gpointer)this );
-    
+
   gtk_signal_connect( GTK_OBJECT(widget), "motion_notify_event",
     GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
-    
-  gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event", 
+
+  gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
     GTK_SIGNAL_FUNC(gtk_window_focus_in_callback), (gpointer)this );
 
-  gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event", 
+  gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event",
     GTK_SIGNAL_FUNC(gtk_window_focus_out_callback), (gpointer)this );
 
-  gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event", 
+  gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event",
     GTK_SIGNAL_FUNC(gtk_window_enter_callback), (gpointer)this );
-    
-  gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event", 
+
+  gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
     GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
 }
 
@@ -1170,7 +1176,7 @@ bool wxWindow::HasVMT(void)
 bool wxWindow::Close( bool force )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
   event.SetEventObject(this);
   event.SetForce(force);
@@ -1181,7 +1187,7 @@ bool wxWindow::Close( bool force )
 bool wxWindow::Destroy(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_hasVMT = FALSE;
   delete this;
   return TRUE;
@@ -1189,13 +1195,13 @@ bool wxWindow::Destroy(void)
 
 bool wxWindow::DestroyChildren(void)
 {
-  if (GetChildren()) 
+  if (GetChildren())
   {
     wxNode *node;
-    while ((node = GetChildren()->First()) != (wxNode *)NULL) 
+    while ((node = GetChildren()->First()) != (wxNode *)NULL)
     {
       wxWindow *child;
-      if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) 
+      if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
       {
         delete child;
         if (GetChildren()->Member(child)) delete node;
@@ -1211,7 +1217,7 @@ void wxWindow::PrepareDC( wxDC &WXUNUSED(dc) )
 }
 
 void wxWindow::ImplementSetSize(void)
-{ 
+{
   if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
   if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
   if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
@@ -1227,31 +1233,31 @@ void wxWindow::ImplementSetPosition(void)
       gtk_widget_set_uposition( m_widget, m_x, m_y );
     return;
   }
-  
+
   if (!m_parent)
   {
     wxFAIL_MSG( "wxWindow::SetSize error.\n" );
     return;
   }
-  
+
   if ((m_parent) && (m_parent->m_wxwindow))
     gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y );
-    
-  // Don't do anything for children of wxNotebook and wxMDIChildFrame   
+
+  // Don't do anything for children of wxNotebook and wxMDIChildFrame
 }
 
 void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_resizing) return; // I don't like recursions
   m_resizing = TRUE;
-  
+
   int newX = x;
   int newY = y;
   int newW = width;
   int newH = height;
-  
+
   if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING)
   {
     if (newX == -1) newX = m_x;
@@ -1259,17 +1265,17 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
     if (newW == -1) newW = m_width;
     if (newH == -1) newH = m_height;
   }
-  
+
   if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH)
   {
     if (newW == -1) newW = 80;
   }
-  
+
   if ((sizeFlags & wxSIZE_AUTO_HEIGHT) == wxSIZE_AUTO_HEIGHT)
   {
     if (newH == -1) newH = 26;
   }
-  
+
   if ((m_x != newX) || (m_y != newY) || (!m_sizeSet))
   {
     m_x = newX;
@@ -1283,11 +1289,11 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
     ImplementSetSize();
   }
   m_sizeSet = TRUE;
-  
+
   wxSizeEvent event( wxSize(m_width,m_height), GetId() );
   event.SetEventObject( this );
   ProcessEvent( event );
-  
+
   m_resizing = FALSE;
 }
 
@@ -1304,7 +1310,7 @@ void wxWindow::Move( int x, int y )
 void wxWindow::GetSize( int *width, int *height ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (width) (*width) = m_width;
   if (height) (*height) = m_height;
 }
@@ -1312,7 +1318,7 @@ void wxWindow::GetSize( int *width, int *height ) const
 void wxWindow::SetClientSize( int width, int height )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_wxwindow)
   {
     SetSize( width, height );
@@ -1321,14 +1327,14 @@ void wxWindow::SetClientSize( int width, int height )
   {
     int dw = 0;
     int dh = 0;
-    
+
     if (!m_hasScrolling)
     {
 /*
       do we have sunken dialogs ?
-      
+
       GtkStyleClass *window_class = m_wxwindow->style->klass;
-    
+
       dw += 2 * window_class->xthickness;
       dh += 2 * window_class->ythickness;
 */
@@ -1337,33 +1343,33 @@ void wxWindow::SetClientSize( int width, int height )
     {
       GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
       GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-    
+
       GtkWidget *viewport = scroll_window->viewport;
       GtkStyleClass *viewport_class = viewport->style->klass;
-    
+
       GtkWidget *hscrollbar = scroll_window->hscrollbar;
       GtkWidget *vscrollbar = scroll_window->vscrollbar;
-    
+
       if ((m_windowStyle & wxRAISED_BORDER) ||
           (m_windowStyle & wxSUNKEN_BORDER))
       {
         dw += 2 * viewport_class->xthickness;
         dh += 2 * viewport_class->ythickness;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(vscrollbar))
       {
         dw += vscrollbar->allocation.width;
         dw += scroll_class->scrollbar_spacing;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(hscrollbar))
       {
         dh += hscrollbar->allocation.height;
         dw += scroll_class->scrollbar_spacing;
       }
     }
-    
+
     SetSize( width+dw, height+dh );
   }
 }
@@ -1371,7 +1377,7 @@ void wxWindow::SetClientSize( int width, int height )
 void wxWindow::GetClientSize( int *width, int *height ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_wxwindow)
   {
     if (width) (*width) = m_width;
@@ -1381,14 +1387,14 @@ void wxWindow::GetClientSize( int *width, int *height ) const
   {
     int dw = 0;
     int dh = 0;
-    
+
     if (!m_hasScrolling)
     {
 /*
       do we have sunken dialogs ?
-      
+
       GtkStyleClass *window_class = m_wxwindow->style->klass;
-    
+
       dw += 2 * window_class->xthickness;
       dh += 2 * window_class->ythickness;
 */
@@ -1397,27 +1403,27 @@ void wxWindow::GetClientSize( int *width, int *height ) const
     {
       GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
       GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-    
+
       GtkWidget *viewport = scroll_window->viewport;
       GtkStyleClass *viewport_class = viewport->style->klass;
-    
+
       GtkWidget *hscrollbar = scroll_window->hscrollbar;
       GtkWidget *vscrollbar = scroll_window->vscrollbar;
-    
+
       if ((m_windowStyle & wxRAISED_BORDER) ||
           (m_windowStyle & wxSUNKEN_BORDER))
       {
         dw += 2 * viewport_class->xthickness;
         dh += 2 * viewport_class->ythickness;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(vscrollbar))
       {
 //        dw += vscrollbar->allocation.width;
         dw += 15;                               // range.slider_width = 11 + 2*2pts edge
         dw += scroll_class->scrollbar_spacing;
       }
-    
+
       if (GTK_WIDGET_VISIBLE(hscrollbar))
       {
 //        dh += hscrollbar->allocation.height;
@@ -1425,7 +1431,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
         dh += scroll_class->scrollbar_spacing;
       }
     }
-    
+
     if (width) (*width) = m_width - dw;
     if (height) (*height) = m_height - dh;
   }
@@ -1434,7 +1440,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
 void wxWindow::GetPosition( int *x, int *y ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (x) (*x) = m_x;
   if (y) (*y) = m_y;
 }
@@ -1442,61 +1448,61 @@ void wxWindow::GetPosition( int *x, int *y ) const
 void wxWindow::ClientToScreen( int *x, int *y )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GdkWindow *source = (GdkWindow *) NULL;
   if (m_wxwindow)
     source = m_wxwindow->window;
   else
     source = m_widget->window;
-    
+
   int org_x = 0;
   int org_y = 0;
   gdk_window_get_origin( source, &org_x, &org_y );
 
   if (!m_wxwindow)
-  {  
+  {
     if (GTK_WIDGET_NO_WINDOW (m_widget))
     {
       org_x += m_widget->allocation.x;
       org_y += m_widget->allocation.y;
     }
   }
-  
-  if (x) *x += org_x;  
-  if (y) *y += org_y;  
+
+  if (x) *x += org_x;
+  if (y) *y += org_y;
 }
 
 void wxWindow::ScreenToClient( int *x, int *y )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GdkWindow *source = (GdkWindow *) NULL;
   if (m_wxwindow)
     source = m_wxwindow->window;
   else
     source = m_widget->window;
-    
+
   int org_x = 0;
   int org_y = 0;
   gdk_window_get_origin( source, &org_x, &org_y );
 
   if (!m_wxwindow)
-  {  
+  {
     if (GTK_WIDGET_NO_WINDOW (m_widget))
     {
       org_x += m_widget->allocation.x;
       org_y += m_widget->allocation.y;
     }
   }
-  
-  if (x) *x -= org_x;  
-  if (y) *y -= org_y;  
+
+  if (x) *x -= org_x;
+  if (y) *y -= org_y;
 }
 
 void wxWindow::Centre( int direction )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (IS_KIND_OF(this,wxDialog) || IS_KIND_OF(this,wxFrame))
   {
     if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (gdk_screen_width () - m_width) / 2;
@@ -1520,7 +1526,7 @@ void wxWindow::Centre( int direction )
 void wxWindow::Fit(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   int maxX = 0;
   int maxY = 0;
   wxNode *node = GetChildren()->First();
@@ -1543,7 +1549,7 @@ void wxWindow::Fit(void)
 void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_minWidth = minW;
   m_minHeight = minH;
   m_maxWidth = maxW;
@@ -1558,19 +1564,19 @@ void wxWindow::OnSize( wxSizeEvent &WXUNUSED(event) )
 bool wxWindow::Show( bool show )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (show)
     gtk_widget_show( m_widget );
   else
     gtk_widget_hide( m_widget );
-  m_isShown = show;  
+  m_isShown = show;
   return TRUE;
 }
 
 void wxWindow::Enable( bool enable )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_isEnabled = enable;
   gtk_widget_set_sensitive( m_widget, enable );
   if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
@@ -1579,13 +1585,13 @@ void wxWindow::Enable( bool enable )
 int wxWindow::GetCharHeight(void) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_font.Ok())
   {
     wxFAIL_MSG( "invalid font" );
     return -1;
   }
-  
+
   GdkFont *font = m_font.GetInternalFont( 1.0 );
   return font->ascent + font->descent;
 }
@@ -1593,13 +1599,13 @@ int wxWindow::GetCharHeight(void) const
 int wxWindow::GetCharWidth(void) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (!m_font.Ok())
   {
     wxFAIL_MSG( "invalid font" );
     return -1;
   }
-  
+
   GdkFont *font = m_font.GetInternalFont( 1.0 );
   return gdk_string_width( font, "H" );
 }
@@ -1608,17 +1614,17 @@ void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
   int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxFont fontToUse = m_font;
   if (theFont) fontToUse = *theFont;
-  
+
   if (!fontToUse.Ok())
   {
     wxFAIL_MSG( "invalid font" );
     return;
   }
   wxASSERT_MSG( (m_font.Ok()), "invalid font" );
-  
+
   GdkFont *font = fontToUse.GetInternalFont( 1.0 );
   if (x) (*x) = gdk_string_width( font, string );
   if (y) (*y) = font->ascent + font->descent;
@@ -1647,7 +1653,7 @@ void wxWindow::MakeModal( bool modal )
 void wxWindow::SetFocus(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GtkWidget *connect_widget = GetConnectWidget();
   if (connect_widget)
   {
@@ -1669,68 +1675,68 @@ void wxWindow::AddChild( wxWindow *child )
   wxASSERT_MSG( (m_wxwindow != NULL), "window need client area" );
   wxASSERT_MSG( (child != NULL), "invalid child" );
   wxASSERT_MSG( (child->m_widget != NULL), "invalid child" );
-  
+
   // Addchild is (often) called before the program
   // has left the parents constructor so that no
   // virtual tables work yet. The approach below
   // practically imitates virtual tables, i.e. it
   // implements a different AddChild() behaviour
-  // for wxFrame, wxDialog, wxWindow and 
+  // for wxFrame, wxDialog, wxWindow and
   // wxMDIParentFrame.
 
   // wxFrame and wxDialog as children aren't placed into the parents
-  
+
   if (( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog) ) &&
       (!IS_KIND_OF(child,wxMDIChildFrame)))
   {
     m_children.Append( child );
-    
+
     if ((child->m_x != -1) && (child->m_y != -1))
       gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
-      
+
     return;
   }
-  
-  // In the case of an wxMDIChildFrame descendant, we use the 
+
+  // In the case of an wxMDIChildFrame descendant, we use the
   // client windows's AddChild()
-  
+
   if (IS_KIND_OF(this,wxMDIParentFrame))
   {
     if (IS_KIND_OF(child,wxMDIChildFrame))
     {
       wxMDIClientWindow *client = ((wxMDIParentFrame*)this)->GetClientWindow();
       if (client)
-      { 
+      {
         client->AddChild( child );
         return;
       }
     }
   }
-  
+
   // wxNotebook is very special, so it has a private AddChild()
-  
+
   if (IS_KIND_OF(this,wxNotebook))
   {
     wxNotebook *tab = (wxNotebook*)this;
     tab->AddChild( child );
     return;
   }
-  
+
   // wxFrame has a private AddChild
-  
+
   if (IS_KIND_OF(this,wxFrame) && !IS_KIND_OF(this,wxMDIChildFrame))
   {
     wxFrame *frame = (wxFrame*)this;
     frame->AddChild( child );
     return;
   }
-  
+
   // All the rest
-  
+
   m_children.Append( child );
-  if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, 
+  if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
     child->m_x, child->m_y );
-  
+
   gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
 }
 
@@ -1759,14 +1765,14 @@ int wxWindow::GetReturnCode(void)
 void wxWindow::Raise(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_widget) gdk_window_raise( m_widget->window );
 }
 
 void wxWindow::Lower(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_widget) gdk_window_lower( m_widget->window );
 }
 
@@ -1836,13 +1842,13 @@ wxWindowID wxWindow::GetId(void)
 void wxWindow::SetCursor( const wxCursor &cursor )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_cursor == NULL)
   {
     wxFAIL_MSG( "wxWindow::SetCursor m_cursor == NULL" );
     m_cursor = new wxCursor( wxCURSOR_ARROW );
   }
-    
+
   if (cursor.Ok())
   {
     if (*((wxCursor*)&cursor) == m_cursor) return;
@@ -1855,7 +1861,7 @@ void wxWindow::SetCursor( const wxCursor &cursor )
 
   if ((m_widget) && (m_widget->window))
     gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
-    
+
   if ((m_wxwindow) && (m_wxwindow->window))
     gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
 }
@@ -1863,17 +1869,17 @@ void wxWindow::SetCursor( const wxCursor &cursor )
 void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (eraseBackground && m_wxwindow && m_wxwindow->window)
   {
     if (rect)
-      gdk_window_clear_area( m_wxwindow->window, 
-        rect->x, 
-        rect->y, 
-        rect->width, 
+      gdk_window_clear_area( m_wxwindow->window,
+        rect->x,
+        rect->y,
+        rect->width,
         rect->height );
     else
-      Clear(); 
+      Clear();
   }
   if (!rect)
   {
@@ -1882,7 +1888,7 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
       int w = 0;
       int h = 0;
       GetClientSize( &w, &h );
-      
+
       GdkRectangle gdk_rect;
       gdk_rect.x = 0;
       gdk_rect.y = 0;
@@ -1898,7 +1904,7 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
     gdk_rect.y = rect->y;
     gdk_rect.width = rect->width;
     gdk_rect.height = rect->height;
-    
+
     if (m_wxwindow)
       gtk_widget_draw( m_wxwindow, &gdk_rect );
     else
@@ -1934,7 +1940,7 @@ bool wxWindow::IsExposed( const wxRect& rect ) const
 void wxWindow::Clear(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
 }
 
@@ -1946,7 +1952,7 @@ wxColour wxWindow::GetBackgroundColour(void) const
 void wxWindow::SetBackgroundColour( const wxColour &colour )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   m_backgroundColour = colour;
   if (m_wxwindow)
   {
@@ -1970,12 +1976,12 @@ void wxWindow::SetForegroundColour( const wxColour &colour )
 bool wxWindow::Validate(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxNode *node = GetChildren()->First();
   while (node)
   {
     wxWindow *child = (wxWindow *)node->Data();
-    if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this)) 
+    if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this))
       { return FALSE; }
     node = node->Next();
   }
@@ -1985,7 +1991,7 @@ bool wxWindow::Validate(void)
 bool wxWindow::TransferDataToWindow(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxNode *node = GetChildren()->First();
   while (node)
   {
@@ -2004,7 +2010,7 @@ bool wxWindow::TransferDataToWindow(void)
 bool wxWindow::TransferDataFromWindow(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxNode *node = GetChildren()->First();
   while (node)
   {
@@ -2029,7 +2035,7 @@ void wxWindow::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) )
 void wxWindow::InitDialog(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxInitDialogEvent event(GetId());
   event.SetEventObject( this );
   GetEventHandler()->ProcessEvent(event);
@@ -2051,23 +2057,31 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
 bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   SetInvokingWindow( menu, this );
-  gtk_menu_popup( GTK_MENU(menu->m_menu), (GtkWidget *) NULL, (GtkWidget *) NULL, (GtkMenuPositionFunc) NULL, NULL, 0, 0 );
+  gtk_menu_popup(
+                  GTK_MENU(menu->m_menu),
+                  (GtkWidget *)NULL,          // parent menu shell
+                  (GtkWidget *)NULL,          // parent menu item
+                  (GtkMenuPositionFunc)NULL,
+                  NULL,                       // client data
+                  0,                          // button used to activate it
+                  0//gs_timeLastClick            // the time of activation
+                );
   return TRUE;
 }
 
 void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   GtkWidget *dnd_widget = GetConnectWidget();
-  
+
   DisconnectDnDWidget( dnd_widget );
-  
+
   if (m_pDropTarget) delete m_pDropTarget;
   m_pDropTarget = dropTarget;
-  
+
   ConnectDnDWidget( dnd_widget );
 }
 
@@ -2079,9 +2093,9 @@ wxDropTarget *wxWindow::GetDropTarget() const
 void wxWindow::ConnectDnDWidget( GtkWidget *widget )
 {
   if (!m_pDropTarget) return;
-  
+
   m_pDropTarget->RegisterWidget( widget );
-    
+
   gtk_signal_connect( GTK_OBJECT(widget), "drop_data_available_event",
     GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
 }
@@ -2089,10 +2103,10 @@ void wxWindow::ConnectDnDWidget( GtkWidget *widget )
 void wxWindow::DisconnectDnDWidget( GtkWidget *widget )
 {
   if (!m_pDropTarget) return;
-  
+
   gtk_signal_disconnect_by_func( GTK_OBJECT(widget),
     GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
-  
+
   m_pDropTarget->UnregisterWidget( widget );
 }
 
@@ -2100,10 +2114,10 @@ GtkWidget* wxWindow::GetConnectWidget(void)
 {
   GtkWidget *connect_widget = m_widget;
   if (m_wxwindow) connect_widget = m_wxwindow;
-  
+
   return connect_widget;
 }
-  
+
 bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
 {
   if (m_wxwindow) return (window == m_wxwindow->window);
@@ -2113,7 +2127,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
 void wxWindow::SetFont( const wxFont &font )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   if (((wxFont*)&font)->Ok())
     m_font = font;
   else
@@ -2129,10 +2143,10 @@ void wxWindow::SetFont( const wxFont &font )
   {
     style = gtk_widget_get_style( m_widget );
   }
-  
+
   gdk_font_unref( style->font );
   style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
-  
+
   gtk_widget_set_style( m_widget, style );
 }
 
@@ -2154,16 +2168,16 @@ long wxWindow::GetWindowStyleFlag(void) const
 void wxWindow::CaptureMouse(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (g_capturing == FALSE), "CaptureMouse called twice" );
-  
+
   GtkWidget *connect_widget = GetConnectWidget();
   gtk_grab_add( connect_widget );
   gdk_pointer_grab ( connect_widget->window, FALSE,
                     (GdkEventMask)
-        (GDK_BUTTON_PRESS_MASK | 
+        (GDK_BUTTON_PRESS_MASK |
         GDK_BUTTON_RELEASE_MASK |
-        GDK_POINTER_MOTION_MASK), 
+        GDK_POINTER_MOTION_MASK),
         (GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
   g_capturing = TRUE;
 }
@@ -2171,9 +2185,9 @@ void wxWindow::CaptureMouse(void)
 void wxWindow::ReleaseMouse(void)
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (g_capturing == TRUE), "ReleaseMouse called twice" );
-  
+
   GtkWidget *connect_widget = GetConnectWidget();
   gtk_grab_remove( connect_widget );
   gdk_pointer_ungrab ( GDK_CURRENT_TIME );
@@ -2246,9 +2260,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
       int range, bool refresh )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return;
 
   if (orient == wxHORIZONTAL)
@@ -2256,16 +2270,16 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     float fpos = (float)pos;
     float frange = (float)range;
     float fthumb = (float)thumbVisible;
-    
+
     if ((fabs(frange-m_hAdjust->upper) < 0.2) &&
         (fabs(fthumb-m_hAdjust->page_size) < 0.2))
     {
       SetScrollPos( orient, pos, refresh );
       return;
     }
-      
+
     m_oldHorizontalPos = fpos;
-    
+
     m_hAdjust->lower = 0.0;
     m_hAdjust->upper = frange;
     m_hAdjust->value = fpos;
@@ -2278,16 +2292,16 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     float fpos = (float)pos;
     float frange = (float)range;
     float fthumb = (float)thumbVisible;
-    
+
     if ((fabs(frange-m_vAdjust->upper) < 0.2) &&
         (fabs(fthumb-m_vAdjust->page_size) < 0.2))
     {
       SetScrollPos( orient, pos, refresh );
       return;
     }
-    
+
     m_oldVerticalPos = fpos;
-      
+
     m_vAdjust->lower = 0.0;
     m_vAdjust->upper = frange;
     m_vAdjust->value = fpos;
@@ -2295,14 +2309,14 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     m_vAdjust->page_increment = (float)(wxMax(fthumb,0));
     m_vAdjust->page_size = fthumb;
   }
-  
+
   if (m_wxwindow->window)
   {
     if (orient == wxHORIZONTAL)
       gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
     else
       gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
-      
+
     gtk_widget_set_usize( m_widget, m_width, m_height );
   }
 }
@@ -2310,11 +2324,11 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
 void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return;
-  
+
   if (orient == wxHORIZONTAL)
   {
     float fpos = (float)pos;
@@ -2330,14 +2344,14 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
     if (fabs(fpos-m_vAdjust->value) < 0.2) return;
     m_vAdjust->value = fpos;
   }
-  
+
   if (!m_isScrolling)
   {
     if (m_wxwindow->window)
-    {  
+    {
       if (orient == wxHORIZONTAL)
         gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "value_changed" );
-      else  
+      else
         gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "value_changed" );
     }
   }
@@ -2346,9 +2360,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
 int wxWindow::GetScrollThumb( int orient ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return 0;
 
   if (orient == wxHORIZONTAL)
@@ -2360,9 +2374,9 @@ int wxWindow::GetScrollThumb( int orient ) const
 int wxWindow::GetScrollPos( int orient ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return 0;
 
   if (orient == wxHORIZONTAL)
@@ -2374,9 +2388,9 @@ int wxWindow::GetScrollPos( int orient ) const
 int wxWindow::GetScrollRange( int orient ) const
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return 0;
 
   if (orient == wxHORIZONTAL)
@@ -2388,15 +2402,15 @@ int wxWindow::GetScrollRange( int orient ) const
 void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
 {
   wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-  
+
   wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-  
+
   if (!m_wxwindow) return;
 
     int cw = 0;
     int ch = 0;
     GetClientSize( &cw, &ch );
-    
+
     int w = cw - abs(dx);
     int h = ch - abs(dy);
     if ((h < 0) || (w < 0))
@@ -2414,13 +2428,13 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     if (dy > 0) d_y = dy;
     gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
       m_wxwindow->window, s_x, s_y, w, h );
-      
+
     wxRect rect;
     if (dx < 0) rect.x = cw+dx; else rect.x = 0;
     if (dy < 0) rect.y = ch+dy; else rect.y = 0;
     if (dy != 0) rect.width = cw; else rect.width = abs(dx);
     if (dx != 0) rect.height = ch; else rect.height = abs(dy);
-  
+
     Refresh( TRUE, &rect );
 }
 
@@ -2584,7 +2598,7 @@ bool wxWindow::Layout(void)
     GetConstraints()->width.SetValue(w);
     GetConstraints()->height.SetValue(h);
   }
-  
+
   // If top level (one sizer), evaluate the sizer's constraints.
   if (GetSizer())
   {
@@ -2625,7 +2639,7 @@ bool wxWindow::LayoutPhase1(int *noChanges)
 bool wxWindow::LayoutPhase2(int *noChanges)
 {
   *noChanges = 0;
-  
+
   // Layout children
   DoPhase(1);
   DoPhase(2);
@@ -2766,7 +2780,7 @@ void wxWindow::TransformSizerToActual(int *x, int *y) const
   if (!m_sizerParent || m_sizerParent->IsKindOf(CLASSINFO(wxDialog)) ||
          m_sizerParent->IsKindOf(CLASSINFO(wxFrame)) )
     return;
-    
+
   int xp, yp;
   m_sizerParent->GetPosition(&xp, &yp);
   m_sizerParent->TransformSizerToActual(&xp, &yp);
diff --git a/src/motif/app.cpp b/src/motif/app.cpp
index dc3f61a7e6..d8df53ed4c 100644
--- a/src/motif/app.cpp
+++ b/src/motif/app.cpp
@@ -29,11 +29,11 @@
 #include "wx/module.h"
 #include "wx/memory.h"
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 #endif
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 #include "wx/postscrp.h"
 #endif
 
@@ -71,7 +71,7 @@ bool wxApp::Initialize()
     wxBuffer = new char[BUFSIZ + 512];
 #endif
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
     streambuf* sBuf = new wxDebugStreamBuf;
     ostream* oStr = new ostream(sBuf) ;
@@ -85,12 +85,12 @@ bool wxApp::Initialize()
     wxTheColourDatabase->Initialize();
     wxInitializeStockObjects();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
     wxInitializeResourceSystem();
 #endif
 
   // For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
     wxInitializePrintSetupData();
     wxThePrintPaperDatabase = new wxPrintPaperDatabase;
     wxThePrintPaperDatabase->CreateDatabase();
@@ -113,7 +113,7 @@ void wxApp::CleanUp()
 
     wxModule::CleanUpModules();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
     wxCleanUpResourceSystem();
 #endif
 
@@ -136,7 +136,7 @@ void wxApp::CleanUp()
     delete wxTheColourDatabase;
     wxTheColourDatabase = NULL;
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
     wxInitializePrintSetupData(FALSE);
     delete wxThePrintPaperDatabase;
     wxThePrintPaperDatabase = NULL;
@@ -210,7 +210,7 @@ int wxEntry( int argc, char *argv[] )
     delete wxTheApp;
     wxTheApp = NULL;
   
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (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/data.cpp b/src/motif/data.cpp
index 793bc7dc4d..e65f345b87 100644
--- a/src/motif/data.cpp
+++ b/src/motif/data.cpp
@@ -127,11 +127,11 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
 const char *wxFloatToStringStr = "%.2f";
 const char *wxDoubleToStringStr = "%.2f";
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
 #endif
 
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
 ///// Event tables (also must be in one, statically-linked file for shared libraries)
 
 // This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp
index 313ea015da..ec62649fed 100644
--- a/src/motif/dialog.cpp
+++ b/src/motif/dialog.cpp
@@ -61,7 +61,7 @@ wxList wxModalDialogs;
 wxList wxModelessWindows;  // Frames and modeless dialogs
 extern wxList wxPendingDelete;
 
-#define USE_INVISIBLE_RESIZE 1
+#define wxUSE_INVISIBLE_RESIZE 1
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp
index f8f02a0cb5..e83b831ebc 100644
--- a/src/motif/frame.cpp
+++ b/src/motif/frame.cpp
@@ -76,7 +76,7 @@ END_EVENT_TABLE()
 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 bool wxFrame::m_useNativeStatusBar = TRUE;
 #else
 bool wxFrame::m_useNativeStatusBar = FALSE;
@@ -688,7 +688,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
-  #if USE_CONSTRAINTS
+  #if wxUSE_CONSTRAINTS
     if ( GetAutoLayout() ) {
       Layout();
       return;
diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp
index b1685194a4..113f78c50a 100644
--- a/src/motif/mdi.cpp
+++ b/src/motif/mdi.cpp
@@ -97,7 +97,7 @@ void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
 
 void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     if (GetAutoLayout())
       Layout();
 #endif
diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp
index 53df95214b..dcaaa94df4 100644
--- a/src/motif/menu.cpp
+++ b/src/motif/menu.cpp
@@ -822,7 +822,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
 
       XmString label_str = XmStringCreateSimple (wxBuffer);
       buttonWidget = XtVaCreateManagedWidget (wxBuffer,
-#if USE_GADGETS
+#if wxUSE_GADGETS
 					 xmCascadeButtonGadgetClass, (Widget) parent,
 #else
 					 xmCascadeButtonWidgetClass, (Widget) parent,
diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp
index ef1bbe2a62..afb8709ae0 100644
--- a/src/motif/utils.cpp
+++ b/src/motif/utils.cpp
@@ -126,7 +126,7 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 }
 
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
 bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
 {
     // TODO
@@ -198,7 +198,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c
   }
   else return FALSE;
 }
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
 
 static int wxBusyCursorCount = 0;
 
diff --git a/src/motif/window.cpp b/src/motif/window.cpp
index bdf67fa1f3..17a54f842d 100644
--- a/src/motif/window.cpp
+++ b/src/motif/window.cpp
@@ -31,7 +31,7 @@
 #include "wx/menuitem.h"
 #include "wx/log.h"
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
 #include "wx/dnd.h"
 #endif
 
@@ -104,7 +104,7 @@ wxWindow::wxWindow()
     m_defaultForegroundColour = *wxBLACK ;
     m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
     m_pDropTarget = NULL;
 #endif
 
@@ -197,7 +197,7 @@ wxWindow::~wxWindow()
 	// Have to delete constraints/sizer FIRST otherwise
 	// sizers may try to look at deleted windows as they
 	// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     DeleteRelatedConstraints();
     if (m_constraints)
     {
@@ -269,7 +269,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
     m_sizerParent = NULL;
     m_autoLayout = FALSE;
     m_windowValidator = NULL;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
     m_pDropTarget = NULL;
 #endif
     m_caretWidth = 0; m_caretHeight = 0;
@@ -488,7 +488,7 @@ wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler)
 		return NULL;
 }
 
-#if    USE_DRAG_AND_DROP
+#if    wxUSE_DRAG_AND_DROP
 
 void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
 {
diff --git a/src/msw/app.cpp b/src/msw/app.cpp
index cb88395f1a..4d1221e0a8 100644
--- a/src/msw/app.cpp
+++ b/src/msw/app.cpp
@@ -40,7 +40,7 @@
 #include "wx/log.h"
 #include "wx/module.h"
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   #include "wx/resource.h"
 #endif
 
@@ -122,7 +122,7 @@ bool wxApp::Initialize()
   #endif // debug build under MS VC++
 */
 
-  #if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+  #if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
     #if defined(_WINDLL)
       streambuf* sBuf = NULL;
     #else  // EXE
@@ -131,11 +131,11 @@ bool wxApp::Initialize()
 
     ostream* oStr = new ostream(sBuf) ;
     wxDebugContext::SetStream(oStr, sBuf);
-  #endif  // USE_MEMORY_TRACING
+  #endif  // wxUSE_MEMORY_TRACING
 
   wxClassInfo::InitializeClasses();
 
-  #if USE_RESOURCES
+  #if wxUSE_RESOURCES
     wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
   #endif
 
@@ -145,12 +145,12 @@ bool wxApp::Initialize()
   wxInitializeStockLists();
   wxInitializeStockObjects();
 
-  #if USE_WX_RESOURCES
+  #if wxUSE_WX_RESOURCES
     wxInitializeResourceSystem();
   #endif
 
   // For PostScript printing
-  #if USE_POSTSCRIPT
+  #if wxUSE_POSTSCRIPT
     wxInitializePrintSetupData();
     wxThePrintPaperDatabase = new wxPrintPaperDatabase;
     wxThePrintPaperDatabase->CreateDatabase();
@@ -201,7 +201,7 @@ bool wxApp::Initialize()
   wxDisableButtonBrush = ::CreateBrushIndirect( & lb ) ;
   ::DeleteObject( (HGDIOBJ)lb.lbHatch ) ;
 
-  #if USE_PENWINDOWS
+  #if wxUSE_PENWINDOWS
     wxRegisterPenWin();
   #endif
 
@@ -435,7 +435,7 @@ void wxApp::CleanUp()
   //// COMMON CLEANUP
   wxModule::CleanUpModules();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   wxCleanUpResourceSystem();
 
 //  wxDefaultResourceTable->ClearTable();
@@ -456,7 +456,7 @@ void wxApp::CleanUp()
   delete wxTheColourDatabase;
   wxTheColourDatabase = NULL;
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData(FALSE);
   delete wxThePrintPaperDatabase;
   wxThePrintPaperDatabase = NULL;
@@ -476,7 +476,7 @@ void wxApp::CleanUp()
     FreeLibrary(gs_hRichEdit);
 #endif
 
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
   wxCleanUpPenWin();
 #endif
 
@@ -589,7 +589,7 @@ int wxEntry(WXHINSTANCE hInstance,
   delete wxTheApp;
   wxTheApp = NULL;
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (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/bitmap.cpp b/src/msw/bitmap.cpp
index 0a89cabca2..44099f7598 100644
--- a/src/msw/bitmap.cpp
+++ b/src/msw/bitmap.cpp
@@ -36,7 +36,7 @@
 
 #include "assert.h"
 
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
 #define FOR_MSW 1
 #include "../../contrib/wxxpm/libxpm.34b/lib/xpm34.h"
 #endif
@@ -168,7 +168,7 @@ wxBitmap::wxBitmap(const wxString& filename, long type)
     wxTheBitmapList->AddBitmap(this);
 }
 
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
 // Create from data
 wxBitmap::wxBitmap(const char **data, wxItem *WXUNUSED(anItem))
 {
@@ -642,7 +642,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
 bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
     int desiredWidth, int desiredHeight)
 {
-#if USE_IMAGE_LOADING_IN_MSW
+#if wxUSE_IMAGE_LOADING_IN_MSW
     wxPalette *palette = NULL;
     bool success = FALSE;
 /*
@@ -666,7 +666,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
 
 bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal)
 {
-#if USE_IMAGE_LOADING_IN_MSW
+#if wxUSE_IMAGE_LOADING_IN_MSW
     wxPalette *actualPalette = (wxPalette *)pal;
     if (!actualPalette && (!M_BITMAPHANDLERDATA->m_bitmapPalette.IsNull()))
       actualPalette = & (M_BITMAPHANDLERDATA->m_bitmapPalette);
@@ -696,7 +696,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
 bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
     int desiredWidth, int desiredHeight)
 {
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
     XImage *ximage;
     XpmAttributes xpmAttr;
     HDC     dc;
@@ -738,7 +738,7 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
 
 bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
 {
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
       HDC     dc = NULL;
 
       Visual *visual = NULL;
@@ -788,7 +788,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
 
 bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
 {
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
   XImage *ximage;
   int     ErrorStatus;
   XpmAttributes xpmAttr;
diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp
index 2eb9b3d7a6..d42b33424d 100644
--- a/src/msw/checklst.cpp
+++ b/src/msw/checklst.cpp
@@ -24,7 +24,7 @@
 #pragma hdrstop
 #endif
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 
 #include <windows.h>
 
diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp
index 0c92cfc8e2..5701f61ff8 100644
--- a/src/msw/clipbrd.cpp
+++ b/src/msw/clipbrd.cpp
@@ -25,7 +25,7 @@
 #include "wx/setup.h"
 #endif
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 
 #ifndef WX_PRECOMP
 #include "wx/app.h"
@@ -121,7 +121,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
     }
     case wxDF_DIB:
     {
-#if USE_IMAGE_LOADING_IN_MSW
+#if wxUSE_IMAGE_LOADING_IN_MSW
       HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP();
       HANDLE hDIB=BitmapToDIB(hBitmap,NULL); // NULL==uses system palette
       bool success = (::SetClipboardData(CF_DIB,hDIB) != 0);
@@ -131,7 +131,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
       return success;
       break;
     }
-#if USE_METAFILE
+#if wxUSE_METAFILE
     case wxDF_METAFILE:
     {
       wxMetaFile *wxMF = (wxMetaFile *)obj;
@@ -461,5 +461,5 @@ char *wxClipboard::GetClipboardData(char *format, long *length, long time)
 }
 
 
-#endif // USE_CLIPBOARD
+#endif // wxUSE_CLIPBOARD
 
diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp
index 8cc929e3bc..01a8df28be 100644
--- a/src/msw/combobox.cpp
+++ b/src/msw/combobox.cpp
@@ -24,7 +24,7 @@
 #include "wx/setup.h"
 #endif
 
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
 
 #include "wx/combobox.h"
 #include "wx/clipbrd.h"
@@ -257,7 +257,7 @@ long wxComboBox::GetLastPosition() const
 
 void wxComboBox::Replace(long from, long to, const wxString& value)
 {
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
     HWND hWnd = (HWND) GetHWND();
     long fromChar = from;
     long toChar = to;
@@ -317,5 +317,5 @@ void wxComboBox::SetSelection(long from, long to)
 }
 
 #endif
- // USE_COMBOBOX
+ // wxUSE_COMBOBOX
 
diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp
index 8eb388fae4..3a3c09aa70 100644
--- a/src/msw/cursor.cpp
+++ b/src/msw/cursor.cpp
@@ -34,12 +34,12 @@
 
 #include "assert.h"
 
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
 #define FOR_MSW 1
 #include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h"
 #endif
 
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
 #include "wx/msw/curico.h"
 #include "wx/msw/curicop.h"
 #endif
@@ -88,21 +88,21 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho
   }
   else if (flags & wxBITMAP_TYPE_CUR)
   {
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
     M_CURSORDATA->m_hCursor = (WXHCURSOR) ReadCursorFile((char *)(const char *)cursor_file, wxGetInstance(), &M_CURSORDATA->m_width, &M_CURSORDATA->m_height);
 	M_CURSORDATA->m_destroyCursor = TRUE;
 #endif
   }
   else if (flags & wxBITMAP_TYPE_ICO)
   {
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
     M_CURSORDATA->m_hCursor = (WXHCURSOR) IconToCursor((char *)(const char *)cursor_file, wxGetInstance(), hotSpotX, hotSpotY, &M_CURSORDATA->m_width, &M_CURSORDATA->m_height);
 	M_CURSORDATA->m_destroyCursor = TRUE;
 #endif
   }
   else if (flags & wxBITMAP_TYPE_BMP)
   {
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
     HBITMAP hBitmap = 0;
     HPALETTE hPalette = 0;
     bool success = ReadDIB((char *)(const char *)cursor_file, &hBitmap, &hPalette) != 0;
diff --git a/src/msw/data.cpp b/src/msw/data.cpp
index d26dc0a4f6..f0aba88f2b 100644
--- a/src/msw/data.cpp
+++ b/src/msw/data.cpp
@@ -153,11 +153,11 @@ const char *wxDoubleToStringStr = "%.2f";
 const char *wxUserResourceStr = "TEXT";
 #endif
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
 #endif
 
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
 /*
  * For wxWindows to be made into a dynamic library (e.g. Sun),
  * all IMPLEMENT_... macros must be in one place.
@@ -181,13 +181,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
 #include "wx/choice.h"
 IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 #include "wx/clipbrd.h"
 IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
 #endif
 
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
 #include "wx/combobox.h"
 IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
 #endif
@@ -227,7 +227,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintData, wxObject)
 #include "wx/colordlg.h"
 #include "wx/fontdlg.h"
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include "wx/generic/colordlg.h"
 #include "wx/generic/fontdlg.h"
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
@@ -268,7 +268,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxHashTable, wxObject)
 #include "wx/helpbase.h"
 IMPLEMENT_CLASS(wxHelpControllerBase, wxObject)
 
-#if USE_HELP
+#if wxUSE_HELP
 
 #ifdef __WXMSW__
 #include "wx/msw/helpwin.h"
@@ -295,7 +295,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNode, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
 
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 #include "wx/print.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
 IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
@@ -312,7 +312,7 @@ IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
 IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
 #endif
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 #include "wx/postscrp.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
@@ -321,7 +321,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
 #endif
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
@@ -361,12 +361,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxList)
 #include "wx/process.h"
 IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 #include "wx/date.h"
 IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
 #endif
 
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
 #include "wx/docview.h"
 //IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
@@ -375,7 +375,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
 IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
 IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
 IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
 #endif
 IMPLEMENT_CLASS(wxCommand, wxObject)
@@ -383,7 +383,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
 #endif
 
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
 #include "wx/layout.h"
 IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
@@ -391,7 +391,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSizer, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
 #endif
 
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
 #include "wx/tbarbase.h"
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
@@ -462,7 +462,7 @@ BEGIN_EVENT_TABLE(wxStatusBar, wxWindow)
     EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
 END_EVENT_TABLE()
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 #include "wx/time.h"
 IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
 #endif
@@ -500,7 +500,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxBitmapHandler)
 #include "wx/statbox.h"
 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
 
-#if USE_IPC
+#if wxUSE_IPC
 #include "wx/dde.h"
 IMPLEMENT_CLASS(wxServerBase, wxObject)
 IMPLEMENT_CLASS(wxClientBase, wxObject)
@@ -531,7 +531,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
 
-#if USE_METAFILE
+#if wxUSE_METAFILE
 #include "wx/metafile.h"
 IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
@@ -583,7 +583,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
 #include "wx/dirdlg.h"
 #include "wx/choicdlg.h"
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 #include "wx/generic/msgdlgg.h"
 IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
 #endif
@@ -597,7 +597,7 @@ IMPLEMENT_CLASS(wxDirDialog, wxDialog)
 IMPLEMENT_CLASS(wxMessageDialog)
 #endif
 
-#if USE_GAUGE
+#if wxUSE_GAUGE
 #ifdef __WXMOTIF__
 #include "../../contrib/xmgauge/gauge.h"
 #endif
@@ -715,7 +715,7 @@ BEGIN_EVENT_TABLE(wxControl, wxWindow)
   EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
 END_EVENT_TABLE()
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
 	EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
 	EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp
index 432769c8c0..e588c676ed 100644
--- a/src/msw/dc.cpp
+++ b/src/msw/dc.cpp
@@ -35,7 +35,7 @@
 #include <math.h>
 #include <fstream.h>
 
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
 #include <commdlg.h>
 #endif
 
@@ -1326,9 +1326,9 @@ void wxDC::GetSizeMM(long *width, long *height) const
   *height = h;
 }
 
-#if USE_SPLINES
+#if wxUSE_SPLINES
 #include "xfspline.inc"
-#endif // USE_SPLINES
+#endif // wxUSE_SPLINES
 
 void wxDC::DrawPolygon(wxList *list, long xoffset, long yoffset,int fillStyle)
 {
@@ -1370,7 +1370,7 @@ void wxDC::SetTextBackground(const wxColour& colour)
     m_textBackgroundColour = colour;
 }
 
-#if USE_SPLINES
+#if wxUSE_SPLINES
 // Make a 3-point spline
 void wxDC::DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
 {
diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp
index 35c568f7a5..147f520545 100644
--- a/src/msw/dcprint.cpp
+++ b/src/msw/dcprint.cpp
@@ -30,7 +30,7 @@
 
 #include <windows.h>
 
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
 #include <commdlg.h>
 #endif
 
@@ -61,7 +61,7 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_nam
   if (!file.IsNull() && file != "")
     m_filename = file;
 
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
    if (interactive)
    {
      PRINTDLG pd;
diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp
index d829167ae1..c46f04c233 100644
--- a/src/msw/dde.cpp
+++ b/src/msw/dde.cpp
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if USE_IPC
+#if wxUSE_IPC
 
 #ifndef WX_PRECOMP
 #include "wx/utils.h"
@@ -782,4 +782,4 @@ void DDEPrintError(void)
 }
 
 #endif
-  // USE_IPC
+  // wxUSE_IPC
diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp
index a55bda8b5c..85ba82edd0 100644
--- a/src/msw/dialog.cpp
+++ b/src/msw/dialog.cpp
@@ -30,7 +30,7 @@
 
 #include "wx/msw/private.h"
 
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
 #include <commdlg.h>
 #endif
 
diff --git a/src/msw/font.cpp b/src/msw/font.cpp
index 27370bf433..da43d01fac 100644
--- a/src/msw/font.cpp
+++ b/src/msw/font.cpp
@@ -35,7 +35,7 @@
 #if !USE_SHARED_LIBRARIES
 IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
-#if USE_PORTABLE_FONTS_IN_MSW
+#if wxUSE_PORTABLE_FONTS_IN_MSW
 IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
 #endif
 
diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp
index a45bf2ea6b..29e363328c 100644
--- a/src/msw/frame.cpp
+++ b/src/msw/frame.cpp
@@ -40,7 +40,7 @@
 #undef LoadAccelerators
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 #include <wx/msw/statbr95.h>
 #endif
 
@@ -62,7 +62,7 @@ END_EVENT_TABLE()
 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 bool wxFrame::m_useNativeStatusBar = TRUE;
 #else
 bool wxFrame::m_useNativeStatusBar = FALSE;
@@ -357,7 +357,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
 {
     wxStatusBar *statusBar = NULL;
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
     if (UsesNativeStatusBar())
     {
         statusBar = new wxStatusBar95(this, id, style);
@@ -421,7 +421,7 @@ void wxFrame::PositionStatusBar(void)
 {
   // native status bar positions itself
   if (m_frameStatusBar
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
    && !m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95))
 #endif
     )
@@ -590,7 +590,7 @@ void wxFrame::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *
 
   // Keep this in wxFrame because it saves recoding this function
   // in wxTinyFrame
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
   if (style & wxTINY_CAPTION_VERT)
     msflags |= IBS_VERTCAPTION;
   if (style & wxTINY_CAPTION_HORIZ)
@@ -709,7 +709,7 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
  if (!m_iconized)
  {
   // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
   if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
   {
     wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
@@ -804,7 +804,7 @@ bool wxFrame::MSWTranslateMessage(WXMSG* pMsg)
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
-  #if USE_CONSTRAINTS
+  #if wxUSE_CONSTRAINTS
     if ( GetAutoLayout() ) {
       Layout();
       return;
diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp
index d0ddf67099..cd6e0902f4 100644
--- a/src/msw/gauge95.cpp
+++ b/src/msw/gauge95.cpp
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if USE_GAUGE && defined(__WIN95__)
+#if wxUSE_GAUGE && defined(__WIN95__)
 
 #include "wx/msw/gauge95.h"
 #include "wx/msw/private.h"
@@ -178,4 +178,4 @@ void wxGauge95::SetBackgroundColour(const wxColour& col)
   m_backgroundColour = col ;
 }
 
-#endif // USE_GAUGE
+#endif // wxUSE_GAUGE
diff --git a/src/msw/gaugemsw.cpp b/src/msw/gaugemsw.cpp
index 1df35a9e9c..dacfc8f8d4 100644
--- a/src/msw/gaugemsw.cpp
+++ b/src/msw/gaugemsw.cpp
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if USE_GAUGE 
+#if wxUSE_GAUGE 
 
 #include "wx/msw/gaugemsw.h"
 #include "wx/msw/private.h"
@@ -1171,4 +1171,4 @@ zyzgForceRepaint3D:
 
 /** EOF: zyzgauge.c **/
 
-#endif // USE_GAUGE
+#endif // wxUSE_GAUGE
diff --git a/src/msw/helpwin.cpp b/src/msw/helpwin.cpp
index 808a63ffcf..e761c09d45 100644
--- a/src/msw/helpwin.cpp
+++ b/src/msw/helpwin.cpp
@@ -26,7 +26,7 @@
 
 #include "wx/msw/helpwin.h"
 
-#if USE_HELP
+#if wxUSE_HELP
 #include <time.h>
 
 #ifdef __WXMSW__
@@ -145,4 +145,4 @@ void wxWinHelpController::OnQuit(void)
 {
 }
 
-#endif // USE_HELP
+#endif // wxUSE_HELP
diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp
index 587bf7b4c4..17d2703d59 100644
--- a/src/msw/icon.cpp
+++ b/src/msw/icon.cpp
@@ -32,12 +32,12 @@
 #include "wx/msw/private.h"
 #include "assert.h"
 
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
 #define FOR_MSW 1
 #include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h"
 #endif
 
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
 #include "wx/msw/curico.h"
 #include "wx/msw/curicop.h"
 #endif
@@ -119,7 +119,7 @@ void wxIcon::SetHICON(WXHICON ico)
 bool wxICOFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
     int desiredWidth, int desiredHeight)
 {
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
   if ( bitmap->IsKindOf(CLASSINFO(wxIcon)) )
   {
     wxIcon *icon = (wxIcon *)bitmap;
diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp
index f15ecf02e9..4d4a05769c 100644
--- a/src/msw/listbox.cpp
+++ b/src/msw/listbox.cpp
@@ -38,7 +38,7 @@
 #undef GetCharWidth
 #endif
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   #include  "wx/ownerdrw.h"
 #endif
 
@@ -53,7 +53,7 @@
 // list box item declaration and implementation
 // ============================================================================
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 
 class wxListBoxItem : public wxOwnerDrawn
 {
@@ -183,7 +183,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
   if (m_windowStyle & wxLB_SORT)
     wstyle |= LBS_SORT;
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
       // we don't support LBS_OWNERDRAWVARIABLE yet
       wstyle |= LBS_OWNERDRAWFIXED;
@@ -229,7 +229,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]);
   }
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
       for (ui = 0; ui < (size_t)n; ui++) {
         // create new item which will process WM_{DRAW|MEASURE}ITEM messages
@@ -255,7 +255,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
 wxListBox::~wxListBox(void)
 {
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     size_t uiCount = m_aItems.Count();
     while ( uiCount-- != 0 ) {
       delete m_aItems[uiCount];
@@ -294,7 +294,7 @@ void wxListBox::Append(const wxString& item)
   int index = ListBox_AddString(hwnd, item);
   m_noItems ++;
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
       wxOwnerDrawn *pNewItem = CreateItem(-1); // dummy argument
       pNewItem->SetName(item);
@@ -311,7 +311,7 @@ void wxListBox::Append(const wxString& item, char *Client_data)
   int index = ListBox_AddString(hwnd, item);
   m_noItems ++;
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
       // client data must be pointer to wxOwnerDrawn, otherwise we would crash
       // in OnMeasure/OnDraw.
@@ -337,7 +337,7 @@ void wxListBox::Set(int n, const wxString *choices, char** clientData)
   }
   m_noItems = n;
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
       // first delete old items
       size_t ui = m_aItems.Count();
@@ -592,7 +592,7 @@ wxListBox::InsertItems(int nItems, const wxString items[], int pos)
     ListBox_InsertString(hwnd, i + pos, items[i]);
   m_noItems += nItems;
 
-  #if USE_OWNER_DRAWN
+  #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
       for ( i = 0; i < nItems; i++ ) {
         wxOwnerDrawn *pNewItem = CreateItem((size_t)(pos + i));
@@ -628,7 +628,7 @@ void wxListBox::SetString(int N, const wxString& s)
   if (sel >= 0)
     SetSelection(sel);
 
-#if       USE_OWNER_DRAWN
+#if       wxUSE_OWNER_DRAWN
   if ( m_windowStyle & wxLB_OWNERDRAW )
 	  // update item's text
 	  m_aItems[N]->SetName(s);
@@ -764,7 +764,7 @@ long wxListBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
   return wxControl::MSWWindowProc(nMsg, wParam, lParam);
 }
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 
 // drawing
 // -------
@@ -818,4 +818,4 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
 }
 
 #endif
-  // USE_OWNER_DRAWN
+  // wxUSE_OWNER_DRAWN
diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp
index 2ec45d19b7..d33807a73a 100644
--- a/src/msw/mdi.cpp
+++ b/src/msw/mdi.cpp
@@ -34,7 +34,7 @@
 #include "wx/mdi.h"
 #include "wx/msw/private.h"
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 #include <wx/msw/statbr95.h>
 #endif
 
@@ -266,7 +266,7 @@ void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
 
 void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     if (GetAutoLayout())
       Layout();
 #endif
@@ -280,7 +280,7 @@ void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 
 /* Already done in MSWOnSize
   // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
   if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
     ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
 #endif
@@ -303,7 +303,7 @@ void wxMDIParentFrame::OldOnSize(int x, int y)
   GetEventHandler()->ProcessEvent(event);
 #else
 
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
   if (GetAutoLayout())
     Layout();
 #endif
@@ -443,7 +443,7 @@ void wxMDIParentFrame::MSWOnSize(int x, int y, WXUINT id)
  if (!m_iconized)
  {
   // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
   if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
   {
     wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
@@ -918,7 +918,7 @@ void wxMDIChildFrame::MSWOnSize(int x, int y, WXUINT id)
   if (!m_iconized)
   {
     // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
     if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
     {
       wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp
index 097a123854..8898ae5d9e 100644
--- a/src/msw/menu.cpp
+++ b/src/msw/menu.cpp
@@ -35,7 +35,7 @@
 #include "wx/utils.h"
 #endif
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
 #include "wx/ownerdrw.h"
 #endif
 
@@ -177,7 +177,7 @@ void wxMenu::Append(wxMenuItem *pItem)
   LPCSTR pData;
   wxString name("");
 
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   if ( pItem->IsOwnerDrawn() ) {  // want to get {Measure|Draw}Item messages?
     // item draws itself, pass pointer to it in data parameter
     flags |= MF_OWNERDRAW;
diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp
index 46625d1a08..f7822a730f 100644
--- a/src/msw/menuitem.cpp
+++ b/src/msw/menuitem.cpp
@@ -38,7 +38,7 @@
 // ----------------------------------------------------------------------------
 
 #if     !defined(USE_SHARED_LIBRARY) || !USE_SHARED_LIBRARY
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
   IMPLEMENT_DYNAMIC_CLASS2(wxMenuItem, wxObject, wxOwnerDrawn)
 #else   //!USE_OWNER_DRAWN
   IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
@@ -57,7 +57,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
                        const wxString& strName, const wxString& strHelp,
                        bool bCheckable,
                        wxMenu *pSubMenu) :
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
                         wxOwnerDrawn(strName, bCheckable),
 #else   //no owner drawn support
                         m_bCheckable(bCheckable),
@@ -67,7 +67,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
 {
   wxASSERT( pParentMenu != NULL );
 
-#if  USE_OWNER_DRAWN
+#if  wxUSE_OWNER_DRAWN
     // set default menu colors
     #define SYS_COLOR(c) (wxSystemSettings::GetSystemColour(wxSYS_COLOUR_##c))
     
diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp
index 28d972b3a2..dd7f16f38b 100644
--- a/src/msw/metafile.cpp
+++ b/src/msw/metafile.cpp
@@ -24,7 +24,7 @@
 #include "wx/setup.h"
 #endif
 
-#if USE_METAFILE
+#if wxUSE_METAFILE
 
 #ifndef WX_PRECOMP
 #include "wx/utils.h"
@@ -374,4 +374,4 @@ bool wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, i
   return TRUE;
 }
 
-#endif // USE_METAFILE
+#endif // wxUSE_METAFILE
diff --git a/src/msw/minifram.cpp b/src/msw/minifram.cpp
index 346e95d9b9..c64fdf0e7d 100644
--- a/src/msw/minifram.cpp
+++ b/src/msw/minifram.cpp
@@ -26,7 +26,7 @@
 #include "wx/utils.h"
 #endif
 
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
 
 #include "wx/minifram.h"
 #include "wx/msw/private.h"
@@ -177,14 +177,14 @@ wxMiniFrame::~wxMiniFrame(void)
 //    Unfortunately there is a bug in the Windows 3.0 8514 driver
 //    in using ExtTextOut() to a memory DC.  If you are drawing
 //    to an off screen bitmap, then blitting that bitmap to the
-//    display, do not #define USE_EXTTEXTOUT below.
+//    display, do not #define wxUSE_EXTTEXTOUT below.
 //
 //    The following macro (DRAWFASTRECT) draws a filled rectangle
 //    with no border and a solid color.  It uses the current back-
 //    ground color as the fill color.
 //////////////////////////////////////////////////////////////////////
-#define USE_EXTTEXTOUT
-#ifdef USE_EXTTEXTOUT
+#define wxUSE_EXTTEXTOUT
+#ifdef wxUSE_EXTTEXTOUT
    #define DRAWFASTRECT(hdc,lprc) ExtTextOut(hdc,0,0,ETO_OPAQUE,lprc,NULL,0,NULL)
 #else
    #define DRAWFASTRECT(hdc,lprc) {\
@@ -1589,4 +1589,4 @@ void PASCAL DrawArrow( HDC hdc, LPRECT lprc, UINT uiStyle )
 
 }  // DrawArrow()   
 
-#endif // USE_ITSY_BITSY
+#endif // wxUSE_ITSY_BITSY
diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp
index 1e381bfb56..e6955bad07 100644
--- a/src/msw/ole/dropsrc.cpp
+++ b/src/msw/ole/dropsrc.cpp
@@ -30,7 +30,7 @@
 
 #include  <wx/setup.h>
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 
 #include  <wx/log.h>
 #include  <wx/msw/ole/oleutils.h>
diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp
index b1d2e04fc0..becfe73232 100644
--- a/src/msw/ole/droptgt.cpp
+++ b/src/msw/ole/droptgt.cpp
@@ -30,7 +30,7 @@
 
 #include  <wx/setup.h>
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 
 #include  <wx/log.h>
 
@@ -416,4 +416,4 @@ wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
 }
 
 #endif
- // USE_DRAG_AND_DROP
+ // wxUSE_DRAG_AND_DROP
diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp
index 246452f99b..cb2a9e698b 100644
--- a/src/msw/ole/oleutils.cpp
+++ b/src/msw/ole/oleutils.cpp
@@ -56,7 +56,7 @@ bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount)
   return FALSE;
 }
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 
 // ----------------------------------------------------------------------------
 // Debug support
@@ -187,4 +187,4 @@ void wxLogRelease(const char *szInterface, ULONG cRef)
 #endif  //WXDEBUG
 
 #endif
-  // USE_DRAG_AND_DROP
+  // wxUSE_DRAG_AND_DROP
diff --git a/src/msw/ole/uuid.cpp b/src/msw/ole/uuid.cpp
index 7314b4fcbe..4df4faa7ba 100644
--- a/src/msw/ole/uuid.cpp
+++ b/src/msw/ole/uuid.cpp
@@ -26,7 +26,7 @@
 
 #include  <wx/setup.h>
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
 
 // standard headers
 #include  <rpc.h>                       // UUID related functions
@@ -149,4 +149,4 @@ void Uuid::UuidToCForm()
 }
 
 #endif
-  // USE_DRAG_AND_DROP
+  // wxUSE_DRAG_AND_DROP
diff --git a/src/msw/penwin.cpp b/src/msw/penwin.cpp
index 4ec5935e6e..7a530ac643 100644
--- a/src/msw/penwin.cpp
+++ b/src/msw/penwin.cpp
@@ -26,7 +26,7 @@
 
 #include "wx/msw/private.h"
 
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
 
 #ifdef __BORLANDC__
 #define RPA_DEFAULT 1
@@ -85,11 +85,11 @@ void wxEnablePenAppHooks (bool hook)
 }
 
 #endif
-  // End USE_PENWINDOWS
+  // End wxUSE_PENWINDOWS
 
 void wxRegisterPenWin(void)
 {
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
 ///////////////////////////////////////////////////////////////////////
 // If running on a Pen Windows system, register this app so all
 // EDIT controls in dialogs are replaced by HEDIT controls.
@@ -108,7 +108,7 @@ void wxRegisterPenWin(void)
 
 void wxCleanUpPenWin(void)
 {
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
   if (g_hPenWin) {
     // Unregister this app
     if (RegPenApp != NULL)
diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp
index 8cc90dee02..477716f823 100644
--- a/src/msw/statbr95.cpp
+++ b/src/msw/statbr95.cpp
@@ -47,7 +47,7 @@
 #include  <commctrl.h>
 #endif
 
-#if     USE_NATIVE_STATUSBAR
+#if     wxUSE_NATIVE_STATUSBAR
 
 #if     !USE_SHARED_LIBRARY
   IMPLEMENT_DYNAMIC_CLASS(wxStatusBar95, wxStatusBar);
diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp
index 12b4f41ba8..ef1863c000 100644
--- a/src/msw/tbar95.cpp
+++ b/src/msw/tbar95.cpp
@@ -24,7 +24,7 @@
 #include "wx.h"
 #endif
 
-#if USE_BUTTONBAR && USE_TOOLBAR && defined(__WIN95__)
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR && defined(__WIN95__)
 
 #ifndef __GNUWIN32__
 #include "malloc.h"
diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp
index e891c5e436..84bf089014 100644
--- a/src/msw/tbarmsw.cpp
+++ b/src/msw/tbarmsw.cpp
@@ -24,7 +24,7 @@
 #include "wx.h"
 #endif
 
-#if USE_BUTTONBAR && USE_TOOLBAR
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
 
 #ifndef __GNUWIN32__
 #include "malloc.h"
@@ -47,7 +47,7 @@
 /////// Non-Windows 95 implementation
 
 #if !USE_IMAGE_LOADING_IN_MSW
-#error If USE_IMAGE_LOADING_IN_MSW is set to 0, then USE_BUTTONBAR must be set to 0 too.
+#error If wxUSE_IMAGE_LOADING_IN_MSW is set to 0, then wxUSE_BUTTONBAR must be set to 0 too.
 #endif
 
 #if !USE_SHARED_LIBRARY
diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp
index b764620b40..7ff7b78356 100644
--- a/src/msw/textctrl.cpp
+++ b/src/msw/textctrl.cpp
@@ -25,7 +25,7 @@
 #include "wx/settings.h"
 #endif
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 #include "wx/app.h"
 #include "wx/clipbrd.h"
 #endif
diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp
index d495c7f480..6b2ec26550 100644
--- a/src/msw/utils.cpp
+++ b/src/msw/utils.cpp
@@ -189,7 +189,7 @@ bool wxGetUserName(char *buf, int maxSize)
     return *buf ? TRUE : FALSE;
 //  }
 #else
-#if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && USE_PENWINDOWS
+#if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && wxUSE_PENWINDOWS
   extern HANDLE g_hPenWin; // PenWindows Running?
   if (g_hPenWin)
   {
@@ -366,7 +366,7 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 #  ifdef __WINDOWS_386__
   retValue = wxWIN386;
 #  else
-#    if !defined(__WATCOMC__) && !defined(GNUWIN32) && USE_PENWINDOWS
+#    if !defined(__WATCOMC__) && !defined(GNUWIN32) && wxUSE_PENWINDOWS
   extern HANDLE g_hPenWin;
   retValue = g_hPenWin ? wxPENWINDOWS : wxWINDOWS ;
 #    endif
@@ -379,7 +379,7 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 }
 
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
 bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
 {
   if (file != "")
@@ -469,7 +469,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c
   }
   else return FALSE;
 }
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
 
 // Old cursor
 static HCURSOR wxBusyCursorOld = 0;
diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index db9a0969bd..9470cf692b 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -37,11 +37,11 @@
 #include "wx/msgdlg.h"
 #endif
 
-#if     USE_OWNER_DRAWN
+#if     wxUSE_OWNER_DRAWN
 #include "wx/ownerdrw.h"
 #endif
 
-#if     USE_DRAG_AND_DROP
+#if     wxUSE_DRAG_AND_DROP
 #include "wx/msw/ole/droptgt.h"
 #endif
 
@@ -264,7 +264,7 @@ wxWindow::wxWindow(void)
   m_lastEvent = -1;
   m_returnCode = 0;
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
   m_pDropTarget = NULL;
 #endif
 }
@@ -284,7 +284,7 @@ wxWindow::~wxWindow(void)
   // Have to delete constraints/sizer FIRST otherwise
   // sizers may try to look at deleted windows as they
   // delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
   DeleteRelatedConstraints();
   if (m_constraints)
   {
@@ -379,7 +379,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
   m_sizerParent = NULL;
   m_autoLayout = FALSE;
   m_windowValidator = NULL;
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
   m_pDropTarget = NULL;
 #endif
 
@@ -538,7 +538,7 @@ wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler)
     return NULL;
 }
 
-#if    USE_DRAG_AND_DROP
+#if    wxUSE_DRAG_AND_DROP
 
 void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
 {
@@ -1591,7 +1591,7 @@ bool wxWindow::MSWOnDestroy(void)
   wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
 #endif
   // delete our drop target if we've got one
-  #if USE_DRAG_AND_DROP
+  #if wxUSE_DRAG_AND_DROP
     if ( m_pDropTarget != NULL ) {
       m_pDropTarget->Revoke(m_hWnd);
 
@@ -1745,7 +1745,7 @@ void wxWindow::MSWOnDropFiles(WXWPARAM wParam)
 
 bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
 {
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( id == 0 ) {    // is it a menu item?
       DRAWITEMSTRUCT *pDrawStruct = (DRAWITEMSTRUCT *)itemStruct;
       wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
@@ -1766,7 +1766,7 @@ bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
 #endif  // owner-drawn menus
 
   wxWindow *item = FindItem(id);
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
   if (item && item->IsKindOf(CLASSINFO(wxControl)))
   {
     return ((wxControl *)item)->MSWOnDraw(itemStruct);
@@ -1778,7 +1778,7 @@ bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
 
 bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
 {
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
     if ( id == 0 ) {    // is it a menu item?
       MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct;
       wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
@@ -1790,7 +1790,7 @@ bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
 #endif  // owner-drawn menus
 
   wxWindow *item = FindItem(id);
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
   if (item && item->IsKindOf(CLASSINFO(wxControl)))
   {
     return ((wxControl *)item)->MSWOnMeasure(itemStruct);
diff --git a/src/qt/app.cpp b/src/qt/app.cpp
index f54a6806e2..f34b677837 100644
--- a/src/qt/app.cpp
+++ b/src/qt/app.cpp
@@ -28,7 +28,7 @@
 #include "wx/log.h"
 #include "wx/module.h"
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 #endif
 
@@ -63,12 +63,12 @@ void wxApp::CommonInit()
   wxTheColourDatabase->Initialize();
   wxInitializeStockObjects();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   wxInitializeResourceSystem();
 #endif
 
   // For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData();
   wxThePrintPaperDatabase = new wxPrintPaperDatabase;
   wxThePrintPaperDatabase->CreateDatabase();
@@ -84,7 +84,7 @@ void wxApp::CommonCleanUp()
 {
   wxModule::CleanUpModules();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   wxCleanUpResourceSystem();
 #endif
 
@@ -106,7 +106,7 @@ void wxApp::CommonCleanUp()
   delete wxTheColourDatabase;
   wxTheColourDatabase = NULL;
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData(FALSE);
   delete wxThePrintPaperDatabase;
   wxThePrintPaperDatabase = NULL;
@@ -125,7 +125,7 @@ int wxEntry( int argc, char *argv[] )
 {
   wxClassInfo::InitializeClasses();
   
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
 #if !defined(_WINDLL)
   streambuf* sBuf = new wxDebugStreamBuf;
@@ -182,7 +182,7 @@ int wxEntry( int argc, char *argv[] )
   
   wxApp::CommonCleanUp();
   
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (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/qt/data.cpp b/src/qt/data.cpp
index d706f82334..6748ee636f 100644
--- a/src/qt/data.cpp
+++ b/src/qt/data.cpp
@@ -127,7 +127,7 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
 const char *wxFloatToStringStr = "%.2f";
 const char *wxDoubleToStringStr = "%.2f";
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
 #endif
 
diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp
index 3d9b5b0004..56f72c6dfe 100644
--- a/src/qt/frame.cpp
+++ b/src/qt/frame.cpp
@@ -34,7 +34,7 @@ END_EVENT_TABLE()
 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 bool wxFrame::m_useNativeStatusBar = TRUE;
 #else
 bool wxFrame::m_useNativeStatusBar = FALSE;
@@ -312,7 +312,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
-  #if USE_CONSTRAINTS
+  #if wxUSE_CONSTRAINTS
     if ( GetAutoLayout() ) {
       Layout();
       return;
diff --git a/src/qt/mdi.cpp b/src/qt/mdi.cpp
index bcd7785c0d..3823536063 100644
--- a/src/qt/mdi.cpp
+++ b/src/qt/mdi.cpp
@@ -95,7 +95,7 @@ void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
 
 void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     if (GetAutoLayout())
       Layout();
 #endif
diff --git a/src/qt/window.cpp b/src/qt/window.cpp
index 341ad00e51..603f29994f 100644
--- a/src/qt/window.cpp
+++ b/src/qt/window.cpp
@@ -30,7 +30,7 @@
 #include "wx/menuitem.h"
 #include "wx/log.h"
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
 #include "wx/dnd.h"
 #endif
 
@@ -79,7 +79,7 @@ wxWindow::wxWindow()
     m_defaultForegroundColour = *wxBLACK ;
     m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
     m_pDropTarget = NULL;
 #endif
 }
@@ -90,7 +90,7 @@ wxWindow::~wxWindow()
 	// Have to delete constraints/sizer FIRST otherwise
 	// sizers may try to look at deleted windows as they
 	// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     DeleteRelatedConstraints();
     if (m_constraints)
     {
@@ -157,7 +157,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
     m_autoLayout = FALSE;
     m_windowValidator = NULL;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
     m_pDropTarget = NULL;
 #endif
 
@@ -249,7 +249,7 @@ wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler)
 		return NULL;
 }
 
-#if    USE_DRAG_AND_DROP
+#if    wxUSE_DRAG_AND_DROP
 
 void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
 {
diff --git a/src/stubs/app.cpp b/src/stubs/app.cpp
index 6274caf50e..3b4f618bb6 100644
--- a/src/stubs/app.cpp
+++ b/src/stubs/app.cpp
@@ -29,11 +29,11 @@
 #include "wx/module.h"
 #include "wx/memory.h"
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 #endif
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 #include "wx/postscrp.h"
 #endif
 
@@ -61,7 +61,7 @@ bool wxApp::Initialize()
   wxBuffer = new char[BUFSIZ + 512];
 #endif
 
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
 
   streambuf* sBuf = new wxDebugStreamBuf;
   ostream* oStr = new ostream(sBuf) ;
@@ -75,12 +75,12 @@ bool wxApp::Initialize()
   wxTheColourDatabase->Initialize();
   wxInitializeStockObjects();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   wxInitializeResourceSystem();
 #endif
 
   // For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData();
   wxThePrintPaperDatabase = new wxPrintPaperDatabase;
   wxThePrintPaperDatabase->CreateDatabase();
@@ -98,7 +98,7 @@ void wxApp::CleanUp()
 {
   wxModule::CleanUpModules();
 
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
   wxCleanUpResourceSystem();
 #endif
 
@@ -121,7 +121,7 @@ void wxApp::CleanUp()
   delete wxTheColourDatabase;
   wxTheColourDatabase = NULL;
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
   wxInitializePrintSetupData(FALSE);
   delete wxThePrintPaperDatabase;
   wxThePrintPaperDatabase = NULL;
@@ -192,7 +192,7 @@ int wxEntry( int argc, char *argv[] )
   delete wxTheApp;
   wxTheApp = NULL;
   
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (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/data.cpp b/src/stubs/data.cpp
index ae2895408b..6245f1607c 100644
--- a/src/stubs/data.cpp
+++ b/src/stubs/data.cpp
@@ -127,11 +127,11 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
 const char *wxFloatToStringStr = "%.2f";
 const char *wxDoubleToStringStr = "%.2f";
 
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
 wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
 #endif
 
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
 ///// Event tables (also must be in one, statically-linked file for shared libraries)
 
 // This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp
index 5326e615d9..591b59e4f4 100644
--- a/src/stubs/frame.cpp
+++ b/src/stubs/frame.cpp
@@ -39,7 +39,7 @@ END_EVENT_TABLE()
 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 bool wxFrame::m_useNativeStatusBar = TRUE;
 #else
 bool wxFrame::m_useNativeStatusBar = FALSE;
@@ -312,7 +312,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
-  #if USE_CONSTRAINTS
+  #if wxUSE_CONSTRAINTS
     if ( GetAutoLayout() ) {
       Layout();
       return;
diff --git a/src/stubs/mdi.cpp b/src/stubs/mdi.cpp
index 95e05263a0..4869697cd7 100644
--- a/src/stubs/mdi.cpp
+++ b/src/stubs/mdi.cpp
@@ -97,7 +97,7 @@ void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
 
 void wxMDIParentFrame::OnSize(wxSizeEvent& event)
 {
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     if (GetAutoLayout())
       Layout();
 #endif
diff --git a/src/stubs/utils.cpp b/src/stubs/utils.cpp
index 8d9cbf0387..940bdc21bc 100644
--- a/src/stubs/utils.cpp
+++ b/src/stubs/utils.cpp
@@ -122,7 +122,7 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 }
 
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
 bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
 {
     // TODO
@@ -194,7 +194,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c
   }
   else return FALSE;
 }
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
 
 static int wxBusyCursorCount = 0;
 
diff --git a/src/stubs/window.cpp b/src/stubs/window.cpp
index 62937732c5..cb9aec4ea6 100644
--- a/src/stubs/window.cpp
+++ b/src/stubs/window.cpp
@@ -31,7 +31,7 @@
 #include "wx/menuitem.h"
 #include "wx/log.h"
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
 #include "wx/dnd.h"
 #endif
 
@@ -80,7 +80,7 @@ wxWindow::wxWindow()
     m_defaultForegroundColour = *wxBLACK ;
     m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
 
-#if  USE_DRAG_AND_DROP
+#if  wxUSE_DRAG_AND_DROP
     m_pDropTarget = NULL;
 #endif
 }
@@ -91,7 +91,7 @@ wxWindow::~wxWindow()
 	// Have to delete constraints/sizer FIRST otherwise
 	// sizers may try to look at deleted windows as they
 	// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
     DeleteRelatedConstraints();
     if (m_constraints)
     {
@@ -158,7 +158,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
     m_autoLayout = FALSE;
     m_windowValidator = NULL;
 
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
     m_pDropTarget = NULL;
 #endif
 
@@ -250,7 +250,7 @@ wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler)
 		return NULL;
 }
 
-#if    USE_DRAG_AND_DROP
+#if    wxUSE_DRAG_AND_DROP
 
 void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
 {
diff --git a/utils/ogl/samples/ogledit/doc.cpp b/utils/ogl/samples/ogledit/doc.cpp
index 484442a349..c5e9731231 100644
--- a/utils/ogl/samples/ogledit/doc.cpp
+++ b/utils/ogl/samples/ogledit/doc.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "ogledit.h"
diff --git a/utils/ogl/samples/ogledit/ogledit.cpp b/utils/ogl/samples/ogledit/ogledit.cpp
index ee31750c2b..7e2e666e81 100644
--- a/utils/ogl/samples/ogledit/ogledit.cpp
+++ b/utils/ogl/samples/ogledit/ogledit.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "ogledit.h"
diff --git a/utils/ogl/samples/ogledit/view.cpp b/utils/ogl/samples/ogledit/view.cpp
index 2ff5d84b5a..cf7a59c940 100644
--- a/utils/ogl/samples/ogledit/view.cpp
+++ b/utils/ogl/samples/ogledit/view.cpp
@@ -27,7 +27,7 @@
 #include <wx/colordlg.h>
 
 #if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
 #include "ogledit.h"
diff --git a/utils/ogl/src/basic.cpp b/utils/ogl/src/basic.cpp
index 5a8b417ee3..33d25bdf21 100644
--- a/utils/ogl/src/basic.cpp
+++ b/utils/ogl/src/basic.cpp
@@ -28,7 +28,7 @@
 #include <wx/wxexpr.h>
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/utils/ogl/src/basic2.cpp b/utils/ogl/src/basic2.cpp
index d959c5e5c1..e54c84bbeb 100644
--- a/utils/ogl/src/basic2.cpp
+++ b/utils/ogl/src/basic2.cpp
@@ -27,7 +27,7 @@
 #include <wx/wxexpr.h>
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/utils/ogl/src/canvas.cpp b/utils/ogl/src/canvas.cpp
index d0ca4ee7c8..39f91a3420 100644
--- a/utils/ogl/src/canvas.cpp
+++ b/utils/ogl/src/canvas.cpp
@@ -28,7 +28,7 @@
 #include <wx/wxexpr.h>
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp
index 90a524d118..56508e4c43 100644
--- a/utils/ogl/src/lines.cpp
+++ b/utils/ogl/src/lines.cpp
@@ -28,7 +28,7 @@
 #include <wx/wxexpr.h>
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/utils/ogl/src/misc.cpp b/utils/ogl/src/misc.cpp
index 03a9b5a4fc..4d9d814d24 100644
--- a/utils/ogl/src/misc.cpp
+++ b/utils/ogl/src/misc.cpp
@@ -30,7 +30,7 @@
 
 #include <wx/types.h>
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/utils/ogl/src/ogldiag.cpp b/utils/ogl/src/ogldiag.cpp
index 35deb671dd..d6c3f3672e 100644
--- a/utils/ogl/src/ogldiag.cpp
+++ b/utils/ogl/src/ogldiag.cpp
@@ -28,7 +28,7 @@
 #include <wx/wxexpr.h>
 #endif
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
 #include <iostream>
diff --git a/utils/wxPython/src/helpers.cpp b/utils/wxPython/src/helpers.cpp
index 6649ed56c8..4aba1c4abf 100644
--- a/utils/wxPython/src/helpers.cpp
+++ b/utils/wxPython/src/helpers.cpp
@@ -22,7 +22,7 @@
 #include "helpers.h"
 
 #ifdef __WXGTK__
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
 #include "gdk_imlib/gdk_imlib.h"
 #endif
 #endif
@@ -139,7 +139,7 @@ void __wxPreStart()
     gtk_init( &argc, &argv );
     delete [] argv;
 
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
     gdk_imlib_init();
     gtk_widget_push_visual(gdk_imlib_get_visual());
     gtk_widget_push_colormap(gdk_imlib_get_colormap());
@@ -651,6 +651,10 @@ wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source) {
 /////////////////////////////////////////////////////////////////////////////
 //
 // $Log$
+// Revision 1.9  1998/09/25 13:28:52  VZ
+// USE_xxx constants renamed to wxUSE_xxx. This is an incompatible change, you
+// must recompile everything after upgrading!
+//
 // Revision 1.8  1998/08/27 21:59:08  RD
 // Some chicken-and-egg problems solved for wxPython on wxGTK
 //