+ return TRUE;
+} // end of wxFrame::HandleMenuSelect
+
+// ---------------------------------------------------------------------------
+// the window proc for wxFrame
+// ---------------------------------------------------------------------------
+
+MRESULT wxFrame::OS2WindowProc(
+ WXUINT uMessage
+, WXWPARAM wParam
+, WXLPARAM lParam
+)
+{
+ MRESULT mRc = 0L;
+ bool bProcessed = FALSE;
+
+ switch (uMessage)
+ {
+ case WM_CLOSE:
+ //
+ // If we can't close, tell the system that we processed the
+ // message - otherwise it would close us
+ //
+ bProcessed = !Close();
+ break;
+
+ case WM_COMMAND:
+ {
+ WORD wId;
+ WORD wCmd;
+ WXHWND hWnd;
+
+ UnpackCommand( (WXWPARAM)wParam
+ ,(WXLPARAM)lParam
+ ,&wId
+ ,&hWnd
+ ,&wCmd
+ );
+
+ bProcessed = HandleCommand( wId
+ ,wCmd
+ ,(WXHWND)hWnd
+ );
+ }
+ break;
+
+ case WM_MENUSELECT:
+ {
+ WXWORD wItem;
+ WXWORD wFlags;
+ WXHMENU hMenu;
+
+ UnpackMenuSelect( wParam
+ ,lParam
+ ,&wItem
+ ,&wFlags
+ ,&hMenu
+ );
+ bProcessed = HandleMenuSelect( wItem
+ ,wFlags
+ ,hMenu
+ );
+ mRc = (MRESULT)TRUE;
+ }
+ break;
+
+ case WM_PAINT:
+ bProcessed = HandlePaint();
+ break;
+
+ case WM_ERASEBACKGROUND:
+ //
+ // Return TRUE to request PM to paint the window background
+ // in SYSCLR_WINDOW.
+ //
+ bProcessed = TRUE;
+ mRc = (MRESULT)(TRUE);
+ break;
+
+ case CM_QUERYDRAGIMAGE:
+ {
+ HPOINTER hIcon;
+
+ if (m_icon.Ok())
+ hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
+ else
+ hIcon = (HPOINTER)m_hDefaultIcon;
+ mRc = (MRESULT)hIcon;
+ bProcessed = mRc != 0;
+ }
+ break;
+
+ case WM_SIZE:
+ bProcessed = HandleSize(LOWORD(lParam), HIWORD(lParam), (WXUINT)wParam);
+ break;
+
+ case WM_QUERYFRAMECTLCOUNT:
+ {
+ USHORT itemCount = SHORT1FROMMR(OS2GetOldWndProc()(GetHWND(), uMessage, wParam, lParam));
+ if(m_frameStatusBar)
+ ++itemCount;
+ bProcessed = TRUE;
+ mRc = MRFROMSHORT( itemCount );
+ }
+ break;
+
+ case WM_FORMATFRAME:
+ {
+ PSWP pSWP = 0;
+ USHORT usClient = 0;
+ SWP swp;
+ USHORT itemCount;
+ char s[128];
+
+ itemCount = SHORT1FROMMR(OS2GetOldWndProc()(GetHWND(), uMessage, wParam, lParam));
+ pSWP = (PSWP)PVOIDFROMMP( wParam );
+
+ while(pSWP[usClient].hwnd != WinWindowFromID(GetHWND(), FID_CLIENT)
+ && usClient < itemCount)
+ usClient++;
+
+ if(m_frameStatusBar)
+ {
+ int height;
+
+ m_frameStatusBar->GetSize(NULL, &height);
+
+ if(usClient == itemCount)
+ {
+ // frame has no client window
+ // using another method of calculation
+ RECTL wRectl;
+
+ ::WinQueryWindowRect(GetHWND(), &wRectl);
+ ::WinMapWindowPoints(GetHWND(), HWND_DESKTOP, (PPOINTL)&wRectl, 2);
+ ::WinCalcFrameRect(GetHWND(), &wRectl, TRUE);
+ ::WinMapWindowPoints(HWND_DESKTOP, GetHWND(), (PPOINTL)&wRectl, 2);
+
+ pSWP[itemCount].x = wRectl.xLeft;
+ pSWP[itemCount].y = wRectl.yBottom;
+ pSWP[itemCount].cx = wRectl.xRight - wRectl.xLeft - 1;
+ pSWP[itemCount].cy = height;
+ pSWP[itemCount].fl = SWP_SIZE |
+ SWP_MOVE |
+ SWP_SHOW;
+ pSWP[itemCount].hwnd = m_frameStatusBar->GetHWND();
+ pSWP[itemCount].hwndInsertBehind = HWND_TOP;
+ ++itemCount;
+ }
+ else
+ {
+ pSWP[itemCount].x = pSWP[usClient].x;
+ pSWP[itemCount].y = pSWP[usClient].y;
+ pSWP[itemCount].cx = pSWP[usClient].cx;
+ pSWP[itemCount].cy = height;
+ pSWP[itemCount].fl = SWP_SIZE |
+ SWP_MOVE |
+ SWP_SHOW;
+ pSWP[itemCount].hwnd = m_frameStatusBar->GetHWND();
+ pSWP[itemCount].hwndInsertBehind = HWND_TOP;
+ pSWP[usClient].cy -= height;
+ pSWP[usClient].y += height;
+
+ ++itemCount;
+ }
+ }
+ bProcessed = TRUE;
+ mRc = MRFROMSHORT(itemCount);
+ }
+ break;
+ }
+
+ if (!bProcessed )
+ mRc = wxWindow::OS2WindowProc( uMessage
+ ,wParam
+ ,lParam
+ );
+ return (MRESULT)mRc;
+} // wxFrame::OS2WindowProc
+
+
+void wxFrame::SetClient(WXHWND c_Hwnd)
+{
+ // Are we really need to implement it?