//
// Tell the owner drawing code to to show the accel string as well
//
- SetAccelString(m_text.AfterFirst(_T('\t')));
+ SetAccelString(m_text.AfterFirst(wxT('\t')));
#endif // wxUSE_OWNER_DRAWN
} // end of wxMenuItem::Init
return (uFlag & MIA_CHECKED) == MIA_CHECKED ;
} // end of wxMenuItem::IsChecked
-wxString wxMenuItemBase::GetLabelFromText(
+wxString wxMenuItemBase::GetLabelText(
const wxString& rsText
)
{
sLabel += *zPc;
}
return sLabel;
-} // end of wxMenuItemBase::GetLabelFromText
+} // end of wxMenuItemBase::GetLabelText
//
// Radio group stuff
)
{
wxASSERT_MSG( !m_bIsRadioGroupStart
- ,_T("should only be called for the next radio items")
+ ,wxT("should only be called for the next radio items")
);
m_vRadioGroup.m_nStart = nStart;
)
{
wxASSERT_MSG( m_bIsRadioGroupStart
- ,_T("should only be called for the first radio item")
+ ,wxT("should only be called for the first radio item")
);
m_vRadioGroup.m_nEnd = nEnd;
} // end of wxMenuItem::SetRadioGroupEnd
int nPos = rItems.IndexOf(this);
wxCHECK_RET( nPos != wxNOT_FOUND
- ,_T("menuitem not found in the menu items list?")
+ ,wxT("menuitem not found in the menu items list?")
);
//
wxMenuItemBase::Check(bCheck);
} // end of wxMenuItem::Check
-void wxMenuItem::SetText( const wxString& rText )
+void wxMenuItem::SetItemLabel( const wxString& rText )
{
//
// Don't do anything if label didn't change
if (m_text == sText)
return;
- if (sText.IsEmpty())
- {
- wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
- sText = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC);
- }
+ // wxMenuItemBase will do stock ID checks
+ wxMenuItemBase::SetItemLabel(sText);
+
+ // m_text could now be different from 'text' if we are a stock menu item,
+ // so use only m_text below
- wxMenuItemBase::SetText(sText);
- OWNER_DRAWN_ONLY(wxOwnerDrawn::SetName(sText));
+ OWNER_DRAWN_ONLY(wxOwnerDrawn::SetName(m_text));
#if wxUSE_OWNER_DRAWN
if (rText.IsEmpty())
- SetAccelString(sText.AfterFirst(_T('\t')));
+ SetAccelString(m_text.AfterFirst(wxT('\t')));
else
- SetAccelString(rText.AfterFirst(_T('\t')));
+ SetAccelString(rText.AfterFirst(wxT('\t')));
#endif // wxUSE_OWNER_DRAWN
HWND hMenu = GetHmenuOf(m_parentMenu);
uFlagsOld |= MIS_SUBMENU;
}
- BYTE* pData;
+ char* pData;
#if wxUSE_OWNER_DRAWN
if (IsOwnerDrawn())
{
uFlagsOld |= MIS_OWNERDRAW;
- pData = (BYTE*)this;
+ pData = (char*)this;
}
else
#endif //owner drawn
{
uFlagsOld |= MIS_TEXT;
- pData = (BYTE*)sText.c_str();
+ pData = (char*) m_text.wx_str();
}
//