]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid using _WIN32_IE
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Aug 2003 23:26:30 +0000 (23:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Aug 2003 23:26:30 +0000 (23:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp
src/msw/tbar95.cpp
src/msw/tooltip.cpp
src/msw/treectrl.cpp

index c4598991730b07184c0f2d32f5ce34a83dc64770..f86daaf9cb1c5b933832b576debefe4e1bb28486 100644 (file)
@@ -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
index f6fd243ceb1754cfdf7a16353892b920de7f8d32..bf12362f39c85035853377b0b3d8f1ce979fdf82 100644 (file)
@@ -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 )
index 8c50c9bd3e7c80f968648a8c0b66d8c67b7db2b6..bdcd7478b4826091cf11f013147dbd962cc14a91 100644 (file)
     #include <commctrl.h>
 #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,
index b8a78965fdbb47d409b973fa73d0939c221ca876..0d4e6271959766023de90bc1a590483edb9d5d72 100644 (file)
@@ -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:
             {