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

📄 tbounddlg.cpp

📁 这是工厂应用的软件
💻 CPP
字号:
// TBoundDlg.cpp : implementation file
//

#include "stdafx.h"
#include "SUNTEK.h"
#include "TBoundDlg.h"

//add necessary head files
#include "RecsetTBound.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTBoundDlg dialog


CTBoundDlg::CTBoundDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CTBoundDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTBoundDlg)
	m_edit_upT1 = _T("");
	m_edit_upT2 = _T("");
	m_edit_upT3 = _T("");
	m_edit_downT1 = _T("");
	m_edit_downT2 = _T("");
	m_edit_downT3 = _T("");
	//}}AFX_DATA_INIT
}


void CTBoundDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTBoundDlg)
	DDX_Text(pDX, IDC_EDIT_UPT1, m_edit_upT1);
	DDX_Text(pDX, IDC_EDIT_UPT2, m_edit_upT2);
	DDX_Text(pDX, IDC_EDIT_UPT3, m_edit_upT3);
	DDX_Text(pDX, IDC_EDIT_DOWNT1, m_edit_downT1);
	DDX_Text(pDX, IDC_EDIT_DOWNT2, m_edit_downT2);
	DDX_Text(pDX, IDC_EDIT_DOWNT3, m_edit_downT3);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTBoundDlg, CDialog)
	//{{AFX_MSG_MAP(CTBoundDlg)
	ON_WM_CTLCOLOR()
	ON_BN_CLICKED(IDC_SEEBOUND, OnSeebound)
	ON_BN_CLICKED(ID_NEWTBOUND, OnNewtbound)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTBoundDlg message handlers

BOOL CTBoundDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_TBkBrush.CreateSolidBrush(RGB(58,110,165));
	m_TBkColor=(HBRUSH)m_TBkBrush;

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

HBRUSH CTBoundDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	if(nCtlColor==CTLCOLOR_DLG)
	{
//		pDC->SetBkColor(RGB(58,110,165));
		return m_TBkColor;
	}
	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

void CTBoundDlg::OnSeebound() 
{
	// TODO: Add your control notification handler code here
	if(recsetTBound.IsOpen())
	{
		recsetTBound.Close();
	}
	recsetTBound.Open();
	m_edit_upT1.Format("%.3f",recsetTBound.m_upT1);
	m_edit_upT2.Format("%.3f",recsetTBound.m_upT2);
	m_edit_upT3.Format("%.3f",recsetTBound.m_upT3);
	m_edit_downT1.Format("%.3f",recsetTBound.m_downT1);
	m_edit_downT2.Format("%.3f",recsetTBound.m_downT2);
	m_edit_downT3.Format("%.3f",recsetTBound.m_downT3);
	UpdateData(false);
	recsetTBound.Close();

}

void CTBoundDlg::OnNewtbound() 
{
	// TODO: Add your control notification handler code here

	UpdateData();
	if(recsetTBound.IsOpen())
	{
		recsetTBound.Close();
	}
	recsetTBound.Open();
	recsetTBound.Edit();
	recsetTBound.m_upT1=atof(m_edit_upT1);
	recsetTBound.m_upT2=atof(m_edit_upT2);
	recsetTBound.m_upT3=atof(m_edit_upT3);

	recsetTBound.m_downT1=atof(m_edit_downT1);
	recsetTBound.m_downT2=atof(m_edit_downT2);
	recsetTBound.m_downT3=atof(m_edit_downT3);

	recsetTBound.Update();
	recsetTBound.Close();

	CDialog::OnOK();

}

⌨️ 快捷键说明

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