X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6beb85c0d32d2bca8520feb7e100a6f612720a53..94e2ed3b8db0220160c0b939782cd46914ec073a:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index ee461db1be..b1b4e12a8f 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -64,7 +64,6 @@ // ---------------------------------------------------------------------------- extern wxWindowList wxModelessWindows; -extern wxList WXDLLEXPORT wxPendingDelete; extern const wxChar *wxFrameClassName; #if wxUSE_MENUS_NATIVE @@ -158,7 +157,10 @@ bool wxFrameMSW::Create(wxWindow *parent, wxTopLevelWindows.Append(this); - MSWCreate(m_windowId, parent, wxFrameClassName, this, title, + // 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_TOOL_WINDOW style handled elsewhere) + MSWCreate(m_windowId, NULL, wxFrameClassName, this, title, x, y, width, height, style); wxModelessWindows.Append(this); @@ -481,7 +483,7 @@ void wxFrameMSW::PositionStatusBar() void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) { - m_frameMenuBar = menubar; + wxFrameBase::AttachMenuBar(menubar); if ( !menubar ) { @@ -496,15 +498,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();