If I set a background color to the DataListDisplay, when the SettingsList disappears, the background color is visible, meaning the wxPanel is displaying properly. If I remove the SettingsList and instead add a simple wxTextCtrl, I have the same issues, so it's not an issue specific to the wxListView. It is something to do with how the wxListView is being added to the wxPanel. I have tried catching EVT_SIZE and calling Layout() and Refresh(), but neither worked. Some example code:
Code: Select all
wxSizer* MainView::CreateSettingsList(wxWindow* parent)
{
m_pDataList = new DataListDisplay(parent);
wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->AddSpacer(4);
sizer->Add(m_pDataList);
return sizer;
}
DataListDisplay::DataListDisplay(wxWindow* parent) : wxPanel(parent, wxID_ANY, wxDefaultPosition)
{
SettingsList = new wxListView(this, wxID_ANY, wxDefaultPosition, wxSize(325, 250), wxLC_REPORT | wxLC_HRULES | wxLC_VRULES);
// various headers and data added ...
wxSizer* sizer = new wxBoxSizer(wxVertical);
sizer->add(SettingsList, 0, wxExpand);
SetSizer(sizer);
}