X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3379ed3789e405f874d9db757d95346f1d378795..d32cad2cce9bfb819d7af071e88d515b648daf60:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 65f7951813..23abc60f42 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -564,19 +564,21 @@ void wxTextCtrl::AppendText( const wxString &text ) { if ( !m_defaultStyle.IsDefault() ) { - GdkFont *font = m_defaultStyle.HasFont() - ? m_defaultStyle.GetFont().GetInternalFont() - : NULL; + wxFont font = m_defaultStyle.HasFont() ? m_defaultStyle.GetFont() + : m_font; + GdkFont *fnt = font.Ok() ? font.GetInternalFont() : NULL; - GdkColor *colFg = m_defaultStyle.HasTextColour() - ? m_defaultStyle.GetTextColour().GetColor() - : NULL; + wxColour col = m_defaultStyle.HasTextColour() + ? m_defaultStyle.GetTextColour() + : m_foregroundColour; + GdkColor *colFg = col.Ok() ? col.GetColor() : NULL; - GdkColor *colBg = m_defaultStyle.HasBackgroundColour() - ? m_defaultStyle.GetBackgroundColour().GetColor() - : NULL; + col = m_defaultStyle.HasBackgroundColour() + ? m_defaultStyle.GetBackgroundColour() + : m_backgroundColour; + GdkColor *colBg = col.Ok() ? col.GetColor() : NULL; - gtk_text_insert( GTK_TEXT(m_text), font, colFg, colBg, txt, txtlen ); + gtk_text_insert( GTK_TEXT(m_text), fnt, colFg, colBg, txt, txtlen ); } else // no style { @@ -1058,6 +1060,8 @@ bool wxTextCtrl::SetFont( const wxFont &font ) { m_updateFont = TRUE; + m_defaultStyle.SetFont(font); + ChangeFontGlobally(); } @@ -1102,7 +1106,8 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) { wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") ); - wxControl::SetBackgroundColour( colour ); + if ( !wxControl::SetBackgroundColour( colour ) ) + return FALSE; if (!m_widget->window) return FALSE; @@ -1290,3 +1295,19 @@ wxSize wxTextCtrl::DoGetBestSize() const wxSize ret( wxControl::DoGetBestSize() ); return wxSize(80, ret.y); } + +void wxTextCtrl::Freeze() +{ + if ( HasFlag(wxTE_MULTILINE) ) + { + gtk_text_freeze(GTK_TEXT(m_text)); + } +} + +void wxTextCtrl::Thaw() +{ + if ( HasFlag(wxTE_MULTILINE) ) + { + gtk_text_thaw(GTK_TEXT(m_text)); + } +}