added support for wxTE_LINEWRAP; use GTK_WRAP_WORD_CHAR for wxTE_WORDWRAP instead of GTK_WRAP_WORD (parts of patch 1156507)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
44353523d8
commit
c211082373
@ -41,6 +41,7 @@ wxGTK:
|
||||
- Corrected default button size handling for different themes.
|
||||
- Corrected splitter sash size and look for different themes.
|
||||
- Fixed keyboard input for dead-keys.
|
||||
- Added support for wxTE_LINEWRAP (Mart Raudsepp)
|
||||
|
||||
wxMac:
|
||||
|
||||
|
@ -570,11 +570,13 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
// Insert view into scrolled window
|
||||
gtk_container_add( GTK_CONTAINER(m_widget), m_text );
|
||||
|
||||
// Global settings which can be overridden by tags, I guess.
|
||||
if (HasFlag( wxHSCROLL ) || HasFlag( wxTE_DONTWRAP ))
|
||||
// translate wx wrapping style to GTK+
|
||||
if ( HasFlag( wxTE_DONTWRAP ) )
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_NONE );
|
||||
else
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_WORD );
|
||||
else if ( HasFlag( wxTE_LINEWRAP ) )
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_CHAR );
|
||||
else // HasFlag(wxTE_WORDWRAP) always true as wxTE_WORDWRAP == 0
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_WORD_CHAR );
|
||||
|
||||
if (!HasFlag(wxNO_BORDER))
|
||||
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(m_widget), GTK_SHADOW_IN );
|
||||
@ -582,7 +584,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
gtk_widget_add_events( GTK_WIDGET(m_text), GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK );
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
||||
#else
|
||||
#else // GTK+ 1
|
||||
// create our control ...
|
||||
m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
|
||||
|
||||
@ -605,7 +607,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
GTK_FILL,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
|
||||
0, 0);
|
||||
#endif
|
||||
#endif // GTK+ 2/1
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -570,11 +570,13 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
// Insert view into scrolled window
|
||||
gtk_container_add( GTK_CONTAINER(m_widget), m_text );
|
||||
|
||||
// Global settings which can be overridden by tags, I guess.
|
||||
if (HasFlag( wxHSCROLL ) || HasFlag( wxTE_DONTWRAP ))
|
||||
// translate wx wrapping style to GTK+
|
||||
if ( HasFlag( wxTE_DONTWRAP ) )
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_NONE );
|
||||
else
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_WORD );
|
||||
else if ( HasFlag( wxTE_LINEWRAP ) )
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_CHAR );
|
||||
else // HasFlag(wxTE_WORDWRAP) always true as wxTE_WORDWRAP == 0
|
||||
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), GTK_WRAP_WORD_CHAR );
|
||||
|
||||
if (!HasFlag(wxNO_BORDER))
|
||||
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(m_widget), GTK_SHADOW_IN );
|
||||
@ -582,7 +584,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
gtk_widget_add_events( GTK_WIDGET(m_text), GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK );
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
||||
#else
|
||||
#else // GTK+ 1
|
||||
// create our control ...
|
||||
m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
|
||||
|
||||
@ -605,7 +607,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
GTK_FILL,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
|
||||
0, 0);
|
||||
#endif
|
||||
#endif // GTK+ 2/1
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user