From f377d4646757abb31d3024bf533f46576d77bc6e Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Tue, 9 Feb 2016 00:28:40 -0500 Subject: [PATCH] Better tooltip handling for Windows --- src/visual/InteractiveCanvas.cpp | 10 ++++++++-- src/visual/InteractiveCanvas.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/visual/InteractiveCanvas.cpp b/src/visual/InteractiveCanvas.cpp index 9ac9493..d4fe77c 100644 --- a/src/visual/InteractiveCanvas.cpp +++ b/src/visual/InteractiveCanvas.cpp @@ -157,8 +157,14 @@ void InteractiveCanvas::OnMouseEnterWindow(wxMouseEvent& event) { void InteractiveCanvas::setStatusText(std::string statusText) { wxGetApp().getAppFrame()->GetStatusBar()->SetStatusText(statusText); - if (wxGetApp().getConfig()->getShowTips()) { - this->SetToolTip(statusText); + if (wxGetApp().getConfig()->getShowTips()) { + if (statusText != lastToolTip) { + wxToolTip::Enable(false); + this->SetToolTip(statusText); + lastToolTip = statusText; + wxToolTip::SetDelay(1000); + wxToolTip::Enable(true); + } } else { this->SetToolTip(""); } diff --git a/src/visual/InteractiveCanvas.h b/src/visual/InteractiveCanvas.h index f310918..3fdb2be 100644 --- a/src/visual/InteractiveCanvas.h +++ b/src/visual/InteractiveCanvas.h @@ -58,5 +58,6 @@ protected: unsigned int lastBandwidth; bool isView; + std::string lastToolTip; };