settingdlg.cpp

来自「图像标注程序」· C++ 代码 · 共 86 行

CPP
86
字号
// SettingDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Picture Training.h"
#include "SettingDlg.h"
#include "GlobalVariable.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif



/////////////////////////////////////////////////////////////////////////////
// CSettingDlg dialog



CSettingDlg::CSettingDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSettingDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSettingDlg)
	m_Height = 0;
	m_Width = 0;
	//}}AFX_DATA_INIT
}


void CSettingDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSettingDlg)
	DDX_Control(pDX, IDC_RADIO1, m_IsNormalize);
	DDX_Control(pDX, IDC_EDIT_Height, m_ConHeight);
	DDX_Control(pDX, IDC_EDIT_Width, m_ConWidth);
	DDX_Text(pDX, IDC_EDIT_Height, m_Height);
	DDX_Text(pDX, IDC_EDIT_Width, m_Width);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSettingDlg, CDialog)
	//{{AFX_MSG_MAP(CSettingDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSettingDlg message handlers

void CSettingDlg::OnOK() 
{
	// TODO: Add extra validation here
    UpdateData(TRUE);

	TargetHeight=m_Height;
	TargetWidth=m_Width;
	if(GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO2)==1022)
		IsNormalize=TRUE;
	else
		IsNormalize=FALSE;
	CDialog::OnOK();
}

BOOL CSettingDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    m_Height=TargetHeight;
    m_Width=TargetWidth;
	CString CsTargetHeight,CsTargetWidth;
	CsTargetHeight.Format("%d",TargetHeight);
	CsTargetWidth.Format("%d",TargetWidth);
	m_ConHeight.SetSel(0,-1);
	m_ConWidth.SetSel(0,-1);
	m_ConHeight.ReplaceSel(CsTargetHeight);
	m_ConWidth.ReplaceSel(CsTargetWidth);
    CheckRadioButton(IDC_RADIO1,IDC_RADIO2,(!IsNormalize)+1022);

	
	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 + -
显示快捷键?