added more tests for SetValue/WriteText

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-10-13 19:27:20 +00:00
parent 9007386bc8
commit 82898ed9df

View File

@@ -711,6 +711,15 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
(long) GetLineLength(line), (long) GetLineLength(line),
GetValue().length(), GetValue().length(),
GetLastPosition()); GetLastPosition());
long from, to;
GetSelection(&from, &to);
wxString sel = GetStringSelection();
wxLogMessage(_T("Selection: from %ld to %ld."), from, to);
wxLogMessage(_T("Selection = '%s' (len = %u)"),
sel.c_str(), sel.length());
} }
break; break;
@@ -745,28 +754,26 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
break; break;
case WXK_F6: case WXK_F6:
SetValue("F6 was just pressed."); SetValue("SetValue() has been called");
break; break;
case WXK_F7: case WXK_F7:
wxLogMessage(_T("Position 10 should be now visible."));
ShowPosition(10); ShowPosition(10);
break; break;
case WXK_F8: case WXK_F8:
wxLogMessage(_T("Control has been cleared"));
Clear(); Clear();
break; break;
case WXK_F9:
WriteText("WriteText() has been called");
break;
case WXK_F10: case WXK_F10:
{ AppendText("AppendText() has been called");
long from, to; break;
GetSelection(&from, &to);
wxString sel = GetStringSelection();
wxLogMessage(_T("Selection: from %ld to %ld."), from, to);
wxLogMessage(_T("Selection = '%s' (len = %u)"),
sel.c_str(), sel.length());
}
} }
if ( ms_logKey ) if ( ms_logKey )
@@ -863,7 +870,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_multitext->SetBackgroundColour(*wxLIGHT_GREY); m_multitext->SetBackgroundColour(*wxLIGHT_GREY);
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
m_multitext->SetToolTip("Press F1 here for statitics, F4 for capture and uncapture mouse."); m_multitext->SetToolTip("Press Fn function keys here");
#endif #endif
m_tab = new MyTextCtrl( this, 100, "Multiline, allow <TAB> processing.", m_tab = new MyTextCtrl( this, 100, "Multiline, allow <TAB> processing.",