more framework fixes for menu displays

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2000-03-16 23:24:38 +00:00
parent cc534ff767
commit c3cea74805
2 changed files with 72 additions and 23 deletions

View File

@@ -552,6 +552,9 @@ void wxFrame::SetMenuBar(
wxMenuBar* pMenuBar
)
{
ERRORID vError;
wxString sError;
if (!pMenuBar)
{
DetachMenuBar();
@@ -578,6 +581,22 @@ void wxFrame::SetMenuBar(
return;
}
//
// Set the parent and owner of the menubar to be the frame
//
if (!::WinSetParent(m_hMenu, GetHwnd(), FALSE))
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError);
}
if (!::WinSetOwner(m_hMenu, GetHwnd()))
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError);
}
InternalSetMenuBar();
m_frameMenuBar = pMenuBar;