Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторная работа 31 / oot / OLEApp / KeyInputDialog
.cpp// KeyInputDialog.cpp : implementation file
//
#include "stdafx.h"
#include "OLEApp.h"
#include "KeyInputDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// KeyInputDialog dialog
KeyInputDialog::KeyInputDialog(CWnd* pParent /*=NULL*/)
: CDialog(KeyInputDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(KeyInputDialog)
m_textBox = _T("");
//}}AFX_DATA_INIT
}
void KeyInputDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(KeyInputDialog)
DDX_Control(pDX, IDC_EDIT3, m_EditControl);
DDX_Text(pDX, IDC_EDIT3, m_textBox);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(KeyInputDialog, CDialog)
//{{AFX_MSG_MAP(KeyInputDialog)
ON_WM_SHOWWINDOW()
ON_EN_CHANGE(IDC_EDIT3, OnChangeEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// KeyInputDialog message handlers
void KeyInputDialog::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
m_EditControl.SetFocus();
}
void KeyInputDialog::OnChangeEdit()
{
CString strText;
m_EditControl.GetWindowText(strText);
CButton* btnOK = (CButton*)GetDlgItem(IDOK);
btnOK->EnableWindow(!strText.IsEmpty());
}
Соседние файлы в папке OLEApp