#include "icons/listbox.xpm"
// ----------------------------------------------------------------------------
#include "icons/listbox.xpm"
// ----------------------------------------------------------------------------
EVT_LISTBOX_DCLICK(ListboxPage_Listbox, ListboxWidgetsPage::OnListboxDClick)
EVT_CHECKLISTBOX(ListboxPage_Listbox, ListboxWidgetsPage::OnCheckListbox)
EVT_LISTBOX_DCLICK(ListboxPage_Listbox, ListboxWidgetsPage::OnListboxDClick)
EVT_CHECKLISTBOX(ListboxPage_Listbox, ListboxWidgetsPage::OnCheckListbox)
- EVT_CHECKBOX(-1, ListboxWidgetsPage::OnCheckOrRadioBox)
- EVT_RADIOBOX(-1, ListboxWidgetsPage::OnCheckOrRadioBox)
+ EVT_CHECKBOX(wxID_ANY, ListboxWidgetsPage::OnCheckOrRadioBox)
+ EVT_RADIOBOX(wxID_ANY, ListboxWidgetsPage::OnCheckOrRadioBox)
- wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set listbox parameters"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
+ _T("&Set listbox parameters"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
static const wxString modes[] =
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
static const wxString modes[] =
- m_radioSelMode = new wxRadioBox(this, -1, _T("Selection &mode:"),
+ m_radioSelMode = new wxRadioBox(this, wxID_ANY, _T("Selection &mode:"),
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change listbox contents"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
+ _T("&Change listbox contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ListboxPage_Change, _T("C&hange current"));
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ListboxPage_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(this, ListboxPage_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(this, ListboxPage_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);
- m_chkSort->SetValue(FALSE);
- m_chkCheck->SetValue(FALSE);
- m_chkHScroll->SetValue(TRUE);
- m_chkVScroll->SetValue(FALSE);
+ m_chkSort->SetValue(false);
+ m_chkCheck->SetValue(false);
+ m_chkHScroll->SetValue(true);
+ m_chkVScroll->SetValue(false);
- wxLogMessage(_T("Listbox item %ld selected"), sel);
+ if (event.IsSelection())
+ wxLogMessage(_T("Listbox item %ld selected"), sel);
+ else
+ wxLogMessage(_T("Listbox item %ld deselected"), sel);