added CreateAccelTable() helper which creates the accel table for just this menu

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-27 16:45:24 +00:00
parent 058f225a44
commit 67fdb6f9af
2 changed files with 18 additions and 2 deletions

View File

@@ -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 <commctrl.h> "properly"
@@ -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<wxAcceleratorEntry> accels(new wxAcceleratorEntry[count]);
CopyAccels(accels.get());
return new wxAcceleratorTable(count, accels.get());
}
#endif // wxUSE_ACCEL
// ---------------------------------------------------------------------------