]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/manager.cpp
Added wxPropertyGridManager::SetPageSplitterLeft
[wxWidgets.git] / src / propgrid / manager.cpp
index c9252f2172b7dfe3de1a259ba8fd26de1bfa717d..6a1f9fe6e16241f62fb33d37b89b11099271fded 100644 (file)
@@ -1830,6 +1830,27 @@ void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages )
 #endif
 }
 
+void wxPropertyGridManager::SetPageSplitterLeft(int page, bool subProps)
+{
+    wxASSERT_MSG( (page < (int) GetPageCount()),
+                  wxT("SetPageSplitterLeft() has no effect until pages have been added") );
+
+    if (page < (int) GetPageCount())
+    {
+        wxClientDC dc(this);
+        dc.SetFont(m_pPropGrid->GetFont());
+
+        int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[page]->m_properties, 0, subProps );
+        maxW += m_pPropGrid->m_marginWidth;
+        SetPageSplitterPosition( page, maxW );
+
+#if wxUSE_HEADERCTRL
+        if ( m_showHeader )
+            m_pHeaderCtrl->OnColumWidthsChanged();
+#endif
+    }
+}
+
 // -----------------------------------------------------------------------
 
 void wxPropertyGridManager::OnPropertyGridSelect( wxPropertyGridEvent& event )