X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b6ae8db82b3de9811238d8dd68d87f764fd72725..107d0fd493dc4d750ba18518a2eea5b93d988965:/src/gtk1/textctrl.cpp?ds=inline diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 625ec9c915..a970bf7dd5 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -26,7 +26,7 @@ #include #include #include -#include // for fabs +#include "wx/math.h" #include "wx/gtk/private.h" #include @@ -396,6 +396,11 @@ bool wxTextCtrl::Create( wxWindow *parent, // a single-line text control: no need for scrollbars m_widget = m_text = gtk_entry_new(); + +#ifdef __WXGTK20__ + if (style & wxNO_BORDER) + g_object_set( GTK_ENTRY(m_text), "has-frame", FALSE, NULL ); +#endif } m_parent->DoAddChild( this ); @@ -487,16 +492,19 @@ bool wxTextCtrl::Create( wxWindow *parent, gtk_text_view_set_justification( GTK_TEXT_VIEW(m_text), GTK_JUSTIFY_CENTER ); // Left justify (alignment) is the default and we don't need to apply GTK_JUSTIFY_LEFT } - // gtk_entry_set_alignment was introduced in gtk+-2.3.5 -#if GTK_CHECK_VERSION(2, 3, 5) else { - if (style & wxTE_RIGHT) - gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 ); - else if (style & wxTE_CENTRE) - gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 ); +#ifdef __WXGTK24__ + // gtk_entry_set_alignment was introduced in gtk+-2.3.5 + if (!gtk_check_version(2,4,0)) + { + if (style & wxTE_RIGHT) + gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 ); + else if (style & wxTE_CENTRE) + gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 ); + } +#endif } -#endif // gtk+-2.3.5 #endif // __WXGTK20__ // We want to be notified about text changes.