]> git.saurik.com Git - wxWidgets.git/commitdiff
applied patch 446014 (misc mingw fixes from Mattia)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 2 Aug 2001 19:02:17 +0000 (19:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 2 Aug 2001 19:02:17 +0000 (19:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
include/wx/listctrl.h
include/wx/msw/gccpriv.h
src/generic/listctrl.cpp
src/msw/dialup.cpp
src/msw/listctrl.cpp
src/msw/tbar95.cpp
src/msw/treectrl.cpp

index 19cefa67f6334f82a2fef0cee38035047dea76bd..8cb02a12d82a446f5d4fe9ed5ce6f40c922512ae 100644 (file)
     #endif
 #endif // Win32
 
+#if defined(__WXMSW__) || defined(__WIN32__)
+    #if !defined(__WINDOWS__)
+        #define __WINDOWS__
+    #endif
+#endif
+
 #ifdef __WXWINE__
     #ifndef __WIN32__
         #define __WIN32__
index f8f79a1e4c15c5777f1b7c8f5c21e3da428c5603..8526b2ef274468a4852a5d83103d44197acfebd1 100644 (file)
@@ -331,6 +331,8 @@ public:
     // return TRUE if the item is selected
     bool IsSelected(long index)
         { return GetItemState(index, wxLIST_STATE_SELECTED) != 0; }
+private:
+    DECLARE_DYNAMIC_CLASS(wxListView)
 };
 
 // ----------------------------------------------------------------------------
index 1776267b2bf407fd4df8151404a76356f3673be2..c0e84b250b3b59f00cad8dc70812d75999ab1abf 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef _WX_MSW_GCCPRIV_H_
 #define _WX_MSW_GCCPRIV_H_
 
-#if defined( __MINGW32__ )
-    //#include <_mingw.h>
-    #if __MINGW32_MAJOR_VERSION >= 1
-        #ifndef HAVE_W32API_H
-        #define HAVE_W32API_H
+#if defined( __MINGW32__ ) && !defined( HAVE_W32API_H )
+    #if ( __GNUC__ > 2 ) || ( ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 95 ) )
+        #include <_mingw.h>
+        #if __MINGW32_MAJOR_VERSION >= 1
+            #define HAVE_W32API_H
         #endif
     #endif
 #endif
index 85d1144fdcd8c5ecc4653693018b66bbb6e08614..93b43f15299222f55d10f7e47e2510c28db4a75e 100644 (file)
@@ -4317,6 +4317,7 @@ void wxListEvent::CopyObject(wxObject& object_dest) const
 // -------------------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
 
 BEGIN_EVENT_TABLE(wxListCtrl,wxControl)
   EVT_SIZE(wxListCtrl::OnSize)
index 5d94d8d8dfa9ca6bfa8885a5b1b69765f82804ed..e7a00a506b984db8399bbd74be19962806cad3ae 100644 (file)
@@ -864,9 +864,17 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP,
 
     if ( dwRet != 0 )
     {
+#if wxUSE_UNICODE
+        // can't pass a wxWCharBuffer through ( ... )
+        wxLogError(_("Failed to %s dialup connection: %s").data(),
+                   async ? _("initiate").data() : _("establish").data(),
+                   GetErrorString(dwRet).c_str());
+#else
+        // can't pass a wxWCharBuffer through ( ... )
         wxLogError(_("Failed to %s dialup connection: %s"),
                    wxString(async ? _("initiate") : _("establish")).c_str(),
                    GetErrorString(dwRet).c_str());
+#endif
 
         // we should still call RasHangUp() if we got a non 0 connection
         if ( ms_hRasConnection )
index c974aaf47f2bfc6dcd5078e7c194d9bb24f84b2f..63eb8ffba08c76b8aa18b5ef1f51c48f702f913e 100644 (file)
@@ -123,6 +123,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT)
 
 IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
 IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
 
 BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
@@ -480,20 +481,19 @@ long wxListCtrl::ConvertToMSWStyle(long& oldStyle, long style) const
         wstyle |= LVS_SORTDESCENDING;
     }
 
+#if !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )
     if ( style & wxLC_VIRTUAL )
     {
         int ver = wxTheApp->GetComCtl32Version();
         if ( ver < 470 )
         {
-            wxLogWarning(_("Please install a newer version of comctl32.dll\n"
-                           "(at least version 4.70 is required but you have "
-                           "%d.%02d)\n"
-                           "or this program won't operate correctly."),
+            wxLogWarning(_("Please install a newer version of comctl32.dll\n(at least version 4.70 is required but you have %d.%02d)\nor this program won't operate correctly."),
                         ver / 100, ver % 100);
         }
 
         wstyle |= LVS_OWNERDATA;
     }
+#endif
 
     return wstyle;
 }
@@ -1625,7 +1625,8 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             break;
 #endif // 0
 
-#if defined(_WIN32_IE) && _WIN32_IE >= 0x300
+#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 \
+    && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )
         case NM_CUSTOMDRAW:
             *result = OnCustomDraw(lParam);
 
index 7d209cc8016112118752b7f25e2e016d62c4d31d..f1ed7ca012dbc8808beba69bc7d6825cff8adfa2 100644 (file)
@@ -1058,7 +1058,7 @@ void wxToolBar::MapBitmap(WXHBITMAP bitmap, int width, int height)
     //  ColorMap[4].from = sm_stdColours[4]; ColorMap[4].to = COLOR_HIGHLIGHT;  // blue         (0, 0, 255)
     ColorMap[4].from = sm_stdColours[5]; ColorMap[4].to = COLOR_WINDOW;       // magenta      (255, 0, 255)
 
-    for ( int n = 0; n < WXSIZEOF(ColorMap); n++)
+    for ( size_t n = 0; n < WXSIZEOF(ColorMap); n++)
     {
         ColorMap[n].to = ::GetSysColor(ColorMap[n].to);
     }
@@ -1076,7 +1076,7 @@ void wxToolBar::MapBitmap(WXHBITMAP bitmap, int width, int height)
             {
                 COLORREF pixel = ::GetPixel(hdcMem, i, j);
 
-                for ( int k = 0; k < WXSIZEOF(ColorMap); k++ )
+                for ( size_t k = 0; k < WXSIZEOF(ColorMap); k++ )
                 {
                     int distance = abs( GetRValue( pixel ) - GetRValue( ColorMap[k].from )) ;
                     distance = max( distance , abs(GetGValue(pixel ) - GetGValue( ColorMap[k].from ))) ;
index 5d48e4c93815db5107e3f9da8a64baeba25f5aad..5e20b78bb5c26135d1c65515d423863e6ea62a47 100644 (file)
@@ -2141,7 +2141,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             }
             break;
 
-#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 && !wxUSE_COMCTL32_SAFELY && !defined(__GNUWIN32__)
+#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 && !wxUSE_COMCTL32_SAFELY && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )
         case NM_CUSTOMDRAW:
             {
                 LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW)lParam;