?? myview.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 + -