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

📄 topview.cpp

📁 VC.net 的一些有用的技巧
💻 CPP
字号:
// TopView.cpp : CTopView 类的实现
//

#include "stdafx.h"
#include "SplitWindow.h"

#include "SplitWindowDoc.h"
#include "TopView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CTopView

IMPLEMENT_DYNCREATE(CTopView, CFormView)

BEGIN_MESSAGE_MAP(CTopView, CFormView)
	ON_BN_CLICKED(IDC_SETRECT, OnBnClickedSetrect)
END_MESSAGE_MAP()

// CTopView 构造/销毁

CTopView::CTopView()
	: CFormView(CTopView::IDD)
	, left(10)
	, top(10)
	, right(100)
	, bottom(100)
{
	// TODO: 在此处添加构造代码

}

CTopView::~CTopView()
{
}

void CTopView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	DDX_Text(pDX,IDC_LEFT,left);
	DDX_Text(pDX,IDC_TOP,top);
	DDX_Text(pDX,IDC_RIGHT,right);
	DDX_Text(pDX,IDC_BOTTOM,bottom);
}

BOOL CTopView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或
	// 样式

	return CFormView::PreCreateWindow(cs);
}

void CTopView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();
}


// CTopView 诊断

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

void CTopView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

CSplitWindowDoc* CTopView::GetDocument() const // 非调试版本是内联的
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSplitWindowDoc)));
	return (CSplitWindowDoc*)m_pDocument;
}
#endif //_DEBUG


// CTopView 消息处理程序

void CTopView::OnBnClickedSetrect()
{
	// TODO: 在此添加控件通知处理程序代码
	UpdateData();
	m_toprect.left = left;
	m_toprect.top = top;
	m_toprect.right = right;
	m_toprect.bottom = bottom;
	GetDocument()->m_docrect = m_toprect;
	GetDocument()->UpdateAllViews(this);
}

⌨️ 快捷键说明

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