X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6522713c7527e5f683a107dff8f40e3ea19a4745..ef70f0ecdbc4268923e132b257c95e8a2525f4ca:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 4304b09fee..6df2977bb5 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -139,15 +139,6 @@ bool wxFrameMSW::Create(wxWindow *parent, { SetName(name); m_windowStyle = style; -#if wxUSE_MENUS - m_frameMenuBar = NULL; -#endif // wxUSE_MENUS -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif // wxUSE_TOOLBAR -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif // wxUSE_STATUSBAR SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); @@ -490,6 +481,8 @@ void wxFrameMSW::PositionStatusBar() void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) { + wxFrameBase::AttachMenuBar(menubar); + if ( !menubar ) { // actually remove the menu from the frame @@ -503,15 +496,15 @@ void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) { m_hMenu = menubar->GetHMenu(); } - else + else // no HMENU yet { - if ( menubar->IsAttached() ) - menubar->Detach(); - m_hMenu = menubar->Create(); if ( !m_hMenu ) + { + wxFAIL_MSG( _T("failed to create menu bar") ); return; + } } InternalSetMenuBar();