Fix building wxDebugReport without wxUSE_OWNER_DRAWN

replace wxCheckListBox with wxListBox.
This commit is contained in:
Maarten Bent
2019-11-21 21:26:57 +01:00
parent 5fefe1df11
commit 0c212421f5

View File

@@ -270,7 +270,11 @@ private:
wxDebugReport& m_dbgrpt; wxDebugReport& m_dbgrpt;
#if wxUSE_OWNER_DRAWN
wxCheckListBox *m_checklst; wxCheckListBox *m_checklst;
#else
wxListBox *m_checklst;
#endif
wxTextCtrl *m_notes; wxTextCtrl *m_notes;
wxArrayString m_files; wxArrayString m_files;
@@ -342,7 +346,11 @@ wxDebugReportDialog::wxDebugReportDialog(wxDebugReport& dbgrpt)
wxSizerFlags().Border(wxTOP)); wxSizerFlags().Border(wxTOP));
sizerFileBtns->AddStretchSpacer(1); sizerFileBtns->AddStretchSpacer(1);
#if wxUSE_OWNER_DRAWN
m_checklst = new wxCheckListBox(this, wxID_ANY); m_checklst = new wxCheckListBox(this, wxID_ANY);
#else
m_checklst = new wxListBox(this, wxID_ANY);
#endif
wxSizer *sizerFiles = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerFiles = new wxBoxSizer(wxHORIZONTAL);
sizerFiles->Add(m_checklst, flagsExpand); sizerFiles->Add(m_checklst, flagsExpand);
@@ -390,7 +398,9 @@ bool wxDebugReportDialog::TransferDataToWindow()
if ( m_dbgrpt.GetFile(n, &name, &desc) ) if ( m_dbgrpt.GetFile(n, &name, &desc) )
{ {
m_checklst->Append(name + wxT(" (") + desc + wxT(')')); m_checklst->Append(name + wxT(" (") + desc + wxT(')'));
#if wxUSE_OWNER_DRAWN
m_checklst->Check(n); m_checklst->Check(n);
#endif
m_files.Add(name); m_files.Add(name);
} }
@@ -401,6 +411,7 @@ bool wxDebugReportDialog::TransferDataToWindow()
bool wxDebugReportDialog::TransferDataFromWindow() bool wxDebugReportDialog::TransferDataFromWindow()
{ {
#if wxUSE_OWNER_DRAWN
// any unchecked files should be removed from the report // any unchecked files should be removed from the report
const size_t count = m_checklst->GetCount(); const size_t count = m_checklst->GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
@@ -410,6 +421,7 @@ bool wxDebugReportDialog::TransferDataFromWindow()
m_dbgrpt.RemoveFile(m_files[n]); m_dbgrpt.RemoveFile(m_files[n]);
} }
} }
#endif
// if the user entered any notes, add them to the report // if the user entered any notes, add them to the report
const wxString notes = m_notes->GetValue(); const wxString notes = m_notes->GetValue();