]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
simplified and cleaned up wxGTK's focus handling
[wxWidgets.git] / src / msw / textctrl.cpp
index f20fd9c970af6bdbf63b18d5f54fc0c1c49b9228..c8173d7fc7bcc0a00425f135c7e6fc4665406d9d 100644 (file)
@@ -1305,6 +1305,13 @@ void wxTextCtrl::DoSetSelection(long from, long to, int flags)
 #if wxUSE_RICHEDIT
     if ( IsRich() )
     {
+        // if from and to are both -1, it means (in wxWidgets) that all text
+        // should be selected, translate this into Windows convention
+        if ( (from == -1) && (to == -1) )
+        {
+            from = 0;
+        }
+
         CHARRANGE range;
         range.cpMin = from;
         range.cpMax = to;