code demonstrating wxMSW bug added

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-04-03 21:15:28 +00:00
parent cb2302446c
commit 14531b30fe

View File

@ -71,6 +71,7 @@ public:
: wxTextCtrl(parent, id, value, pos, size, style) { } : wxTextCtrl(parent, id, value, pos, size, style) { }
void OnKeyDown(wxKeyEvent& event); void OnKeyDown(wxKeyEvent& event);
void OnChar(wxKeyEvent& event);
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@ -210,8 +211,29 @@ bool MyApp::OnInit()
BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl) BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl)
EVT_KEY_DOWN(MyTextCtrl::OnKeyDown) EVT_KEY_DOWN(MyTextCtrl::OnKeyDown)
EVT_CHAR(MyTextCtrl::OnChar)
END_EVENT_TABLE() END_EVENT_TABLE()
void MyTextCtrl::OnChar(wxKeyEvent& event)
{
static int s_keycode = 0;
static size_t s_repeatCount = 0;
int keycode = event.KeyCode();
if ( keycode == s_keycode )
s_repeatCount++;
else
{
s_keycode = keycode;
s_repeatCount = 1;
}
wxLogStatus("Key event: %d (x%u), at position %ld",
s_keycode, s_repeatCount, GetInsertionPoint());
event.Skip();
}
void MyTextCtrl::OnKeyDown(wxKeyEvent& event) void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
{ {
switch ( event.KeyCode() ) switch ( event.KeyCode() )