7
: CView
1.
2. - cview
3.
, CDocument, , , CView, . , CView, , .
³ , , . SDI , MDI MDI. , OLE ( '), , . , , (, (split window)).
, , , . , , . , , .
, , , . , , .
, , - , , - :
class CZoomView: public CView
{
protected:
CZoomView ();
DECLARE_DYNCREATE(CZoomView)
public:
CZoomableDoc* GetDocument();
WORD m_wZoomPercent;
}
, -, , -, . (current selection) ' , . , , , , , ( OLE drag-and-drop).
. , :
class CSelectableView: public CView {
//
CList <CDocItem *, CDocItera *> m_SelectList;
//
}
, -, 䳿 (, ). , - OnDraw . OnDraw , , , -.
|
|
, COleDocument CDocItern, - OnDraw , , :
void COleCapView::OnDraw(CDC *PDC)
{
COLECapDoc *pDoc = GetDocument();
ASSERT_VALID{pDoc);
POSITION posDoc = pDoc->GetStartPosition();
while (posDoc!= NULL)
{
CDocItem *pObject = pDoc->GetNextItem(posDoc);
if <PObject->IsKindOf (RUNTIME_CLASS (CNorrnDocItem)))
(
((CNorrnDocItem *)pObject)->Draw(pDc);
}
else if (pObject->IsKindOf(RUNTIME_CLASS{COleDocItem)))
{
((COleDocItem *)pObject)->Draw(pDc);
} else
ASSERT(FALSE);
}
}