X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3ffb94d27ad659b1bbe0a73ec155ba3d87e34dd..f4854380c1b7c0d72fc78ad47220f42fb05d7b17:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 558d9064e5..4fc49796fb 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -685,7 +685,6 @@ bool wxTextCtrl::Create( wxWindow *parent, const wxString &name ) { m_needParent = true; - m_acceptsFocus = true; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) @@ -711,7 +710,10 @@ bool wxTextCtrl::Create( wxWindow *parent, // create scrolled window m_widget = gtk_scrolled_window_new( NULL, NULL ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( m_widget ), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); + GTK_POLICY_AUTOMATIC, + style & wxTE_NO_VSCROLL + ? GTK_POLICY_NEVER + : GTK_POLICY_AUTOMATIC ); // for ScrollLines/Pages m_scrollBar[1] = (GtkRange*)((GtkScrolledWindow*)m_widget)->vscrollbar; @@ -1000,7 +1002,13 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags ) m_modified = false; DontMarkDirtyOnNextChange(); - const wxCharBuffer buffer(wxGTK_CONV_ENC(value, GetTextEncoding())); + wxFontEncoding enc = m_defaultStyle.HasFont() + ? m_defaultStyle.GetFont().GetEncoding() + : wxFONTENCODING_SYSTEM; + if ( enc == wxFONTENCODING_SYSTEM ) + enc = GetTextEncoding(); + + const wxCharBuffer buffer(wxGTK_CONV_ENC(value, enc)); if ( !buffer ) { // see comment in WriteText() as to why we must warn the user about @@ -1021,6 +1029,14 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags ) if ( IsMultiLine() ) { gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) ); + + if ( !m_defaultStyle.IsDefault() ) + { + GtkTextIter start, end; + gtk_text_buffer_get_bounds( m_buffer, &start, &end ); + wxGtkTextApplyTagsFromAttr(m_widget, m_buffer, m_defaultStyle, + &start, &end); + } } else // single line { @@ -1285,9 +1301,9 @@ bool wxTextCtrl::Enable( bool enable ) } // wxGTK-specific: called recursively by Enable, -// to give widgets an oppprtunity to correct their colours after they +// to give widgets an opportunity to correct their colours after they // have been changed by Enable -void wxTextCtrl::OnParentEnable( bool enable ) +void wxTextCtrl::OnEnabled( bool enable ) { // If we have a custom background colour, we use this colour in both // disabled and enabled mode, or we end up with a different colour under the