#include "wx/wx.h"
#endif
+#ifdef __WXMSW__
#include "wx/ownerdrw.h"
+#endif
#include "wx/menuitem.h"
-#include "wx/msw/checklst.h"
+#include "wx/checklst.h"
// Define a new application type
class CheckListBoxApp: public wxApp
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);
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;
delete [] astrChoices;
+ // 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 // 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);
}
{
}
-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);
wxString strSelection;
unsigned int nSel = event.GetSelection();
strSelection.sprintf("item %d selected (%schecked)", nSel,
- m_pListBox->IsChecked(nSel) ? "" : "not ");
+ m_pListBox->IsChecked((int)nSel) ? "" : "not ");
SetStatusText(strSelection);
}
-void CheckListBoxFrame::OnListboxDblClick(wxCommandEvent& event)
+void CheckListBoxFrame::OnListboxDblClick(wxCommandEvent& WXUNUSED(event))
{
wxString strSelection;
strSelection.sprintf("item %d double clicked", m_pListBox->GetSelection());