Added wxPropertyGridManager::SetPageSplitterLeft

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-03-18 20:35:01 +00:00
parent 977b5d7d8e
commit 216b59c66a
3 changed files with 31 additions and 0 deletions

View File

@@ -574,6 +574,11 @@ public:
*/ */
void SetSplitterLeft( bool subProps = false, bool allPages = true ); void SetSplitterLeft( bool subProps = false, bool allPages = true );
/** Moves splitter as left as possible on an individual page, while still allowing all
labels to be shown in full.
*/
void SetPageSplitterLeft(int page, bool subProps = false);
/** /**
Sets splitter position on individual page. Sets splitter position on individual page.

View File

@@ -467,6 +467,11 @@ public:
*/ */
void SetSplitterLeft( bool subProps = false, bool allPages = true ); void SetSplitterLeft( bool subProps = false, bool allPages = true );
/** Moves splitter as left as possible on an individual page, while still allowing all
labels to be shown in full.
*/
void SetPageSplitterLeft(int page, bool subProps = false);
/** /**
Sets splitter position on individual page. Sets splitter position on individual page.

View File

@@ -1830,6 +1830,27 @@ void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages )
#endif #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 ) void wxPropertyGridManager::OnPropertyGridSelect( wxPropertyGridEvent& event )