From cb1a1dc963683ea42f9573b23024473f7543c9d9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 6 Feb 1999 23:28:53 +0000 Subject: [PATCH] fixes for compilation without wxUSE_TOOLTIPS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/window.h | 4 ++++ src/msw/tooltip.cpp | 4 ++++ src/msw/window.cpp | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 9124feda18..7d72620bd1 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -262,6 +262,7 @@ public: wxDropTarget *GetDropTarget() const { return m_pDropTarget; } #endif +#if wxUSE_TOOLTIPS // tooltips // create a tooltip with this text void SetToolTip(const wxString &tip); @@ -269,6 +270,7 @@ public: void SetToolTip(wxToolTip *tooltip); // get the current tooltip (may return NULL if none) wxToolTip* GetToolTip() const { return m_tooltip; } +#endif // wxUSE_TOOLTIPS // Accept files for dragging virtual void DragAcceptFiles(bool accept); @@ -761,7 +763,9 @@ private: void Init(); // the associated tooltip (may be NULL if none) +#if wxUSE_TOOLTIPS wxToolTip *m_tooltip; +#endif DECLARE_EVENT_TABLE() }; diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 7fe9056949..281f8e45cb 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -27,6 +27,8 @@ #include "wx/wx.h" #endif +#if wxUSE_TOOLTIPS + #include "wx/tooltip.h" #include "wx/msw/private.h" @@ -196,3 +198,5 @@ void wxToolTip::SetTip(const wxString& tip) (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, 0, &ti); } } + +#endif // wxUSE_TOOLTIPS diff --git a/src/msw/window.cpp b/src/msw/window.cpp index ff224f8492..bf30596b93 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -189,6 +189,7 @@ bool wxWindow::MSWNotify(WXWPARAM WXUNUSED(wParam), WXLPARAM* WXUNUSED(result)) { #ifdef __WIN95__ +#if wxUSE_TOOLTIPS NMHDR* hdr = (NMHDR *)lParam; if ( hdr->code == TTN_NEEDTEXT && m_tooltip ) { @@ -198,6 +199,7 @@ bool wxWindow::MSWNotify(WXWPARAM WXUNUSED(wParam), // processed return TRUE; } +#endif #endif return FALSE; @@ -287,7 +289,9 @@ void wxWindow::Init() m_pDropTarget = NULL; #endif +#if wxUSE_TOOLTIPS m_tooltip = NULL; +#endif } wxWindow::wxWindow() @@ -302,7 +306,9 @@ wxWindow::~wxWindow() // first of all, delete the things on which nothing else depends +#if wxUSE_TOOLTIPS wxDELETE(m_tooltip); +#endif // JACS - if behaviour is odd, restore this // to the start of ~wxWindow. Vadim has changed @@ -542,6 +548,8 @@ void wxWindow::DragAcceptFiles(bool accept) // tooltips // ---------------------------------------------------------------------------- +#if wxUSE_TOOLTIPS + void wxWindow::SetToolTip(const wxString &tip) { SetToolTip(new wxToolTip(tip)); @@ -556,6 +564,8 @@ void wxWindow::SetToolTip(wxToolTip *tooltip) m_tooltip->SetWindow(this); } +#endif // wxUSE_TOOLTIPS + // Get total size void wxWindow::GetSize(int *x, int *y) const { -- 2.45.2