]> git.saurik.com Git - wxWidgets.git/commitdiff
added wrapper for <commctrl.h> as well
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Aug 2003 10:57:51 +0000 (10:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Aug 2003 10:57:51 +0000 (10:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/files.bkl
include/wx/msw/wrapcctl.h [new file with mode: 0644]
src/msw/app.cpp
src/msw/listctrl.cpp
src/msw/tbar95.cpp
src/msw/tooltip.cpp
src/msw/treectrl.cpp

index 19b70f1c4e9f4cf172e94b092dc1c666a91071e8..c87a7ab06a5a7b002f16b1721c7be1dc1bdd77e0 100644 (file)
@@ -81,6 +81,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/msw/gccpriv.h
     wx/msw/mimetype.h
     wx/msw/winundef.h
+    wx/msw/wrapcctl.h
     wx/msw/wrapwin.h
 </set>
 
diff --git a/include/wx/msw/wrapcctl.h b/include/wx/msw/wrapcctl.h
new file mode 100644 (file)
index 0000000..fb26166
--- /dev/null
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/msw/wrapcctl.h
+// Purpose:     Wrapper for the standard <commctrl.h> header
+// Author:      Vadim Zeitlin
+// Modified by:
+// Created:     03.08.2003
+// RCS-ID:      $Id$
+// Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MSW_WRAPCCTL_H_
+#define _WX_MSW_WRAPCCTL_H_
+
+// define _WIN32_IE to a high value because we always check for the version
+// of installed DLLs at runtime anyway (see wxApp::GetComCtl32Version()) unless
+// the user really doesn't want it and had defined it to a (presumably lower)
+// value
+//
+// just for the reference, here is the table showing what the different value
+// of _WIN32_IE correspond to:
+//
+// 0x0200     for comctl32.dll 4.00 shipped with Win95/NT 4.0
+// 0x0300                      4.70              IE 3.x
+// 0x0400                      4.71              IE 4.0
+// 0x0401                      4.72              IE 4.01 and Win98
+// 0x0500                      5.80              IE 5.x
+// 0x0500                      5.81              Win2k/ME
+// 0x0600                      6.00              WinXP
+
+#ifndef _WIN32_IE
+    // use maximal set of features by default, we check for them during
+    // run-time anyhow
+    #define _WIN32_IE 0x0600
+#endif // !defined(_WIN32_IE)
+
+#if defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)
+    #include "wx/msw/gnuwin32/extra.h"
+#else
+    #include <commctrl.h>
+#endif
+
+// define things which might be missing from our commctrl.h
+#include "wx/msw/missing.h"
+
+#endif // _WX_MSW_WRAPCCTL_H_
+
index 007b5241e4fe89c8ba2356c29b1cdec7e0bb3d30..24768fe1a5fd4570cc7c67eb44bb626ec456cb3e 100644 (file)
 #include <string.h>
 #include <ctype.h>
 
-#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__WXMICROWIN__)) && !defined(__CYGWIN10__))
-    #include <commctrl.h>
-#endif
-
-// ----------------------------------------------------------------------------
-// conditional compilation
-// ----------------------------------------------------------------------------
-
-// The macro _WIN32_IE is defined by commctrl.h (unless it had already been
-// defined before) and shows us what common control features are available
-// during the compile time (it doesn't mean that they will be available during
-// the run-time, use GetComCtl32Version() to test for them!). The possible
-// values are:
-//
-// 0x0200     for comctl32.dll 4.00 shipped with Win95/NT 4.0
-// 0x0300                      4.70              IE 3.x
-// 0x0400                      4.71              IE 4.0
-// 0x0401                      4.72              IE 4.01 and Win98
-// 0x0500                      5.80              IE 5.x
-// 0x0500                      5.81              Win2k/ME
-// 0x0600                      6.00              WinXP
-
-#ifndef _WIN32_IE
-    // use maximal set of features by default, we check for them during
-    // run-time anyhow
-    #define _WIN32_IE 0x0600
-#endif
+#include "wx/msw/wrapcctl.h"
 
 #if (!defined(__MINGW32__) || wxCHECK_W32API_VERSION( 2, 0 )) && \
     !defined(__CYGWIN__) && !defined(__WXWINCE__) && \
index f86daaf9cb1c5b933832b576debefe4e1bb28486..6d6aac182d3396503319a52022f0e5ead63202bc 100644 (file)
 
 #include "wx/msw/private.h"
 
-#if defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)
-    #include "wx/msw/gnuwin32/extra.h"
-#else
-    #include <commctrl.h>
-#endif
-
-#include "wx/msw/missing.h"
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
 
 // ----------------------------------------------------------------------------
 // private functions
index bf12362f39c85035853377b0b3d8f1ce979fdf82..7276787ba478f59d4f6de15392da4278d90eaf51 100644 (file)
 
 #include "wx/msw/private.h"
 
-#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__))
-    #include <commctrl.h>
-#else
-    #include "wx/msw/gnuwin32/extra.h"
-#endif
-
-#include "wx/msw/missing.h"
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
 
 #include "wx/app.h"         // for GetComCtl32Version
 
-#if defined(__MWERKS__) && defined(__WXMSW__)
-// including <windef.h> for max definition doesn't seem
-// to work using CodeWarrior 6 Windows. So we define it
-// here. (Otherwise we get a undefined identifier 'max'
-// later on in this file.) (Added by dimitri@shortcut.nl)
-#   ifndef max
-#       define max(a,b)            (((a) > (b)) ? (a) : (b))
-#   endif
-
-#endif
-
 // ----------------------------------------------------------------------------
 // conditional compilation
 // ----------------------------------------------------------------------------
index bdcd7478b4826091cf11f013147dbd962cc14a91..29b03ade78ca98c44d7f64d4e0edaa8a6d201b79 100644 (file)
@@ -32,9 +32,8 @@
 #include "wx/tooltip.h"
 #include "wx/msw/private.h"
 
-#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__))
-    #include <commctrl.h>
-#endif
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
 
 // VZ: normally, the trick with subclassing the tooltip control and processing
 //     TTM_WINDOWFROMPOINT should work but, somehow, it doesn't. I leave the
index 0d4e6271959766023de90bc1a590483edb9d5d72..2be2afb6c6becfb4d78b544b6d71a271d3bac23c 100644 (file)
 #include "wx/msw/treectrl.h"
 #include "wx/msw/dragimag.h"
 
-#ifdef __GNUWIN32_OLD__
-    #include "wx/msw/gnuwin32/extra.h"
-#endif
-
-#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__))
-    #include <commctrl.h>
-#endif
-
-// Bug in headers, sometimes
-#ifndef TVIS_FOCUSED
-    #define TVIS_FOCUSED            0x0001
-#endif
-
-#ifndef TV_FIRST
-    #define TV_FIRST                0x1100
-#endif
-
-#ifndef TVS_CHECKBOXES
-    #define TVS_CHECKBOXES          0x0100
-#endif
-
-#ifndef TVS_FULLROWSELECT
-    #define TVS_FULLROWSELECT       0x1000
-#endif
-
-// old headers might miss these messages (comctl32.dll 4.71+ only)
-#ifndef TVM_SETBKCOLOR
-    #define TVM_SETBKCOLOR          (TV_FIRST + 29)
-    #define TVM_SETTEXTCOLOR        (TV_FIRST + 30)
-#endif
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
 
 // macros to hide the cast ugliness
 // --------------------------------