]> git.saurik.com Git - wxWidgets.git/commitdiff
wxUniv compilation fixes
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Aug 2003 00:16:06 +0000 (00:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 2 Aug 2003 00:16:06 +0000 (00:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/filedlgg.cpp
src/msw/window.cpp

index d528b92b1ea9e0a7737a8d54f4fdc95b41cbd84c..17333175ab723ba599446ea666667d443115bf63 100644 (file)
@@ -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"),
index 6099e4e34d0cce6a44571335ac7fa73018c33870..628575ecc0a0e310f70d99f1c37fd788352c30f2 100644 (file)
@@ -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;
 }