X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9cd6d737d5adc5fe415cddb3ef0024b9da2b9e08..0e32fdb872d413f14da8ce045766f0e2f13e202d:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 05ccf01a77..f16643b0c7 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -21,6 +21,7 @@ #include #include #include +#include // for fabs #include "gdk/gdk.h" #include "gtk/gtk.h" @@ -96,11 +97,9 @@ static gint gtk_text_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(ev g_focusWindow = win; - wxPanel *panel = wxDynamicCast(win->GetParent(), wxPanel); - if (panel) - { - panel->SetLastFocus(win); - } + // notify the parent that we got the focus + wxChildFocusEvent eventFocus(win); + (void)win->GetEventHandler()->ProcessEvent(eventFocus); #ifdef HAVE_XIM if (win->m_ic) @@ -123,7 +122,6 @@ static gint gtk_text_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(ev if (win->GetEventHandler()->ProcessEvent( event )) { - gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" ); return TRUE; } @@ -178,7 +176,6 @@ static gint gtk_text_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED(e if (win->GetEventHandler()->ProcessEvent( event )) { - gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" ); return TRUE; } @@ -1078,10 +1075,10 @@ void wxTextCtrl::ChangeFontGlobally() wxString value = GetValue(); if ( !value.IsEmpty() ) { + m_updateFont = FALSE; + Clear(); AppendText(value); - - m_updateFont = FALSE; } } @@ -1312,6 +1309,8 @@ void wxTextCtrl::Thaw() { if ( HasFlag(wxTE_MULTILINE) ) { + GTK_TEXT(m_text)->vadj->value = 0.0; + gtk_text_thaw(GTK_TEXT(m_text)); } } @@ -1368,6 +1367,6 @@ bool wxTextCtrl::ScrollPages(int pages) if ( !adj ) return FALSE; - return DoScroll(adj, pages*adj->page_increment); + return DoScroll(adj, (int)ceil(pages*adj->page_increment)); }