X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fab591c5cceff41c0bedaa89af34cd039e2c44e1..b77b87881bae2e6306366d79e7fe160334b3d4a2:/src/gtk/spinctrl.cpp diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index f04242957b..e071efbce9 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -8,10 +8,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "spinctrl.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/spinctrl.h" #if wxUSE_SPINCTRL @@ -124,9 +127,8 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(); + InheritAttributes(); - SetFont( parent->GetFont() ); - wxSize size_best( DoGetBestSize() ); wxSize new_size( size ); if (new_size.x == -1) @@ -138,8 +140,6 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, if ((new_size.x != size.x) || (new_size.y != size.y)) SetSize( new_size.x, new_size.y ); - SetBackgroundColour( parent->GetBackgroundColour() ); - SetValue( value ); Show( TRUE ); @@ -255,7 +255,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) { wxCHECK_RET( m_widget != NULL, wxT("invalid spin ctrl") ); - if (event.KeyCode() == WXK_RETURN) + if (event.GetKeyCode() == WXK_RETURN) { wxWindow *top_frame = m_parent; while (top_frame->GetParent() && !(top_frame->GetParent()->IsTopLevel())) @@ -282,7 +282,11 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window ) { - return GTK_SPIN_BUTTON(m_widget)->panel == window; + if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE; + + if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE; + + return FALSE; } void wxSpinCtrl::ApplyWidgetStyle()