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

📄 lytthree.cpp

📁 draw 2D and 3D basic graph with visual C++!
💻 CPP
字号:
// LYTTHREE.cpp : implementation file
//

#include "stdafx.h"
#include "LYTGraphics.h"
#include "LYTTHREE.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define WM_TRANSLATE WM_USER+100//手工处理消息映射(VC++课本218页)
#include "MainFrm.h"

/////////////////////////////////////////////////////////////////////////////
// LYTTHREE dialog


LYTTHREE::LYTTHREE(CWnd* pParent /*=NULL*/)
	: CDialog(LYTTHREE::IDD, pParent)
{
	//{{AFX_DATA_INIT(LYTTHREE)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


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


BEGIN_MESSAGE_MAP(LYTTHREE, CDialog)
	//{{AFX_MSG_MAP(LYTTHREE)
	ON_BN_CLICKED(IDC_TRANSLATE_UP, OnTranslateUp)
	ON_BN_CLICKED(IDC_TRANSLATE_DOWN, OnTranslateDown)
	ON_BN_CLICKED(IDC_TRANSLATE_LEFT, OnTranslateLeft)
	ON_BN_CLICKED(IDC_TRANSLATE_RIGHT, OnTranslateRight)
	ON_BN_CLICKED(IDC_TRANSLATE_FORWARD, OnTranslateForward)
	ON_BN_CLICKED(IDC_TRANSLATE_BACK, OnTranslateBack)
	ON_BN_CLICKED(IDC_TRANSLATE_RESET, OnTranslateReset)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// LYTTHREE message handlers

void LYTTHREE::OnTranslateUp() 
{
	// TODO: Add your control notification handler code here
	nType=1;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);
	
}

void LYTTHREE::OnTranslateDown() 
{
	// TODO: Add your control notification handler code here
	nType=2;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);
	
}

void LYTTHREE::OnTranslateLeft() 
{
	// TODO: Add your control notification handler code here
	nType=3;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);
	
}

void LYTTHREE::OnTranslateRight() 
{
	// TODO: Add your control notification handler code here
	nType=4;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);

	
}

void LYTTHREE::OnTranslateForward() 
{
	// TODO: Add your control notification handler code here
	nType=5;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);
}

void LYTTHREE::OnTranslateBack() 
{
	// TODO: Add your control notification handler code here
	nType=6;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);
	
}

void LYTTHREE::OnTranslateReset() 
{
	// TODO: Add your control notification handler code here
	nType=7;
	CMainFrame * pWnd=(CMainFrame*)AfxGetMainWnd();
	pWnd->GetActiveView()->SendMessage(WM_TRANSLATE,nType,0);
	
}

void LYTTHREE::PostNcDestroy() 
{
	// TODO: Add your specialized code here and/or call the base class
	delete this;

	
	CDialog::PostNcDestroy();
}

UINT LYTTHREE::OnNcHitTest(CPoint point)
{
	UINT nHitTest=CDialog::OnNcHitTest(point);
	return (nHitTest==HTCLIENT)?HTCAPTION:nHitTest;


}


⌨️ 快捷键说明

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