// tView.cpp : implementation of the CTView class // #include "stdafx.h" #include "t.h" #include "tDoc.h" #include "tView.h" #include "MainFrm.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTView IMPLEMENT_DYNCREATE(CTView, CView) BEGIN_MESSAGE_MAP(CTView, CView) //{{AFX_MSG_MAP(CTView) ON_WM_KEYDOWN() ON_WM_CREATE() ON_WM_SIZE() //}}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() ///////////////////////////////////////////////////////////////////////////// // CTView construction/destruction CTView::CTView() { // TODO: add construction code here } CTView::~CTView() { } BOOL CTView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CTView drawing void CTView::OnDraw(CDC* pDC) { CTDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CTView printing BOOL CTView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CTView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CTView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CTView diagnostics #ifdef _DEBUG void CTView::AssertValid() const { CView::AssertValid(); } void CTView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CTDoc* CTView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTDoc))); return (CTDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CTView message handlers void CTView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { exit(0); /* //如果按的键为Esc键 if(nChar==VK_ESCAPE) { //获取主框架窗口的指针 CMainFrame *pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd; //调用主窗口类的自定义函数 EndFullScreen,便可退出全屏显示状态 pFrame->EndFullScreen(); } */ CView::OnKeyDown(nChar, nRepCnt, nFlags); } int CTView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here RECT rect; rect.top=0; rect.bottom=0; rect.left=0; rect.right=0; gauss.Create(NULL,"",WS_CHILD | WS_BORDER | WS_VISIBLE,rect,this,101); return 0; } void CTView::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType, cx, cy); // TODO: Add your message handler code here CRect rect; this->GetClientRect(&rect); gauss.MoveWindow(&rect); }