Don't set column title if wxPG header is going to be hidden

wxPropertyGridManager::SetColumnTitle() shouldn't be called when we going
to hide the header because it makes the header visible.
This commit is contained in:
Artur Wieczorek 2018-07-07 20:29:37 +02:00
parent 0ee25cce3a
commit 54c5584c65

View File

@ -2703,8 +2703,12 @@ void FormMain::OnEnableLabelEditing(wxCommandEvent& event)
#if wxUSE_HEADERCTRL
void FormMain::OnShowHeader( wxCommandEvent& event )
{
m_pPropGridManager->ShowHeader(event.IsChecked());
m_pPropGridManager->SetColumnTitle(2, wxT("Units"));
bool show = event.IsChecked();
m_pPropGridManager->ShowHeader(show);
if ( show )
{
m_pPropGridManager->SetColumnTitle(2, wxT("Units"));
}
}
#endif // wxUSE_HEADERCTRL