added Get/SetItemToolTip() (and implemented them for MSW) to allow setting tooltips for the individual radiobox items

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-05-04 16:08:56 +00:00
parent c009bf3e9f
commit c670c85582
7 changed files with 187 additions and 5 deletions

View File

@@ -37,9 +37,6 @@
#include "wx/msw/subwin.h"
#if wxUSE_TOOLTIPS
#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
#include <commctrl.h>
#endif
#include "wx/tooltip.h"
#endif // wxUSE_TOOLTIPS
@@ -421,6 +418,25 @@ bool wxRadioBox::IsItemShown(unsigned int item) const
GWL_STYLE) & WS_VISIBLE) != 0;
}
#if wxUSE_TOOLTIPS
bool wxRadioBox::HasToolTips() const
{
return wxStaticBox::HasToolTips() || wxRadioBoxBase::HasItemToolTips();
}
void wxRadioBox::DoSetItemToolTip(unsigned int item, wxToolTip *tooltip)
{
// we have already checked for the item to be valid in wxRadioBoxBase
const HWND hwndRbtn = (*m_radioButtons)[item];
if ( tooltip != NULL )
tooltip->Add(hwndRbtn);
else // unset the tooltip
wxToolTip::Remove(hwndRbtn);
}
#endif // wxUSE_TOOLTIPS
WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxRadioBox, wxStaticBox, m_radioButtons)
// ----------------------------------------------------------------------------