From 74124ea96161da28a76df576e410c3437ac58272 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Feb 2005 01:23:03 +0000 Subject: [PATCH] show tooltips for the text control part of the spin control as well (bug 735044) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/spinctrl.h | 3 +++ src/msw/spinctrl.cpp | 28 ++++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/include/wx/msw/spinctrl.h b/include/wx/msw/spinctrl.h index 350c6ea861..bd13d0e305 100644 --- a/include/wx/msw/spinctrl.h +++ b/include/wx/msw/spinctrl.h @@ -96,6 +96,9 @@ protected: virtual void DoMoveWindow(int x, int y, int width, int height); virtual wxSize DoGetBestSize() const; virtual void DoGetSize(int *width, int *height) const; +#if wxUSE_TOOLTIPS + virtual void DoSetToolTip( wxToolTip *tip ); +#endif // wxUSE_TOOLTIPS // the handler for wxSpinButton events void OnSpinChange(wxSpinEvent& event); diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 283d9fe0e3..02319d7e7b 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 22.07.99 // RCS-ID: $Id$ -// Copyright: (c) Vadim Zeitlin +// Copyright: (c) 1999-2005 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -35,14 +35,13 @@ #if wxUSE_SPINCTRL -#if defined(__WIN95__) - #include "wx/spinctrl.h" #include "wx/msw/private.h" +#include "wx/msw/wrapcctl.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#endif +#if wxUSE_TOOLTIPS + #include "wx/tooltip.h" +#endif // wxUSE_TOOLTIPS #include // for INT_MIN @@ -502,6 +501,18 @@ void wxSpinCtrl::SetFocus() ::SetFocus(GetBuddyHwnd()); } +#if wxUSE_TOOLTIPS + +void wxSpinCtrl::DoSetToolTip(wxToolTip *tip) +{ + wxSpinButton::DoSetToolTip(tip); + + if ( tip ) + tip->Add(m_hwndBuddy); +} + +#endif // wxUSE_TOOLTIPS + // ---------------------------------------------------------------------------- // event processing // ---------------------------------------------------------------------------- @@ -593,8 +604,5 @@ void wxSpinCtrl::DoGetPosition(int *x, int *y) const wxConstCast(this, wxSpinCtrl)->m_hWnd = hWnd; } -#endif // __WIN95__ - -#endif - // wxUSE_SPINCTRL +#endif // wxUSE_SPINCTRL -- 2.45.2