added a helper function to show the popup menu allowing to configure the columns in header control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -226,6 +226,29 @@ wxHeaderCtrlBase::DoResizeColumnIndices(wxArrayInt& colIndices, unsigned int cou
|
||||
wxASSERT_MSG( colIndices.size() == count, "logic error" );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxHeaderCtrl extra UI
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxHeaderCtrlBase::ShowColumnsMenu(const wxString& title)
|
||||
{
|
||||
wxMenu menu;
|
||||
if ( !title.empty() )
|
||||
menu.SetTitle(title);
|
||||
|
||||
const unsigned count = GetColumnCount();
|
||||
for ( unsigned n = 0; n < count; n++ )
|
||||
{
|
||||
const wxHeaderColumn& col = GetColumn(n);
|
||||
menu.AppendCheckItem(n, col.GetTitle());
|
||||
if ( col.IsShown() )
|
||||
menu.Check(n, true);
|
||||
}
|
||||
|
||||
return GetPopupMenuSelectionFromUser(menu,
|
||||
ScreenToClient(wxGetMousePosition()));
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// wxHeaderCtrlSimple implementation
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user