X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af8964c4c3770b2d54ee54a9f8275113e944a3d9..491b5be8305968871bc289453ed088a70c3de044:/src/msw/frame.cpp?ds=inline diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index e99831a461..ee461db1be 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)); @@ -486,24 +477,12 @@ void wxFrameMSW::PositionStatusBar() } #endif // wxUSE_STATUSBAR -void wxFrameMSW::DetachMenuBar() -{ -#if wxUSE_MENUS - if ( m_frameMenuBar ) - { - m_frameMenuBar->Detach(); - m_frameMenuBar = NULL; - } -#endif // wxUSE_MENUS -} +#if wxUSE_MENUS_NATIVE -void wxFrameMSW::SetMenuBar(wxMenuBar *menubar) +void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) { -#if wxUSE_MENUS - // detach the old menu bar in any case - DetachMenuBar(); + m_frameMenuBar = menubar; -#if wxUSE_MENUS_NATIVE if ( !menubar ) { // actually remove the menu from the frame @@ -519,7 +498,7 @@ void wxFrameMSW::SetMenuBar(wxMenuBar *menubar) } else { - if (menubar->IsAttached()) + if ( menubar->IsAttached() ) menubar->Detach(); m_hMenu = menubar->Create(); @@ -530,18 +509,8 @@ void wxFrameMSW::SetMenuBar(wxMenuBar *menubar) InternalSetMenuBar(); } -#endif // wxUSE_MENUS_NATIVE - - if ( menubar ) - { - m_frameMenuBar = menubar; - menubar->Attach((wxFrame *)this); - } -#endif // wxUSE_MENUS } -#if wxUSE_MENUS_NATIVE - void wxFrameMSW::InternalSetMenuBar() { #ifndef __WXMICROWIN__ @@ -926,7 +895,7 @@ void wxFrameMSW::IconizeChildFrames(bool bIconize) // the child MDI frames are a special case and should not be touched by // the parent frame - instead, they are managed by the user - wxFrameMSW *frame = wxDynamicCast(win, wxFrameMSW); + wxFrameMSW *frame = wxDynamicCast(win, wxFrame); if ( frame #if wxUSE_MDI_ARCHITECTURE && !wxDynamicCast(frame, wxMDIChildFrame)