added wxTextCtrl::GetSelection() returning a wxString - useful for multiline controls under Windows

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-11-14 01:27:16 +00:00
parent 9327c3aa02
commit 184144794d
6 changed files with 71 additions and 1 deletions

View File

@@ -244,6 +244,20 @@ void wxTextCtrlBase::SelectAll()
SetSelection(0, GetLastPosition());
}
wxString wxTextCtrlBase::GetSelection() const
{
long from, to;
GetSelection(&from, &to);
wxString sel;
if ( from < to )
{
sel = GetValue().Mid(from, to - from);
}
return sel;
}
#else // !wxUSE_TEXTCTRL
// define this one even if !wxUSE_TEXTCTRL because it is also used by other