From ad28a8de8b680e3c91c22403ce38ff957e8a4a3a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 18 Sep 2002 17:15:40 +0000 Subject: [PATCH] SetSelection(-1, -1) now selects the entire string as on wxMSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 6 ++++++ src/gtk1/textctrl.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 034a4cce4a..980ef79142 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -928,6 +928,12 @@ void wxTextCtrl::SetSelection( long from, long to ) { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); + if (from == -1 && to == -1) + { + from = 0; + to = GetValue().Length(); + } + #ifndef __WXGTK20__ if ( (m_windowStyle & wxTE_MULTILINE) && !GTK_TEXT(m_text)->line_start_cache ) diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 034a4cce4a..980ef79142 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -928,6 +928,12 @@ void wxTextCtrl::SetSelection( long from, long to ) { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); + if (from == -1 && to == -1) + { + from = 0; + to = GetValue().Length(); + } + #ifndef __WXGTK20__ if ( (m_windowStyle & wxTE_MULTILINE) && !GTK_TEXT(m_text)->line_start_cache )