本文整理汇总了C++中COleClientItem类的典型用法代码示例。如果您正苦于以下问题:C++ COleClientItem类的具体用法?C++ COleClientItem怎么用?C++ COleClientItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了COleClientItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDocument
void CCodeHighLightView::OnDestroy()
{
// 停用处于析构中的项;这在
// 使用拆分器视图时非常重要
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
{
pActiveItem->Deactivate();
ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
CSynEditView::OnDestroy();
}
示例2: GetDocument
void CTinyCADView::OnDestroy()
{
// 析构时停用此项;这在
// 使用拆分视图时非常重要
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
{
pActiveItem->Deactivate();
ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
CTinyCADZoomView::OnDestroy();
}
示例3: GetDocument
void CABMOfficeSystemcppView::OnDestroy()
{
// Deactivate the item on destruction; this is important
// when a splitter view is being used
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
{
pActiveItem->Deactivate();
ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
CView::OnDestroy();
}
示例4: GetActiveView
void CRibbonSampleCntrItem::OnActivate()
{
// allow only one inplace active item per frame
CView* pView = GetActiveView();
ASSERT_VALID(pView);
COleClientItem* pItem = GetDocument()->GetInPlaceActiveItem(pView);
if (pItem != NULL && pItem != this)
pItem->Close();
ActiveStateChanged(TRUE);
COleClientItem::OnActivate();
}
示例5: GetActiveView
void CRectItem::OnActivate()
{
// allow only one inplace active item per frame
CMainView* pView = GetActiveView();
ASSERT_VALID(pView);
COleClientItem* pItem = GetDocument()->GetInPlaceActiveItem(pView);
if (pItem != NULL && pItem != this)
pItem->Close();
COleClientItem::OnActivate();
// set selection to an item when it becomes active
pView->SetSelection(this);
}
示例6: GetStartPosition
void COleDocument::CommitItems(BOOL bSuccess)
{
// special 'Commit' phase for COleClientItem items
POSITION pos = GetStartPosition();
COleClientItem* pItem;
while ((pItem = GetNextClientItem(pos)) != NULL)
{
// calling CommitItem with FALSE causes the object to revert
// to the original storage. Calling CommitItem TRUE causes
// the item to adopt the new storage created in the Serialize
// function.
pItem->CommitItem(bSuccess);
}
}
示例7:
STDMETHODIMP COlePropertiesDialog::XOleUIObjInfo::ConvertObject(
DWORD dwObject, REFCLSID clsidNew)
{
COleClientItem* pItem = (COleClientItem*)dwObject;
ASSERT_VALID(pItem);
if (!pItem->ConvertTo(clsidNew))
{
AfxMessageBox(AFX_IDP_FAILED_TO_CONVERT,
MB_OK | MB_ICONEXCLAMATION);
return E_FAIL;
}
return S_OK;
}
示例8: GetStartPosition
void COleDocument::OnUpdateEditLinksMenu(CCmdUI* pCmdUI)
{
POSITION pos = GetStartPosition();
COleClientItem* pItem;
while ((pItem = GetNextClientItem(pos)) != NULL)
{
if (pItem->GetType() == OT_LINK)
{
// we found a link!
pCmdUI->Enable(TRUE);
return;
}
}
pCmdUI->Enable(FALSE); // no links today
}
示例9: ASSERT_VALID
void COleDocument::UpdateModifiedFlag()
{
ASSERT_VALID(this);
POSITION pos = GetStartPosition();
COleClientItem* pItem;
while ((pItem = GetNextClientItem(pos)) != NULL)
{
if (pItem->IsModified())
{
SetModifiedFlag();
break;
}
}
}
示例10: OnLButtonDown
void CDrawTool::OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint& point)
{
// deactivate any in-place active item on this view!
COleClientItem* pActiveItem = pView->GetDocument()->GetInPlaceActiveItem(pView);
if (pActiveItem != NULL)
{
pActiveItem->Close();
ASSERT(pView->GetDocument()->GetInPlaceActiveItem(pView) == NULL);
}
pView->SetCapture();
c_nDownFlags = nFlags;
c_down = point;
c_last = point;
}
示例11:
STDMETHODIMP CRichToolTipCtrl::XRichEditOleCallback::GetNewStorage(LPSTORAGE* ppstg)
{
// Create a flat storage and steal it from the client item
// the client item is only used for creating the storage
COleClientItem item;
item.GetItemStorageFlat();
*ppstg = item.m_lpStorage;
HRESULT hRes = E_OUTOFMEMORY;
if (item.m_lpStorage != NULL)
{
item.m_lpStorage = NULL;
hRes = S_OK;
}
return hRes;
}
示例12: GetDocument
// 在就地编辑一个对象时,容器需要对 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);
}
示例13: 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);
}
示例14: GetStartPosition
void COleDocument::DeleteContents()
{
// deletes all COleClientItem objects in the doc item list
// (Note: doesn't touch server items or other docitems)
POSITION pos = GetStartPosition();
COleClientItem* pItem;
while ((pItem = GetNextClientItem(pos)) != NULL)
{
if (pItem->m_lpObject != NULL)
{
pItem->Release(OLECLOSE_NOSAVE); // release OLE object
RemoveItem(pItem); // disconnect from document
pItem->InternalRelease(); // may 'delete pItem'
}
}
}
示例15: ourDrawRelation
void CDrawTool::ourDrawRelation(CDrawView* pView, const CPoint& entryPoint,const CPoint& point, const CString &Name)
{
COleClientItem* pActiveItem = pView->GetDocument()->GetInPlaceActiveItem(pView);
if (pActiveItem != NULL)
{
pActiveItem->Close();
ASSERT(pView->GetDocument()->GetInPlaceActiveItem(pView) == NULL);
}
CPoint local;
local.SetPoint(point.x,point.y);
CDrawRect* pObj = new CDrawRect(CRect(entryPoint, local),Name);
pObj->m_nShape = CDrawRect::line;
pView->GetDocument()->Add(pObj);
pView->Select(pObj);
pView->OnObjectMoveToBack();
CDrawTool::c_drawShape = selection;
}