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:
@@ -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
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user