X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/26412151db13c86f9177eef882c961b80dab9004..404b319a85dadd7decf7a5a5331020520031a41c:/src/propgrid/manager.cpp diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index c9252f2172..788af596d3 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); @@ -745,12 +745,14 @@ bool wxPropertyGridManager::DoSelectPage( int index ) return false; } +#if wxUSE_TOOLBAR wxPropertyGridPage* prevPage; if ( m_selPage >= 0 ) prevPage = GetPage(m_selPage); else prevPage = m_emptyPage; +#endif wxPropertyGridPage* nextPage; @@ -1830,6 +1832,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 +1908,11 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) ) } } } + +#if wxUSE_HEADERCTRL + if ( m_showHeader ) + m_pHeaderCtrl->OnColumWidthsChanged(); +#endif } // ----------------------------------------------------------------------- @@ -1982,7 +2010,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 )