// "focus_in_event"
//-----------------------------------------------------------------------------
-wxWindow *FindFocusedChild(wxWindow *win);
extern wxWindow *g_focusWindow;
extern bool g_blockEventsOnDrag;
// extern bool g_isIdle;
g_sendActivateEvent = 0;
#endif
- wxWindow *winFocus = FindFocusedChild(win);
+ wxWindow *winFocus = wxFindFocusedChild(win);
if ( winFocus )
win = winFocus;
{
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
{
{
m_updateFont = TRUE;
+ m_defaultStyle.SetFont(font);
+
ChangeFontGlobally();
}
{
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;
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));
+ }
+}