respect SetFont/SetXXXColour in wxTextCtrl even when using styles
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1f4774338e
commit
1ff4714de0
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user