1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #include "myDialog.h"
myDialog::myDialog(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size)
:wxDialog(parent, -1, title, pos, size, wxSYSTEM_MENU)
{
wxBoxSizer * theSizer = new wxBoxSizer( wxHORIZONTAL );
// Création de la première liste
TypeList = new wxCheckListBox(this, -1, wxPoint(-1,-1), wxSize(-1, -1) );
theSizer->Add(TypeList, wxALL);
TypeList->Connect(wxEVT_KEY_DOWN,(wxObjectEventFunction) &myDialog::OnKeyDown, NULL, this);
// Création de la deuxieme liste
SubTypeList = new wxCheckListBox(this, -1, wxPoint(-1,-1), wxSize(-1, -1) );
theSizer->Add(SubTypeList, wxALL);
SubTypeList->Connect(wxEVT_KEY_DOWN,(wxObjectEventFunction) &myDialog::OnKeyDown, NULL, this);
}
myDialog::~myDialog(){
}
void myDialog::OnKeyDown(wxKeyEvent & event){
wxMessageBox( wxString::Format("%d", event.GetKeyCode() ) );
} |
Partager