⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sunview.cpp

📁 MFC编写的一个FFT算法实现
💻 CPP
字号:
// sunView.cpp : implementation of the CSunView class
//

#include "stdafx.h"
#include "sun.h"

#include "sunDoc.h"
#include "sunView.h"
#include "complex.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSunView

IMPLEMENT_DYNCREATE(CSunView, CView)

BEGIN_MESSAGE_MAP(CSunView, CView)
	//{{AFX_MSG_MAP(CSunView)
	ON_COMMAND(ID_FFT, OnFft)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CSunView construction/destruction

CSunView::CSunView()
{
	// TODO: add construction code here

}

CSunView::~CSunView()
{
}

BOOL CSunView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CSunView drawing

void CSunView::OnDraw(CDC* pDC)
{
	CSunDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	if(dlg.Flag==1){
	pDC->MoveTo(100,100);
	pDC->LineTo(150,100);
	}


}

/////////////////////////////////////////////////////////////////////////////
// CSunView printing

BOOL CSunView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CSunView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CSunView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CSunView diagnostics

#ifdef _DEBUG
void CSunView::AssertValid() const
{
	CView::AssertValid();
}

void CSunView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CSunDoc* CSunView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSunDoc)));
	return (CSunDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSunView message handlers

void CSunView::OnFft() 
{	if(dlg.DoModal()!=IDOK)
	{
		return;
	}
	// TODO: Add your command handler code here
	
   dlg.Flag=1;
   Invalidate();

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -