void OSMDIChildWnd::onRestore() { OSMDICHILDWND_PARENT::onRestore(); if (!detached) { getMDIParent()->updateMDIControlButtons(isMaximized()); getMDIParent()->onMDIChildRestore(this); } }
void OSMDIChildWnd::onMinimize() { OSMDICHILDWND_PARENT::onMinimize(); if (!detached) { if (!getMDIParent()->areAllMDIMinimized()) getMDIParent()->nextMDI(); else getMDIParent()->updateMDIControlButtons(0); } }
LRESULT MDIFrameDispatcher::chain(const MSG& msg) { if(getMDIParent()) { return ::DefFrameProc(hWnd, getMDIParent()->handle(), msg, wPar, lPar); } return NormalDispatcher::chain(msg); }
LRESULT OSMDIChildWnd::wndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { #ifdef DETACHABLE if (detached) { if ( uMsg == WM_SYSCOMMAND && wParam == MDICHILD_SYSMENU_DETACH && m_oldparent) { attachMDI(); return 1; } return OSMDICHILDWND_PARENT::wndProc(hWnd, uMsg, wParam, lParam); } #endif if (uMsg == WM_MOVE) { if (isMaximized() && getMDIParent()->isMDIScrolling()) { getMDIParent()->remaximizeMDI(this); } } switch (uMsg) { case WM_NCACTIVATE: if ( wParam == FALSE ) return callDefProc(hWnd, uMsg, wParam, lParam); case WM_CHILDACTIVATE: { OSMDIParentWnd *p = getMDIParent(); if (p) p->onMDIChildActivate(this); onActivate(); // NO break } case WM_GETMINMAXINFO: case WM_MENUCHAR: case WM_MOVE: case WM_SETFOCUS: if ( uMsg == WM_SETFOCUS && wantFocus() ) onGetFocus(); case WM_SIZE: { //CUT case WM_SYSCOMMAND: int r = callDefProc(hWnd, uMsg, wParam, lParam); //CUT if (uMsg == WM_SYSCOMMAND) { //CUT switch (wParam & 0xFFF0) { //CUT case SC_MAXIMIZE: //CUT onMaximize(); //CUT break; //CUT case SC_MINIMIZE: //CUT onMinimize(); //CUT break; //CUT case SC_RESTORE: //CUT onRestore(); //CUT break; //CUT } //CUT } return r; } #ifdef DETACHABLE case WM_SYSCOMMAND: { if (wParam == MDICHILD_SYSMENU_DETACH) { detachMDI(); return 1; } } break; #endif case WM_ERASEBKGND: return 1; // wayyyyy faster -BU } return OSMDICHILDWND_PARENT::wndProc(hWnd, uMsg, wParam, lParam); }
int OSMDIChildWnd::onPostedMove() { OSMDICHILDWND_PARENT::onPostedMove(); if (detached) return 1; getMDIParent()->onMDIChildMove(this); return 1; }
void OSMDIChildWnd::onSetName() { if (getMDIParent() != NULL) getMDIParent()->onMDIChildNameChange(this); if (!isMaximized()) SetWindowText(gethWnd(), getName()); }