don't duplicate base class m_acceleratorTable as m_accelTable in wxMenuBar, this is not only unnecessary but also doesn't allow using GetAcceleratorTable() to retrieve the menu bar accelerators (#9654)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -183,9 +183,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_ACCEL
|
#if wxUSE_ACCEL
|
||||||
// get the accel table for all the menus
|
|
||||||
const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
|
|
||||||
|
|
||||||
// update the accel table (must be called after adding/deleting a menu)
|
// update the accel table (must be called after adding/deleting a menu)
|
||||||
void RebuildAccelTable();
|
void RebuildAccelTable();
|
||||||
#endif // wxUSE_ACCEL
|
#endif // wxUSE_ACCEL
|
||||||
@@ -213,10 +210,6 @@ protected:
|
|||||||
// Return the MSW position for a wxMenu which is sometimes different from
|
// Return the MSW position for a wxMenu which is sometimes different from
|
||||||
// the wxWidgets position.
|
// the wxWidgets position.
|
||||||
int MSWPositionForWxMenu(wxMenu *menu, int wxpos);
|
int MSWPositionForWxMenu(wxMenu *menu, int wxpos);
|
||||||
#if wxUSE_ACCEL
|
|
||||||
// the accelerator table for all accelerators in all our menus
|
|
||||||
wxAcceleratorTable m_accelTable;
|
|
||||||
#endif // wxUSE_ACCEL
|
|
||||||
|
|
||||||
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
|
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
|
||||||
wxToolBar* m_toolBar;
|
wxToolBar* m_toolBar;
|
||||||
|
@@ -828,13 +828,10 @@ bool wxFrame::MSWDoTranslateMessage(wxFrame *frame, WXMSG *pMsg)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if wxUSE_MENUS && wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
|
#if wxUSE_MENUS && wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
|
||||||
// try the menu bar accels
|
// try the menu bar accelerators
|
||||||
wxMenuBar *menuBar = GetMenuBar();
|
wxMenuBar *menuBar = GetMenuBar();
|
||||||
if ( menuBar )
|
if ( menuBar && menuBar->GetAcceleratorTable()->Translate(frame, pMsg) )
|
||||||
{
|
return true;
|
||||||
const wxAcceleratorTable& acceleratorTable = menuBar->GetAccelTable();
|
|
||||||
return acceleratorTable.Translate(frame, pMsg);
|
|
||||||
}
|
|
||||||
#endif // wxUSE_MENUS && wxUSE_ACCEL
|
#endif // wxUSE_MENUS && wxUSE_ACCEL
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -1347,7 +1347,7 @@ void wxMenuBar::RebuildAccelTable()
|
|||||||
nAccelCount += (*it)->CopyAccels(&accelEntries[nAccelCount]);
|
nAccelCount += (*it)->CopyAccels(&accelEntries[nAccelCount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_accelTable = wxAcceleratorTable(nAccelCount, accelEntries);
|
SetAcceleratorTable(wxAcceleratorTable(nAccelCount, accelEntries));
|
||||||
|
|
||||||
delete [] accelEntries;
|
delete [] accelEntries;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user