#endif
#if wxUSE_FILE
- #include "wx/file.h"
+ #include "wx/file.h"
#endif
#if wxUSE_TOOLTIPS
void OnKeyDown(wxKeyEvent& event);
void OnKeyUp(wxKeyEvent& event);
void OnChar(wxKeyEvent& event);
+ void OnText(wxCommandEvent& event);
bool m_hasCapture;
TEXT_QUIT = 100,
TEXT_ABOUT,
TEXT_LOAD,
- TEXT_SAVE,
+ TEXT_SAVE,
TEXT_CLEAR,
// clipboard menu
EVT_KEY_DOWN(MyTextCtrl::OnKeyDown)
EVT_KEY_UP(MyTextCtrl::OnKeyUp)
EVT_CHAR(MyTextCtrl::OnChar)
+ EVT_TEXT(-1, MyTextCtrl::OnText)
END_EVENT_TABLE()
void MyTextCtrl::LogEvent(const wxChar *name, wxKeyEvent& event) const
}
+void MyTextCtrl::OnText(wxCommandEvent& event)
+{
+ MyTextCtrl *win = (MyTextCtrl *)event.GetEventObject();
+ const wxChar *data = (const wxChar *)(win->GetClientData());
+ if ( data )
+ {
+ wxLogMessage(_T("text changed in control '%s'"), data);
+ }
+}
+
void MyTextCtrl::OnChar(wxKeyEvent& event)
{
LogEvent( _T("Char"), event);
void MyTextCtrl::OnKeyUp(wxKeyEvent& event)
{
- LogEvent( _("Key up"), event);
+ LogEvent( _T("Key up"), event);
event.Skip();
}
case WXK_F5:
// insert a blank line
WriteText("\n");
- break;
+ break;
- default:
- LogEvent( _("Key down"), event);
+ default:
+ LogEvent( wxT("Key down"), event);
}
event.Skip();
m_multitext->SetToolTip("Press F1 here for statitics, F4 for capture and uncapture mouse.");
#endif
- m_tab = new MyTextCtrl( this, -1, "Multiline, allow <TAB> processing.",
+ m_tab = new MyTextCtrl( this, 100, "Multiline, allow <TAB> processing.",
wxPoint(180,90), wxSize(240,70), wxTE_MULTILINE | wxTE_PROCESS_TAB );
+ m_tab->SetClientData(_T("tab"));
- m_enter = new MyTextCtrl( this, -1, "Multiline, allow <ENTER> processing.",
+ m_enter = new MyTextCtrl( this, 100, "Multiline, allow <ENTER> processing.",
wxPoint(180,170), wxSize(240,70), wxTE_MULTILINE);
+ m_enter->SetClientData(_T("enter"));
m_textrich = new MyTextCtrl(this, -1, "Allows more than 30Kb of text\n"
"(even under broken Win9x)",