本文整理汇总了C++中CdIpmDoc类的典型用法代码示例。如果您正苦于以下问题:C++ CdIpmDoc类的具体用法?C++ CdIpmDoc怎么用?C++ CdIpmDoc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CdIpmDoc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTreeCtrl
void CvIpmLeft::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
CTreeCtrl& tree = GetTreeCtrl();
*pResult = 0; // default to allow expanding
CdIpmDoc* pDoc = (CdIpmDoc*)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
// Manage "update all after load on first action"
if (pDoc->GetPTreeGD()->CurrentlyLoading())
return;
if (pDoc->ManageMonSpecialState() || m_bProhibitActionOnTreeCtrl)
{
*pResult = 1; // do not allow expanding
return;
}
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
if (pNMTreeView->action == TVE_EXPAND)
{
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
CTreeItem *pItem;
pItem = (CTreeItem *)tree.GetItemData(hItem);
if (pItem && !pItem->IsAlreadyExpanded())
{
if (pItem->CreateSubBranches(hItem))
pItem->SetAlreadyExpanded(TRUE);
else
*pResult = 1; // prevent expanding
}
}
}
示例2: OnMenuReplicationChangeRunNode
void CvIpmLeft::OnMenuReplicationChangeRunNode()
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
pDoc->ItemReplicationServerChangeNode();
}
示例3: OnMenuForceRefresh
void CvIpmLeft::OnMenuForceRefresh()
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
pDoc->ForceRefresh();
}
示例4: OnMenuOpenServer
void CvIpmLeft::OnMenuOpenServer()
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
pDoc->ItemOpenServer();
}
示例5: OnMenuShutdown
void CvIpmLeft::OnMenuShutdown()
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
pDoc->ItemShutdown();
}
示例6: OnUpdateMenuReplicationChangeRunNode
void CvIpmLeft::OnUpdateMenuReplicationChangeRunNode(CCmdUI* pCmdUI)
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
BOOL bEnable = pDoc->IsEnabledItemReplicationServerChangeNode();
pCmdUI->Enable(bEnable);
}
示例7: OnUpdateMenuShutdown
void CvIpmLeft::OnUpdateMenuShutdown(CCmdUI* pCmdUI)
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
if (!pDoc)
return;
BOOL bEnable = pDoc->IsEnabledItemShutdown();
pCmdUI->Enable(bEnable);
}
示例8: GetClientRect
BOOL CIpmCtrl::Initiate(LPCTSTR lpszNode, LPCTSTR lpszServer, LPCTSTR lpszUser, LPCTSTR lpszOption)
{
BOOL bOK = FALSE;
if (m_pIpmFrame)
{
m_pIpmFrame->ShowWindow (SW_HIDE);
m_pIpmFrame->DestroyWindow();
m_pIpmFrame = NULL;
}
CWnd* pParent = this;
CRect r;
GetClientRect (r);
m_pIpmFrame = new CfIpmFrame();
m_pIpmFrame->Create (
NULL,
NULL,
WS_CHILD,
r,
pParent);
m_pIpmFrame->InitialUpdateFrame(NULL, TRUE);
m_pIpmFrame->ShowWindow(SW_HIDE);
CdIpmDoc* pDoc = m_pIpmFrame->GetIpmDoc();
ASSERT(pDoc);
if (pDoc)
{
CaIpmProperty& property = pDoc->GetProperty();
ConstructPropertySet (property);
UINT nMask = IPMMASK_TIMEOUT|IPMMASK_BKREFRESH|IPMMASK_SHOWGRID|IPMMASK_FONT|IPMMASK_MAXSESSION;
IPM_PropertiesChange((WPARAM)nMask, (LPARAM)&property);
theApp.SetRefreshFrequency(m_refreshFrequency);
theApp.SetActivateBkRefresh(m_activateRefresh);
theApp.StartBackgroundRefreshThread();
}
ASSERT(m_pIpmFrame); // Must create the window first
if (!m_pIpmFrame)
return FALSE;
if (pDoc)
{
SFILTER* pFilter = theApp.GetFilter();
SFILTER* pDocFilter = pDoc->GetFilter();
memcpy (pDocFilter, pFilter, sizeof(SFILTER));
bOK = pDoc->Initiate(lpszNode, lpszServer, lpszUser, lpszOption);
}
if (!bOK)
{
m_pIpmFrame->ShowWindow (SW_HIDE);
m_pIpmFrame->DestroyWindow();
m_pIpmFrame = NULL;
return bOK;
}
m_pIpmFrame->ShowWindow(SW_SHOW);
return bOK;
}
示例9: ASSERT
void CIpmCtrl::CollapseOne()
{
ASSERT(m_pIpmFrame); // Must create the window first
if (!m_pIpmFrame)
return;
CdIpmDoc* pDoc = m_pIpmFrame->GetIpmDoc();
ASSERT(pDoc);
if (pDoc)
pDoc->ItemCollapseOne();
}
示例10: OnDestroy
void CvIpmLeft::OnDestroy()
{
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
// delete itemdata associated with each item
pDoc->GetPTreeGD()->FreeAllTreeItemsData();
// standard management
CTreeView::OnDestroy();
}
示例11: GetParent
BOOL CuDlgIpmTabCtrl::ChangeTab()
{
int nSel;
CRect r;
CWnd* pNewPage;
CuPageInformation* pPageInfo;
CWnd* pParent1 = GetParent(); // The view: CImView2
ASSERT (pParent1);
CfIpmFrame* pFrame = (CfIpmFrame*)GetParentFrame(); // The Frame Window
ASSERT (pFrame);
CdIpmDoc* pDoc = (CdIpmDoc*)((CView*)pParent1)->GetDocument();
ASSERT (pDoc);
if (!pFrame->IsAllViewCreated())
return FALSE;
if (!m_pCurrentProperty)
return FALSE;
CWaitCursor doWaitCursor;
m_cTab1.GetClientRect (r);
m_cTab1.AdjustRect (FALSE, r);
nSel = m_cTab1.GetCurSel();
m_pCurrentProperty->SetCurSel(nSel);
pPageInfo = m_pCurrentProperty->GetPageInfo();
try
{
pNewPage = GetPage (pPageInfo->GetDlgID (nSel));
}
catch (CMemoryException* e)
{
theApp.OutOfMemoryMessage();
e->Delete();
return FALSE;
}
catch (CResourceException* e)
{
AfxMessageBox (IDS_E_LOAD_RESOURCE);//"Fail to load resource"
e->Delete();
return FALSE;
}
if (m_pCurrentPage)
m_pCurrentPage->ShowWindow (SW_HIDE);
m_pCurrentPage = pNewPage;
m_pCurrentPage->MoveWindow (r);
m_pCurrentPage->ShowWindow(SW_SHOW);
//
// Properties:
UINT nMask = IPMMASK_FONT|IPMMASK_SHOWGRID;
m_pCurrentPage->SendMessage (WMUSRMSG_CHANGE_SETTING, (WPARAM)nMask, (LPARAM)&(pDoc->GetProperty()));
//
// Update Data:
m_pCurrentPage->SendMessage (WM_USER_IPMPAGE_UPDATEING, (WPARAM)pDoc, (LPARAM)pPageInfo->GetUpdateParam());
return TRUE;
}
示例12: CdIpmDoc
SCODE CIpmCtrl::Loading(LPUNKNOWN pStream)
{
//
// 1) Destroy the old frame first:
// m_pIpmFrame->ShowWindow (SW_HIDE)
// m_pIpmFrame->DestroyWindow();
// delete m_pIpmFrame ?
// 2) Construct the Document from Stream.
// CdIpmDoc* pLoadedDoc = new CdIpmDoc();
// pLoadedDoc->SetData(pSream);
// 3) Create new Frame associated with the new Doc
// m_pIpmFrame = new CfIpmFrame (pLoadedDoc);
// m_pIpmFrame->Create (...)
// ...
// m_pIpmFrame->ShowWindow (SW_SHOW)
if (m_pIpmFrame && IsWindow(m_pIpmFrame->m_hWnd))
{
m_pIpmFrame->ShowWindow (SW_HIDE);
m_pIpmFrame->DestroyWindow();
m_pIpmFrame = NULL;
}
CdIpmDoc* pDoc = new CdIpmDoc();
IStream* pSream = (IStream*)pStream;
BOOL bOK = pDoc->SetData(pSream);
if (!bOK)
{
delete pDoc;
return S_FALSE;
}
CaIpmProperty& property = pDoc->GetProperty();
ConstructPropertySet (property);
CWnd* pParent = this;
CRect r;
GetWindowRect (r);
m_pIpmFrame = new CfIpmFrame(pDoc);
m_pIpmFrame->Create (
NULL,
NULL,
WS_CHILD,
r,
pParent);
m_pIpmFrame->InitialUpdateFrame(pDoc, TRUE);
m_pIpmFrame->ShowWindow(SW_SHOW);
return bOK? S_OK: S_FALSE;
}
示例13: GetParentFrame
void CuDlgIpmDetailNetTrafic::OnButtonStartup()
{
m_cEditTimeStamp.SetWindowText("Startup");
m_bStartup = TRUE;
if (m_bRefresh)
{
CWnd* pParent1 = GetParentFrame(); // Frame of CFormView
CfIpmFrame* pParent2 = (CfIpmFrame*)pParent1->GetParentFrame();
CdIpmDoc* pDoc = pParent2->GetIpmDoc();
if (pDoc)
{
if (!pDoc->ManageMonSpecialState())
pDoc->ForceRefresh();
}
}
UpdateData(FALSE);
}
示例14: OnInitialUpdate
void CvIpmLeft::OnInitialUpdate()
{
CTreeView::OnInitialUpdate();
CdIpmDoc* pDoc = (CdIpmDoc *)GetDocument();
ASSERT(pDoc);
CTreeCtrl &tree = GetTreeCtrl();
pDoc->GetPTreeGD()->SetPTree(&tree);
CaIpmProperty& property = pDoc->GetProperty();
tree.SendMessage (WM_SETFONT, (WPARAM)property.GetFont(), MAKELPARAM(TRUE, 0));
if (pDoc->IsLoadedDoc())
{
//
// Recreate tree lines from serialization data
pDoc->GetPTreeGD()->FillTreeFromSerialList();
}
}
示例15: FirePropertyChange
void CIpmCtrl::NotifySettingChange(UINT nMask)
{
FirePropertyChange();
if (m_pIpmFrame && IsWindow (m_pIpmFrame->m_hWnd))
{
CdIpmDoc* pDoc = m_pIpmFrame->GetIpmDoc();
ASSERT(pDoc);
if (pDoc)
{
CaIpmProperty& property = pDoc->GetProperty();
ConstructPropertySet (property);
m_pIpmFrame->PostMessage(WMUSRMSG_CHANGE_SETTING, (WPARAM)nMask, (LPARAM)&property);
}
return;
}
CaIpmProperty property;
ConstructPropertySet (property);
IPM_PropertiesChange((WPARAM)nMask, (LPARAM)&property);
}