]> git.saurik.com Git - wxWidgets.git/blobdiff - src/ribbon/page.cpp
Let wxMSW report wxDataViewCustomRenderer::LeftClick() report the click position...
[wxWidgets.git] / src / ribbon / page.cpp
index 5e7562f4a089652f5a1d4d2fc2e3b20e64bd6ad0..3448462420b4bfe709af4b5a3c81e97e2f127818 100644 (file)
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
-#include "wx/ribbon/page.h"
-
 #if wxUSE_RIBBON
 
 #if wxUSE_RIBBON
 
+#include "wx/ribbon/page.h"
 #include "wx/ribbon/art.h"
 #include "wx/ribbon/bar.h"
 #include "wx/dcbuffer.h"
 #include "wx/ribbon/art.h"
 #include "wx/ribbon/bar.h"
 #include "wx/dcbuffer.h"
@@ -374,6 +373,8 @@ void wxRibbonPage::SetSizeWithScrollButtonAdjustment(int x, int y, int width, in
             }
         }
     }
             }
         }
     }
+    if (width < 0) width = 0;
+    if (height < 0) height = 0;
     SetSize(x, y, width, height);
 }
 
     SetSize(x, y, width, height);
 }
 
@@ -414,9 +415,12 @@ void wxRibbonPage::OnSize(wxSizeEvent& evt)
 {
     wxSize new_size = evt.GetSize();
 
 {
     wxSize new_size = evt.GetSize();
 
-    wxMemoryDC temp_dc;
-    wxRect invalid_rect = m_art->GetPageBackgroundRedrawArea(temp_dc, this, m_old_size, new_size);
-    Refresh(true, &invalid_rect);
+    if (m_art)
+    {
+        wxMemoryDC temp_dc;
+        wxRect invalid_rect = m_art->GetPageBackgroundRedrawArea(temp_dc, this, m_old_size, new_size);
+        Refresh(true, &invalid_rect);
+    }
 
     m_old_size = new_size;
 
 
     m_old_size = new_size;