// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
void OnButtonDelete(wxCommandEvent& event);
void OnButtonDeleteSel(wxCommandEvent& event);
void OnButtonClear(wxCommandEvent& event);
void OnButtonDelete(wxCommandEvent& event);
void OnButtonDeleteSel(wxCommandEvent& event);
void OnButtonClear(wxCommandEvent& event);
void OnButtonAdd(wxCommandEvent& event);
void OnButtonAddSeveral(wxCommandEvent& event);
void OnButtonAddMany(wxCommandEvent& event);
void OnButtonAdd(wxCommandEvent& event);
void OnButtonAddSeveral(wxCommandEvent& event);
void OnButtonAddMany(wxCommandEvent& event);
EVT_BUTTON(LboxTest_Delete, LboxTestFrame::OnButtonDelete)
EVT_BUTTON(LboxTest_DeleteSel, LboxTestFrame::OnButtonDeleteSel)
EVT_BUTTON(LboxTest_Clear, LboxTestFrame::OnButtonClear)
EVT_BUTTON(LboxTest_Delete, LboxTestFrame::OnButtonDelete)
EVT_BUTTON(LboxTest_DeleteSel, LboxTestFrame::OnButtonDeleteSel)
EVT_BUTTON(LboxTest_Clear, LboxTestFrame::OnButtonClear)
EVT_BUTTON(LboxTest_Add, LboxTestFrame::OnButtonAdd)
EVT_BUTTON(LboxTest_AddSeveral, LboxTestFrame::OnButtonAddSeveral)
EVT_BUTTON(LboxTest_AddMany, LboxTestFrame::OnButtonAddMany)
EVT_BUTTON(LboxTest_Add, LboxTestFrame::OnButtonAdd)
EVT_BUTTON(LboxTest_AddSeveral, LboxTestFrame::OnButtonAddSeveral)
EVT_BUTTON(LboxTest_AddMany, LboxTestFrame::OnButtonAddMany)
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(panel, LboxTest_Change, _T("C&hange current"));
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(panel, LboxTest_Change, _T("C&hange current"));
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(panel, LboxTest_Delete, _T("&Delete this item"));
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(panel, LboxTest_Delete, _T("&Delete this item"));
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerUp->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
// the lower one only has the log listbox and a button to clear it
sizerUp->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
// the lower one only has the log listbox and a button to clear it
wxSizer *sizerDown = new wxStaticBoxSizer
(
new wxStaticBox(panel, wxID_ANY, _T("&Log window")),
wxSizer *sizerDown = new wxStaticBoxSizer
(
new wxStaticBox(panel, wxID_ANY, _T("&Log window")),
);
m_lboxLog = new wxListBox(panel, wxID_ANY);
sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5);
);
m_lboxLog = new wxListBox(panel, wxID_ANY);
sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5);
btn = new wxButton(panel, LboxTest_ClearLog, _T("Clear &log"));
sizerBtns->Add(btn);
sizerBtns->Add(10, 0); // spacer
btn = new wxButton(panel, LboxTest_ClearLog, _T("Clear &log"));
sizerBtns->Add(btn);
sizerBtns->Add(10, 0); // spacer
btn = new wxButton(panel, LboxTest_Quit, _T("E&xit"));
sizerBtns->Add(btn);
sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5);
btn = new wxButton(panel, LboxTest_Quit, _T("E&xit"));
sizerBtns->Add(btn);
sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5);
// now that everything is created we can redirect the log messages to the
// listbox
m_logTarget = new LboxLogger(m_lboxLog, wxLog::GetActiveTarget());
wxLog::SetActiveTarget(m_logTarget);
// now that everything is created we can redirect the log messages to the
// listbox
m_logTarget = new LboxLogger(m_lboxLog, wxLog::GetActiveTarget());
wxLog::SetActiveTarget(m_logTarget);
- int count = m_lbox->GetCount();
- for ( int n = 0; n < count; n++ )
- {
- items.Add(m_lbox->GetString(n));
- }
-
- m_sizerLbox->Detach(m_lbox);
- delete m_lbox;
+ items.Add(m_lbox->GetString(n));
- m_lbox = new wxListBox(this, wxID_ANY,
+ m_sizerLbox->Detach(m_lbox);
+ delete m_lbox;
+
+ m_lbox = new wxListBox(parent, LboxTest_Listbox,