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

📄 inputview.cpp

📁 《VC++ 编程技巧与示例 .rar》各个示例代码绝对可用
💻 CPP
字号:
// InputView.cpp : implementation file
//

#include "stdafx.h"
#include "DVSDITest.h"
#include "InputView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CInputView

IMPLEMENT_DYNCREATE(CInputView, CFormView)

CInputView::CInputView()
	: CFormView(CInputView::IDD)
{
	//{{AFX_DATA_INIT(CInputView)
	m_Blue = 0;
	m_Green = 0;
	m_Red = 0;
	//}}AFX_DATA_INIT
}

CInputView::~CInputView()
{
}

void CInputView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInputView)
	DDX_Text(pDX, IDC_BLUE, m_Blue);
	DDV_MinMaxUInt(pDX, m_Blue, 0, 255);
	DDX_Text(pDX, IDC_GREEN, m_Green);
	DDV_MinMaxUInt(pDX, m_Green, 0, 255);
	DDX_Text(pDX, IDC_RED, m_Red);
	DDV_MinMaxUInt(pDX, m_Red, 0, 255);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInputView, CFormView)
	//{{AFX_MSG_MAP(CInputView)
	ON_BN_CLICKED(IDC_UPDATECLR, OnUpdateclr)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInputView diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CInputView message handlers

void CInputView::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CDVSDITestDoc * pDoc;
	pDoc=GetDocument();
	m_Red  =GetRValue(pDoc->m_clr);
	m_Green=GetGValue(pDoc->m_clr);
	m_Blue =GetBValue(pDoc->m_clr);
	UpdateData(FALSE);
}

CDVSDITestDoc* CInputView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDVSDITestDoc)));
	return (CDVSDITestDoc*)m_pDocument;
}

void CInputView::OnUpdateclr() 
{
	// TODO: Add your control notification handler code here
	CDVSDITestDoc * pDoc;
	pDoc=GetDocument();
	UpdateData();
	pDoc->m_clr=RGB(m_Red,m_Green,m_Blue);
	pDoc->SetModifiedFlag();
	pDoc->UpdateAllViews(this);
}

⌨️ 快捷键说明

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