]> 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 fcca24e37bcd6df5783fb103fd0f9892d113dd94..3448462420b4bfe709af4b5a3c81e97e2f127818 100644 (file)
     #pragma hdrstop
 #endif
 
-#include "wx/ribbon/page.h"
-
 #if wxUSE_RIBBON
 
+#include "wx/ribbon/page.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);
 }
 
@@ -414,9 +415,12 @@ void wxRibbonPage::OnSize(wxSizeEvent& evt)
 {
     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;
 
@@ -539,6 +543,7 @@ bool wxRibbonPage::DoActualLayout()
         minor_axis_size = GetSize().GetWidth() - origin.x - m_art->GetMetric(wxRIBBON_ART_PAGE_BORDER_RIGHT_SIZE);
         available_space = m_size_in_major_axis_for_children - m_art->GetMetric(wxRIBBON_ART_PAGE_BORDER_BOTTOM_SIZE) - origin.y;
     }
+    if (minor_axis_size < 0) minor_axis_size = 0;
     size_t size_index;
     for(size_index = 0; size_index < m_size_calc_array_size; ++size_index)
     {