From 567be1875494c4cb90a3bdff691f8545e4f6e41d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Aug 2003 00:16:06 +0000 Subject: [PATCH] wxUniv compilation fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/filedlgg.cpp | 4 ++-- src/msw/window.cpp | 51 +++++++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index d528b92b1e..17333175ab 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -180,7 +180,7 @@ void wxFileData::ReadData() #if defined(__DOS__) || defined(__WINDOWS__) // c:\.. is a drive don't stat it - if ((fileName == wxT("..")) && (filePath.length() <= 5)) + if ((m_fileName == wxT("..")) && (m_filePath.length() <= 5)) { m_type = is_drive; m_size = 0; @@ -225,7 +225,7 @@ void wxFileData::ReadData() buff.st_mode & wxS_IWOTH ? _T('w') : _T('-'), buff.st_mode & wxS_IXOTH ? _T('x') : _T('-')); #elif defined(__WIN32__) - DWORD attribs = GetFileAttributes(filePath); + DWORD attribs = GetFileAttributes(m_filePath); if (attribs != (DWORD)-1) { m_permissions.Printf(_T("%c%c%c%c"), diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 6099e4e34d..628575ecc0 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2348,13 +2348,15 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam case WM_PAINT: { - wxPaintDCEx *pdc = 0; - if (wParam) { - pdc = new wxPaintDCEx(this, (WXHDC) wParam); + if ( wParam ) + { + // cast to wxWindow is needed for wxUniv + wxPaintDCEx dc((wxWindow *)this, (WXHDC)wParam); + processed = HandlePaint(); } - processed = HandlePaint(); - if (pdc) { - delete pdc; + else + { + processed = HandlePaint(); } break; } @@ -3550,19 +3552,25 @@ bool wxWindowMSW::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct) #endif // USE_OWNER_DRAWN -#if wxUSE_CONTROLS +#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__) + wxControl *item = wxDynamicCast + ( + FindItem(id), #if wxUSE_OWNER_DRAWN - wxWindow *item = FindItem(id); - if ( item && item->IsKindOf(CLASSINFO(wxControl)) ) - return ((wxControl *)item)->MSWOnDraw(itemStruct); -#elif !defined(__WXUNIVERSAL__) - // we may still have owner-drawn buttons internally because we have to make - // them owner-drawn to support colour change - wxWindow *item = FindItem(id); - if ( item && item->IsKindOf(CLASSINFO(wxButton)) ) - return ((wxButton *)item)->MSWOnDraw(itemStruct); + wxControl +#else // !wxUSE_OWNER_DRAWN + // we may still have owner-drawn buttons internally + // because we have to make them owner-drawn to support + // colour change + wxButton #endif // USE_OWNER_DRAWN + ); + + if ( item ) + { + return item->MSWOnDraw(itemStruct); + } #endif // wxUSE_CONTROLS @@ -3571,7 +3579,7 @@ bool wxWindowMSW::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct) bool wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct) { -#if wxUSE_OWNER_DRAWN +#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__) // is it a menu item? MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct; if ( id == 0 && pMeasureStruct->CtlType == ODT_MENU ) @@ -3584,12 +3592,13 @@ bool wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct) &pMeasureStruct->itemHeight); } - wxWindow *item = FindItem(id); - if ( item && item->IsKindOf(CLASSINFO(wxControl)) ) + wxControl *item = wxDynamicCast(FindItem(id), wxControl); + if ( item ) { - return ((wxControl *)item)->MSWOnMeasure(itemStruct); + return item->MSWOnMeasure(itemStruct); } -#endif // owner-drawn menus +#endif // wxUSE_OWNER_DRAWN + return FALSE; } -- 2.45.2