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

📄 drawdlgbase.cpp

📁 一个用于无刷直流电动机的驱动与控制程序.里面所用的采集卡的型号为MC08.
💻 CPP
字号:
// DrawDlgBase.cpp : implementation file
//

#include "stdafx.h"
#include "TestForm.h"
#include "DrawDlgBase.h"

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

#define totalDialog  2  //定义绘图窗口中需要显示的对话框总数

/////////////////////////////////////////////////////////////////////////////
// DrawDlgBase

IMPLEMENT_DYNCREATE(DrawDlgBase, CFormView)

DrawDlgBase::DrawDlgBase()
	: CFormView(DrawDlgBase::IDD)
{
	//{{AFX_DATA_INIT(DrawDlgBase)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_nCurrPage = 0;
	memset( m_arhwndPage, 0, sizeof(HWND)*10 );
}

DrawDlgBase::~DrawDlgBase()
{
}

void DrawDlgBase::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(DrawDlgBase)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(DrawDlgBase, CFormView)
	//{{AFX_MSG_MAP(DrawDlgBase)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// DrawDlgBase diagnostics

#ifdef _DEBUG
void DrawDlgBase::AssertValid() const
{
	CFormView::AssertValid();
}

void DrawDlgBase::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// DrawDlgBase message handlers

void DrawDlgBase::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	//-------------------------------------------////
	CTestFormApp *pApp=(CTestFormApp *)AfxGetApp();	
	pApp->pDrawDlgBase =this;

		CRect drawBaseFrm;		
		GetWindowRect(drawBaseFrm);

		//GetDlgItem(IDC_STATIC);
		
		powerDrawDlg.Create(IDD_DRAWDIALOG_POWER,this);
		m_arhwndPage[0]=powerDrawDlg.GetSafeHwnd();	

		prvDrawDlg.Create(IDD_DRAWDIALOG_PRV,this);
		m_arhwndPage[1]=prvDrawDlg.GetSafeHwnd();

//		ScreenToClient( &drawBaseFrm );
//		for(int i=0;i<totalDialog;i++)
//		{
//			::MoveWindow( m_arhwndPage[ i ], 
//				drawBaseFrm.left+2, drawBaseFrm.top+2, drawBaseFrm.Width()-4, drawBaseFrm.Height()-4, 
//				0 );
//		}
		::ShowWindow( m_arhwndPage[0], SW_SHOW );
	//-------------------------------------------////	
}

void DrawDlgBase::DrawSwitchView(int nview)
{
		DWORD flag = AW_SLIDE | AW_HOR_POSITIVE;
	//DWORD flag = AW_SLIDE | AW_CENTER;
		BOOL b =::AnimateWindow(
			m_arhwndPage[ nview ],
			200,
			flag
			);
		//MessageBox("123");
	for (int i=0;i<nview;i++)
		{
			::ShowWindow( m_arhwndPage[ i ], SW_HIDE );
		}
	for (int j=nview+1;j<totalDialog;j++)
		{
			::ShowWindow( m_arhwndPage[ j ], SW_HIDE );
		}	


}

⌨️ 快捷键说明

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