Add wxUSE_MENUBAR build option, off by default in wxiOS
Allow building without wxMenuBar (but with wxMenu), as this class doesn't exist and can't be reasonably implemented under iOS (but wxMenu can and should be, as it's widely used in iOS 14 UI).
This commit is contained in:
committed by
Vadim Zeitlin
parent
49f6370890
commit
68ee7ffa2a
@@ -148,7 +148,7 @@ wxCONSTRUCTOR_6( wxFrame, wxWindow*, Parent, wxWindowID, Id, wxString, Title, \
|
||||
|
||||
wxFrameBase::wxFrameBase()
|
||||
{
|
||||
#if wxUSE_MENUS
|
||||
#if wxUSE_MENUBAR
|
||||
m_frameMenuBar = NULL;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
@@ -183,7 +183,7 @@ wxFrame *wxFrameBase::New(wxWindow *parent,
|
||||
|
||||
void wxFrameBase::DeleteAllBars()
|
||||
{
|
||||
#if wxUSE_MENUS
|
||||
#if wxUSE_MENUBAR
|
||||
wxDELETE(m_frameMenuBar);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
@@ -198,7 +198,7 @@ void wxFrameBase::DeleteAllBars()
|
||||
|
||||
bool wxFrameBase::IsOneOfBars(const wxWindow *win) const
|
||||
{
|
||||
#if wxUSE_MENUS
|
||||
#if wxUSE_MENUBAR
|
||||
if ( win == GetMenuBar() )
|
||||
return true;
|
||||
#endif // wxUSE_MENUS
|
||||
@@ -258,11 +258,15 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const
|
||||
|
||||
bool wxFrameBase::ProcessCommand(int id)
|
||||
{
|
||||
#if wxUSE_MENUBAR
|
||||
wxMenuItem* const item = FindItemInMenuBar(id);
|
||||
if ( !item )
|
||||
return false;
|
||||
|
||||
return ProcessCommand(item);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxFrameBase::ProcessCommand(wxMenuItem *item)
|
||||
@@ -308,7 +312,7 @@ void wxFrameBase::UpdateWindowUI(long flags)
|
||||
GetToolBar()->UpdateWindowUI(flags);
|
||||
#endif
|
||||
|
||||
#if wxUSE_MENUS
|
||||
#if wxUSE_MENUBAR
|
||||
if (GetMenuBar())
|
||||
{
|
||||
// If coming from an idle event, we only want to update the menus if
|
||||
@@ -635,14 +639,18 @@ void wxFrameBase::DoMenuUpdates(wxMenu* menu)
|
||||
{
|
||||
menu->UpdateUI();
|
||||
}
|
||||
#if wxUSE_MENUBAR
|
||||
else
|
||||
{
|
||||
wxMenuBar* bar = GetMenuBar();
|
||||
if (bar != NULL)
|
||||
bar->UpdateMenus();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxUSE_MENUBAR
|
||||
|
||||
void wxFrameBase::DetachMenuBar()
|
||||
{
|
||||
if ( m_frameMenuBar )
|
||||
@@ -681,4 +689,6 @@ wxMenuItem *wxFrameBase::FindItemInMenuBar(int menuId) const
|
||||
return menuBar ? menuBar->FindItem(menuId) : NULL;
|
||||
}
|
||||
|
||||
#endif // wxUSE_MENUBAR
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
Reference in New Issue
Block a user