From c4590236d741307708c08fe30c4e5e4f8185d6d7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Mar 2005 00:36:04 +0000 Subject: [PATCH] use GTK_WRAP_WORD_CHAR for wxTE_BESTWRAP if available git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 13 +++++++++++-- src/gtk1/textctrl.cpp | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 08fd4c335c..2fe6b59267 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -601,10 +601,19 @@ bool wxTextCtrl::Create( wxWindow *parent, GtkWrapMode wrap; if ( HasFlag( wxTE_DONTWRAP ) ) wrap = GTK_WRAP_NONE; - else if ( HasFlag( wxTE_LINEWRAP ) ) + else if ( HasFlag( wxTE_CHARWRAP ) ) wrap = GTK_WRAP_CHAR; - else // HasFlag(wxTE_WORDWRAP) always true as wxTE_WORDWRAP == 0 + else if ( HasFlag( wxTE_WORDWRAP ) ) wrap = GTK_WRAP_WORD; + else // HasFlag(wxTE_BESTWRAP) always true as wxTE_BESTWRAP == 0 + { + // GTK_WRAP_WORD_CHAR seems to be new in GTK+ 2.4 +#ifdef __WXGTK24__ + wrap = GTK_WRAP_WORD_CHAR; +#else + wrap = GTK_WRAP_WORD; +#endif + } gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), wrap ); diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 08fd4c335c..2fe6b59267 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -601,10 +601,19 @@ bool wxTextCtrl::Create( wxWindow *parent, GtkWrapMode wrap; if ( HasFlag( wxTE_DONTWRAP ) ) wrap = GTK_WRAP_NONE; - else if ( HasFlag( wxTE_LINEWRAP ) ) + else if ( HasFlag( wxTE_CHARWRAP ) ) wrap = GTK_WRAP_CHAR; - else // HasFlag(wxTE_WORDWRAP) always true as wxTE_WORDWRAP == 0 + else if ( HasFlag( wxTE_WORDWRAP ) ) wrap = GTK_WRAP_WORD; + else // HasFlag(wxTE_BESTWRAP) always true as wxTE_BESTWRAP == 0 + { + // GTK_WRAP_WORD_CHAR seems to be new in GTK+ 2.4 +#ifdef __WXGTK24__ + wrap = GTK_WRAP_WORD_CHAR; +#else + wrap = GTK_WRAP_WORD; +#endif + } gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), wrap ); -- 2.47.2