X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d73e6791fc93a590630b6deb918a6518b91ea142..d9f7f49ea3aca3e0e0beafe648a61e6606e37663:/src/common/textcmn.cpp 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