+{
+ // TODO:
+/*
+ wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ if ( parent && parent->GetClientWindow() )
+ {
+ ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE,
+ (WPARAM) GetHwnd(), 0);
+ }
+*/
+}
+
+// ---------------------------------------------------------------------------
+// MDI window proc and message handlers
+// ---------------------------------------------------------------------------
+
+MRESULT wxMDIChildFrame::OS2WindowProc(WXUINT message,
+ WXWPARAM wParam,
+ WXLPARAM lParam)
+{
+ MRESULT rc = 0;
+ bool processed = FALSE;
+
+ // TODO:
+/*
+ switch ( message )
+ {
+ case WM_COMMAND:
+ {
+ WORD id, cmd;
+ WXHWND hwnd;
+ UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
+ &id, &hwnd, &cmd);
+
+ processed = HandleCommand(id, cmd, (WXHWND)hwnd);
+ }
+ break;
+
+ case WM_GETMINMAXINFO:
+ // let the default window proc calculate the size of MDI children
+ // frames because it is based on the size of the MDI client window,
+ // not on the values specified in wxWindow m_min/max variables
+ return MSWDefWindowProc(message, wParam, lParam);
+
+ case WM_MDIACTIVATE:
+ {
+ WXWORD act;
+ WXHWND hwndAct, hwndDeact;
+ UnpackMDIActivate(wParam, lParam, &act, &hwndAct, &hwndDeact);
+
+ processed = HandleMDIActivate(act, hwndAct, hwndDeact);
+ }
+ // fall through
+
+ case WM_MOVE:
+ // must pass WM_MOVE to DefMDIChildProc() to recalculate MDI client
+ // scrollbars if necessary
+
+ // fall through
+
+ case WM_SIZE:
+ // must pass WM_SIZE to DefMDIChildProc(), otherwise many weird
+ // things happen
+ MSWDefWindowProc(message, wParam, lParam);
+ break;
+
+ case WM_SYSCOMMAND:
+ // DefMDIChildProc handles SC_{NEXT/PREV}WINDOW here, so pass it
+ // the message (the base class version does not)
+ return MSWDefWindowProc(message, wParam, lParam);
+
+ case WM_WINDOWPOSCHANGING:
+ processed = HandleWindowPosChanging((LPWINDOWPOS)lParam);
+ break;
+ }
+*/
+ if ( !processed )
+ rc = wxFrame::OS2WindowProc(message, wParam, lParam);
+
+ return rc;
+}
+
+bool wxMDIChildFrame::HandleSize(int x, int y, WXUINT id)
+{
+ HWND hwnd = GetHwnd();
+
+ if ( !hwnd || hwnd == invalidHandle )
+ {
+ return FALSE;
+ }
+
+ // TODO:
+/*
+ switch (id)
+ {
+ case SIZEFULLSCREEN:
+ case SIZENORMAL:
+ m_iconized = FALSE;
+ break;
+
+ case SIZEICONIC:
+ m_iconized = TRUE;
+ break;
+ }
+
+ if ( !m_iconized )
+ {
+ // forward WM_SIZE to status bar control
+#if wxUSE_NATIVE_STATUSBAR
+ if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
+ {
+ wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
+ event.SetEventObject( m_frameStatusBar );
+
+ ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
+ }
+#endif // wxUSE_NATIVE_STATUSBAR
+
+ PositionStatusBar();
+ PositionToolBar();
+
+ return wxWindow::HandleSize(x, y, id);
+ }
+ else
+ {
+ return FALSE;
+ }
+*/
+ return TRUE;
+}
+
+bool wxMDIChildFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
+{
+ // In case it's e.g. a toolbar.
+ if ( hwnd )
+ {
+ wxWindow *win = wxFindWinFromHandle(hwnd);
+// if (win)
+// Fix dependent stuff return win->OS2Command(cmd, id);
+ }
+
+ if (wxCurrentPopupMenu)
+ {
+ wxMenu *popupMenu = wxCurrentPopupMenu;
+ wxCurrentPopupMenu = NULL;
+// Fix dependent stuff if (popupMenu->OS2Command(cmd, id))
+// return TRUE;
+ }
+
+ if (GetMenuBar() && GetMenuBar()->FindItem(id))
+ {
+ ProcessCommand(id);
+ return TRUE;
+ }
+ else
+ return FALSE;
+
+ return TRUE;
+}
+
+bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
+ WXHWND hwndAct,
+ WXHWND hwndDeact)
+{
+ wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+
+ HMENU menuToSet = 0;
+
+ bool activated;
+
+ if ( m_hWnd == hwndAct )
+ {
+ activated = TRUE;
+ parent->m_currentChild = this;
+
+ HMENU child_menu = (HMENU)GetWinMenu();
+ if ( child_menu )
+ {
+ parent->m_parentFrameActive = FALSE;
+
+ menuToSet = child_menu;
+ }
+ }
+ else if ( m_hWnd == hwndDeact )
+ {
+ wxASSERT_MSG( parent->m_currentChild == this,
+ wxT("can't deactivate MDI child which wasn't active!") );
+
+ activated = FALSE;
+ parent->m_currentChild = NULL;
+
+ HMENU parent_menu = (HMENU)parent->GetWinMenu();
+ if ( parent_menu )
+ {
+ parent->m_parentFrameActive = TRUE;
+
+ menuToSet = parent_menu;
+ }
+ }
+ else
+ {
+ // we have nothing to with it
+ return FALSE;
+ }
+
+ if ( menuToSet )
+ {
+ HMENU subMenu = 0; // TODO: GetSubMenu((HMENU) parent->GetWindowMenu(), 0);
+
+ MDISetMenu(parent->GetClientWindow(), menuToSet, subMenu);
+ }
+
+ wxActivateEvent event(wxEVT_ACTIVATE, activated, m_windowId);
+ event.SetEventObject( this );
+
+ return GetEventHandler()->ProcessEvent(event);
+}
+
+bool wxMDIChildFrame::HandleWindowPosChanging(void *pos)
+{
+// WINDOWPOS *lpPos = (WINDOWPOS *)pos;
+ return FALSE;
+}
+
+// ---------------------------------------------------------------------------
+// MDI specific message translation/preprocessing
+// ---------------------------------------------------------------------------
+
+MRESULT wxMDIChildFrame::OS2DefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)