本文整理汇总了C++中COleClientItem::GetInPlaceWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ COleClientItem::GetInPlaceWindow方法的具体用法?C++ COleClientItem::GetInPlaceWindow怎么用?C++ COleClientItem::GetInPlaceWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COleClientItem
的用法示例。
在下文中一共展示了COleClientItem::GetInPlaceWindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnUpdateFrameMenu
//****************************************************************************
void CBCGPFrameWnd::OnUpdateFrameMenu (HMENU hMenuAlt)
{
CFrameWnd::OnUpdateFrameMenu (hMenuAlt);
BOOL bIsMenuBar = m_Impl.m_pMenuBar != NULL &&
(m_Impl.m_pMenuBar->GetStyle () & WS_VISIBLE);
BOOL bIsRibbon = FALSE;
#ifndef BCGP_EXCLUDE_RIBBON
if (m_Impl.m_pRibbonBar != NULL &&
(m_Impl.m_pRibbonBar->GetStyle () & WS_VISIBLE))
{
bIsRibbon = TRUE;
}
#endif
if (bIsMenuBar || bIsRibbon)
{
COleClientItem* pActiveItem = GetInPlaceActiveItem ();
if (pActiveItem == NULL ||
pActiveItem->GetInPlaceWindow () == NULL)
{
SetMenu (NULL);
}
else
{
SetMenu (CMenu::FromHandle (hMenuAlt));
}
}
}
示例2: GetDocument
// Special handling of OnSetFocus and OnSize are required for a container
// when an object is being edited in-place.
void CMy1553View::OnSetFocus(CWnd* pOldWnd)
{
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL &&
pActiveItem->GetItemState() == COleClientItem::activeUIState)
{
// need to set focus to this item if it is in the same view
CWnd* pWnd = pActiveItem->GetInPlaceWindow();
if (pWnd != NULL)
{
pWnd->SetFocus(); // don't call the base class
return;
}
}
CView::OnSetFocus(pOldWnd);
}
示例3: OnSetFocus
// 在就地编辑一个对象时,容器需要对 OnSetFocus 和 OnSize
// 进行特殊处理
void CClientView::OnSetFocus(CWnd* pOldWnd)
{
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL &&
pActiveItem->GetItemState() == COleClientItem::activeUIState)
{
// 如果该项处于同一视图中,则需要将焦点设置到该项
CWnd* pWnd = pActiveItem->GetInPlaceWindow();
if (pWnd != NULL)
{
pWnd->SetFocus(); // 不要调用基类
return;
}
}
CView::OnSetFocus(pOldWnd);
}