Fix compilation with GTK+ 2.4.

Support for ellipsization in GtkTreeView and gtk_window_set_focus_on_map() are
new in 2.6, don't use them with 2.4.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-02-28 11:08:59 +00:00
parent 049c4f6caa
commit 995d5aa24a
2 changed files with 22 additions and 3 deletions

View File

@ -1695,6 +1695,7 @@ int wxDataViewRenderer::GetAlignment() const
void wxDataViewRenderer::EnableEllipsize(wxEllipsizeMode mode)
{
#ifdef __WXGTK26__
if ( gtk_check_version(2, 6, 0) != NULL )
return;
@ -1709,10 +1710,14 @@ void wxDataViewRenderer::EnableEllipsize(wxEllipsizeMode mode)
g_value_set_enum( &gvalue, static_cast<PangoEllipsizeMode>(mode) );
g_object_set_property( G_OBJECT(rend), "ellipsize", &gvalue );
g_value_unset( &gvalue );
#else // GTK < 2.6
wxUnusedVar(mode);
#endif // GTK 2.6/before
}
wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
{
#ifdef __WXGTK26__
if ( gtk_check_version(2, 6, 0) != NULL )
return wxELLIPSIZE_NONE;
@ -1728,6 +1733,9 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
g_value_unset( &gvalue );
return mode;
#else // GTK < 2.6
return wxELLIPSIZE_NONE;
#endif // GTK 2.6/before
}
void

View File

@ -358,8 +358,15 @@ gtk_frame_map_callback( GtkWidget*,
eventShow.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(eventShow);
}
// restore focus-on-map setting in case ShowWithoutActivating() was called
gtk_window_set_focus_on_map(GTK_WINDOW(win->m_widget), true);
#if GTK_CHECK_VERSION(2,6,0)
if (!gtk_check_version(2,6,0))
{
// restore focus-on-map setting in case ShowWithoutActivating() was called
gtk_window_set_focus_on_map(GTK_WINDOW(win->m_widget), true);
}
#endif // GTK+ 2.6+
return false;
}
}
@ -897,7 +904,11 @@ void wxTopLevelWindowGTK::ShowWithoutActivating()
{
if (!m_isShown)
{
gtk_window_set_focus_on_map(GTK_WINDOW(m_widget), false);
#if GTK_CHECK_VERSION(2,6,0)
if (!gtk_check_version(2,6,0))
gtk_window_set_focus_on_map(GTK_WINDOW(m_widget), false);
#endif // GTK+ 2.6+
Show(true);
}
}