X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/660e7fda2ce2bf5f9703416d12890ec16d2cdae1..c1bc8d9f92a3fde4e9d33213a1df46992478f369:/src/msw/menuitem.cpp?ds=sidebyside diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 964e64892f..d1ecba4332 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -137,6 +137,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, Init(); } +#if WXWIN_COMPATIBILITY_2_8 wxMenuItem::wxMenuItem(wxMenu *parentMenu, int id, const wxString& text, @@ -151,6 +152,7 @@ wxMenuItem::wxMenuItem(wxMenu *parentMenu, { Init(); } +#endif void wxMenuItem::Init() { @@ -170,7 +172,7 @@ 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 @@ -186,13 +188,13 @@ wxMenuItem::~wxMenuItem() // ---- // 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()); } @@ -203,7 +205,7 @@ bool wxMenuItem::IsChecked() const { // 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);