From 0d236fd0faa89b4c3da04facdd50817f03207093 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Aug 2003 10:57:51 +0000 Subject: [PATCH] added wrapper for as well git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build/bakefiles/files.bkl | 1 + include/wx/msw/wrapcctl.h | 47 +++++++++++++++++++++++++++++++++++++++ src/msw/app.cpp | 28 +---------------------- src/msw/listctrl.cpp | 9 ++------ src/msw/tbar95.cpp | 20 ++--------------- src/msw/tooltip.cpp | 5 ++--- src/msw/treectrl.cpp | 32 ++------------------------ 7 files changed, 57 insertions(+), 85 deletions(-) create mode 100644 include/wx/msw/wrapcctl.h diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 19b70f1c4e..c87a7ab06a 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -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 diff --git a/include/wx/msw/wrapcctl.h b/include/wx/msw/wrapcctl.h new file mode 100644 index 0000000000..fb26166ee0 --- /dev/null +++ b/include/wx/msw/wrapcctl.h @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/msw/wrapcctl.h +// Purpose: Wrapper for the standard header +// Author: Vadim Zeitlin +// Modified by: +// Created: 03.08.2003 +// RCS-ID: $Id$ +// Copyright: (c) 2003 Vadim Zeitlin +// 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 +#endif + +// define things which might be missing from our commctrl.h +#include "wx/msw/missing.h" + +#endif // _WX_MSW_WRAPCCTL_H_ + diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 007b5241e4..24768fe1a5 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -85,33 +85,7 @@ #include #include -#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__WXMICROWIN__)) && !defined(__CYGWIN10__)) - #include -#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__) && \ diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index f86daaf9cb..6d6aac182d 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -45,13 +45,8 @@ #include "wx/msw/private.h" -#if defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__) - #include "wx/msw/gnuwin32/extra.h" -#else - #include -#endif - -#include "wx/msw/missing.h" +// include "properly" +#include "wx/msw/wrapcctl.h" // ---------------------------------------------------------------------------- // private functions diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index bf12362f39..7276787ba4 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -49,27 +49,11 @@ #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#else - #include "wx/msw/gnuwin32/extra.h" -#endif - -#include "wx/msw/missing.h" +// include "properly" +#include "wx/msw/wrapcctl.h" #include "wx/app.h" // for GetComCtl32Version -#if defined(__MWERKS__) && defined(__WXMSW__) -// including 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 // ---------------------------------------------------------------------------- diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index bdcd7478b4..29b03ade78 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -32,9 +32,8 @@ #include "wx/tooltip.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#endif +// include "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 diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 0d4e627195..2be2afb6c6 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -44,36 +44,8 @@ #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 -#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 "properly" +#include "wx/msw/wrapcctl.h" // macros to hide the cast ugliness // --------------------------------