applied patch 446014 (misc mingw fixes from Mattia)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-08-02 19:02:17 +00:00
parent 4acb6ca672
commit bf9b6266fa
8 changed files with 31 additions and 13 deletions

View File

@ -37,6 +37,12 @@
#endif
#endif // Win32
#if defined(__WXMSW__) || defined(__WIN32__)
#if !defined(__WINDOWS__)
#define __WINDOWS__
#endif
#endif
#ifdef __WXWINE__
#ifndef __WIN32__
#define __WIN32__

View 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)
};
// ----------------------------------------------------------------------------

View 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

View 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)

View 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 )

View 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);

View 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 ))) ;

View 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;