《C语言实例教程(PDF格式)》第107章



arTextOut(0;yval;pDoc…》data_string'loop_index';
pDoc…》data_string'loop_index'。GetLength());
yval+=tm。tmHeight;

// TODO: add draw code for native data here

/////////////////////////////////////////////////////////////////////////////
// CMdiView printing
// CMdiView diagnostics
// 。。。
#ifdef _DEBUG
void CMdiView::AssertValid() const

CView::AssertValid();

// 。。。
// CMdiView message handlers
…………………………………………………………Page 508……………………………………………………………
void CMdiView::OnChar(UINT nChar; UINT nRepCnt; UINT nFlags)

// TODO: Add your message handler code here and/or call default
CMdiDoc *pDoc=GetDocument();
CClientDC dc(this);
OnPrepareDC(&dc);
if(nChar=="r"){
pDoc…》line_number++;

else{
pDoc…》data_string'pDoc…》line_number'+=nChar;
TEXTMETRIC tm;
dc。GetTextMetrics(&tm);
dc。TextOut(0;(int)pDoc…》line_number*tm。tmHeight;
pDoc…》data_string'pDoc…》line_number';
pDoc…》data_string'pDoc…》line_number'。GetLength());

pDoc…》UpdateAllViews(this;0l;NULL);
pDoc…》SetModifiedFlag();
CView::OnChar(nChar; nRepCnt; nFlags);

void CMdiView::OnUpdate(CView* pSender; LPARAM lHint; CObject* pHint)

// TODO: Add your specialized code here and/or call the base class
Invalidate();

…………………………………………………………Page 509……………………………………………………………
void CMdiView::OnInitialUpdate()

CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class

// Mdi。h : main header file for the MDI application
#if !defined(AFX_MDI_H__6A6E4EF9_1FC8_11D2_BC8B_E95B8191F13C__INCLUDED_)
// 。。。
/////////////////////////////////////////////////////////////////////////////
// CMdiApp:
// See Mdi。cpp for the implementation of this class
//
class CMdiApp : public CWinApp

public:
CMdiApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMdiApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// 。。。
DECLARE_MESSAGE_MAP()
};
// 。。。
…………………………………………………………Page 510……………………………………………………………
#endif // !defined(AFX_MDI_H__6A6E4EF9_1FC8_11D2_BC8B_E95B8191F13C__INCLUDED_)
// Mdi。cpp : Defines the class behaviors for the application。
#include 〃stdafx。h〃
#include 〃Mdi。h〃
#include 〃MdiSplitFrm。h〃
#include 〃MainFrm。h〃
// 。。。
// CMdiApp
// 。。。
// CMdiApp construction
// 。。。
// The one and only CMdiApp object
CMdiApp theApp;
// CMdiApp initialization
// 。。。
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MDITYPE;
RUNTIME_CLASS(CMdiDoc);
RUNTIME_
小说推荐
返回首页返回目录