X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7802da36fa043e7fdc162a70e97821754a2f2f14..3cfde7c049bddf6fd3b4c2e35a6b8ecdcdc1d74f:/src/msw/menu.cpp?ds=sidebyside diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 4c929adce5..32676538ba 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -39,6 +39,8 @@ #include "wx/ownerdrw.h" #endif +#include "wx/ptr_scpd.h" + #include "wx/msw/private.h" #include "wx/msw/wrapcctl.h" // include "properly" @@ -469,7 +471,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) } mii.cch = itemText.length(); - mii.dwTypeData = wx_const_cast(wxChar *, itemText.wx_str()); + mii.dwTypeData = const_cast(itemText.wx_str()); if (flags & MF_POPUP) { @@ -489,7 +491,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // item and this looks downright ugly // // so instead draw it ourselves in MSWOnDrawItem() - mii.dwItemData = wx_reinterpret_cast(ULONG_PTR, pItem); + mii.dwItemData = reinterpret_cast(pItem); if ( pItem->IsCheckable() ) { mii.hbmpChecked = @@ -714,6 +716,15 @@ size_t wxMenu::CopyAccels(wxAcceleratorEntry *accels) const return count; } +wxAcceleratorTable *wxMenu::CreateAccelTable() const +{ + const size_t count = m_accels.size(); + wxScopedArray accels(new wxAcceleratorEntry[count]); + CopyAccels(accels.get()); + + return new wxAcceleratorTable(count, accels.get()); +} + #endif // wxUSE_ACCEL // --------------------------------------------------------------------------- @@ -760,7 +771,7 @@ void wxMenu::SetTitle(const wxString& label) info.fMask = MIIM_TYPE; info.fType = MFT_STRING; info.cch = m_title.length(); - info.dwTypeData = wx_const_cast(wxChar *, m_title.wx_str()); + info.dwTypeData = const_cast(m_title.wx_str()); if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) ) { wxLogLastError(wxT("SetMenuItemInfo")); @@ -930,7 +941,7 @@ WXHMENU wxMenuBar::Create() if ( m_hMenu != 0 ) return m_hMenu; - wxToolMenuBar * const bar = wx_static_cast(wxToolMenuBar *, GetToolBar()); + wxToolMenuBar * const bar = static_cast(GetToolBar()); if ( !bar ) return NULL; @@ -1080,7 +1091,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) info.fMask = MIIM_TYPE; info.fType = MFT_STRING; info.cch = label.length(); - info.dwTypeData = wx_const_cast(wxChar *, label.wx_str()); + info.dwTypeData = const_cast(label.wx_str()); if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, &info) ) { wxLogLastError(wxT("SetMenuItemInfo"));