+ // we want to show the tip below the mouse, not over it
+ //
+ // NB: the reason we use "/ 2" here is that we don't know where the current
+ // cursors hot spot is... it would be nice if we could find this out
+ // though
+ y += wxSystemSettings::GetMetric(wxSYS_CURSOR_Y) / 2;
+
+#if wxUSE_POPUPWIN
+ Position(wxPoint(x, y), wxSize(0,0));
+ Popup(m_view);
+ #ifdef __WXGTK__
+ m_view->CaptureMouse();
+ #endif
+#else
+ Move(x, y);
+ Show(true);
+#endif
+}
+
+wxTipWindow::~wxTipWindow()
+{
+ if ( m_windowPtr )
+ {
+ *m_windowPtr = NULL;
+ }
+ #if wxUSE_POPUPWIN
+ #ifdef __WXGTK__
+ if ( m_view->HasCapture() )
+ m_view->ReleaseMouse();
+ #endif
+ #endif
+}
+
+void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event))
+{
+ Close();
+}
+
+#if wxUSE_POPUPWIN
+
+void wxTipWindow::OnDismiss()
+{
+ Close();
+}
+
+#else // !wxUSE_POPUPWIN
+
+void wxTipWindow::OnActivate(wxActivateEvent& event)
+{
+ if (!event.GetActive())
+ Close();
+}
+
+void wxTipWindow::OnKillFocus(wxFocusEvent& WXUNUSED(event))
+{
+ // Under Windows at least, we will get this immediately
+ // because when the view window is focussed, the
+ // tip window goes out of focus.
+#ifdef __WXGTK__
+ Close();
+#endif
+}
+
+#endif // wxUSE_POPUPWIN // !wxUSE_POPUPWIN
+
+void wxTipWindow::SetBoundingRect(const wxRect& rectBound)
+{
+ m_rectBound = rectBound;
+}
+
+void wxTipWindow::Close()
+{
+ if ( m_windowPtr )
+ {
+ *m_windowPtr = NULL;
+ m_windowPtr = NULL;
+ }
+
+#if wxUSE_POPUPWIN
+ Show(false);
+ #ifdef __WXGTK__
+ if ( m_view->HasCapture() )
+ m_view->ReleaseMouse();
+ #endif
+ // Under OS X we get destroyed because of wxEVT_KILL_FOCUS generated by
+ // Show(false).
+ #ifndef __WXOSX__
+ Destroy();
+ #endif
+#else
+ wxFrame::Close();
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// wxTipWindowView
+// ----------------------------------------------------------------------------