X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/538f4dd82b7d37293a45516da0036b453f631f9f..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/propgrid/manager.cpp diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 1b4bf21bb0..abb8f27c8d 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -346,7 +346,7 @@ private: virtual bool ProcessEvent( wxEvent& event ) { - if ( event.IsKindOf(CLASSINFO(wxHeaderCtrlEvent)) ) + if ( event.IsKindOf(wxCLASSINFO(wxHeaderCtrlEvent)) ) { wxHeaderCtrlEvent& hcEvent = static_cast(event); @@ -986,7 +986,7 @@ wxPropertyGridPage* wxPropertyGridManager::InsertPage( int index, state->InitNonCatMode(); } - if ( label.length() ) + if ( !label.empty() ) { wxASSERT_MSG( !pageObj->m_label.length(), wxT("If page label is given in constructor, empty label must be given in AddPage")); @@ -1821,7 +1821,7 @@ void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages ) } if ( highest > 0 ) - m_pPropGrid->SetSplitterPosition( highest ); + SetSplitterPosition( highest ); } #if wxUSE_HEADERCTRL @@ -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 ) @@ -1885,6 +1906,11 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) ) } } } + +#if wxUSE_HEADERCTRL + if ( m_showHeader ) + m_pHeaderCtrl->OnColumWidthsChanged(); +#endif } // ----------------------------------------------------------------------- @@ -1982,7 +2008,7 @@ void wxPropertyGridManager::OnMouseClick( wxMouseEvent &event ) void wxPropertyGridManager::OnMouseUp( wxMouseEvent &event ) { - // No event type check - basicly calling this method should + // No event type check - basically calling this method should // just stop dragging. if ( m_dragStatus >= 1 )