X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..d14e03f5b719ce6dbe4a0e81b22ae8436bd230ae:/src/univ/menu.cpp diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index ae7eab4f2a..e8916af3a8 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: univ/menu.cpp +// Name: src/univ/menu.cpp // Purpose: wxMenuItem, wxMenu and wxMenuBar implementation // Author: Vadim Zeitlin // Modified by: @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_MENUS + #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/control.h" // for FindAccelIndex() @@ -32,8 +34,6 @@ #include "wx/log.h" #endif // WX_PRECOMP -#if wxUSE_MENUS - #include "wx/popupwin.h" #include "wx/evtloop.h" #include "wx/dcclient.h" @@ -127,9 +127,6 @@ public: // override the base class version to dismiss any open submenus virtual void Dismiss(); - // notify the menu when the window disappears from screen - virtual void OnDismiss(); - // called when a submenu is dismissed void OnSubmenuDismiss(bool dismissParent); @@ -164,6 +161,8 @@ public: // don't dismiss the popup window if the parent menu was clicked virtual bool ProcessLeftDown(wxMouseEvent& event); + virtual bool SetCurrent(bool doit = true) { return wxPopupTransientWindow::SetCurrent(doit); }; + protected: // how did we perform this operation? enum InputMethod @@ -172,6 +171,9 @@ protected: WithMouse }; + // notify the menu when the window disappears from screen + virtual void OnDismiss(); + // draw the menu inside this window virtual void DoDraw(wxControlRenderer *renderer); @@ -186,7 +188,6 @@ protected: // set the current node and item withotu refreshing anything void SetCurrent(wxMenuItemList::compatibility_iterator node); - virtual bool SetCurrent(bool doit = true){return wxPopupTransientWindow::SetCurrent(doit);}; // change the current item refreshing the old and new items void ChangeCurrent(wxMenuItemList::compatibility_iterator node); @@ -2491,7 +2492,7 @@ void wxMenuBar::OnDismiss() bool wxMenuBar::ReleaseMouseCapture() { -#if __WXX11__ +#ifdef __WXX11__ // With wxX11, when a menu is closed by clicking away from it, a control // under the click will still get an event, even though the menu has the // capture (bug?). So that control may already have taken the capture by @@ -2607,4 +2608,3 @@ void wxWindow::DismissPopupMenu() } #endif // wxUSE_MENUS -