update minimum GTK2 version requirement to 2.6
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
abac13f901
commit
4e621d2471
46
configure
vendored
46
configure
vendored
@ -23103,7 +23103,7 @@ fi
|
||||
no_gtk=yes
|
||||
fi
|
||||
|
||||
min_gtk_version=2.4.0
|
||||
min_gtk_version=2.6.0
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5
|
||||
$as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; }
|
||||
|
||||
@ -24147,8 +24147,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
||||
|
||||
$as_echo "#define __WXGTK210__ 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define __WXGTK26__ 1" >>confdefs.h
|
||||
|
||||
elif test "$WXGTK2" = 1; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
@ -24180,8 +24178,6 @@ if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
$as_echo "#define __WXGTK210__ 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define __WXGTK26__ 1" >>confdefs.h
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
ac_wxgtk218=1
|
||||
@ -24219,8 +24215,6 @@ if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
$as_echo "#define __WXGTK210__ 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define __WXGTK26__ 1" >>confdefs.h
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
ac_wxgtk210=1
|
||||
@ -24233,44 +24227,6 @@ $as_echo "no" >&6; }
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
if test "$ac_wxgtk210" = 0; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.6" >&5
|
||||
$as_echo_n "checking if GTK+ is version >= 2.6... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,6,0)
|
||||
Not GTK+ 2.6
|
||||
#endif
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
$as_echo "#define __WXGTK26__ 1" >>confdefs.h
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
ac_wxgtk26=1
|
||||
|
||||
else
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
ac_wxgtk26=0
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
fi
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
27
configure.in
27
configure.in
@ -2890,7 +2890,7 @@ if test "$wxUSE_GUI" = "yes"; then
|
||||
esac
|
||||
|
||||
if test "$wxGTK_VERSION" != 3; then
|
||||
AM_PATH_GTK_2_0(2.4.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
|
||||
AM_PATH_GTK_2_0(2.6.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
|
||||
fi
|
||||
if test -z "$wx_cv_lib_gtk"; then
|
||||
if test "$wxGTK_VERSION" = 3 -o "$wxGTK_VERSION" = any; then
|
||||
@ -2956,7 +2956,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
||||
if test "$WXGTK3" = 1; then
|
||||
AC_DEFINE(__WXGTK218__)
|
||||
AC_DEFINE(__WXGTK210__)
|
||||
AC_DEFINE(__WXGTK26__)
|
||||
elif test "$WXGTK2" = 1; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
@ -2976,7 +2975,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
||||
[
|
||||
AC_DEFINE(__WXGTK218__)
|
||||
AC_DEFINE(__WXGTK210__)
|
||||
AC_DEFINE(__WXGTK26__)
|
||||
AC_MSG_RESULT([yes])
|
||||
ac_wxgtk218=1
|
||||
],
|
||||
@ -2998,7 +2996,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
||||
],
|
||||
[
|
||||
AC_DEFINE(__WXGTK210__)
|
||||
AC_DEFINE(__WXGTK26__)
|
||||
AC_MSG_RESULT([yes])
|
||||
ac_wxgtk210=1
|
||||
],
|
||||
@ -3006,28 +3003,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
||||
AC_MSG_RESULT([no])
|
||||
ac_wxgtk210=0
|
||||
])
|
||||
|
||||
if test "$ac_wxgtk210" = 0; then
|
||||
dnl test if we have at least GTK+ 2.6:
|
||||
AC_MSG_CHECKING([if GTK+ is version >= 2.6])
|
||||
AC_TRY_COMPILE([
|
||||
#include <gtk/gtk.h>
|
||||
],
|
||||
[
|
||||
#if !GTK_CHECK_VERSION(2,6,0)
|
||||
Not GTK+ 2.6
|
||||
#endif
|
||||
],
|
||||
[
|
||||
AC_DEFINE(__WXGTK26__)
|
||||
AC_MSG_RESULT([yes])
|
||||
ac_wxgtk26=1
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
ac_wxgtk26=0
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
@ -129,7 +129,7 @@ protected:
|
||||
// requires that all classes being mapped as wx{File|Dir}PickerWidget have the
|
||||
// same prototype for the contructor...
|
||||
// since GTK >= 2.6, there is GtkFileButton
|
||||
#if defined(__WXGTK26__) && !defined(__WXUNIVERSAL__)
|
||||
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
|
||||
#include "wx/gtk/filepicker.h"
|
||||
#define wxFilePickerWidget wxFileButton
|
||||
#define wxDirPickerWidget wxDirButton
|
||||
|
@ -1649,7 +1649,6 @@
|
||||
// exact GTK version (without including GTK+ headers that we don't want to
|
||||
// include from our own public headers), just assume a recent GTK 2.x.
|
||||
#define __WXGTK20__
|
||||
#define __WXGTK26__
|
||||
#define __WXGTK210__
|
||||
#define __WXGTK218__
|
||||
//#define __WXGTK3__
|
||||
|
@ -310,7 +310,7 @@ void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
|
||||
// currently wxAboutBox is implemented natively only under these platforms, for
|
||||
// the others we provide a generic fallback here
|
||||
#if !defined(__WXMSW__) && !defined(__WXMAC__) && \
|
||||
(!defined(__WXGTK26__) || defined(__WXUNIVERSAL__))
|
||||
(!defined(__WXGTK20__) || defined(__WXUNIVERSAL__))
|
||||
|
||||
void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_ABOUTDLG && defined(__WXGTK26__)
|
||||
#if wxUSE_ABOUTDLG
|
||||
|
||||
#include "wx/aboutdlg.h"
|
||||
|
||||
@ -27,10 +27,6 @@
|
||||
#include "wx/utils.h" // for wxLaunchDefaultBrowser()
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#ifndef __WXGTK3__
|
||||
#include "wx/generic/aboutdlgg.h"
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "wx/gtk/private.h"
|
||||
#include "wx/gtk/private/gtk2-compat.h"
|
||||
@ -138,9 +134,6 @@ static void wxGtkAboutDialogOnLink(GtkAboutDialog*, const char* link, void*)
|
||||
|
||||
void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent))
|
||||
{
|
||||
#ifndef __WXGTK3__
|
||||
if ( !gtk_check_version(2,6,0) )
|
||||
#endif
|
||||
{
|
||||
// don't create another dialog if one is already present
|
||||
if ( !gs_aboutDialog )
|
||||
@ -246,11 +239,6 @@ void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent))
|
||||
|
||||
gtk_window_present(GTK_WINDOW(dlg));
|
||||
}
|
||||
#ifndef __WXGTK3__
|
||||
else
|
||||
// native about dialog not available, fall back to the generic one
|
||||
wxGenericAboutBox(info);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // wxUSE_ABOUTDLG && GTK+ 2.6+
|
||||
#endif // wxUSE_ABOUTDLG
|
||||
|
@ -178,23 +178,9 @@ void wxAnyButton::GTKDoShowBitmap(const wxBitmap& bitmap)
|
||||
}
|
||||
else // have both label and bitmap
|
||||
{
|
||||
#ifdef __WXGTK26__
|
||||
if ( !gtk_check_version(2,6,0) )
|
||||
{
|
||||
image = gtk_button_get_image(GTK_BUTTON(m_widget));
|
||||
}
|
||||
else
|
||||
#endif // __WXGTK26__
|
||||
{
|
||||
// buttons with both label and bitmap are only supported with GTK+
|
||||
// 2.6 so far
|
||||
//
|
||||
// it shouldn't be difficult to implement them ourselves for the
|
||||
// previous GTK+ versions by stuffing a container with a label and
|
||||
// an image inside GtkButton but there doesn't seem to be much
|
||||
// point in doing this for ancient GTK+ versions
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
wxCHECK_RET( image && GTK_IS_IMAGE(image), "must have image widget" );
|
||||
@ -219,10 +205,9 @@ void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
||||
// its size) changes
|
||||
InvalidateBestSize();
|
||||
}
|
||||
#ifdef __WXGTK26__
|
||||
// normal image is special: setting it enables images for the button and
|
||||
// resetting it to nothing disables all of them
|
||||
else if ( !gtk_check_version(2,6,0) )
|
||||
else
|
||||
{
|
||||
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(m_widget));
|
||||
if ( image && !bitmap.IsOk() )
|
||||
@ -242,7 +227,6 @@ void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
||||
|
||||
InvalidateBestSize();
|
||||
}
|
||||
#endif // GTK+ 2.6+
|
||||
break;
|
||||
|
||||
case State_Pressed:
|
||||
|
@ -327,10 +327,6 @@ wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
|
||||
}
|
||||
|
||||
// otherwise try icon themes
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if ( !gtk_check_version(2,6,0) )
|
||||
#endif
|
||||
{
|
||||
gint *sizes = gtk_icon_theme_get_icon_sizes
|
||||
(
|
||||
@ -352,7 +348,6 @@ wxGTK2ArtProvider::CreateIconBundle(const wxArtID& id,
|
||||
);
|
||||
g_free(sizes);
|
||||
}
|
||||
#endif // __WXGTK26__
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
@ -45,9 +45,7 @@ GtkWidget *gtk_assert_dialog_add_button_to (GtkBox *box, const gchar *label,
|
||||
|
||||
/* add a stock icon inside it */
|
||||
GtkWidget *image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
gtk_button_set_image (GTK_BUTTON (button), image);
|
||||
#endif
|
||||
|
||||
/* add to the given (container) widget */
|
||||
if (box)
|
||||
|
@ -1841,9 +1841,6 @@ void wxDataViewRenderer::GtkPackIntoColumn(GtkTreeViewColumn *column)
|
||||
|
||||
void wxDataViewRenderer::GtkInitHandlers()
|
||||
{
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
g_signal_connect (GTK_CELL_RENDERER(m_renderer), "editing_started",
|
||||
G_CALLBACK (wxgtk_renderer_editing_started),
|
||||
@ -1971,12 +1968,6 @@ int wxDataViewRenderer::GetAlignment() const
|
||||
|
||||
void wxDataViewRenderer::EnableEllipsize(wxEllipsizeMode mode)
|
||||
{
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if ( gtk_check_version(2, 6, 0) != NULL )
|
||||
return;
|
||||
#endif
|
||||
|
||||
GtkCellRendererText * const rend = GtkGetTextRenderer();
|
||||
if ( !rend )
|
||||
return;
|
||||
@ -1988,19 +1979,10 @@ 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__
|
||||
#ifndef __WXGTK3__
|
||||
if ( gtk_check_version(2, 6, 0) != NULL )
|
||||
return wxELLIPSIZE_NONE;
|
||||
#endif
|
||||
|
||||
GtkCellRendererText * const rend = GtkGetTextRenderer();
|
||||
if ( !rend )
|
||||
return wxELLIPSIZE_NONE;
|
||||
@ -2013,9 +1995,6 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
|
||||
g_value_unset( &gvalue );
|
||||
|
||||
return mode;
|
||||
#else // GTK < 2.6
|
||||
return wxELLIPSIZE_NONE;
|
||||
#endif // GTK 2.6/before
|
||||
}
|
||||
|
||||
void
|
||||
@ -2556,8 +2535,6 @@ wxDataViewProgressRenderer::wxDataViewProgressRenderer( const wxString &label,
|
||||
m_label = label;
|
||||
m_value = 0;
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,6,0) == NULL)
|
||||
{
|
||||
m_renderer = (GtkCellRenderer*) gtk_cell_renderer_progress_new();
|
||||
|
||||
@ -2574,13 +2551,9 @@ wxDataViewProgressRenderer::wxDataViewProgressRenderer( const wxString &label,
|
||||
m_needsToSetLabel = true;
|
||||
else
|
||||
#endif // !wxUSE_UNICODE
|
||||
{
|
||||
GTKSetLabel();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Use custom cell code
|
||||
wxDataViewCustomRenderer::Init(mode, align);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2612,8 +2585,6 @@ void wxDataViewProgressRenderer::GTKSetLabel()
|
||||
|
||||
bool wxDataViewProgressRenderer::SetValue( const wxVariant &value )
|
||||
{
|
||||
#ifdef __WXGTK26__
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,6,0) == NULL)
|
||||
{
|
||||
#if !wxUSE_UNICODE
|
||||
if ( m_needsToSetLabel )
|
||||
@ -2627,14 +2598,6 @@ bool wxDataViewProgressRenderer::SetValue( const wxVariant &value )
|
||||
g_object_set_property( G_OBJECT(m_renderer), "value", &gvalue );
|
||||
g_value_unset( &gvalue );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
m_value = (long) value;
|
||||
|
||||
if (m_value < 0) m_value = 0;
|
||||
if (m_value > 100) m_value = 100;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -2675,8 +2638,6 @@ wxDataViewChoiceRenderer::wxDataViewChoiceRenderer( const wxArrayString &choices
|
||||
{
|
||||
m_choices = choices;
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,6,0) == NULL)
|
||||
{
|
||||
m_renderer = (GtkCellRenderer*) gtk_cell_renderer_combo_new();
|
||||
|
||||
@ -2703,12 +2664,6 @@ wxDataViewChoiceRenderer::wxDataViewChoiceRenderer( const wxArrayString &choices
|
||||
|
||||
GtkInitHandlers();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Use custom cell code
|
||||
wxDataViewCustomRenderer::Init(mode, alignment);
|
||||
}
|
||||
}
|
||||
|
||||
bool wxDataViewChoiceRenderer::Render( wxRect rect, wxDC *dc, int state )
|
||||
@ -2725,8 +2680,6 @@ wxSize wxDataViewChoiceRenderer::GetSize() const
|
||||
bool wxDataViewChoiceRenderer::SetValue( const wxVariant &value )
|
||||
{
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,6,0) == NULL)
|
||||
{
|
||||
GValue gvalue = { 0, };
|
||||
g_value_init( &gvalue, G_TYPE_STRING );
|
||||
@ -2736,17 +2689,12 @@ bool wxDataViewChoiceRenderer::SetValue( const wxVariant &value )
|
||||
g_object_set_property( G_OBJECT(m_renderer), "text", &gvalue );
|
||||
g_value_unset( &gvalue );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
m_data = value.GetString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDataViewChoiceRenderer::GetValue( wxVariant &value ) const
|
||||
{
|
||||
#ifdef __WXGTK26__
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,6,0) == NULL)
|
||||
{
|
||||
GValue gvalue = { 0, };
|
||||
g_value_init( &gvalue, G_TYPE_STRING );
|
||||
@ -2759,9 +2707,6 @@ bool wxDataViewChoiceRenderer::GetValue( wxVariant &value ) const
|
||||
//wxPrintf( "temp %s\n", temp );
|
||||
// TODO: remove this code
|
||||
}
|
||||
else
|
||||
#endif
|
||||
value = m_data;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -4579,15 +4524,10 @@ bool wxDataViewCtrl::Create(wxWindow *parent,
|
||||
g_signal_connect (m_treeview, "size_allocate",
|
||||
G_CALLBACK (gtk_dataviewctrl_size_callback), this);
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
bool fixed = (style & wxDV_VARIABLE_LINE_HEIGHT) == 0;
|
||||
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), fixed );
|
||||
}
|
||||
#endif
|
||||
|
||||
if (style & wxDV_MULTIPLE)
|
||||
{
|
||||
@ -4693,15 +4633,10 @@ bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
|
||||
if (!wxDataViewCtrlBase::AssociateModel( model ))
|
||||
return false;
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
bool fixed = (((GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) == 0) || (model->IsVirtualListModel()));
|
||||
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), fixed );
|
||||
}
|
||||
#endif
|
||||
|
||||
m_internal = new wxDataViewCtrlInternal( this, model );
|
||||
|
||||
@ -4725,16 +4660,11 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
|
||||
|
||||
m_cols.Append( col );
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
if (gtk_tree_view_column_get_sizing( GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()) ) !=
|
||||
GTK_TREE_VIEW_COLUMN_FIXED)
|
||||
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
gtk_tree_view_append_column( GTK_TREE_VIEW(m_treeview),
|
||||
GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()) );
|
||||
@ -4749,16 +4679,11 @@ bool wxDataViewCtrl::PrependColumn( wxDataViewColumn *col )
|
||||
|
||||
m_cols.Insert( col );
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
if (gtk_tree_view_column_get_sizing( GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()) ) !=
|
||||
GTK_TREE_VIEW_COLUMN_FIXED)
|
||||
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
gtk_tree_view_insert_column( GTK_TREE_VIEW(m_treeview),
|
||||
GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()), 0 );
|
||||
@ -4773,16 +4698,11 @@ bool wxDataViewCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col )
|
||||
|
||||
m_cols.Insert( pos, col );
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
if (gtk_tree_view_column_get_sizing( GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()) ) !=
|
||||
GTK_TREE_VIEW_COLUMN_FIXED)
|
||||
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
gtk_tree_view_insert_column( GTK_TREE_VIEW(m_treeview),
|
||||
GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()), pos );
|
||||
|
@ -1451,8 +1451,6 @@ void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord
|
||||
|
||||
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
{
|
||||
x = XLOG2DEV(x);
|
||||
y = YLOG2DEV(y);
|
||||
@ -1529,110 +1527,6 @@ void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord
|
||||
CalcBoundingBox(x+minX, y+minY);
|
||||
CalcBoundingBox(x+maxX, y+maxY);
|
||||
}
|
||||
else
|
||||
#endif //__WXGTK26__
|
||||
{
|
||||
#if wxUSE_IMAGE
|
||||
if ( wxIsNullDouble(angle) )
|
||||
{
|
||||
DoDrawText(text, x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
wxCoord w;
|
||||
wxCoord h;
|
||||
|
||||
// TODO: implement later without GdkFont for GTK 2.0
|
||||
DoGetTextExtent(text, &w, &h, NULL,NULL, &m_font);
|
||||
|
||||
// draw the string normally
|
||||
wxBitmap src(w, h);
|
||||
wxMemoryDC dc;
|
||||
dc.SelectObject(src);
|
||||
dc.SetFont(GetFont());
|
||||
dc.SetBackground(*wxBLACK_BRUSH);
|
||||
dc.SetBrush(*wxBLACK_BRUSH);
|
||||
dc.Clear();
|
||||
dc.SetTextForeground( *wxWHITE );
|
||||
dc.DrawText(text, 0, 0);
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
|
||||
// Calculate the size of the rotated bounding box.
|
||||
double rad = DegToRad(angle);
|
||||
double dx = cos(rad),
|
||||
dy = sin(rad);
|
||||
|
||||
// the rectngle vertices are counted clockwise with the first one being at
|
||||
// (0, 0) (or, rather, at (x, y))
|
||||
double x2 = w*dx,
|
||||
y2 = -w*dy; // y axis points to the bottom, hence minus
|
||||
double x4 = h*dy,
|
||||
y4 = h*dx;
|
||||
double x3 = x4 + x2,
|
||||
y3 = y4 + y2;
|
||||
|
||||
// calc max and min
|
||||
wxCoord maxX = (wxCoord)(dmax(x2, dmax(x3, x4)) + 0.5),
|
||||
maxY = (wxCoord)(dmax(y2, dmax(y3, y4)) + 0.5),
|
||||
minX = (wxCoord)(dmin(x2, dmin(x3, x4)) - 0.5),
|
||||
minY = (wxCoord)(dmin(y2, dmin(y3, y4)) - 0.5);
|
||||
|
||||
|
||||
wxImage image = src.ConvertToImage();
|
||||
|
||||
image.ConvertColourToAlpha( m_textForegroundColour.Red(),
|
||||
m_textForegroundColour.Green(),
|
||||
m_textForegroundColour.Blue() );
|
||||
image = image.Rotate( rad, wxPoint(0,0) );
|
||||
|
||||
int i_angle = (int) angle;
|
||||
i_angle = i_angle % 360;
|
||||
if (i_angle < 0)
|
||||
i_angle += 360;
|
||||
int xoffset = 0;
|
||||
if ((i_angle >= 90.0) && (i_angle < 270.0))
|
||||
xoffset = image.GetWidth();
|
||||
int yoffset = 0;
|
||||
if ((i_angle >= 0.0) && (i_angle < 180.0))
|
||||
yoffset = image.GetHeight();
|
||||
|
||||
if ((i_angle >= 0) && (i_angle < 90))
|
||||
yoffset -= (int)( cos(rad)*h );
|
||||
if ((i_angle >= 90) && (i_angle < 180))
|
||||
xoffset -= (int)( sin(rad)*h );
|
||||
if ((i_angle >= 180) && (i_angle < 270))
|
||||
yoffset -= (int)( cos(rad)*h );
|
||||
if ((i_angle >= 270) && (i_angle < 360))
|
||||
xoffset -= (int)( sin(rad)*h );
|
||||
|
||||
int i_x = x - xoffset;
|
||||
int i_y = y - yoffset;
|
||||
|
||||
src = image;
|
||||
DoDrawBitmap( src, i_x, i_y, true );
|
||||
|
||||
|
||||
// it would be better to draw with non underlined font and draw the line
|
||||
// manually here (it would be more straight...)
|
||||
#if 0
|
||||
if ( m_font.GetUnderlined() )
|
||||
{
|
||||
gdk_draw_line( m_gdkwindow, m_textGC,
|
||||
XLOG2DEV(x + x4), YLOG2DEV(y + y4 + font->descent),
|
||||
XLOG2DEV(x + x3), YLOG2DEV(y + y3 + font->descent));
|
||||
}
|
||||
#endif // 0
|
||||
|
||||
// update the bounding box
|
||||
CalcBoundingBox(x + minX, y + minY);
|
||||
CalcBoundingBox(x + maxX, y + maxY);
|
||||
#else // !wxUSE_IMAGE
|
||||
wxUnusedVar(text);
|
||||
wxUnusedVar(x);
|
||||
wxUnusedVar(y);
|
||||
wxUnusedVar(angle);
|
||||
#endif // wxUSE_IMAGE/!wxUSE_IMAGE
|
||||
}
|
||||
}
|
||||
|
||||
void wxWindowDCImpl::DoGetTextExtent(const wxString &string,
|
||||
|
@ -239,9 +239,7 @@ static void wxgtk_main_do_event(GdkEvent* event, void* data)
|
||||
case GDK_SELECTION_REQUEST:
|
||||
case GDK_SELECTION_NOTIFY:
|
||||
case GDK_SELECTION_CLEAR:
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
case GDK_OWNER_CHANGE:
|
||||
#endif
|
||||
cat = wxEVT_CATEGORY_CLIPBOARD;
|
||||
break;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_FILEPICKERCTRL && defined(__WXGTK26__)
|
||||
#if wxUSE_FILEPICKERCTRL
|
||||
|
||||
#include "wx/filepicker.h"
|
||||
#include "wx/tooltip.h"
|
||||
@ -44,11 +44,7 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id,
|
||||
{
|
||||
// we can't use the native button for wxFLP_SAVE pickers as it can only
|
||||
// open existing files and there is no way to create a new file using it
|
||||
if (!(style & wxFLP_SAVE) && !(style & wxFLP_USE_TEXTCTRL)
|
||||
#ifndef __WXGTK3__
|
||||
&& gtk_check_version(2,6,0) == NULL
|
||||
#endif
|
||||
)
|
||||
if (!(style & wxFLP_SAVE) && !(style & wxFLP_USE_TEXTCTRL))
|
||||
{
|
||||
// VERY IMPORTANT: this code is identical to relative code in wxDirButton;
|
||||
// if you find a problem here, fix it also in wxDirButton !
|
||||
@ -140,12 +136,9 @@ void wxFileButton::SetInitialDirectory(const wxString& dir)
|
||||
wxGenericFileButton::SetInitialDirectory(dir);
|
||||
}
|
||||
|
||||
#endif // wxUSE_FILEPICKERCTRL && defined(__WXGTK26__)
|
||||
#endif // wxUSE_FILEPICKERCTRL
|
||||
|
||||
|
||||
|
||||
|
||||
#if wxUSE_DIRPICKERCTRL && defined(__WXGTK26__)
|
||||
#if wxUSE_DIRPICKERCTRL
|
||||
|
||||
#ifdef __UNIX__
|
||||
#include <unistd.h> // chdir
|
||||
@ -201,11 +194,7 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id,
|
||||
long style, const wxValidator& validator,
|
||||
const wxString &name )
|
||||
{
|
||||
if (!(style & wxDIRP_USE_TEXTCTRL)
|
||||
#ifndef __WXGTK3__
|
||||
&& gtk_check_version(2,6,0) == NULL
|
||||
#endif
|
||||
)
|
||||
if (!(style & wxDIRP_USE_TEXTCTRL))
|
||||
{
|
||||
// VERY IMPORTANT: this code is identic to relative code in wxFileButton;
|
||||
// if you find a problem here, fix it also in wxFileButton !
|
||||
@ -299,4 +288,4 @@ void wxDirButton::SetInitialDirectory(const wxString& dir)
|
||||
wxGenericDirButton::SetInitialDirectory(dir);
|
||||
}
|
||||
|
||||
#endif // wxUSE_DIRPICKERCTRL && defined(__WXGTK26__)
|
||||
#endif // wxUSE_DIRPICKERCTRL
|
||||
|
@ -1231,11 +1231,7 @@ const char *wxGetStockGtkID(wxWindowID id)
|
||||
case wx: \
|
||||
return gtk;
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
#define STOCKITEM_26(wx,gtk) STOCKITEM(wx,gtk)
|
||||
#else
|
||||
#define STOCKITEM_26(wx,gtk)
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(2,8,0)
|
||||
#define STOCKITEM_28(wx,gtk) STOCKITEM(wx,gtk)
|
||||
|
@ -166,19 +166,13 @@ void wxMessageDialog::GTKCreateMsgDialog()
|
||||
}
|
||||
|
||||
wxString message;
|
||||
#if GTK_CHECK_VERSION(2, 6, 0)
|
||||
bool needsExtMessage = false;
|
||||
if (!m_extendedMessage.empty()
|
||||
#ifndef __WXGTK3__
|
||||
&& gtk_check_version(2, 6, 0) == NULL
|
||||
#endif
|
||||
)
|
||||
if (!m_extendedMessage.empty())
|
||||
{
|
||||
message = m_message;
|
||||
needsExtMessage = true;
|
||||
}
|
||||
else // extended message not needed or not supported
|
||||
#endif // GTK+ 2.6+
|
||||
else // extended message not needed
|
||||
{
|
||||
message = GetFullMessage();
|
||||
}
|
||||
@ -190,7 +184,6 @@ void wxMessageDialog::GTKCreateMsgDialog()
|
||||
"%s",
|
||||
(const char*)wxGTK_CONV(message));
|
||||
|
||||
#if GTK_CHECK_VERSION(2, 6, 0)
|
||||
if ( needsExtMessage )
|
||||
{
|
||||
gtk_message_dialog_format_secondary_text
|
||||
@ -200,7 +193,6 @@ void wxMessageDialog::GTKCreateMsgDialog()
|
||||
(const char *)wxGTK_CONV(m_extendedMessage)
|
||||
);
|
||||
}
|
||||
#endif // GTK+ 2.6+
|
||||
#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2/!wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
|
||||
|
||||
g_object_ref(m_widget);
|
||||
|
@ -72,10 +72,6 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
|
||||
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
// set ellipsize mode
|
||||
PangoEllipsizeMode ellipsizeMode = PANGO_ELLIPSIZE_NONE;
|
||||
@ -88,7 +84,6 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
|
||||
gtk_label_set_ellipsize( GTK_LABEL(m_widget), ellipsizeMode );
|
||||
}
|
||||
#endif // __WXGTK26__
|
||||
|
||||
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
|
||||
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
|
||||
@ -111,17 +106,6 @@ void wxStaticText::GTKDoSetLabel(GTKLabelSetter setter, const wxString& label)
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
#ifndef __WXGTK3__
|
||||
if (gtk_check_version(2,6,0) && IsEllipsized())
|
||||
{
|
||||
// GTK+ < 2.6 does not support ellipsization so we need to do it
|
||||
// manually and as our ellipsization code doesn't deal with markup, we
|
||||
// have no choice but to ignore it in this case and always use plain
|
||||
// text.
|
||||
GTKSetLabelForLabel(GTK_LABEL(m_widget), GetEllipsizedLabel());
|
||||
}
|
||||
else // Ellipsization not needed or supported by GTK+.
|
||||
#endif
|
||||
{
|
||||
(this->*setter)(GTK_LABEL(m_widget), label);
|
||||
}
|
||||
@ -216,15 +200,6 @@ void wxStaticText::DoSetSize(int x, int y,
|
||||
int sizeFlags )
|
||||
{
|
||||
wxStaticTextBase::DoSetSize(x, y, width, height, sizeFlags);
|
||||
|
||||
#ifndef __WXGTK3__
|
||||
if (gtk_check_version(2,6,0))
|
||||
{
|
||||
// GTK+ < 2.6 does not support ellipsization - we need to run our
|
||||
// generic code (actually it will be run only if IsEllipsized() == true)
|
||||
UpdateLabel();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
wxSize wxStaticText::DoGetBestSize() const
|
||||
|
@ -354,15 +354,10 @@ gtk_frame_map_callback( GtkWidget*,
|
||||
win->GetEventHandler()->ProcessEvent(eventShow);
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
@ -977,12 +972,7 @@ void wxTopLevelWindowGTK::ShowWithoutActivating()
|
||||
{
|
||||
if (!m_isShown)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(2,6,0)
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
gtk_window_set_focus_on_map(GTK_WINDOW(m_widget), false);
|
||||
#endif // GTK+ 2.6+
|
||||
|
||||
Show(true);
|
||||
}
|
||||
|
@ -416,8 +416,6 @@ wxString wxGUIAppTraits::GetDesktopEnvironment() const
|
||||
|
||||
#endif // __UNIX__ || __OS2__
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
|
||||
// see the hack below in wxCmdLineParser::GetUsageString().
|
||||
// TODO: replace this hack with a g_option_group_get_entries()
|
||||
// call as soon as such function exists;
|
||||
@ -463,8 +461,6 @@ wxString wxGetNameFromGtkOptionEntry(const GOptionEntry *opt)
|
||||
return wxT(" ") + ret;
|
||||
}
|
||||
|
||||
#endif // __WXGTK26__
|
||||
|
||||
#ifdef __UNIX__
|
||||
|
||||
wxString
|
||||
@ -473,10 +469,6 @@ wxGUIAppTraits::GetStandardCmdLineOptions(wxArrayString& names,
|
||||
{
|
||||
wxString usage;
|
||||
|
||||
#ifdef __WXGTK26__
|
||||
#ifndef __WXGTK3__
|
||||
if (!gtk_check_version(2,6,0))
|
||||
#endif
|
||||
{
|
||||
// since GTK>=2.6, we can use the glib_check_version() symbol...
|
||||
|
||||
@ -484,7 +476,7 @@ wxGUIAppTraits::GetStandardCmdLineOptions(wxArrayString& names,
|
||||
// because, as we use the undocumented _GOptionGroup struct, we don't want
|
||||
// to run this code with future versions which might change it (2.32 is the
|
||||
// latest one at the time of this writing)
|
||||
if (glib_check_version(2,6,0) == NULL && glib_check_version(2,33,0))
|
||||
if (glib_check_version(2,33,0))
|
||||
{
|
||||
usage << _("The following standard GTK+ options are also supported:\n");
|
||||
|
||||
@ -511,10 +503,6 @@ wxGUIAppTraits::GetStandardCmdLineOptions(wxArrayString& names,
|
||||
g_option_group_free (gtkOpts);
|
||||
}
|
||||
}
|
||||
#else
|
||||
wxUnusedVar(names);
|
||||
wxUnusedVar(desc);
|
||||
#endif // __WXGTK26__
|
||||
|
||||
return usage;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user