test EVT_TEXT_ENTER

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-03-08 00:15:20 +00:00
parent f120af9d56
commit c5dd5a3dac

View File

@ -71,6 +71,7 @@ public:
void OnChar(wxKeyEvent& event);
void OnText(wxCommandEvent& event);
void OnTextEnter(wxCommandEvent& event);
void OnTextURL(wxTextUrlEvent& event);
void OnTextMaxLen(wxCommandEvent& event);
@ -510,6 +511,7 @@ BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl)
EVT_CHAR(MyTextCtrl::OnChar)
EVT_TEXT(wxID_ANY, MyTextCtrl::OnText)
EVT_TEXT_ENTER(wxID_ANY, MyTextCtrl::OnTextEnter)
EVT_TEXT_URL(wxID_ANY, MyTextCtrl::OnTextURL)
EVT_TEXT_MAXLEN(wxID_ANY, MyTextCtrl::OnTextMaxLen)
@ -774,6 +776,23 @@ void MyTextCtrl::OnText(wxCommandEvent& event)
}
}
void MyTextCtrl::OnTextEnter(wxCommandEvent& event)
{
if ( !ms_logText )
return;
MyTextCtrl *win = (MyTextCtrl *)event.GetEventObject();
const wxChar *data = (const wxChar *)(win->GetClientData());
if ( data )
{
wxLogMessage(_T("Enter pressed in control '%s'"), data);
}
else
{
wxLogMessage(_T("Enter pressed in some control"));
}
}
void MyTextCtrl::OnTextMaxLen(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(_T("You can't enter more characters into this control."));