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

📄 myview.cpp

📁 一个非常好的GPS应用软件
💻 CPP
字号:
// MyView.cpp : implementation file
//

#include "stdafx.h"
#include "GpsNav.h"
#include "MyView.h"
#include "MyEditView.h"
#include "MyScrollView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyView

IMPLEMENT_DYNCREATE(CMyView, CView)

CMyView::CMyView()
{
}

CMyView::~CMyView()
{
}


BEGIN_MESSAGE_MAP(CMyView, CView)
	//{{AFX_MSG_MAP(CMyView)
	ON_WM_CREATE()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyView drawing

void CMyView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// CMyView diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CMyView message handlers

int CMyView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here

	CRect rect;
	GetClientRect(&rect);
	CCreateContext *pContext = (CCreateContext*)lpCreateStruct->lpCreateParams;
	m_wndSplitter.CreateStatic(this,2,1);
	m_wndSplitter.CreateView(
		0,
		0,
		RUNTIME_CLASS(CMyScrollView),
		CSize(rect.Width(),rect.Height()*60/100),
		pContext);


	m_wndSplitter.CreateView(
		1,
		0,
		RUNTIME_CLASS(CMyEditView),
		CSize(rect.Width(),rect.Height()*40/100),
		pContext);

	pMyScrollView=(CMyScrollView * )m_wndSplitter.GetPane(0,0);
	pMyEditView=(CMyEditView *)m_wndSplitter.GetPane(1,0);

	pMyScrollView->OnSize(SIZE_MAXIMIZED,10,20);
	//pMyEditView->OnSize(SIZE_MAXIMIZED,1000,1200);
	
	return 0;
}

void CMyView::OnSize(UINT nType, int cx, int cy) 
{
	CView::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	
	CRect rect;
	GetClientRect(&rect);
	int Cx = rect.Width();
	int Cy = rect.Height();
	m_wndSplitter.MoveWindow(-2,-2,Cx,Cy);
	//m_wndSplitter.SetRowInfo(0,0,Cy/2);
	//m_wndSplitter.SetRowInfo(1,110,Cy/2);
	m_wndSplitter.RecalcLayout();	
	
}

⌨️ 快捷键说明

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