X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..d32cad2cce9bfb819d7af071e88d515b648daf60:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 1d41116d87..23abc60f42 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -80,7 +80,6 @@ gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) // "focus_in_event" //----------------------------------------------------------------------------- -wxWindow *FindFocusedChild(wxWindow *win); extern wxWindow *g_focusWindow; extern bool g_blockEventsOnDrag; // extern bool g_isIdle; @@ -152,7 +151,7 @@ static gint gtk_text_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED(e g_sendActivateEvent = 0; #endif - wxWindow *winFocus = FindFocusedChild(win); + wxWindow *winFocus = wxFindFocusedChild(win); if ( winFocus ) win = winFocus; @@ -565,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 { @@ -1059,6 +1060,8 @@ bool wxTextCtrl::SetFont( const wxFont &font ) { m_updateFont = TRUE; + m_defaultStyle.SetFont(font); + ChangeFontGlobally(); } @@ -1103,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; @@ -1291,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)); + } +}