From 1d6e7c3803d34c89d4f17d0ae756140e534c3d35 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 6 Jul 2003 10:38:21 +0000 Subject: [PATCH] Applied patch to wxTextCtrl::IsEditable() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 11 +++++++++-- src/gtk1/textctrl.cpp | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 19c349a7cb..228c922ad4 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1088,7 +1088,7 @@ void wxTextCtrl::Remove( long from, long to ) wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); #ifdef __WXGTK20__ - if ( m_windowStyle & wxTE_MULTILINE ) + if (m_windowStyle & wxTE_MULTILINE) { GtkTextBuffer * text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) ); @@ -1229,7 +1229,14 @@ bool wxTextCtrl::IsEditable() const wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") ); #ifdef __WXGTK20__ - return gtk_editable_get_editable(GTK_EDITABLE(m_text)); + if (m_windowStyle & wxTE_MULTILINE) + { + return gtk_text_view_get_editable(GTK_TEXT_VIEW(m_text)); + } + else + { + return gtk_editable_get_editable(GTK_EDITABLE(m_text)); + } #else return GTK_EDITABLE(m_text)->editable; #endif diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 19c349a7cb..228c922ad4 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -1088,7 +1088,7 @@ void wxTextCtrl::Remove( long from, long to ) wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); #ifdef __WXGTK20__ - if ( m_windowStyle & wxTE_MULTILINE ) + if (m_windowStyle & wxTE_MULTILINE) { GtkTextBuffer * text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) ); @@ -1229,7 +1229,14 @@ bool wxTextCtrl::IsEditable() const wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") ); #ifdef __WXGTK20__ - return gtk_editable_get_editable(GTK_EDITABLE(m_text)); + if (m_windowStyle & wxTE_MULTILINE) + { + return gtk_text_view_get_editable(GTK_TEXT_VIEW(m_text)); + } + else + { + return gtk_editable_get_editable(GTK_EDITABLE(m_text)); + } #else return GTK_EDITABLE(m_text)->editable; #endif