+void wxFrame::AttachMenuBar(
+ wxMenuBar* pMenubar
+)
+{
+ wxFrameBase::AttachMenuBar(pMenubar);
+
+ m_frameMenuBar = pMenubar;
+
+ if (!pMenubar)
+ {
+ //
+ // Actually remove the menu from the frame
+ //
+ m_hMenu = (WXHMENU)0;
+ InternalSetMenuBar();
+ }
+ else // Set new non NULL menu bar
+ {
+ //
+ // Can set a menubar several times.
+ //
+ if (pMenubar->GetHMenu())
+ {
+ m_hMenu = pMenubar->GetHMenu();
+ }
+ else
+ {
+ if (pMenubar->IsAttached())
+ pMenubar->Detach();
+
+ m_hMenu = pMenubar->Create();
+
+ if (!m_hMenu)
+ return;
+ }
+ InternalSetMenuBar();
+ }
+} // end of wxFrame::AttachMenuBar
+
+void wxFrame::InternalSetMenuBar()
+{
+ ERRORID vError;
+ wxString sError;
+ //
+ // Set the parent and owner of the menubar to be the frame
+ //
+ if (!::WinSetParent(m_hMenu, m_hFrame, FALSE))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting parent for submenu. Error: %s\n", sError);
+ }
+
+ if (!::WinSetOwner(m_hMenu, m_hFrame))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting parent for submenu. Error: %s\n", sError);
+ }
+ ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+} // end of wxFrame::InternalSetMenuBar
+#endif // wxUSE_MENUS_NATIVE
+
+//
+// Responds to colour changes, and passes event on to children
+//
+void wxFrame::OnSysColourChanged(
+ wxSysColourChangedEvent& rEvent
+)
+{
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
+ Refresh();
+
+#if wxUSE_STATUSBAR
+ if (m_frameStatusBar)
+ {
+ wxSysColourChangedEvent vEvent2;
+
+ vEvent2.SetEventObject(m_frameStatusBar);
+ m_frameStatusBar->GetEventHandler()->ProcessEvent(vEvent2);
+ }
+#endif //wxUSE_STATUSBAR
+
+ //
+ // Propagate the event to the non-top-level children
+ //
+ wxWindow::OnSysColourChanged(rEvent);
+} // end of wxFrame::OnSysColourChanged
+
+// Pass TRUE to show full screen, FALSE to restore.
+bool wxFrame::ShowFullScreen(
+ bool bShow
+, long lStyle
+)
+{
+ if (bShow)
+ {
+ if (IsFullScreen())
+ return FALSE;
+
+ m_bFsIsShowing = TRUE;
+ m_lFsStyle = lStyle;
+
+#if wxUSE_TOOLBAR
+ wxToolBar* pTheToolBar = GetToolBar();
+#endif //wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
+ wxStatusBar* pTheStatusBar = GetStatusBar();
+#endif //wxUSE_STATUSBAR
+
+ int nDummyWidth;
+
+#if wxUSE_TOOLBAR
+ if (pTheToolBar)
+ pTheToolBar->GetSize(&nDummyWidth, &m_nFsToolBarHeight);
+#endif //wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
+ if (pTheStatusBar)
+ pTheStatusBar->GetSize(&nDummyWidth, &m_nFsStatusBarHeight);
+#endif //wxUSE_STATUSBAR
+
+#if wxUSE_TOOLBAR
+ //
+ // Zap the toolbar, menubar, and statusbar
+ //
+ if ((lStyle & wxFULLSCREEN_NOTOOLBAR) && pTheToolBar)
+ {
+ pTheToolBar->SetSize(-1,0);
+ pTheToolBar->Show(FALSE);
+ }
+#endif //wxUSE_TOOLBAR
+
+ if (lStyle & wxFULLSCREEN_NOMENUBAR)
+ {
+ ::WinSetParent(m_hMenu, m_hFrame, FALSE);
+ ::WinSetOwner(m_hMenu, m_hFrame);
+ ::WinSendMsg((HWND)m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+ }
+
+#if wxUSE_STATUSBAR
+ //
+ // Save the number of fields in the statusbar
+ //
+ if ((lStyle & wxFULLSCREEN_NOSTATUSBAR) && pTheStatusBar)
+ {
+ m_nFsStatusBarFields = pTheStatusBar->GetFieldsCount();
+ SetStatusBar((wxStatusBar*) NULL);
+ delete pTheStatusBar;
+ }
+ else
+ m_nFsStatusBarFields = 0;
+#endif //wxUSE_STATUSBAR
+
+ //
+ // Zap the frame borders
+ //
+
+ //
+ // Save the 'normal' window style
+ //
+ m_lFsOldWindowStyle = ::WinQueryWindowULong(m_hFrame, QWL_STYLE);
+
+ //
+ // Save the old position, width & height, maximize state
+ //
+ m_vFsOldSize = GetRect();
+ m_bFsIsMaximized = IsMaximized();
+
+ //
+ // Decide which window style flags to turn off
+ //
+ LONG lNewStyle = m_lFsOldWindowStyle;
+ LONG lOffFlags = 0;