X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b292e2f512fa9b25e2d2928604ab884b00e6c6bf..ccfd0a25fe037ea732f45b766fa234eedc56d5e9:/samples/checklst/checklst.cpp?ds=sidebyside diff --git a/samples/checklst/checklst.cpp b/samples/checklst/checklst.cpp index 8310a8aa91..8f26703e8a 100644 --- a/samples/checklst/checklst.cpp +++ b/samples/checklst/checklst.cpp @@ -30,10 +30,6 @@ #include "wx/menuitem.h" #include "wx/checklst.h" -#ifdef __WXGTK__ -#include "mondrian.xpm" -#endif - // Define a new application type class CheckListBoxApp: public wxApp { @@ -74,8 +70,7 @@ BEGIN_EVENT_TABLE(CheckListBoxFrame, wxFrame) EVT_MENU(Menu_Quit, CheckListBoxFrame::OnQuit) EVT_LISTBOX(Control_Listbox, CheckListBoxFrame::OnListboxSelect) EVT_CHECKLISTBOX(Control_Listbox, CheckListBoxFrame::OnCheckboxToggle) - EVT_COMMAND(Control_Listbox, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, - CheckListBoxFrame::OnListboxDblClick) + EVT_LISTBOX_DCLICK(Control_Listbox, CheckListBoxFrame::OnListboxDblClick) END_EVENT_TABLE() IMPLEMENT_APP(CheckListBoxApp); @@ -94,8 +89,11 @@ bool CheckListBoxApp::OnInit(void) CheckListBoxFrame::CheckListBoxFrame(wxFrame *frame, char *title, int x, int y, int w, int h) : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) { - // set the icon - SetIcon(wxICON(mondrian)); + // create the status line + const int widths[] = { -1, 60 }; + CreateStatusBar(2); + SetStatusWidths(2, widths); + SetStatusText("no selection", 0); // Make a menubar wxMenu *file_menu = new wxMenu; @@ -133,20 +131,15 @@ CheckListBoxFrame::CheckListBoxFrame(wxFrame *frame, char *title, int x, int y, delete [] astrChoices; -#ifdef __WXMSW__ + // not implemented in wxGTK yet +#ifndef __WXGTK__ for ( ui = 0; ui < WXSIZEOF(aszChoices); ui += 2 ) { m_pListBox->GetItem(ui)->SetBackgroundColour(wxColor(200, 200, 200)); } -#endif +#endif // wxGTK m_pListBox->Check(2); - // create the status line - const int widths[] = { -1, 60 }; - CreateStatusBar(2); - SetStatusWidths(2, widths); - SetStatusText("no selection", 0); - Show(TRUE); } @@ -154,12 +147,12 @@ CheckListBoxFrame::~CheckListBoxFrame() { } -void CheckListBoxFrame::OnQuit(wxCommandEvent& event) +void CheckListBoxFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } -void CheckListBoxFrame::OnAbout(wxCommandEvent& event) +void CheckListBoxFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageDialog dialog(this, "Demo of wxCheckListBox control\n" "About wxCheckListBox", wxYES_NO | wxCANCEL); @@ -175,7 +168,7 @@ void CheckListBoxFrame::OnListboxSelect(wxCommandEvent& event) SetStatusText(strSelection); } -void CheckListBoxFrame::OnListboxDblClick(wxCommandEvent& event) +void CheckListBoxFrame::OnListboxDblClick(wxCommandEvent& WXUNUSED(event)) { wxString strSelection; strSelection.sprintf("item %d double clicked", m_pListBox->GetSelection());