Init();
}
+#if WXWIN_COMPATIBILITY_2_8
wxMenuItem::wxMenuItem(wxMenu *parentMenu,
int id,
const wxString& text,
{
Init();
}
+#endif
void wxMenuItem::Init()
{
ResetOwnerDrawn();
// switch ownerdraw back on if using a non default margin
- if ( GetId() != wxID_SEPARATOR )
+ if ( !IsSeparator() )
SetMarginWidth(GetMarginWidth());
// tell the owner drawing code to show the accel string as well
// ----
// return the id for calling Win32 API functions
-unsigned wxMenuItem::GetMSWId() const
+WXWPARAM wxMenuItem::GetMSWId() const
{
// we must use ids in unsigned short range with Windows functions, if we
// pass ids > USHRT_MAX to them they get very confused (e.g. start
// generating WM_COMMAND messages with negative high word of wParam), so
// use the cast to ensure the id is in range
- return m_subMenu ? wx_reinterpret_cast(unsigned, m_subMenu->GetHMenu())
+ return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu())
: wx_static_cast(unsigned short, GetId());
}
{
// fix that RTTI is always getting the correct state (separators cannot be checked, but the call below
// returns true
- if ( GetId() == wxID_SEPARATOR )
+ if ( IsSeparator() )
return false ;
int flag = ::GetMenuState(GetHMenuOf(m_parentMenu), GetMSWId(), MF_BYCOMMAND);
return (flag & MF_CHECKED) != 0;
}
-/* static */
-wxString wxMenuItemBase::GetLabelText(const wxString& text)
-{
- return wxStripMenuCodes(text);
-}
-
// radio group stuff
// -----------------