本文整理汇总了C++中CDocument::IsKindOf方法的典型用法代码示例。如果您正苦于以下问题:C++ CDocument::IsKindOf方法的具体用法?C++ CDocument::IsKindOf怎么用?C++ CDocument::IsKindOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDocument
的用法示例。
在下文中一共展示了CDocument::IsKindOf方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetActiveDocument
CGrannyViewerDoc * CMainFrame::GetDocument(void)
{
CDocument* pDoc = GetActiveDocument();
if (pDoc && pDoc->IsKindOf(RUNTIME_CLASS(CGrannyViewerDoc)))
return dynamic_cast<CGrannyViewerDoc*>(pDoc);
return NULL;
}
示例2: DrawItem
void CMDITabsDialogBar::DrawItem(LPDRAWITEMSTRUCT pdis)
{
CRect rc = pdis->rcItem;
int nTabIndex = pdis->itemID;
bool fSelected = (nTabIndex == GetCurSel());
ODA_DRAWENTIRE;
char label[64];
TCITEM tci;
tci.mask = TCIF_TEXT | TCIF_PARAM;
tci.pszText = label;
tci.cchTextMax = ARRAYSIZE(label);
if (GetItem(nTabIndex, &tci))
{
CMDITabChildWnd *pActive = reinterpret_cast<CMDITabChildWnd*>(tci.lParam);
CDC dc;
dc.Attach(pdis->hDC);
int iIndex = _GetBitmapIndex(pActive->GetTabType());
CExtBitmap &bitmapToUse = fSelected ? _tabBitmap[iIndex] : _tabBitmapNS[iIndex];
CRect rcSrc(CPoint(0, 0), bitmapToUse.GetSize());
//CRect rcPadding(2, 2, 2, 2);
CRect rcPadding(0, 0, 0, 0);
bitmapToUse.AlphaBlendSkinParts(pdis->hDC, rc, rcSrc, rcPadding, /*__EXT_BMP_FLAG_PREMULTIPLIED_RGB_CHANNELS |*/ CExtBitmap::__EDM_STRETCH, true, true, 0xFF);
// Use a different font decoration depending on if this is the most recent version of this item.
bool fNotMostRecent = false;
CDocument *pDocAny = pActive->GetActiveDocument();
if (pDocAny && pDocAny->IsKindOf(RUNTIME_CLASS(CResourceDocument)))
{
CResourceDocument *pDoc = static_cast<CResourceDocument*>(pDocAny);
fNotMostRecent = !theApp._resourceRecency.IsResourceMostRecent(pDoc);
}
if (fNotMostRecent)
{
// Draw a diagonal line across the thing.
dc.MoveTo(rc.TopLeft());
dc.LineTo(rc.BottomRight());
}
rc.OffsetRect(4, 1); // indent
COLORREF crText = RGB(0, 0, 0); // g_PaintManager->PAINTPUSHBUTTONDATA::m_clrForceTextNormal; // green in release, black in debug!
int nOldText = dc.SetTextColor(crText);
int nOldBk = dc.SetBkMode(TRANSPARENT);
dc.DrawText(tci.pszText, -1, &rc, DT_SINGLELINE);
dc.SetBkMode(nOldBk);
dc.SetTextColor(nOldText);
dc.Detach();
}
}
示例3: OnImageLevel
void CLevelApp::OnImageLevel()
{
CDocument* pDoc = PIGetActiveDocument();
if (pDoc == NULL)
return;
if (!pDoc->IsKindOf(RUNTIME_CLASS(CPIDocument)))
return;
CLevelDlg dlg;
dlg.DoModal();
// CLevelDlg* pDlg = new CLevelDlg;
// PIDockablePane(pDlg, _T("Test"));
}
示例4: OnImageInverse
void CProcessApp::OnImageInverse()
{
CDocument* pDoc = PIGetActiveDocument();
if (pDoc == NULL)
return;
if (!pDoc->IsKindOf(RUNTIME_CLASS(CPIDocument)))
return;
CImage* pImage = ((CPIDocument*)pDoc)->GetImage();
if (pImage == NULL)
return;
AfxBeginThread(InverseThread, pImage);
}
示例5:
CDocument *CMDITabsDialogBar::_GetIfKindOf(int i, const CRuntimeClass* pClass, CMDITabChildWnd **pActive) const
{
CDocument *pDoc = NULL;
TCITEM tcitem = { 0 };
tcitem.mask = TCIF_PARAM;
if (GetItem(i, &tcitem))
{
*pActive = reinterpret_cast<CMDITabChildWnd*>(tcitem.lParam);
CDocument *pDocQ = (*pActive)->GetActiveDocument();
if (pDocQ->IsKindOf(pClass))
{
pDoc = pDocQ;
}
}
return pDoc;
}
示例6: get_Count
STDMETHODIMP CFWDocuments::get_Count(long *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if(!m_pApp)
return E_FAIL;
*pVal = 0;
int nIndex = 0;
POSITION pos = m_pApp->GetFirstDocTemplatePosition();
while (pos)
{
CDocTemplate* pTemplate = (CDocTemplate*)m_pApp->GetNextDocTemplate(pos);
POSITION pos2 = pTemplate->GetFirstDocPosition();
while (pos2)
{
CDocument* pDoc = pTemplate->GetNextDoc(pos2);
if(pDoc->IsKindOf(RUNTIME_CLASS(FW_Document)))
(*pVal)++;
}
}
return S_OK;
}
示例7: OnCreateObject
CCmdTarget* COleTemplateServer::OnCreateObject()
{
ASSERT_VALID(this);
ASSERT_VALID(m_pDocTemplate);
// save application user control status
BOOL bUserCtrl = AfxOleGetUserCtrl();
// create invisible doc/view/frame set
CDocument* pDoc = m_pDocTemplate->OpenDocumentFile(NULL, FALSE);
// restore application's user control status
AfxOleSetUserCtrl(bUserCtrl);
if (pDoc != NULL)
{
ASSERT_VALID(pDoc);
ASSERT(pDoc->IsKindOf(RUNTIME_CLASS(CDocument)));
// all new documents created by OLE start out modified
pDoc->SetModifiedFlag();
}
return pDoc;
}
示例8: GetGumpDocument
CGumpEditorDoc* CMainFrame::GetGumpDocument()
{
CDocument* pDoc = GetActiveDocument();
if (pDoc && pDoc->IsKindOf(RUNTIME_CLASS(CGumpEditorDoc))) return (CGumpEditorDoc*)pDoc;
return NULL;
}