Handle updating tooltip text in wxCompositeWindow correctly.

While calling SetToolTip(wxToolTip*) overload already worked correctly for
wxCompositeWindow, using SetToolTip(wxString) did not if a tooltip already
existed, as it didn't use the virtual DoSetToolTip() in this case, resulting
in e.g. impossibility to update wxSpinCtrlDouble tooltip using this method.

Fix this by introducing DoSetToolTipText() virtual which is used by that
overload now and overriding it in wxCompositeWindow.

Also don't override DoSetToolTip() in wxSpinCtrlGenericBase any more, it is
not necessary as it's already done by its base class wxCompositeWindow.

Closes #16595.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-05 22:19:10 +00:00
parent 68232dec2b
commit a2b0b8dbaa
6 changed files with 14 additions and 31 deletions

View File

@@ -1312,7 +1312,7 @@ public:
#if wxUSE_TOOLTIPS
// the easiest way to set a tooltip for a window is to use this method
void SetToolTip( const wxString &tip );
void SetToolTip( const wxString &tip ) { DoSetToolTipText(tip); }
// attach a tooltip to the window, pointer can be NULL to remove
// existing tooltip
void SetToolTip( wxToolTip *tip ) { DoSetToolTip(tip); }
@@ -1787,6 +1787,7 @@ protected:
virtual void DoCentre(int dir);
#if wxUSE_TOOLTIPS
virtual void DoSetToolTipText( const wxString &tip );
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS