]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textcmn.cpp
applied patch 475879 (Can't use subclassed GridCellEditor)
[wxWidgets.git] / src / common / textcmn.cpp
index b2e57eb854717655a8ae043e6fb60a65040d767e..8b5744f1bf5815e5f37c47ed5218c7756d782dfe 100644 (file)
@@ -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