void CExtMiniDockFrameWnd::OnCancelMode() { CMiniDockFrameWnd::OnCancelMode(); CExtPopupMenuWnd::CancelMenuTracking(); ASSERT( !CExtPopupMenuWnd::IsMenuTracking() ); if( _ResizingIsInProgress() ) _ResizingEnd(); }
void CExtMiniDockFrameWnd::OnRButtonDown(UINT nFlags, CPoint point) { if( _ResizingIsInProgress() ) { _ResizingEnd(); return; } CMiniDockFrameWnd::OnRButtonDown(nFlags, point); }
void CExtMiniDockFrameWnd::OnCaptureChanged(CWnd *pWnd) { if( _ResizingIsInProgress() && pWnd != this ) { _ResizingEnd(); return; } CMiniDockFrameWnd::OnCaptureChanged(pWnd); }
void CExtMiniDockFrameWnd::OnNcMouseMove( UINT nHitTest, CPoint point ) { if( g_bAutoMakeTopmostOnMouseEvent && (!CExtPopupMenuWnd::IsMenuTracking()) ) BringWindowToTop(); if( _ResizingIsInProgress() ) { return; } CMiniDockFrameWnd::OnNcMouseMove( nHitTest, point ); _AnalyzeButtonsHover(point); }
void CExtMiniDockFrameWnd::OnMouseMove(UINT nFlags, CPoint point) { if( g_bAutoMakeTopmostOnMouseEvent && (!CExtPopupMenuWnd::IsMenuTracking()) ) BringWindowToTop(); if( _ResizingIsInProgress() ) { ClientToScreen( &point ); _ResizingUpdateState( point ); return; } CMiniDockFrameWnd::OnMouseMove(nFlags, point); }
void CExtMiniDockFrameWnd::OnNcLButtonUp(UINT nHitTest, CPoint point) { if( _ResizingIsInProgress() ) { _ResizingEnd(); return; } if( CExtControlBar::_DraggingGetBar() != NULL ) return; CRect rcBarWnd; GetWindowRect( &rcBarWnd ); CPoint ptDevOffset = -rcBarWnd.TopLeft(); CPoint ptWnd( point + ptDevOffset ); CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar != NULL && pExtBar->m_bNcAreaBtnTracking ) { INT nCountOfNcButtons = pExtBar->NcButtons_GetCount(); for( INT nBtn = 0; nBtn < nCountOfNcButtons; nBtn++ ) { CExtBarNcAreaButton * pBtn = pExtBar->NcButtons_GetAt( nBtn ); if( !pBtn->OnQueryVisibility() ) continue; if( pBtn->OnNcAreaClicked( ptWnd ) ) return; } // for( INT nBtn = 0; nBtn < nCountOfNcButtons; nBtn++ ) return; } // if( pExtBar != NULL && pExtBar->m_bNcAreaBtnTracking ) if( m_rcBtnHideBar.PtInRect( ptWnd ) ) { CControlBar * pBar = GetControlBar(); if( pBar == NULL ) return; ASSERT_VALID( pBar ); GetParentFrame()-> ShowControlBar( pBar, FALSE, FALSE ); return; } CMiniDockFrameWnd::OnNcLButtonUp(nHitTest, point); }
void CExtMiniDockFrameWnd::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos) { CMiniDockFrameWnd::OnWindowPosChanged(lpwndpos); if( _ResizingIsInProgress() || g_bOnWndPosChgProcessing || (lpwndpos->flags & SWP_NOMOVE) != 0 ) return; CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar == NULL || !pExtBar->IsFloating() ) return; CRect rcWnd; GetWindowRect( &rcWnd ); int nSmallCaptionDY = ::GetSystemMetrics( SM_CYSMCAPTION ); CExtPaintManager::monitor_parms_t _mp; CExtPaintManager::stat_GetMonitorParms( _mp, this ); ASSERT( !g_bOnWndPosChgProcessing ); if( rcWnd.top < _mp.m_rcWorkArea.top ) { rcWnd.top = _mp.m_rcWorkArea.top; g_bOnWndPosChgProcessing = true; } else if( rcWnd.top + nSmallCaptionDY > _mp.m_rcWorkArea.bottom ) { rcWnd.top = max( _mp.m_rcWorkArea.top, _mp.m_rcWorkArea.bottom - nSmallCaptionDY ); g_bOnWndPosChgProcessing = true; } if( !g_bOnWndPosChgProcessing ) return; SetWindowPos( NULL, rcWnd.left, rcWnd.top, -1, -1, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE ); pExtBar->OnNcAreaButtonsReposition(); PostMessage( WM_NCPAINT ); CExtPaintManager::stat_PassPaintMessages(); g_bOnWndPosChgProcessing = false; }
void CExtMiniDockFrameWnd::OnNcRButtonDown(UINT nHitTest, CPoint point) { if( _ResizingIsInProgress() ) { _ResizingEnd(); return; } if( nHitTest == HTCAPTION ) { CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar != NULL ) { pExtBar->_ContextMenuTrack(); return; } // if( pExtBar != NULL ) } // if( nHitTest == HTCAPTION ) CMiniDockFrameWnd::OnNcRButtonDown(nHitTest,point); }
void CExtMiniDockFrameWnd::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos) { CMiniDockFrameWnd::OnWindowPosChanged(lpwndpos); if( _ResizingIsInProgress() || g_bOnWndPosChgProcessing || (lpwndpos->flags & SWP_NOMOVE) != 0 ) return; CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar == NULL || !pExtBar->IsFloating() ) return; CRect rcWnd; GetWindowRect( &rcWnd ); CRect rcDesktop; ::SystemParametersInfo( SPI_GETWORKAREA, 0, &rcDesktop, 0 ); ASSERT( !g_bOnWndPosChgProcessing ); if( rcWnd.top < rcDesktop.top ) { rcWnd.top = rcDesktop.top; g_bOnWndPosChgProcessing = true; } else if( rcWnd.top + ::GetSystemMetrics(SM_CYSMCAPTION) > rcDesktop.bottom ) { rcWnd.top = max( rcDesktop.top, rcDesktop.bottom - ::GetSystemMetrics(SM_CYSMCAPTION) ); g_bOnWndPosChgProcessing = true; } if( !g_bOnWndPosChgProcessing ) return; SetWindowPos( NULL, rcWnd.left, rcWnd.top, -1, -1, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE ); g_bOnWndPosChgProcessing = false; }
void CExtMiniDockFrameWnd::OnTimer( UINT nIDEvent ) { CExtControlBar * pExtBar = GetControlBarExt(); if( nIDEvent == 1 ) { if( pExtBar == NULL ) return; KillTimer(1); SetWindowPos( NULL,0,0,0,0, SWP_NOMOVE|SWP_NOACTIVATE // |SWP_NOSIZE |SWP_NOZORDER|SWP_NOOWNERZORDER |SWP_FRAMECHANGED ); return; } if( nIDEvent == 2 ) { _AnalyzeButtonsHover(); return; } if( nIDEvent == 3 ) { if( pExtBar == NULL || _ResizingIsInProgress() ) return; RecalcLayout(); KillTimer(3); return; } if( pExtBar == NULL ) return; ASSERT_VALID( pExtBar ); if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() ) { if( _ResizingIsInProgress() ) return; CPoint pt; VERIFY( GetCursorPos( &pt ) ); CWnd * pTempWnd = WindowFromPoint( pt ); int IsMouseInsideTheWindow = IsChild( pTempWnd ) || pTempWnd->m_hWnd == m_hWnd; if( IsMouseInsideTheWindow || IsChild(GetFocus()) || (GetCapture() && pExtBar->m_hWnd == GetCapture()->m_hWnd) || CExtPopupMenuWnd::IsMenuTracking() ) { if( IsMouseInsideTheWindow && !CExtPopupMenuWnd::IsMenuTracking() && IsWindowEnabled() && GetFocus() ) BringWindowToTop(); } } // if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() ) }
void CExtMiniDockFrameWnd::OnNcRButtonDown(UINT nHitTest, CPoint point) { if( _ResizingIsInProgress() ) { _ResizingEnd(); return; } if( nHitTest == HTCAPTION ) { #if (!defined __EXT_MFC_NO_CUSTOMIZE) CExtCustomizeSite * pSite = CExtCustomizeSite::GetCustomizeSite( m_hWnd ); if( pSite != NULL && pSite->IsCustomizeMode() ) return; #endif // (!defined __EXT_MFC_NO_CUSTOMIZE) if( CExtControlBar::FindHelpMode(this) ) return; CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar != NULL ) { ASSERT_VALID( pExtBar ); CFrameWnd * pFrame = pExtBar->_GetDockingFrameImpl(); ASSERT_VALID( pFrame ); CPoint point; if( ! ::GetCursorPos(&point) ) return; HWND hWndTrack = pFrame-> /*pExtBar->GetOwner()->*/ GetSafeHwnd(); ASSERT( hWndTrack != NULL && ::IsWindow(hWndTrack) ); CExtPopupMenuWnd * pPopup = new CExtPopupMenuWnd; VERIFY( pPopup->CreatePopupMenu(hWndTrack) ); if( ! CExtDockBar::_ConstructDockSiteControlBarPopupMenu( pFrame, pPopup, CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_MINIFRAME_NC_CTX, pExtBar, WM_NCRBUTTONDOWN, NULL ) ) { delete pPopup; return; } if( pPopup->ItemGetCount() == 0 ) { delete pPopup; return; } //::SetFocus( hWndTrack ); if( ! pPopup->TrackPopupMenu( TPMX_OWNERDRAW_FIXED, point.x, point.y ) ) { delete pPopup; } return; } // if( pExtBar != NULL ) } // if( nHitTest == HTCAPTION ) CMiniDockFrameWnd::OnNcRButtonDown(nHitTest,point); }
void CExtMiniDockFrameWnd::OnTimer( UINT nIDEvent ) { CExtControlBar * pExtBar = GetControlBarExt(); if( nIDEvent == 1 ) { if( pExtBar == NULL ) return; KillTimer( 1 ); pExtBar->OnNcAreaButtonsReposition(); // SetWindowPos( // NULL, // 0, 0, 0, 0, // SWP_NOREDRAW|SWP_NOSIZE // |SWP_NOMOVE|SWP_NOACTIVATE // |SWP_NOZORDER|SWP_NOOWNERZORDER // |SWP_FRAMECHANGED // ); return; } if( nIDEvent == 2 ) { _AnalyzeButtonsHover(); return; } if( nIDEvent == 3 ) { if( pExtBar == NULL //|| _ResizingIsInProgress() ) return; KillTimer( 3 ); RecalcLayout(); pExtBar->OnNcAreaButtonsReposition(); SendMessage( WM_NCPAINT ); return; } if( nIDEvent == 4 ) { if( pExtBar != NULL ) { ASSERT_VALID( pExtBar ); CPoint point; if( ! ::GetCursorPos(&point) ) return; UINT nHT = pExtBar->NcButtons_HitTest( point ); if( nHT == HTCLIENT ) { PostMessage( WM_NCPAINT ); pExtBar->m_bNcAreaBtnTracking = false; } } if( !pExtBar->m_bNcAreaBtnTracking ) KillTimer( 4 ); return; } if( pExtBar == NULL ) return; ASSERT_VALID( pExtBar ); if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() ) { if( _ResizingIsInProgress() ) return; CPoint pt; if( ! ::GetCursorPos( &pt ) ) return; CWnd * pTempWnd = WindowFromPoint( pt ); int IsMouseInsideTheWindow = IsChild( pTempWnd ) || pTempWnd->m_hWnd == m_hWnd; if( IsMouseInsideTheWindow || IsChild(GetFocus()) || (CExtMouseCaptureSink::GetCapture() && pExtBar->m_hWnd == CExtMouseCaptureSink::GetCapture()) || CExtPopupMenuWnd::IsMenuTracking() ) { if( IsMouseInsideTheWindow && !CExtPopupMenuWnd::IsMenuTracking() && IsWindowEnabled() && GetFocus() ) BringWindowToTop(); } } // if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() ) }
void CExtMiniDockFrameWnd::OnSize(UINT nType, int cx, int cy) { // if( _ResizingIsInProgress() ) // return; ASSERT( cx >= 0 && cy >= 0 ); CExtPaintManager::monitor_parms_t _mp; CExtPaintManager::stat_GetMonitorParms( _mp, this ); if( cx > _mp.m_rcWorkArea.Width() || cy > _mp.m_rcWorkArea.Height() ) { CRect rcWnd; GetWindowRect( &rcWnd ); rcWnd.right = rcWnd.left + ( min( cx, _mp.m_rcWorkArea.Width() ) ) ; rcWnd.bottom = rcWnd.top + ( min( cy, _mp.m_rcWorkArea.Height() ) ) ; MoveWindow( &rcWnd ); return; } CMiniDockFrameWnd::OnSize(nType, cx, cy); int nWinResizingFrameDX = ::GetSystemMetrics( SM_CXSIZEFRAME ); int nWinResizingFrameDY = ::GetSystemMetrics( SM_CYSIZEFRAME ); int nSmallCaptionDY = ::GetSystemMetrics( SM_CYSMCAPTION ); CRect rcFrameCaption; GetWindowRect( &rcFrameCaption ); rcFrameCaption -= rcFrameCaption.TopLeft(); rcFrameCaption.left += nWinResizingFrameDX; rcFrameCaption.right -= nWinResizingFrameDX; rcFrameCaption.top += nWinResizingFrameDY; rcFrameCaption.bottom = rcFrameCaption.top + nSmallCaptionDY - ::GetSystemMetrics( SM_CYSMSIZE ); rcFrameCaption.bottom = rcFrameCaption.top + ::GetSystemMetrics( SM_CYSMSIZE ); m_rcFrameCaption = rcFrameCaption; int nDummyMetric = ::GetSystemMetrics( SM_CXSMSIZE ) - 1; int nRight = m_rcFrameCaption.right - nDummyMetric - 1; m_rcBtnHideBar.SetRect( nRight, m_rcFrameCaption.top + 2, nRight + nDummyMetric - 2, m_rcFrameCaption.bottom - 2 ); CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar != NULL ) { pExtBar->OnNcAreaButtonsReinitialize(); pExtBar->OnNcAreaButtonsReposition(); } // if( pExtBar != NULL ) if( !_ResizingIsInProgress() ) RedrawWindow( NULL, NULL, RDW_FRAME|RDW_INVALIDATE|RDW_ERASE |RDW_UPDATENOW|RDW_ALLCHILDREN ); CExtPaintManager::stat_PassPaintMessages(); }