X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6522713c7527e5f683a107dff8f40e3ea19a4745..c10f20703e5b4e9c605b908f480b863c89ca31ee:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 4304b09fee..40ef132187 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)); @@ -165,6 +156,14 @@ bool wxFrameMSW::Create(wxWindow *parent, m_iconized = FALSE; + // the frame must have NULL parent HWND or it would be always on top of its + // parent which is not what we usually want (in fact, we only want it for + // frames with the special wxFRAME_FLOAT_ON_PARENT style) + if ( !(m_windowStyle & wxFRAME_FLOAT_ON_PARENT) ) + { + parent = NULL; + } + wxTopLevelWindows.Append(this); MSWCreate(m_windowId, parent, wxFrameClassName, this, title, @@ -490,6 +489,8 @@ void wxFrameMSW::PositionStatusBar() void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) { + wxFrameBase::AttachMenuBar(menubar); + if ( !menubar ) { // actually remove the menu from the frame @@ -503,15 +504,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();