note.cpp

来自「IO函数调用测试」· C++ 代码 · 共 82 行

CPP
82
字号
// Note.cpp : implementation file
//

#include "stdafx.h"
#include "IOExplorer.h"
#include "Note.h"

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

/////////////////////////////////////////////////////////////////////////////
// CNote dialog


CNote::CNote(CWnd* pParent /*=NULL*/)
	: CDialog(CNote::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNote)
	m_Annotation = _T("");
	//}}AFX_DATA_INIT
}


void CNote::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNote)
	DDX_Control(pDX, IDC_ANNOTATION, c_Annotation);
	DDX_Control(pDX, IDOK, c_OK);
	DDX_Text(pDX, IDC_ANNOTATION, m_Annotation);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNote, CDialog)
	//{{AFX_MSG_MAP(CNote)
	ON_EN_CHANGE(IDC_ANNOTATION, OnChangeAnnotation)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNote message handlers

void CNote::OnChangeAnnotation() 
{
 updateControls();	
}

/****************************************************************************
*                            CNote::updateControls
* Result: void
*       
* Effect: 
*       Updates the controls
****************************************************************************/

void CNote::updateControls()
    {
     c_OK.EnableWindow(c_Annotation.GetWindowTextLength() > 0);
    }

/****************************************************************************
*                             CNote::OnInitDialog
* Result: BOOL
*       TRUE, always
* Effect: 
*       Initializes the controls
****************************************************************************/

BOOL CNote::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
 	updateControls();
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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