virtual bool ProcessEvent( wxEvent& event )
{
- if ( event.IsKindOf(CLASSINFO(wxHeaderCtrlEvent)) )
+ if ( event.IsKindOf(wxCLASSINFO(wxHeaderCtrlEvent)) )
{
wxHeaderCtrlEvent& hcEvent =
static_cast<wxHeaderCtrlEvent&>(event);
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"));
}
if ( highest > 0 )
- m_pPropGrid->SetSplitterPosition( highest );
+ SetSplitterPosition( highest );
}
#if wxUSE_HEADERCTRL
#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 )
}
}
}
+
+#if wxUSE_HEADERCTRL
+ if ( m_showHeader )
+ m_pHeaderCtrl->OnColumWidthsChanged();
+#endif
}
// -----------------------------------------------------------------------
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 )