]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/window.cpp
Optimized sizers to not call CalcMin more often than neccessary
[wxWidgets.git] / src / gtk1 / window.cpp
index 4c95bf0741fee838f9aecfb2d806a0e374f53c57..e471db7e9fbaa9c76ca3dd9970c1ca239d3a0e43 100644 (file)
@@ -1274,11 +1274,15 @@ static void gtk_wxwindow_commit_cb (GtkIMContext *context,
     if (event.m_uniChar < 256)
         event.m_keyCode = event.m_uniChar;
 #else
-    gunichar uniChar = g_utf8_get_char( str );
-    // We cannot handle Unicode in non-Unicode mode
-    if (uniChar > 255) return;
-
-    event.m_keyCode = uniChar;
+    wchar_t unistr[2];
+    unistr[0] = g_utf8_get_char(str);
+    unistr[1] = 0;
+    wxCharBuffer ansistr(wxConvLocal.cWC2MB(unistr));
+    // We cannot handle characters that cannot be represented in 
+    // current locale's charset in non-Unicode mode:
+    if (ansistr.data() == NULL) return;
+
+    event.m_keyCode = ansistr[0u];
 #endif
 
 
@@ -2695,17 +2699,6 @@ bool wxWindowGTK::Create( wxWindow *parent,
     gtk_signal_connect( GTK_OBJECT(m_vAdjust), "value_changed",
           (GtkSignalFunc) gtk_window_vscroll_callback, (gpointer) this );
 
-#ifdef __WXGTK20__
-    // Create input method handler
-    m_imContext = gtk_im_multicontext_new();
-
-    // Cannot handle drawing preedited text yet
-    gtk_im_context_set_use_preedit( m_imContext, FALSE );
-
-    g_signal_connect (G_OBJECT (m_imContext), "commit",
-                      G_CALLBACK (gtk_wxwindow_commit_cb), this);
-#endif
-
     gtk_widget_show( m_wxwindow );
 
     if (m_parent)
@@ -2801,6 +2794,7 @@ void wxWindowGTK::PostCreation()
 #else
             // gtk_widget_set_redraw_on_allocate( GTK_WIDGET(m_wxwindow), !HasFlag( wxFULL_REPAINT_ON_RESIZE ) );
 #endif
+        }
 
 #ifdef __WXGTK20__
         // Create input method handler
@@ -2812,7 +2806,6 @@ void wxWindowGTK::PostCreation()
         g_signal_connect (G_OBJECT (m_imContext), "commit",
                           G_CALLBACK (gtk_wxwindow_commit_cb), this);
 #endif
-        }
 
         // these are called when the "sunken" or "raised" borders are drawn
         gtk_signal_connect( GTK_OBJECT(m_widget), "expose_event",