]> git.saurik.com Git - wxWidgets.git/commitdiff
added UnsetToolTip() which is also provided (as empty function) in wxUSE_TOOLTIPS...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 25 Aug 2008 23:19:04 +0000 (23:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 25 Aug 2008 23:19:04 +0000 (23:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/window.h
interface/wx/window.h

index 73411b216767cde9c3521f0c679e188f7a5c3336..59e9eabda4576038346ff77e0f0f312d8c6841d5 100644 (file)
@@ -1208,16 +1208,20 @@ public:
 #if wxUSE_TOOLTIPS
         // the easiest way to set a tooltip for a window is to use this method
     void SetToolTip( const wxString &tip );
-        // attach a tooltip to the window
+        // attach a tooltip to the window, pointer can be NULL to remove
+        // existing tooltip
     void SetToolTip( wxToolTip *tip ) { DoSetToolTip(tip); }
+        // more readable synonym for SetToolTip(NULL)
+    void UnsetToolTip() { SetToolTip(NULL); }
         // get the associated tooltip or NULL if none
     wxToolTip* GetToolTip() const { return m_tooltip; }
-    wxString GetToolTipText() const ;
-#else
+    wxString GetToolTipText() const;
+#else // !wxUSE_TOOLTIPS
         // make it much easier to compile apps in an environment
         // that doesn't support tooltips, such as PocketPC
-    inline void SetToolTip( const wxString & WXUNUSED(tip) ) {}
-#endif // wxUSE_TOOLTIPS
+    void SetToolTip(const wxString & WXUNUSED(tip)) { }
+    void UnsetToolTip() { }
+#endif // wxUSE_TOOLTIPS/!wxUSE_TOOLTIPS
 
     // drag and drop
     // -------------
index b1fe0fa9e7f8221c70db0dd66535a13fb136cceb..b7b8b22875929d482cdd7e87560a0a26cf387031 100644 (file)
@@ -2399,8 +2399,16 @@ public:
     //@{
     /**
         Attach a tooltip to the window.
-        See also: GetToolTip(),
-         wxToolTip
+
+        wxToolTip pointer can be @NULL in the overload taking the pointer,
+        meaning to unset any existing tooltips, however UnsetToolTip() provides
+        a more readable alternative to this operation.
+
+        Notice that these methods are always available, even if wxWidgets was
+        compiled with @c wxUSE_TOOLTIPS set to 0, but don't do anything in this
+        case.
+
+        @see GetToolTip(), wxToolTip
     */
     void SetToolTip(const wxString& tip);
     void SetToolTip(wxToolTip* tip);
@@ -2584,6 +2592,15 @@ public:
     */
     static void UnreserveControlId(wxWindowID id, int count = 1);
 
+    /**
+        Unset any existing tooltip.
+
+        @since 2.9.0
+
+        @see SetToolTip()
+     */
+    void UnsetToolTip();
+
     /**
         Calling this method immediately repaints the invalidated area of the window and
         all of its children recursively while this would usually only happen when the