+ return FALSE;
+} // end of wxFrame::HandleCommand
+
+bool wxFrame::HandleMenuSelect(
+ WXWORD nItem
+, WXWORD nFlags
+, WXHMENU hMenu
+)
+{
+ int nMenuItem;
+
+ if (nFlags == 0xFFFF && hMenu == 0)
+ {
+ //
+ // Menu was removed from screen
+ //
+ nMenuItem = -1;
+ }
+ else if (!(nFlags & MIS_SUBMENU) && !(nFlags & MIS_SEPARATOR))
+ {
+ nMenuItem = nItem;
+ }
+ else
+ {
+ //
+ // Don't give hints for separators (doesn't make sense) nor for the
+ // items opening popup menus (they don't have them anyhow)
+ //
+ return FALSE;
+ }
+ wxMenuEvent vEvent(wxEVT_MENU_HIGHLIGHT, nMenuItem);
+
+ vEvent.SetEventObject(this);
+ return GetEventHandler()->ProcessEvent(vEvent);
+} // 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
+ );
+ }
+ break;
+
+ case WM_PAINT:
+ bProcessed = HandlePaint();
+ 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;
+ }
+
+ if (!bProcessed )
+ mRc = wxWindow::OS2WindowProc( uMessage
+ ,wParam
+ ,lParam
+ );
+ return (MRESULT)0;
+} // wxFrame::OS2WindowProc