From 5b59df83150f65cf440553b11fcc839896d65cf7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Aug 2003 23:26:30 +0000 Subject: [PATCH] avoid using _WIN32_IE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 27 +++++++++++++++------------ src/msw/tbar95.cpp | 2 +- src/msw/tooltip.cpp | 9 ++------- src/msw/treectrl.cpp | 6 ++++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index c459899173..f86daaf9cb 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -636,12 +636,16 @@ bool wxListCtrl::GetColumn(int col, wxListItem& item) const } } -#if _WIN32_IE >= 0x0300 + // the column images were not supported in older versions but how to check + // for this? we can't use _WIN32_IE because we always define it to a very + // high value, so see if another symbol which is only defined starting from + // comctl32.dll 4.70 is available +#ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300 if ( item.m_mask & wxLIST_MASK_IMAGE ) { item.m_image = lvCol.iImage; } -#endif +#endif // LVCOLUMN::iImage exists return success; } @@ -2066,9 +2070,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } break; -#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 \ - && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) ) - case NM_CUSTOMDRAW: +#ifdef NM_CUSTOMDRAW *result = OnCustomDraw(lParam); return TRUE; @@ -2109,13 +2111,13 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxStrncpy(lvi.pszText, text, lvi.cchTextMax); } -#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 \ - && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 1 ) ) + // see comment at the end of wxListCtrl::GetColumn() +#ifdef NM_CUSTOMDRAW if ( lvi.mask & LVIF_IMAGE ) { lvi.iImage = OnGetItemImage(item); } -#endif +#endif // NM_CUSTOMDRAW // a little dose of healthy paranoia: as we never use // LVM_SETCALLBACKMASK we're not supposed to get these ones @@ -2179,7 +2181,8 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) return processed; } -#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 +// see comment at the end of wxListCtrl::GetColumn() +#ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300 WXLPARAM wxListCtrl::OnCustomDraw(WXLPARAM lParam) { @@ -2641,8 +2644,8 @@ static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item, lvCol.cx = item.m_width; } -#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 \ - && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 1 ) ) + // see comment at the end of wxListCtrl::GetColumn() +#ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300 if ( item.m_mask & wxLIST_MASK_IMAGE ) { if ( wxTheApp->GetComCtl32Version() >= 470 ) @@ -2652,7 +2655,7 @@ static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item, } //else: it doesn't support item images anyhow } -#endif +#endif // _WIN32_IE >= 0x0300 } #endif // wxUSE_LISTCTRL diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index f6fd243ceb..bf12362f39 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -796,7 +796,7 @@ bool wxToolBar::Realize() int left = -1; // TB_SETBUTTONINFO message is only supported by comctl32.dll 4.71+ -#if defined(_WIN32_IE) && (_WIN32_IE >= 0x400 ) +#ifdef TB_SETBUTTONINFO // available in headers, now check whether it is available now // (during run-time) if ( wxTheApp->GetComCtl32Version() >= 471 ) diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 8c50c9bd3e..bdcd7478b4 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -36,11 +36,6 @@ #include #endif -#ifndef _WIN32_IE - // minimal set of features by default - #define _WIN32_IE 0x0200 -#endif - // VZ: normally, the trick with subclassing the tooltip control and processing // TTM_WINDOWFROMPOINT should work but, somehow, it doesn't. I leave the // code here for now (but it's not compiled) in case we need it later. @@ -295,10 +290,10 @@ void wxToolTip::Add(WXHWND hWnd) if ( index != wxNOT_FOUND ) { -#if _WIN32_IE >= 0x0300 +#ifdef TTM_SETMAXTIPWIDTH if ( wxTheApp->GetComCtl32Version() >= 470 ) { - // use TTM_SETMAXWIDTH to make tooltip multiline using the + // use TTM_SETMAXTIPWIDTH to make tooltip multiline using the // extent of its first line as max value HFONT hfont = (HFONT)SendTooltipMessage(GetToolTipCtrl(), WM_GETFONT, diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index b8a78965fd..0d4e627195 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2543,7 +2543,9 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } break; -#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 && !wxUSE_COMCTL32_SAFELY && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) ) + // instead of explicitly checking for _WIN32_IE, check if the + // required symbols are available in the headers +#if defined(CDDS_PREPAINT) && !wxUSE_COMCTL32_SAFELY case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW)lParam; @@ -2638,7 +2640,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // we always process it return true; -#endif // _WIN32_IE >= 0x300 +#endif // have owner drawn support in headers case NM_CLICK: { -- 2.45.2