www.pudn.com > wavelet-vc++6.rar > waveletView.cpp
// waveletView.cpp : implementation of the CWaveletView class
//
#include "stdafx.h"
#include "wavelet.h"
#include "waveletDoc.h"
#include "waveletView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWaveletView
IMPLEMENT_DYNCREATE(CWaveletView, CView)
BEGIN_MESSAGE_MAP(CWaveletView, CView)
//{{AFX_MSG_MAP(CWaveletView)
ON_COMMAND(IDM_CS92, ExecCS92)
ON_COMMAND(IDM_CS93, ExecCS93)
ON_COMMAND(IDM_CS97, ExecCs97)
ON_COMMAND(IDM_CS96, ExecCs96)
ON_COMMAND(IDM_LBG, OnLBG)
ON_COMMAND(IDM_CS91, ExecCs91)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CWaveletView construction/destruction
CWaveletView::CWaveletView()
{
// TODO: add construction code here
flag="";
}
CWaveletView::~CWaveletView()
{
}
BOOL CWaveletView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CWaveletView drawing
void CWaveletView::OnDraw(CDC* pDC)
{
CWaveletDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if(flag=="cs91")
cs91.mainprogram();
else if(flag=="cs92")
cs92.DrawWave();
else if(flag=="cs93")
cs93.mainprogram();
// else if(flag=="cs96")
// cs96.mainprogram();
}
/////////////////////////////////////////////////////////////////////////////
// CWaveletView printing
BOOL CWaveletView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CWaveletView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CWaveletView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CWaveletView diagnostics
#ifdef _DEBUG
void CWaveletView::AssertValid() const
{
CView::AssertValid();
}
void CWaveletView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CWaveletDoc* CWaveletView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWaveletDoc)));
return (CWaveletDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CWaveletView message handlers
void CWaveletView::ExecCS92()
{
// TODO: Add your command handler code here
if(cs92.DoModal()==IDOK)
{
cs92.DrawWave();
flag="cs92";
}
return;
}
void CWaveletView::ExecCS93()
{
if(cs93.DoModal()==IDOK)
{
cs93.mainprogram();
flag="cs93";
}
return;
}
void CWaveletView::ExecCs97()
{
if(cs97.DoModal()==IDOK)
{
cs97.mainprogram();
flag="cs97";
}
return;
}
void CWaveletView::ExecCs96()
{
if(cs96.DoModal()==IDOK)
{
cs96.mainprogram();
flag="cs96";
}
return;
}
void CWaveletView::OnLBG()
{
if(LBG.DoModal()==IDOK)
{
LBG.mainprogram();
flag="LBG";
}
return;
}
void CWaveletView::ExecCs91()
{
if(cs91.DoModal()==IDOK)
{
cs91.mainprogram();
flag="cs91";
}
return;
}