view.h
来源:互联网 发布:windows note 编辑:程序博客网 时间:2024/06/05 03:49
// sxView.cpp : implementation of the CSxView class
//
#include "stdafx.h"
#include "sx.h"
#include "sxDoc.h"
#include "sxView.h"
#include"student.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSxView
IMPLEMENT_DYNCREATE(CSxView, CView)
BEGIN_MESSAGE_MAP(CSxView, CView)
//{{AFX_MSG_MAP(CSxView)
ON_WM_LBUTTONDOWN()
ON_WM_RBUTTONDOWN()
ON_COMMAND(AFX_ID_add, OnIDadd)
ON_COMMAND(AFX_ID_jianshao, OnIDjianshao)
ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSxView construction/destruction
CSxView::CSxView()
{
// TODO: add construction code here
num=0;
r=10;
}
CSxView::~CSxView()
{
}
BOOL CSxView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CSxView drawing
void CSxView::OnDraw(CDC* pDC)
{
CSxDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
//str.Format("计数%d",pDoc->num);
//pDC->TextOut(1,1,str);
/* int i=1,x=10,y=10,temp=10;
for(;i<101;++i)
{
str.Format("%d",i);
pDC->TextOut(x,y,str);
x+=30;
if(i==temp)
{
y+=30;
temp+=10;
x=10;
}
}
*/
student st1("找高三",100);
st1.Display(pDC,20,20);
}
/////////////////////////////////////////////////////////////////////////////
// CSxView printing
BOOL CSxView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CSxView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CSxView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CSxView diagnostics
#ifdef _DEBUG
void CSxView::AssertValid() const
{
CView::AssertValid();
}
void CSxView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CSxDoc* CSxView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSxDoc)));
return (CSxDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSxView message handlers
void CSxView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CSxDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
++pDoc->num;
pDoc->SetModifiedFlag();
this->Invalidate();
CDC*pDC=GetDC();
pDC->Ellipse(point.x-r,point.y-r,point.x+r,point.y+r);
CView::OnLButtonDown(nFlags, point);
CStudentRecordSet rs;
rs.Open();
rs AddNew();
rs.m_ID="001"
rs.m_Name="张三";
rs.m_
}
void CSxView::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CSxDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
--pDoc->num;
pDoc->SetModifiedFlag();
this->Invalidate();
CView::OnRButtonDown(nFlags, point);
}
void CSxView::OnIDadd()
{
// TODO: Add your command handler code here
r+=10;
//this->Invalidate();
}
void CSxView::OnIDjianshao()
{
// TODO: Add your command handler code here
r-=10;
}
void CSxView::OnEditUndo()
{
// TODO: Add your command handler code here
this->Invalidate();
}
- view.h
- view.h
- 包含View.h之前要包含Doc.h
- Oracle+Materialized+View+(物化视图) (to H)
- StatusBar expand View,按H/W Back KEY不起作用
- 关于VS包含*view.h文件出现错误的解决办法
- android.view.viewroot$calledfromwrongthreadexception: only the original thread that created a view h
- h
- h
- h
- ,h
- h
- h
- H
- h
- h
- h
- H
- Doc.cpp
- Halcon学习(二十)摄像机标定常用函数(一)
- MyEclipse修改了JSP页面,但Tomcat里的没有实时更新
- Halcon学习(十九)标定文件的生成
- 斗地主智能(AI)出牌算法
- view.h
- python07 更多的打印
- nyoj 201 作业题
- Diretshow简单播放功能实现
- Open HAX device failed!!
- Halcon学习(二十一)摄像机标定常用函数(二)
- tomcat的集群配置
- 7.19 jsp
- view.h