+ m_bFsIsShowing = FALSE;
+
+#if wxUSE_TOOLBAR
+ wxToolBar* pTheToolBar = GetToolBar();
+
+ //
+ // Restore the toolbar, menubar, and statusbar
+ //
+ if (pTheToolBar && (m_lFsStyle & wxFULLSCREEN_NOTOOLBAR))
+ {
+ pTheToolBar->SetSize(-1, m_nFsToolBarHeight);
+ pTheToolBar->Show(TRUE);
+ }
+#endif //wxUSE_TOOLBAR
+
+#if wxUSE_STATUSBAR
+ if ((m_lFsStyle & wxFULLSCREEN_NOSTATUSBAR) && (m_nFsStatusBarFields > 0))
+ {
+ CreateStatusBar(m_nFsStatusBarFields);
+// PositionStatusBar();
+ }
+#endif //wxUSE_STATUSBAR
+
+ if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
+ {
+ ::WinSetParent(m_hMenu, m_hFrame, FALSE);
+ ::WinSetOwner(m_hMenu, m_hFrame);
+ ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+ }
+ Maximize(m_bFsIsMaximized);
+
+ ::WinSetWindowULong( m_hFrame
+ ,QWL_STYLE
+ ,(ULONG)m_lFsOldWindowStyle
+ );
+ ::WinSetWindowPos( (HWND) GetParent()->GetHWND()
+ ,HWND_TOP
+ ,m_vFsOldSize.x
+ ,m_vFsOldSize.y
+ ,m_vFsOldSize.width
+ ,m_vFsOldSize.height
+ ,SWP_SIZE | SWP_SHOW
+ );
+ return TRUE;
+ }
+} // end of wxFrame::ShowFullScreen
+
+//
+// Frame window
+//
+bool wxFrame::OS2Create(
+ int nId
+, wxWindow* pParent
+, const wxChar* zWclass
+, wxWindow* pWxWin
+, const wxChar* zTitle
+, int nX
+, int nY
+, int nWidth
+, int nHeight
+, long ulStyle
+)
+{
+ ULONG ulCreateFlags = 0L;
+ ULONG ulStyleFlags = 0L;
+ ULONG ulExtraFlags = 0L;
+ FRAMECDATA vFrameCtlData;
+ HWND hParent = NULLHANDLE;
+ HWND hTitlebar = NULLHANDLE;
+ HWND hHScroll = NULLHANDLE;
+ HWND hVScroll = NULLHANDLE;
+ HWND hFrame = NULLHANDLE;
+ HWND hClient = NULLHANDLE;
+ SWP vSwp[10];
+ RECTL vRect[10];
+ USHORT uCtlCount;
+ ERRORID vError;
+ wxString sError;
+
+ m_hDefaultIcon = (WXHICON) (wxSTD_FRAME_ICON ? wxSTD_FRAME_ICON : wxDEFAULT_FRAME_ICON);
+
+ if (pParent)
+ hParent = GetWinHwnd(pParent);
+ else
+ hParent = HWND_DESKTOP;
+
+ if (ulStyle == wxDEFAULT_FRAME_STYLE)
+ ulCreateFlags = FCF_SIZEBORDER | FCF_TITLEBAR | FCF_SYSMENU |
+ FCF_MINMAX | FCF_TASKLIST;
+ else
+ {
+ if ((ulStyle & wxCAPTION) == wxCAPTION)
+ ulCreateFlags = FCF_TASKLIST;
+ else
+ ulCreateFlags = FCF_NOMOVEWITHOWNER;
+
+ if ((ulStyle & wxVSCROLL) == wxVSCROLL)
+ ulCreateFlags |= FCF_VERTSCROLL;
+ if ((ulStyle & wxHSCROLL) == wxHSCROLL)
+ ulCreateFlags |= FCF_HORZSCROLL;
+ if (ulStyle & wxMINIMIZE_BOX)
+ ulCreateFlags |= FCF_MINBUTTON;
+ if (ulStyle & wxMAXIMIZE_BOX)
+ ulCreateFlags |= FCF_MAXBUTTON;
+ if (ulStyle & wxTHICK_FRAME)
+ ulCreateFlags |= FCF_DLGBORDER;
+ if (ulStyle & wxSYSTEM_MENU)
+ ulCreateFlags |= FCF_SYSMENU;
+ if (ulStyle & wxCAPTION)
+ ulCreateFlags |= FCF_TASKLIST;
+ if (ulStyle & wxCLIP_CHILDREN)
+ {
+ // Invalid for frame windows under PM
+ }
+
+ if (ulStyle & wxTINY_CAPTION_VERT)
+ ulCreateFlags |= FCF_TASKLIST;
+ if (ulStyle & wxTINY_CAPTION_HORIZ)
+ ulCreateFlags |= FCF_TASKLIST;
+
+ if ((ulStyle & wxTHICK_FRAME) == 0)
+ ulCreateFlags |= FCF_BORDER;
+ if (ulStyle & wxFRAME_TOOL_WINDOW)
+ ulExtraFlags = kFrameToolWindow;
+
+ if (ulStyle & wxSTAY_ON_TOP)
+ ulCreateFlags |= FCF_SYSMODAL;
+ }
+ if ((ulStyle & wxMINIMIZE) || (ulStyle & wxICONIZE))
+ ulStyleFlags |= WS_MINIMIZED;
+ if (ulStyle & wxMAXIMIZE)
+ ulStyleFlags |= WS_MAXIMIZED;
+
+ //
+ // Clear the visible flag, we always call show
+ //
+ ulStyleFlags &= (unsigned long)~WS_VISIBLE;
+ m_bIconized = FALSE;
+
+ //
+ // Set the frame control block
+ //
+ vFrameCtlData.cb = sizeof(vFrameCtlData);
+ vFrameCtlData.flCreateFlags = ulCreateFlags;
+ vFrameCtlData.hmodResources = 0L;
+ vFrameCtlData.idResources = 0;
+
+ //
+ // Create the frame window: We break ranks with other ports now
+ // and instead of calling down into the base wxWindow class' OS2Create
+ // we do all our own stuff here. We will set the needed pieces
+ // of wxWindow manually, here.
+ //
+
+ hFrame = ::WinCreateStdWindow( hParent
+ ,ulStyleFlags // frame-window style
+ ,&ulCreateFlags // window style
+ ,(PSZ)zWclass // class name
+ ,(PSZ)zTitle // window title
+ ,0L // default client style
+ ,NULLHANDLE // resource in executable file
+ ,0 // resource id
+ ,&hClient // receives client window handle
+ );
+ if (!hFrame)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error creating frame. Error: %s\n", sError);
+ return FALSE;
+ }
+
+ //
+ // wxWindow class' m_hWnd set here and needed associations
+ //
+ m_hFrame = hFrame;
+ m_hWnd = hClient;
+ wxAssociateWinWithHandle(m_hWnd, this);
+ wxAssociateWinWithHandle(m_hFrame, this);
+
+ m_backgroundColour.Set(wxString("GREY"));
+
+ LONG lColor = (LONG)m_backgroundColour.GetPixel();
+
+ if (!::WinSetPresParam( m_hWnd
+ ,PP_BACKGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ ))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error creating frame. Error: %s\n", sError);
+ return FALSE;
+ }
+
+ //
+ // Now need to subclass window. Instead of calling the SubClassWin in wxWindow
+ // we manually subclass here because we don't want to use the main wxWndProc
+ // by default
+ //
+ m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(m_hFrame, (PFNWP)wxFrameMainWndProc);
+
+ //
+ // Now size everything. If adding a menu the client will need to be resized.
+ //
+
+ if (pParent)
+ {
+ nY = pParent->GetSize().y - (nY + nHeight);
+ }
+ else
+ {
+ RECTL vRect;
+
+ ::WinQueryWindowRect(HWND_DESKTOP, &vRect);
+ nY = vRect.yTop - (nY + nHeight);
+ }
+ if (!::WinSetWindowPos( m_hFrame
+ ,HWND_TOP
+ ,nX
+ ,nY
+ ,nWidth
+ ,nHeight
+ ,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE | SWP_ZORDER
+ ))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error sizing frame. Error: %s\n", sError);
+ return FALSE;
+ }
+ return TRUE;
+} // end of wxFrame::OS2Create
+
+//