Dear all,
The following are my code.
and I have an wxTextCtrl in my driven class from wxListCtrl.
And I want when I change wxTextCtrl, and event will generate,
and call a member function in my MyPanel_file_text_list.
But the following code seem does not call the member function.
What wrong with it??
Thanks..
class MyPanel_file_text_list : public wxListCtrl
{
public:
MyPanel_file_text_list(wxWindow* parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,long style);
void SetDir(wxCommandEvent& event);
private:
wxTextCtrl* g_dir_text;
wxString g_path;
protected:
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(MyPanel_file_text_list, wxListCtrl)
EVT_TEXT_ENTER(ID_MyPanel_file_text_enter_path, MyPanel_file_text_list::SetDir)
END_EVENT_TABLE()
MyPanel_file_text_list::MyPanel_file_text_list
(wxWindow* parent, wxWindowID id, const wxPoint& pos,
const wxSize& size,long style)
: wxListCtrl( parent, id, pos+wxPoint(0,30), size, style)
{
wxListItem itemCol; itemCol.SetText(wxT("檔名"));
this->InsertColumn(0, itemCol);
this->SetColumnWidth(0, 200);
this->g_dir_text = new wxTextCtrl(parent, ID_MyPanel_file_text_enter_path,
wxEmptyString,
pos,wxDefaultSize,
wxTE_PROCESS_ENTER);
}
void MyPanel_file_text_list::SetDir(wxCommandEvent& event)
{ cout << "test";
}