void wxRadioBoxBase::SetMajorDim(unsigned int majorDim, long style)
{
- wxCHECK_RET( majorDim != 0, _T("major radiobox dimension can't be 0") );
+ wxCHECK_RET( majorDim != 0, wxT("major radiobox dimension can't be 0") );
m_majorDim = majorDim;
break;
default:
- wxFAIL_MSG( _T("unexpected wxDirection value") );
+ wxFAIL_MSG( wxT("unexpected wxDirection value") );
return wxNOT_FOUND;
}
}
wxASSERT_MSG( item < count && item >= 0,
- _T("logic error in wxRadioBox::GetNextItem()") );
+ wxT("logic error in wxRadioBox::GetNextItem()") );
}
// we shouldn't select the non-active items, continue looking for a
// visible and shown one unless we came back to the item we started from in
void wxRadioBoxBase::SetItemToolTip(unsigned int item, const wxString& text)
{
- wxASSERT_MSG( item < GetCount(), _T("Invalid item index") );
+ wxASSERT_MSG( item < GetCount(), wxT("Invalid item index") );
// extend the array to have entries for all our items on first use
if ( !m_itemsTooltips )
// set helptext for a particular item
void wxRadioBoxBase::SetItemHelpText(unsigned int n, const wxString& helpText)
{
- wxCHECK_RET( n < GetCount(), _T("Invalid item index") );
+ wxCHECK_RET( n < GetCount(), wxT("Invalid item index") );
if ( m_itemsHelpTexts.empty() )
{
// retrieve helptext for a particular item
wxString wxRadioBoxBase::GetItemHelpText( unsigned int n ) const
{
- wxCHECK_MSG( n < GetCount(), wxEmptyString, _T("Invalid item index") );
+ wxCHECK_MSG( n < GetCount(), wxEmptyString, wxT("Invalid item index") );
return m_itemsHelpTexts.empty() ? wxString() : m_itemsHelpTexts[n];
}
const wxPoint& pt,
wxHelpEvent::Origin origin) const
{
- const int item = origin == wxHelpEvent::Origin_HelpButton
- ? GetItemFromPoint(pt)
- : GetSelection();
+ int item;
+ switch ( origin )
+ {
+ case wxHelpEvent::Origin_HelpButton:
+ item = GetItemFromPoint(pt);
+ break;
+
+ case wxHelpEvent::Origin_Keyboard:
+ item = GetSelection();
+ break;
+
+ default:
+ wxFAIL_MSG( "unknown help even origin" );
+ // fall through
+
+ case wxHelpEvent::Origin_Unknown:
+ // this value is used when we're called from GetHelpText() for the
+ // radio box itself, so don't return item-specific text in this case
+ item = wxNOT_FOUND;
+ }
if ( item != wxNOT_FOUND )
{
- wxString text = GetItemHelpText(wx_static_cast(unsigned int, item));
+ wxString text = GetItemHelpText(static_cast<unsigned int>(item));
if( !text.empty() )
return text;
}