]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
do accept focus in notebook as it needs it for tabs
[wxWidgets.git] / src / gtk / textctrl.cpp
index 4518dbd7292ff915bafbf51c07b6c9594d23ee51..caa6405299af908b6d8ad1458e5b73de88a3c266 100644 (file)
@@ -1003,7 +1003,13 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
     m_modified = false;
     DontMarkDirtyOnNextChange();
 
-    const wxCharBuffer buffer(wxGTK_CONV_ENC(value, GetTextEncoding()));
+    wxFontEncoding enc = m_defaultStyle.HasFont()
+                            ? m_defaultStyle.GetFont().GetEncoding()
+                            : wxFONTENCODING_SYSTEM;
+    if ( enc == wxFONTENCODING_SYSTEM )
+        enc = GetTextEncoding();
+
+    const wxCharBuffer buffer(wxGTK_CONV_ENC(value, enc));
     if ( !buffer )
     {
         // see comment in WriteText() as to why we must warn the user about
@@ -1024,6 +1030,14 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
     if ( IsMultiLine() )
     {
         gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );
+
+        if ( !m_defaultStyle.IsDefault() )
+        {
+            GtkTextIter start, end;
+            gtk_text_buffer_get_bounds( m_buffer, &start, &end );
+            wxGtkTextApplyTagsFromAttr(m_widget, m_buffer, m_defaultStyle,
+                                       &start, &end);
+        }
     }
     else // single line
     {
@@ -1288,9 +1302,9 @@ bool wxTextCtrl::Enable( bool enable )
 }
 
 // wxGTK-specific: called recursively by Enable,
-// to give widgets an oppprtunity to correct their colours after they
+// to give widgets an opportunity to correct their colours after they
 // have been changed by Enable
-void wxTextCtrl::OnParentEnable( bool enable )
+void wxTextCtrl::OnEnabled( bool enable )
 {
     // If we have a custom background colour, we use this colour in both
     // disabled and enabled mode, or we end up with a different colour under the