I have a wxListBox on a wxDialog Derived class. In the derived class' onstructor ListBox object is made and connected it with the event handler like this
Code: Select all
SearchDialog::SearchDialog(UserInterface* UserInterfaceptr,wxWindow* parent,wxWindowID id, const wxString& title,const wxPoint& pos,const wxSize& size):wxDialog(parent,id,title,pos,size)
{
....
....
SearchList=new wxListBox(this,ID_SEARCH_LISTBOX,wxDefaultPosition,wxSize(200,203),0,NULL,wxLB_EXTENDED|wxLB_NEEDED_SB|wxSUNKEN_BORDER);
SearchList->Connect(ID_SEARCH_LISTBOX,wxEVT_CHAR,wxKeyEventHandler(SearchDialog::OnDel));
...
...
}
Code: Select all
void SearchDialog::OnDel(wxKeyEvent& event)
{
...
if(SearchList->GetCount()==0)
return;
....
Thanks,
Lloyd