本文整理汇总了C++中CDockBar::ClientToScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ CDockBar::ClientToScreen方法的具体用法?C++ CDockBar::ClientToScreen怎么用?C++ CDockBar::ClientToScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDockBar
的用法示例。
在下文中一共展示了CDockBar::ClientToScreen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToggleDocking
void CDockContext::ToggleDocking()
{
if (m_pBar->IsFloating())
{
// Dock it only if is allowed to be docked
if (m_pBar->m_dwDockStyle & CBRS_ALIGN_ANY)
{
ASSERT((m_uMRUDockID >= AFX_IDW_DOCKBAR_TOP &&
m_uMRUDockID <= AFX_IDW_DOCKBAR_BOTTOM) ||
m_uMRUDockID == 0);
CRect rect = m_rectMRUDockPos;
CDockBar* pDockBar = NULL;
if (m_uMRUDockID != 0)
{
pDockBar = (CDockBar*)m_pDockSite->GetControlBar(m_uMRUDockID);
pDockBar->ClientToScreen(&rect);
}
// dock it at the specified position, RecalcLayout will snap
m_pDockSite->ReDockControlBar(m_pBar, pDockBar, &rect);
m_pDockSite->RecalcLayout();
}
}
else
{
CPoint ptFloat = m_ptMRUFloatPos;
if (ptFloat.x < 0 || ptFloat.y < 0)
{
ptFloat = m_rectMRUDockPos.TopLeft();
m_pBar->GetParent()->ClientToScreen(&ptFloat);
}
m_pDockSite->FloatControlBar(m_pBar, ptFloat, m_dwMRUFloatStyle);
}
}
示例2: PreTranslateMessage
//*******************************************************************************************
BOOL CBCGOleDocIPFrameWnd::PreTranslateMessage(MSG* pMsg)
{
switch (pMsg->message)
{
case WM_KEYDOWN:
if (!CBCGFrameImpl::IsHelpKey (pMsg) &&
m_Impl.ProcessKeyboard ((int) pMsg->wParam))
{
return TRUE;
}
break;
case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_RBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK:
{
CPoint pt (BCG_GET_X_LPARAM(pMsg->lParam), BCG_GET_Y_LPARAM(pMsg->lParam));
CWnd* pWnd = CWnd::FromHandle(pMsg->hwnd);
if (!::IsWindow (pMsg->hwnd))
{
return TRUE;
}
if (pWnd != NULL)
{
pWnd->ClientToScreen (&pt);
}
if (m_Impl.ProcessMouseClick (pMsg->message, pt, pMsg->hwnd))
{
return TRUE;
}
if (!::IsWindow (pMsg->hwnd))
{
return TRUE;
}
if (pMsg->message == WM_RBUTTONUP &&
!CBCGToolBar::IsCustomizeMode ())
{
//---------------------------------------
// Activate the control bar context menu:
//---------------------------------------
CDockBar* pBar = DYNAMIC_DOWNCAST(CDockBar, pWnd);
if (pBar != NULL)
{
CPoint pt;
pt.x = BCG_GET_X_LPARAM(pMsg->lParam);
pt.y = BCG_GET_Y_LPARAM(pMsg->lParam);
pBar->ClientToScreen(&pt);
SendMessage (BCGM_TOOLBARMENU,
(WPARAM) GetSafeHwnd (),
MAKELPARAM (pt.x, pt.y));
}
}
}
break;
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONUP:
if (m_Impl.ProcessMouseClick (pMsg->message,
CPoint (BCG_GET_X_LPARAM(pMsg->lParam), BCG_GET_Y_LPARAM(pMsg->lParam)),
pMsg->hwnd))
{
return TRUE;
}
break;
case WM_MOUSEMOVE:
{
CPoint pt (BCG_GET_X_LPARAM(pMsg->lParam), BCG_GET_Y_LPARAM(pMsg->lParam));
CWnd* pWnd = CWnd::FromHandle(pMsg->hwnd);
if (pWnd != NULL)
{
pWnd->ClientToScreen (&pt);
}
if (m_Impl.ProcessMouseMove (pt))
{
return TRUE;
}
}
}
return CFrameWnd::PreTranslateMessage(pMsg);
//.........这里部分代码省略.........