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

📄 settingdlg.cpp

📁 图像标注程序
💻 CPP
字号:
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -