]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
traces of my debugging session, no real changes
[wxWidgets.git] / src / gtk / textctrl.cpp
index ba3c070bb9b9b529a734bfdccd8d52210d65bd92..0e2fab3a2619b4e005f51253f14fb02ceb34dca7 100644 (file)
@@ -97,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)
@@ -828,6 +826,14 @@ void wxTextCtrl::DiscardEdits()
     m_modified = FALSE;
 }
 
+void wxTextCtrl::SetMaxLength(unsigned long len)
+{
+    if ( !HasFlag(wxTE_MULTILINE) )
+    {
+        gtk_entry_set_max_length(GTK_ENTRY(m_text), len);
+    }
+}
+
 void wxTextCtrl::SetSelection( long from, long to )
 {
     wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
@@ -1077,10 +1083,10 @@ void wxTextCtrl::ChangeFontGlobally()
     wxString value = GetValue();
     if ( !value.IsEmpty() )
     {
+        m_updateFont = FALSE;
+
         Clear();
         AppendText(value);
-
-        m_updateFont = FALSE;
     }
 }