X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/51c9a5db64e3df86e17d5ba4779782db677fdf15..67193066b2d16ca36529216f70d093690d7e1123:/src/motif/menu.cpp diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index a394709cbb..0831f46864 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: menu.cpp +// Name: src/motif/menu.cpp // Purpose: wxMenu, wxMenuBar, wxMenuItem // Author: Julian Smart // Modified by: @@ -20,15 +20,16 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #include "wx/menu.h" -#include "wx/menuitem.h" -#include "wx/log.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/frame.h" -#include "wx/settings.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/app.h" + #include "wx/utils.h" + #include "wx/frame.h" + #include "wx/settings.h" + #include "wx/menuitem.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint @@ -140,7 +141,7 @@ wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) item->GetSubMenu()->m_topLevelMenu = m_topLevelMenu; } - return pos == GetMenuItemCount() ? wxMenuBase::DoAppend(item) : + return pos == GetMenuItemCount() ? wxMenuBase::DoAppend(item) : wxMenuBase::DoInsert(pos, item); } @@ -338,12 +339,14 @@ wxMenuItem *wxMenuBar::FindItem(int id, wxMenu ** itemMenu) const if (itemMenu) *itemMenu = NULL; - wxMenuItem *item = NULL; size_t menuCount = GetMenuCount(); for (size_t i = 0; i < menuCount; i++) - if ((item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu))) - return item; - return NULL; + { + wxMenuItem *item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu); + if (item) return item; + } + + return NULL; } // Create menubar @@ -465,7 +468,12 @@ void wxMenu::DestroyWidgetAndDetach() * */ -WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topMenu, size_t index, const wxString& title, bool pullDown) +WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, + WXWidget parent, + wxMenu * topMenu, + size_t WXUNUSED(index), + const wxString& title, + bool pullDown) { Widget menu = (Widget) 0; Widget buttonWidget = (Widget) 0; @@ -671,6 +679,8 @@ void wxMenu::ChangeFont(bool keepOriginalSize) if (item->GetSubMenu()) item->GetSubMenu()->ChangeFont(keepOriginalSize); } +#else + wxUnusedVar(keepOriginalSize); #endif } @@ -722,4 +732,3 @@ bool wxMenuBar::SetFont(const wxFont& font) return true; } -