+void CheckListBoxFrame::OnInsertItemsMiddle(wxCommandEvent& WXUNUSED(event))
+{
+ static size_t s_nItem = 0;
+ wxArrayString items;
+ items.Add(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+ items.Add(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+ items.Add(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+
+ m_pListBox->InsertItems(items, m_pListBox->GetCount() ? 1 : 0);
+}
+
+void CheckListBoxFrame::OnInsertItemsEnd(wxCommandEvent& WXUNUSED(event))
+{
+ static size_t s_nItem = 0;
+ wxArrayString items;
+ items.Add(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+ items.Add(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+ items.Add(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+
+ m_pListBox->InsertItems(items, m_pListBox->GetCount() );
+}
+
+void CheckListBoxFrame::OnAppendItems(wxCommandEvent& WXUNUSED(event))
+{
+ static size_t s_nItem = 0;
+ m_pListBox->Append(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+ m_pListBox->Append(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+ m_pListBox->Append(wxString::Format(_T("New item %lu"), (unsigned long)++s_nItem));
+}
+
+void CheckListBoxFrame::OnRemoveItems(wxCommandEvent& WXUNUSED(event))
+{
+ if(m_pListBox->GetCount())
+ m_pListBox->Delete(0);
+ if(m_pListBox->GetCount())
+ m_pListBox->Delete(0);
+ if(m_pListBox->GetCount())
+ m_pListBox->Delete(0);
+}
+
+void CheckListBoxFrame::OnGetBestSize(wxCommandEvent& WXUNUSED(event))
+{
+ wxSize bestSize = m_pListBox->GetBestSize();
+
+ wxMessageBox(wxString::Format(wxT("Best size of the checklistbox is:[%i,%i]"),
+ bestSize.x, bestSize.y
+ )
+ );
+}
+
+void CheckListBoxFrame::OnMakeItemFirst(wxCommandEvent& WXUNUSED(event))
+{
+ if(m_pListBox->GetSelection() != -1)
+ m_pListBox->SetFirstItem(m_pListBox->GetSelection());
+ else
+ wxMessageBox(wxT("Nothing selected!"));
+}
+