From 605c9c8318875c590fce53cd2ce5d5aabcc92564 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Mon, 9 Nov 1998 08:09:03 +0000 Subject: [PATCH] if the wxTextCtrl is empty set by SetInsertionPointEnd to 0 and not to -1. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 2 +- src/gtk1/textctrl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index d7e77bbc56..7373c0ad2c 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -414,7 +414,7 @@ void wxTextCtrl::SetInsertionPointEnd() pos = gtk_text_get_length( GTK_TEXT(m_text) ); else pos = GTK_ENTRY(m_text)->text_length; - SetInsertionPoint( pos-1 ); + SetInsertionPoint((pos-1)>0 ? (pos-1):0); } void wxTextCtrl::SetEditable( bool editable ) diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index d7e77bbc56..7373c0ad2c 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -414,7 +414,7 @@ void wxTextCtrl::SetInsertionPointEnd() pos = gtk_text_get_length( GTK_TEXT(m_text) ); else pos = GTK_ENTRY(m_text)->text_length; - SetInsertionPoint( pos-1 ); + SetInsertionPoint((pos-1)>0 ? (pos-1):0); } void wxTextCtrl::SetEditable( bool editable ) -- 2.47.2