]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textentrycmn.cpp
Separate label with wx mnemonics (&) and with gtk mnemonics (_) into m_text and m_gtk...
[wxWidgets.git] / src / common / textentrycmn.cpp
index 61d80ffbaaae6619940ec73a54a7f42ed1e34fe2..5ec6850708fdb42077a14be4657664141676f8fb 100644 (file)
@@ -40,7 +40,9 @@
 wxString wxTextEntryBase::GetRange(long from, long to) const
 {
     wxString sel;
-    if ( from < to )
+    wxString value = GetValue();
+    
+    if ((from < to) && ((long)value.length() >= to + from))
     {
         sel = GetValue().substr(from, to - from);
     }
@@ -80,6 +82,14 @@ bool wxTextEntryBase::HasSelection() const
     return from < to;
 }
 
+void wxTextEntryBase::RemoveSelection()
+{
+    long from, to;
+    GetSelection(& from, & to);
+    if (from != -1 && to != -1)
+        Remove(from, to);
+}
+
 wxString wxTextEntryBase::GetStringSelection() const
 {
     long from, to;