]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textentry.cpp
fixed STC under Win64: as wxStyledTextCtrl::SendMsg() used (32 bit) long arguments...
[wxWidgets.git] / src / gtk / textentry.cpp
index 2d1f8686665620a113104c8498d43b08103a040d..a84c0e691ef83f0a79c3387009a321aca03774e9 100644 (file)
@@ -187,6 +187,12 @@ long wxTextEntry::GetLastPosition() const
 
 void wxTextEntry::SetSelection(long from, long to)
 {
+    // in wx convention, (-1, -1) means the entire range but GTK+ translates -1
+    // (or any negative number for that matter) into last position so we need
+    // to translate manually
+    if ( from == -1 && to == -1 )
+        from = 0;
+
     gtk_editable_select_region(GetEditable(), from, to);
 }
 
@@ -313,7 +319,7 @@ void wxTextEntry::SendMaxLenEvent()
     wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
     event.SetEventObject(win);
     event.SetString(GetValue());
-    win->GetEventHandler()->ProcessEvent(event);
+    win->HandleWindowEvent(event);
 }
 
 #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX