本文整理汇总了C++中CDockBar::ScreenToClient方法的典型用法代码示例。如果您正苦于以下问题:C++ CDockBar::ScreenToClient方法的具体用法?C++ CDockBar::ScreenToClient怎么用?C++ CDockBar::ScreenToClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDockBar
的用法示例。
在下文中一共展示了CDockBar::ScreenToClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetPosition
void CLogo::SetPosition()
{
if(!::IsWindow(m_hWnd))
return;
CDockBar* pTopDockBar = GetParentDockBar();
if(!pTopDockBar)
return;
CRect TopDockBarRect;
pTopDockBar->GetClientRect(TopDockBarRect);
CRect LogoRect;
GetWindowRect(LogoRect);
pTopDockBar->ScreenToClient(LogoRect);
int nLeft = TopDockBarRect.right-LogoRect.Width()-::GetSystemMetrics(SM_CXEDGE);
int nTop = TopDockBarRect.top;
if(nLeft != LogoRect.left ||
nTop != LogoRect.top)
SetWindowPos(NULL,
nLeft,
nTop,
0,
0,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE);
CRect UnionToolbarRect;
for(int nI=0;nI<pTopDockBar->m_arrBars.GetSize();nI++)
{
CWnd* pWnd = static_cast<CWnd*>(pTopDockBar->m_arrBars[nI]);
if(!pWnd ||
!AfxIsValidAddress(pWnd,sizeof(CWnd)) ||
!::IsWindow(*pWnd))
continue;
CRect ToolBarRect;
pWnd->GetWindowRect(&ToolBarRect);
UnionToolbarRect.UnionRect(UnionToolbarRect,ToolBarRect);
}
GetWindowRect(LogoRect);
UnionToolbarRect.IntersectRect(UnionToolbarRect,LogoRect);
if(UnionToolbarRect.IsRectEmpty())
{
if(!IsWindowVisible())
ShowWindow(SW_SHOW);
}
else
{
if(IsWindowVisible())
ShowWindow(SW_HIDE);
}
}
示例2: EndDrag
void CGuiDockContext::EndDrag()
{
CancelLoop();
if (m_dwOverDockStyle != 0)
{
CDockBar* pDockBar = GetDockBar(m_dwOverDockStyle);
ASSERT(pDockBar != NULL);
CRect rect = (m_dwOverDockStyle & CBRS_ORIENT_VERT) ?
m_rectDragVert : m_rectDragHorz;
UINT uID = _AfxGetDlgCtrlID(pDockBar->m_hWnd);
if (uID >= AFX_IDW_DOCKBAR_TOP &&
uID <= AFX_IDW_DOCKBAR_BOTTOM)
{
m_uMRUDockID = uID;
m_rectMRUDockPos = rect;
pDockBar->ScreenToClient(&m_rectMRUDockPos);
}
// dock it at the specified position, RecalcLayout will snap
m_pDockSite->DockControlBar(m_pBar, pDockBar, &rect);
m_pDockSite->RecalcLayout();
}
else if ((m_dwStyle & CBRS_SIZE_DYNAMIC) || (HORZF(m_dwStyle) && !m_bFlip) ||
(VERTF(m_dwStyle) && m_bFlip))
{
m_dwMRUFloatStyle = CBRS_ALIGN_TOP | (m_dwDockStyle & CBRS_FLOAT_MULTI);
m_ptMRUFloatPos = m_rectFrameDragHorz.TopLeft();
m_pDockSite->FloatControlBar(m_pBar, m_ptMRUFloatPos, m_dwMRUFloatStyle);
}
else // vertical float
{
m_dwMRUFloatStyle = CBRS_ALIGN_LEFT | (m_dwDockStyle & CBRS_FLOAT_MULTI);
m_ptMRUFloatPos = m_rectFrameDragVert.TopLeft();
m_pDockSite->FloatControlBar(m_pBar, m_ptMRUFloatPos, m_dwMRUFloatStyle);
}
}