Don't use invoking window in wxGTK wxMenuBar implementation.

wxGTK wxMenuBar used its own SetInvokingWindow/UnsetInvokingWindow() and
related functions instead of reusing the base class Attach/Detach() which
exist for exactly the same purpose. This resulted in unnecessary code
duplication and confusion and, since the changes of r64104, resulted in
asserts due to use of SetInvokingWindow() for non-popup menus.

Fix this by removing the wxGTK-specific functions and doing the work they used
to do in (now overridden) Attach() and Detach(). Also call Attach/Detach()
instead of these functions from wxGTK wxFrame and wxMDIParentFrame code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-04-24 15:08:00 +00:00
parent 7739f9c947
commit 6abf7b639c
4 changed files with 51 additions and 64 deletions

View File

@@ -43,19 +43,16 @@ public:
// window
virtual bool GTKNeedsParent() const { return false; }
void Attach(wxFrame *frame);
virtual void Attach(wxFrame *frame);
virtual void Detach();
// implementation only from now on
void SetInvokingWindow( wxWindow *win );
void UnsetInvokingWindow( wxWindow *win );
GtkWidget *m_menubar; // Public for hildon support
private:
// common part of Append and Insert
bool GtkAppend(wxMenu *menu, const wxString& title, int pos=-1);
wxWindow *m_invokingWindow;
void Init(size_t n, wxMenu *menus[], const wxString titles[], long style);
DECLARE_DYNAMIC_CLASS(wxMenuBar)