【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,fullServerView.cpp,希望对大家有所帮助!
// fullServerView.cpp : CfullServerView 类的实现
//
#include "stdafx.h"
#include "fullServer.h"
#include "fullServerDoc.h"
#include "fullServerView.h"
#include ".\fullserverview.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CfullServerView
IMPLEMENT_DYNCREATE(CfullServerView, CView)
BEGIN_MESSAGE_MAP(CfullServerView, CView)
// 标准打印命令
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_CANCEL_EDIT_SRVR, OnCancelEditSrvr)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
ON_WM_CHAR()
END_MESSAGE_MAP()
// CfullServerView 构造/析构
CfullServerView::CfullServerView()
{
// TODO: 在此处添加构造代码
}
CfullServerView::~CfullServerView()
{
}
BOOL CfullServerView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或
// 样式
return CView::PreCreateWindow(cs);
}
// CfullServerView 绘制
void CfullServerView::OnDraw(CDC* pDC)
{
CfullServerDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CBrush cb;
cb.CreateHatchBrush (3,pDoc->m_Color );
CBrush *pOld=pDC->SelectObject (&cb);
CRect rect;
GetClientRect(rect);
pDC->Ellipse(rect);
pDC->SelectObject (pOld);
// TODO: 在此处为本机数据添加绘制代码
}
// CfullServerView 打印
BOOL CfullServerView::OnPreparePrinting(CPrintInfo* pInfo)
{
// 默认准备
return DoPreparePrinting(pInfo);
}
void CfullServerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印前添加额外的初始化
}
void CfullServerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印后添加清除过程
}
// OLE 服务器支持
// 以下命令处理程序提供了标准键盘
// 用户界面以取消就地编辑会话。此处,
// 服务器(而不是容器)将导致停用
void CfullServerView::OnCancelEditSrvr()
{
GetDocument()->OnDeactivateUI(FALSE);
}
// CfullServerView 诊断
#ifdef _DEBUG
void CfullServerView::AssertValid() const
{
CView::AssertValid();
}
void CfullServerView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CfullServerDoc* CfullServerView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CfullServerDoc)));
return (CfullServerDoc*)m_pDocument;
}
#endif //_DEBUG
// CfullServerView 消息处理程序
void CfullServerView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
if(nChar>=0&&nChar<=128)
GetDocument()->m_str +=(char)nChar;
Invalidate();
CView::OnChar(nChar, nRepCnt, nFlags);
}