X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d73e6791fc93a590630b6deb918a6518b91ea142..0ded6bb695f82a0b98d0862ec6870fc5c6cb8b97:/src/common/textcmn.cpp?ds=sidebyside diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index b2e57eb854..8b5744f1bf 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -244,6 +244,20 @@ void wxTextCtrlBase::SelectAll() SetSelection(0, GetLastPosition()); } +wxString wxTextCtrlBase::GetStringSelection() 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