本文整理汇总了C++中CExtControlBar类的典型用法代码示例。如果您正苦于以下问题:C++ CExtControlBar类的具体用法?C++ CExtControlBar怎么用?C++ CExtControlBar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CExtControlBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetControlBarExt
void CExtMiniDockFrameWnd::_AnalyzeButtonsHover(CPoint point)
{
CExtControlBar * pExtBar = GetControlBarExt();
if( pExtBar != NULL )
{
pExtBar->NcButtons_HitTest( point );
return;
}
CRect rcClient, rcBar;
GetClientRect( &rcClient );
ClientToScreen( &rcClient );
GetWindowRect( &rcBar );
rcClient.OffsetRect( -rcBar.TopLeft() );
rcBar.OffsetRect (-rcBar.TopLeft() );
ScreenToClient( &point );
point.y -= rcBar.top - rcClient.top;
bool bBtnHideBarHover = false;
if( m_rcBtnHideBar.PtInRect(point) )
bBtnHideBarHover = true;
if( m_bBtnHideBar != bBtnHideBarHover )
{
m_bBtnHideBar = bBtnHideBarHover;
SendMessage( WM_NCPAINT );
}
if( m_bBtnHideBar || bBtnHideBarHover )
SetTimer(2,20,NULL);
else
KillTimer(2);
}
示例2: GetStyle
void CExtMiniDockFrameWnd::OnSize(UINT nType, int cx, int cy)
{
// if( _ResizingIsInProgress() )
// return;
CMiniDockFrameWnd::OnSize(nType, cx, cy);
DWORD dwStyle = GetStyle();
CSize sizeFrame =
(dwStyle & WS_THICKFRAME)
? CSize(
GetSystemMetrics(SM_CXSIZEFRAME),
GetSystemMetrics(SM_CYSIZEFRAME)
)
: CSize(
GetSystemMetrics(SM_CXFIXEDFRAME),
GetSystemMetrics(SM_CYFIXEDFRAME)
);
CRect rcFrameCaption;
GetWindowRect( &rcFrameCaption );
rcFrameCaption -= rcFrameCaption.TopLeft();
rcFrameCaption.left += sizeFrame.cx;
rcFrameCaption.right -= sizeFrame.cx;
rcFrameCaption.top += sizeFrame.cy;
rcFrameCaption.bottom =
rcFrameCaption.top
+ ::GetSystemMetrics(SM_CYSMCAPTION)
- ::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 )
RedrawWindow(
NULL,
NULL,
RDW_FRAME|RDW_INVALIDATE|RDW_ERASE
|RDW_UPDATENOW|RDW_ALLCHILDREN
);
}
示例3: GetControlBarExt
void CExtMiniDockFrameWnd::_ResizingEnd()
{
m_ptLastResizing.x = m_ptLastResizing.y = -1;
//ASSERT( m_nResizingMode != HTNOWHERE );
if( m_nResizingMode == HTNOWHERE )
return;
if( CExtMouseCaptureSink::GetCapture() == GetSafeHwnd() )
CExtMouseCaptureSink::ReleaseCapture();
CExtControlBar * pExtBar = GetControlBarExt();
ASSERT_VALID( pExtBar );
if( !pExtBar->IsFixedMode() )
ModifyStyle( 0, __REMOVED_NONFIXMODE_STYLES );
m_nResizingMode = HTNOWHERE;
}
示例4: _ResizingEnd
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);
}
示例5: DoCloseWnd
int CMainFrame::DoCloseWnd(CExtControlBar &Box)//заданное ќкно, которое требуетс¤ закрыть
{
CWnd *pWnd=GetFocus();
if(pWnd)
{
CWnd *pParent=pWnd->GetParent();
if(pParent==&Box)//если текущее окно - заданное ќкно, то не закрываем
{
CMDIChildWnd* pView=MDIGetActive();
if(pView)
{
MDIActivate(pView);
pView->SetFocus();
return 0;
}
}
//иначе, если открыто заданное ќкно - закрываем
if(Box.IsVisible())
{
ShowControlBar(&Box,0,1);
return 1;
}
}
return -1;
}
示例6: SendMessage
BOOL CExtMiniDockFrameWnd::OnNcActivate(BOOL bActive)
{
BOOL rc = CMiniDockFrameWnd::OnNcActivate(bActive);
SendMessage( WM_NCPAINT );
if( bActive )
{
CExtControlBar * pExtBar =
GetControlBarExt();
if( pExtBar != NULL )
pExtBar->RedrawWindow(
NULL,
NULL,
RDW_INVALIDATE|RDW_UPDATENOW
|RDW_ERASE|RDW_ALLCHILDREN
);
} // if( bActive )
return rc;
}
示例7: _ResizingEnd
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);
}
示例8: _T
bool CExtMiniDockFrameWnd::_GetSingleVisibleCaptionText( CExtSafeString & sCaption )
{
sCaption = _T("");
CFrameWnd * pDockSite = GetParentFrame();
if( pDockSite == NULL )
return false;
ASSERT( !pDockSite->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd)) );
POSITION pos = pDockSite->m_listControlBars.GetHeadPosition();
for( ; pos != NULL; )
{
CExtControlBar * pBar =
DYNAMIC_DOWNCAST(
CExtControlBar,
((CControlBar *)(pDockSite->m_listControlBars.GetNext(pos)))
);
if( pBar == NULL
|| pBar->m_pDockSite == NULL
|| pBar->IsFixedMode()
|| ( pBar->IsKindOf(RUNTIME_CLASS(CExtDynControlBar))
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
&& !pBar->IsKindOf(RUNTIME_CLASS(CExtDynTabControlBar))
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
)
|| pBar->GetParentFrame() != this
|| pBar->IsFloating()
|| !pBar->IsVisible()
)
continue;
ASSERT( pBar->m_pDockBar != NULL );
if(
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
pBar->m_pDockBar->IsKindOf(RUNTIME_CLASS(CExtDockDynTabBar))
||
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
!pBar->m_pDockBar->IsKindOf(RUNTIME_CLASS(CExtDockBar))
)
continue;
if( ! pBar->_IsSingleVisibleInFloatingPalette() )
return false;
pBar->OnGetBarCaptionText(
CExtControlBar::__EBCT_SINGLE_CAPTION_FLOATING,
sCaption
);
return sCaption.IsEmpty() ? false : true;
}
return false;
}
示例9: GetWindowRect
void CExtMiniDockFrameWnd::OnNcLButtonDblClk(UINT nHitTest, CPoint point)
{
if( nHitTest == HTCAPTION )
{
CRect rcWnd;
GetWindowRect( &rcWnd );
CPoint ptTestBtnHideBar( point - rcWnd.TopLeft() );
if( m_rcBtnHideBar.PtInRect(ptTestBtnHideBar) )
return;
} // if( nHitTest == HTCAPTION )
CExtControlBar * pExtBar = GetControlBarExt();
if( pExtBar != NULL )
{
ASSERT_VALID( pExtBar );
pExtBar->ToggleDocking();
return;
}
CMiniDockFrameWnd::OnNcLButtonDblClk(nHitTest, point);
}
示例10: ASSERT
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();
}
示例11: ModifyStyle
//.........这里部分代码省略.........
rcBar.left,
rcBar.top,
rcBar.left + nWinResizingFrameDX,
rcBar.top + nSmallCaptionDY
);
if( rcTest.PtInRect(point) )
nHit = HTTOPLEFT;
else
{
rcTest.SetRect(
rcBar.left,
rcBar.bottom - nSmallCaptionDY,
rcBar.left + nWinResizingFrameDX,
rcBar.bottom
);
if( rcTest.PtInRect(point) )
nHit = HTBOTTOMLEFT;
}
}
break;
case HTRIGHT:
{
rcTest.SetRect(
rcBar.right - nWinResizingFrameDX,
rcBar.top,
rcBar.right,
rcBar.top + nSmallCaptionDY
);
if( rcTest.PtInRect(point) )
nHit = HTTOPRIGHT;
else
{
rcTest.SetRect(
rcBar.right - nWinResizingFrameDX,
rcBar.bottom - nSmallCaptionDY,
rcBar.right,
rcBar.bottom
);
if( rcTest.PtInRect(point) )
nHit = HTBOTTOMRIGHT;
}
}
break;
} // switch( nHit )
bool bNcRepaint = false;
CExtControlBar * pExtBar = GetControlBarExt();
if( pExtBar != NULL )
{
ASSERT_VALID( pExtBar );
UINT nHT = pExtBar->NcButtons_HitTest( point );
if( nHT != HTCLIENT )
{
pExtBar->m_bNcAreaBtnTracking = true;
if( pExtBar->_IsDockSiteCustomizeMode() )
SetTimer( 4, 20, NULL );
return nHT;
}
else
{
bNcRepaint = true;
pExtBar->m_bNcAreaBtnTracking = false;
}
if( pExtBar->IsFixedMode() )
{
bool bPaletteMode = false;
CExtToolControlBar * pToolBar =
DYNAMIC_DOWNCAST(
CExtToolControlBar,
pExtBar
);
if( pToolBar != NULL )
{
ASSERT_VALID( pToolBar );
bPaletteMode = pToolBar->m_bPaletteMode;
} // if( pToolBar != NULL )
switch( nHit )
{
case HTTOP:
case HTBOTTOM:
case HTLEFT:
case HTRIGHT:
if( bPaletteMode )
nHit = HTCAPTION;
break;
case HTTOPLEFT:
case HTTOPRIGHT:
nHit = bPaletteMode ? HTCAPTION : HTTOP;
break;
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
nHit = bPaletteMode ? HTCAPTION : HTBOTTOM;
break;
} // switch( nHit )
} // if( pExtBar->IsFixedMode() )
} // if( pExtBar != NULL )
if( bNcRepaint )
SendMessage( WM_NCPAINT );
return nHit;
}
示例12: _pt
void CExtMiniDockFrameWnd::_ResizingUpdateState(
const CPoint & point
)
{
if( g_bInResizingUpdateState
|| m_ptLastResizing == point
)
return;
m_ptLastResizing = point;
g_bInResizingUpdateState = true;
CPoint _pt( point );
ASSERT( m_nResizingMode != HTNOWHERE );
CExtControlBar * pExtBar = GetControlBarExt();
ASSERT_VALID( pExtBar );
//BringWindowToTop();
CRect rcClient, rcClientOrg, rcWnd, rcWndOrg;
GetClientRect( &rcClient );
GetWindowRect( &rcWnd );
rcClientOrg = rcClient;
rcWndOrg = rcWnd;
CSize sizeDiff =
rcWnd.Size() - rcClient.Size();
ASSERT( sizeDiff.cx >= 0 && sizeDiff.cy >= 0 );
CSize sizeNcDiff( sizeDiff );
int nCalcMinHW = pExtBar->_CalcDesiredMinHW();
int nCalcMinVH = pExtBar->_CalcDesiredMinVH();
if( sizeDiff.cx < nCalcMinHW )
sizeDiff.cx = nCalcMinHW;
if( sizeDiff.cy < nCalcMinVH )
sizeDiff.cy = nCalcMinVH;
UINT nHit = m_nResizingMode;
bool bLeft = false, bTop = false, bHorz = false,
bInvTop = false, bInvLeft = false;
CPoint ptOffsetWnd( 0, 0 );
if( pExtBar->IsFixedMode() )
{
switch( nHit )
{
case HTTOPLEFT:
case HTTOPRIGHT:
nHit = HTTOP;
break;
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
nHit = HTBOTTOM;
break;
} // switch( nHit )
switch( nHit )
{
case HTTOP:
_pt.y =
rcWndOrg.bottom
+ rcWndOrg.top - _pt.y;
nHit = HTBOTTOM;
bInvLeft = true;
bInvTop = true;
break;
case HTLEFT:
_pt.x =
rcWndOrg.right
+ rcWndOrg.left - _pt.x;
nHit = HTRIGHT;
bInvLeft = true;
bInvTop = true;
break;
} // switch( nHit )
} // if( pExtBar->IsFixedMode() )
if( bInvLeft || bInvTop || (!pExtBar->IsFixedMode()) )
{
CRect rcWnd( rcWndOrg );
ScreenToClient( & rcWnd );
if( bInvLeft || (!pExtBar->IsFixedMode()) )
ptOffsetWnd.x =
abs( rcWnd.left - rcClientOrg.left );
if( bInvTop || (!pExtBar->IsFixedMode()) )
ptOffsetWnd.y =
abs( rcWnd.top - rcClientOrg.top );
} // if( bInvLeft || bInvTop )
switch( nHit )
{
case HTLEFT:
bHorz = true;
rcWnd.left = min( _pt.x, rcWnd.right );
bLeft = true;
break;
case HTRIGHT:
bHorz = true;
rcWnd.right = max( _pt.x, rcWnd.left );
break;
case HTTOP:
rcWnd.top = min( _pt.y, rcWnd.bottom );
bTop = true;
break;
case HTTOPLEFT:
rcWnd.left = min( _pt.x, rcWnd.right );
//.........这里部分代码省略.........
示例13: OnNcPaint
void CExtMiniDockFrameWnd::OnNcPaint()
{
CExtControlBar * pExtBar =
GetControlBarExt();
bool bExtBar = false;
if( pExtBar != NULL
&& !pExtBar->m_bFixedMode
)
bExtBar = true;
CRect rcClient, rcBar;
GetClientRect(rcClient);
ClientToScreen(rcClient);
GetWindowRect(rcBar);
rcClient.OffsetRect(-rcBar.TopLeft());
rcBar.OffsetRect(-rcBar.TopLeft());
CWindowDC dc( this );
dc.ExcludeClipRect(rcClient);
CExtMemoryDC dcWin(&dc);
g_PaintManager->PaintDockingFrame(
dcWin,
rcBar,
rcClient,
true,
bExtBar
);
CString sCaption;
if( pExtBar != NULL )
pExtBar->GetWindowText(sCaption);
if( sCaption.IsEmpty() )
GetWindowText(sCaption);
CRect rcCapt( m_rcFrameCaption );
CRect rcText( m_rcFrameCaption );
rcText.right = m_rcBtnHideBar.left;
if( pExtBar != NULL )
{
INT nCountOfNcButtons = pExtBar->NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
{
CExtBarNcAreaButton * pBtn =
pExtBar->NcButtons_GetAt( nCountOfNcButtons - 1 );
const CRect & rcBtn = *pBtn;
rcText.right = rcBtn.left - 2;
if( rcText.left > rcText.right )
rcText.left = rcText.right;
} // if( nCountOfNcButtons > 0 )
}
bool bActive = false;
HWND hTmpWndFocus = ::GetFocus();
if( hTmpWndFocus != NULL
&& ( GetSafeHwnd() == hTmpWndFocus
|| ::IsChild( GetSafeHwnd(), hTmpWndFocus )
)
)
bActive = true;
rcText.DeflateRect(2,0);
g_PaintManager->PaintGripper(
dcWin,
rcCapt,
rcText,
bActive,
true,
false,
bExtBar,
sCaption.IsEmpty() ? NULL : (LPCTSTR)sCaption
);
if( pExtBar != NULL )
{
pExtBar->NcButtons_Paint( dcWin );
} // if( pExtBar != NULL )
else
{
bool bPushed = false, bEnabled = true;
g_PaintManager->PaintDockingCaptionButton(
dcWin,
m_rcBtnHideBar,
CExtPaintManager::__DCBT_CLOSE,
m_bBtnHideBar,
bPushed,
bEnabled,
bExtBar,
bActive
);
} // else from if( pExtBar != NULL )
}
示例14: AFX_MANAGE_STATE
void CExtMiniDockFrameWnd::_ResizingStart(
UINT nHitTest,
const CPoint & point
)
{
#ifdef _USRDLL
// If this is a DLL, need to set up MFC state
AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
ASSERT( m_nResizingMode == HTNOWHERE );
ASSERT( IsWindowVisible() );
CExtPopupMenuWnd::CancelMenuTracking();
CExtControlBar * pExtBar = GetControlBarExt();
ASSERT_VALID( pExtBar );
if( ( ! pExtBar->IsShowContentWhenDragging() )
// || pExtBar->m_bFixedMode
)
{
m_nResizingMode = HTNOWHERE;
pExtBar->m_pDockContext->StartResize(nHitTest, point);
return;
}
switch( nHitTest )
{
case HTLEFT:
case HTRIGHT:
case HTTOP:
case HTTOPLEFT:
case HTTOPRIGHT:
case HTBOTTOM:
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
m_nResizingMode = nHitTest;
break;
default:
return;
} // switch( nHitTest )
#ifdef _DEBUG
int nPos = 1;
CControlBar * pDebugDummyBar = NULL;
while(
pDebugDummyBar == NULL
&& nPos < m_wndDockBar.m_arrBars.GetSize()
)
pDebugDummyBar =
reinterpret_cast<CExtDockBar&>
(m_wndDockBar).
GetDockedControlBar(nPos++);
ASSERT(pDebugDummyBar != NULL);
ASSERT_KINDOF(CExtControlBar, pDebugDummyBar);
ASSERT(pDebugDummyBar->m_pDockContext != NULL);
// CBRS_SIZE_DYNAMIC toolbars cannot have the CBRS_FLOAT_MULTI style
ASSERT((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0);
#endif // _DEBUG
ASSERT( pExtBar == pDebugDummyBar );
ASSERT(pExtBar->m_pDockContext != NULL);
if( !pExtBar->m_bFixedMode )
ModifyStyle(__REMOVED_NONFIXMODE_STYLES, 0);
BringWindowToTop();
SetCapture();
GetWindowRect( &m_rcWndResizingStart );
while( m_nResizingMode != HTNOWHERE )
{
::WaitMessage();
MSG msg;
// Process all the messages in the message queue
while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) )
{
bool bStop = false;
switch( msg.message )
{
case WM_ACTIVATEAPP:
case WM_COMMAND:
bStop = true;
break;
default:
if( WM_KEYFIRST <= msg.message
&& msg.message <= WM_KEYLAST
)
bStop = true;
break;
} // switch( msg.message )
if( (!bStop) &&
GetCapture() != this
)
bStop = true;
if( bStop )
{
_ResizingEnd();
return;
}
if( !AfxGetApp()->PumpMessage() )
//.........这里部分代码省略.........
示例15: _pt
void CExtMiniDockFrameWnd::_ResizingUpdateState(
const CPoint & point
)
{
CPoint _pt(point);
ASSERT( m_nResizingMode != HTNOWHERE );
CExtControlBar * pExtBar = GetControlBarExt();
ASSERT_VALID( pExtBar );
// BringWindowToTop();
CRect rcClient, rcWnd, rcWndOrg;
GetClientRect(rcClient);
GetWindowRect(rcWnd);
rcWndOrg = rcWnd;
CSize sizeDiff = rcWnd.Size() - rcClient.Size();
ASSERT( sizeDiff.cx >= 0 && sizeDiff.cy >= 0 );
if( sizeDiff.cx < pExtBar->_CalcDesiredMinHW() )
sizeDiff.cx = pExtBar->_CalcDesiredMinHW();
if( sizeDiff.cy < pExtBar->_CalcDesiredMinVH() )
sizeDiff.cy = pExtBar->_CalcDesiredMinVH();
UINT nHit = m_nResizingMode;
bool bLeft=false, bTop=false, bHorz=false,
bInvTop=false, bInvLeft=false;
CPoint ptOffsetWnd(0,0);
if( pExtBar->m_bFixedMode )
{
switch( nHit )
{
case HTTOPLEFT:
case HTTOPRIGHT:
nHit = HTTOP;
break;
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
nHit = HTBOTTOM;
break;
} // switch( nHit )
switch( nHit )
{
case HTTOP:
// if( _pt.y > rcWndOrg.bottom )
// _pt.y = rcWndOrg.bottom;
_pt.y =
rcWndOrg.bottom
+ rcWndOrg.top - _pt.y;
nHit = HTBOTTOM;
bInvLeft = true;
bInvTop = true;
break;
case HTLEFT:
// if( _pt.x > rcWndOrg.right )
// _pt.x = rcWndOrg.right;
_pt.x =
rcWndOrg.right
+ rcWndOrg.left - _pt.x;
nHit = HTRIGHT;
bInvLeft = true;
bInvTop = true;
break;
} // switch( nHit )
} // if( pExtBar->m_bFixedMode )
if( bInvLeft || bInvTop || (!pExtBar->m_bFixedMode) )
{
CRect rcWnd;
CRect rcClient;
GetWindowRect( &rcWnd );
GetClientRect( &rcClient );
ScreenToClient( & rcWnd );
if( bInvLeft || (!pExtBar->m_bFixedMode) )
ptOffsetWnd.x =
abs( rcWnd.left - rcClient.left );
if( bInvTop || (!pExtBar->m_bFixedMode) )
ptOffsetWnd.y =
abs( rcWnd.top - rcClient.top );
} // if( bInvLeft || bInvTop )
switch( nHit )
{
case HTLEFT:
bHorz = true;
rcWnd.left = min(_pt.x,rcWnd.right);
bLeft = true;
break;
case HTRIGHT:
bHorz = true;
rcWnd.right = max(_pt.x,rcWnd.left);
break;
case HTTOP:
rcWnd.top = min(_pt.y,rcWnd.bottom);
bTop = true;
break;
case HTTOPLEFT:
rcWnd.left = min(_pt.x,rcWnd.right);
rcWnd.top = min(_pt.y,rcWnd.bottom);
bLeft = true;
bTop = true;
break;
case HTTOPRIGHT:
//.........这里部分代码省略.........