📄 setagudlg.cpp
字号:
// SetAguDlg.cpp : implementation file
//
#include "stdafx.h"
#include "毕业设计.h"
#include "SetAguDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetAguDlg dialog
CSetAguDlg::CSetAguDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetAguDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetAguDlg)
m_r = TRUE;
m_g = TRUE;
m_b = TRUE;
m_n = 0;
//}}AFX_DATA_INIT
str = _T("");
type = 0;
}
void CSetAguDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetAguDlg)
DDX_Check(pDX, IDC_CR, m_r);
DDX_Check(pDX, IDC_CG, m_g);
DDX_Check(pDX, IDC_CB, m_b);
DDX_Text(pDX, IDC_EDIT1, m_n);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetAguDlg, CDialog)
//{{AFX_MSG_MAP(CSetAguDlg)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetAguDlg message handlers
void CSetAguDlg::OnButton3()
{
// TODO: Add your control notification handler code here
OnCancel();
}
void CSetAguDlg::OnButton1()
{
// TODO: Add your control notification handler code here
OnOK();
}
BOOL CSetAguDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
if(str.GetLength()){
SetDlgItemText(IDC_S,str);
}
if(type){
Change();
}
CWnd * w = GetDlgItem(IDC_EDIT1);
w->SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSetAguDlg::OnOK(){
UpdateData();
if(!m_r&&!m_g&&!m_b){
MessageBox("至少要对一个分量进行处理!");
return;
}
m_n = m_n>255?255:m_n;
UpdateData(FALSE);
CDialog::OnOK();
}
void CSetAguDlg::Change(){
CWnd * wnd;
CRect rect;
switch(type){
case 1:
wnd = GetDlgItem(IDC_S111);
wnd->MoveWindow(-100,-100,12,12);
wnd = GetDlgItem(IDC_EDIT1);
wnd->MoveWindow(-100,-100,12,12);
wnd = GetDlgItem(IDC_S);
wnd->MoveWindow(-100,-100,12,12);
wnd = GetDlgItem(IDC_BUTTON1);
wnd->MoveWindow(40,70,80,30);
wnd = GetDlgItem(IDC_BUTTON3);
wnd->MoveWindow(150,70,80,30);
GetWindowRect(&rect);
rect.bottom -= 115;
MoveWindow(rect);
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -