if (ansistr.data() == NULL)
return;
event.m_keyCode = ansistr[0u];
- wxLogTrace(TRACE_KEYS, _T("IM sent character '%c'"), event.m_keyCode);
+ wxLogTrace(TRACE_KEYS, _T("IM sent character '%c'"), (wxChar)event.m_keyCode);
#endif // wxUSE_UNICODE
bool ret = false;
#ifdef __WXGTK20__
m_imData = NULL;
m_x11Context = NULL;
+ m_dirtyTabOrder = false;
#else
#ifdef HAVE_XIM
m_ic = (GdkIC*) NULL;
void wxWindowGTK::OnInternalIdle()
{
+#ifdef __WXGTK20__
+ if ( m_dirtyTabOrder )
+ RealizeTabOrder();
+#endif
+
// Update invalidated regions.
GtkUpdate();
g_object_unref( G_OBJECT( layout ) );
- return (int) (rect.height / PANGO_SCALE);
+ return (int) PANGO_PIXELS(rect.height);
#else
GdkFont *gfont = font.GetInternalFont( 1.0 );
g_object_unref( G_OBJECT( layout ) );
- return (int) (rect.width / PANGO_SCALE);
+ return (int) PANGO_PIXELS(rect.width);
#else
GdkFont *gfont = font.GetInternalFont( 1.0 );
pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
#endif
}
- PangoLayoutLine *line = (PangoLayoutLine *)pango_layout_get_lines(layout)->data;
PangoRectangle rect;
- pango_layout_line_get_extents(line, NULL, &rect);
+ pango_layout_get_extents(layout, NULL, &rect);
- if (x) (*x) = (wxCoord) (rect.width / PANGO_SCALE);
- if (y) (*y) = (wxCoord) (rect.height / PANGO_SCALE);
+ if (x) (*x) = (wxCoord) PANGO_PIXELS(rect.width);
+ if (y) (*y) = (wxCoord) PANGO_PIXELS(rect.height);
if (descent)
{
- // Do something about metrics here
- (*descent) = 0;
+ PangoLayoutIter *iter = pango_layout_get_iter(layout);
+ int baseline = pango_layout_iter_get_baseline(iter);
+ pango_layout_iter_free(iter);
+ *descent = *y - PANGO_PIXELS(baseline);
}
if (externalLeading) (*externalLeading) = 0; // ??
(*m_insertCallback)(this, child);
}
+#ifdef __WXGTK20__
+
+void wxWindowGTK::AddChild(wxWindowBase *child)
+{
+ wxWindowBase::AddChild(child);
+ m_dirtyTabOrder = true;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+}
+
+void wxWindowGTK::RemoveChild(wxWindowBase *child)
+{
+ wxWindowBase::RemoveChild(child);
+ m_dirtyTabOrder = true;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+}
+
+void wxWindowGTK::DoMoveInTabOrder(wxWindow *win, MoveKind move)
+{
+ wxWindowBase::DoMoveInTabOrder(win, move);
+ m_dirtyTabOrder = true;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+}
+
+void wxWindowGTK::RealizeTabOrder()
+{
+ if (m_wxwindow)
+ {
+ if (m_children.size() > 0)
+ {
+ GList *chain = NULL;
+
+ for (wxWindowList::const_iterator i = m_children.begin();
+ i != m_children.end(); ++i)
+ {
+ chain = g_list_prepend(chain, (*i)->m_widget);
+ }
+
+ chain = g_list_reverse(chain);
+
+ gtk_container_set_focus_chain(GTK_CONTAINER(m_wxwindow), chain);
+ g_list_free(chain);
+ }
+ else
+ {
+ gtk_container_unset_focus_chain(GTK_CONTAINER(m_wxwindow));
+ }
+ }
+
+ m_dirtyTabOrder = false;
+}
+
+#endif // __WXGTK20__
+
void wxWindowGTK::Raise()
{
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );