X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1b93ccbdce1d7b757f6d6180b710214e6277a00..e1983ab58804a0e32ab2d832ded0349af1cc0476:/src/gtk1/slider.cpp diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index 07bc86620d..f3ab24213f 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -7,10 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "slider.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/slider.h" #if wxUSE_SLIDER @@ -131,16 +134,15 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) ); + GtkEnableEvents(); + SetRange( minValue, maxValue ); SetValue( value ); - GtkEnableEvents(); - m_parent->DoAddChild( this ); PostCreation(); - - SetBackgroundColour( parent->GetBackgroundColour() ); + InheritAttributes(); Show( TRUE ); @@ -255,14 +257,15 @@ int wxSlider::GetLineSize() const bool wxSlider::IsOwnGtkWindow( GdkWindow *window ) { GtkRange *range = GTK_RANGE(m_widget); +#ifdef __WXGTK20__ + return (range->event_window == window); +#else return ( (window == GTK_WIDGET(range)->window) -#ifndef __WXGTK20__ || (window == range->trough) || (window == range->slider) || (window == range->step_forw) - || (window == range->step_back) -#endif // GTK+ 1.x - ); + || (window == range->step_back) ); +#endif } void wxSlider::ApplyWidgetStyle()