]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/textctrl.cpp
added the static function GetLabelText() to wxStaticText which was mentioned in the...
[wxWidgets.git] / src / univ / textctrl.cpp
index afba680e8db7d3ffc384074ab4595ca3fc113242..487fb2fca0ec9a269704b69d02faa000d3e8c237 100644 (file)
@@ -1444,8 +1444,12 @@ wxString wxTextCtrl::GetSelectionText() const
 void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to)
 {
     // selecting till -1 is the same as selecting to the end
-    if ( to == -1 && from != -1 )
+    if ( to == -1 )
     {
+        // and selecting (-1, -1) range is the same as selecting everything, by
+        // convention
+        if ( from == -1 )
+            from = 0;
         to = GetLastPosition();
     }