📄 mainpage.cpp
字号:
// CPage2 property page
IMPLEMENT_DYNCREATE(CPage2, CPropertyPage)
CPage2::CPage2() : CPropertyPage(CPage2::IDD)
{
//{{AFX_DATA_INIT(CPage2)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CPage2::~CPage2()
{
}
void CPage2::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPage2)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPage2, CPropertyPage)
//{{AFX_MSG_MAP(CPage2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPage2 message handlers
/////////////////////////////////////////////////////////////////////////////
// CPage3 property page
IMPLEMENT_DYNCREATE(CPage3, CPropertyPage)
CPage3::CPage3() : CPropertyPage(CPage3::IDD)
{
//{{AFX_DATA_INIT(CPage3)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CPage3::~CPage3()
{
}
void CPage3::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPage3)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPage3, CPropertyPage)
//{{AFX_MSG_MAP(CPage3)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPage3 message handlers
BOOL CPage14::OnInitDialog()
{
CPropertyPage::OnInitDialog();
((CComboBox*)GetDlgItem(IDC_CBO_METHOD))->SetCurSel(0);
((CComboBox*)GetDlgItem(IDC_CBO_ART))->SetCurSel(0);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->SetCurSel(0);
// ((CCVenusApp*)AfxGetApp())->m_pMainDlg->InitGrid(0x0E, 0);
CString str;
SYSTEMTIME time;
for(int i = 0; i < 140; i++)
{
str.Format("%d", i + 1960);
((CComboBox*)GetDlgItem(IDC_CBO_BYEAR))->AddString(str);
((CComboBox*)GetDlgItem(IDC_CBO_EYEAR))->AddString(str);
}
for(i = 0; i < 12; i++)
{
str.Format("%d", i + 1);
((CComboBox*)GetDlgItem(IDC_CBO_BMONTH))->AddString(str);
((CComboBox*)GetDlgItem(IDC_CBO_EMONTH))->AddString(str);
}
GetLocalTime(&time);
((CComboBox*)GetDlgItem(IDC_CBO_BYEAR))->SetCurSel(time.wYear - 1960);
((CComboBox*)GetDlgItem(IDC_CBO_EYEAR))->SetCurSel(time.wYear - 1960);
((CComboBox*)GetDlgItem(IDC_CBO_BMONTH))->SetCurSel(time.wMonth - 1);
((CComboBox*)GetDlgItem(IDC_CBO_EMONTH))->SetCurSel(time.wMonth - 1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPage14::OnSelchangeCboArt()
{
int rst = ((CComboBox*)GetDlgItem(IDC_CBO_ART))->GetCurSel();
int rst1 = ((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->GetCurSel();
switch(rst)
{
case 0x00:
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->DeleteString(8);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->InsertString(8, "优选管柱工艺运行费");
break;
case 0x01:
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->DeleteString(8);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->InsertString(8, "机抽工艺运行费");
break;
case 0x02:
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->DeleteString(8);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->InsertString(8, "气举工艺运行费");
break;
case 0x03:
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->DeleteString(8);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->InsertString(8, "电潜泵工艺运行费");
break;
case 0x04:
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->DeleteString(8);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->InsertString(8, "射流泵工艺运行费");
break;
}
((CCVenusApp*)AfxGetApp())->m_pMainDlg->SaveCurGrid(rst, rst1);
((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->SetCurSel(8);
((CCVenusApp*)AfxGetApp())->m_pMainDlg->InitGrid(0x0E, rst1, rst);
}
void CPage14::OnSelchangeCboTable()
{
int rst = ((CComboBox*)GetDlgItem(IDC_CBO_TABLE))->GetCurSel();
int rst1 = ((CComboBox*)GetDlgItem(IDC_CBO_ART))->GetCurSel();
((CCVenusApp*)AfxGetApp())->m_pMainDlg->SaveCurGrid(rst1, rst);
((CCVenusApp*)AfxGetApp())->m_pMainDlg->InitGrid(0x0E, rst, rst1);
}
/*************************************************************************
*
* SetCtrl()
*
* 功 能: 设置工艺初选的组合框和复选框状态
*
* 参 数: CString *pStr: 状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage1::SetCtrl(CString *pStr)
{
}
/*************************************************************************
*
* GetCtrl()
*
* 功 能: 取工艺初选的组合框和复选框状态
*
* 参 数: CString *pStr: 取状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage1::GetCtrl(CString *pStr)
{
}
/*************************************************************************
*
* SetCtrl()
*
* 功 能: 设置自喷井气水节点分析的组合框和复选框状态
*
* 参 数: CString *pStr: 状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage2::SetCtrl(CString *pStr)
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(atoi(pStr[0]));
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(atoi(pStr[1]));
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(atoi(pStr[2]));
((CButton*)GetDlgItem(IDC_CHECK4))->SetCheck(atoi(pStr[3]));
((CButton*)GetDlgItem(IDC_CHECK5))->SetCheck(atoi(pStr[4]));
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(atoi(pStr[5]) - 1);
}
void CPage2::InitCtrl()
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK4))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK5))->SetCheck(false);
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(-1);
}
bool CPage2::IsOK()
{
return (((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK2))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK3))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK4))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck()) &&
(((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() >= 0);
}
/*************************************************************************
*
* GetCtrl()
*
* 功 能: 取自喷井气水节点分析的组合框和复选框状态
*
* 参 数: CString *pStr: 取状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage2::GetCtrl(CString *pStr)
{
pStr[0].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck());
pStr[1].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK2))->GetCheck());
pStr[2].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK3))->GetCheck());
pStr[3].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK4))->GetCheck());
pStr[4].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck());
pStr[5].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() + 1);
}
/*************************************************************************
*
* SetCtrl()
*
* 功 能: 设置气举排水采气节点分析的组合框和复选框状态
*
* 参 数: CString *pStr: 状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage3::SetCtrl(CString *pStr)
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(atoi(pStr[0]));
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(atoi(pStr[1]));
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(atoi(pStr[2]));
((CButton*)GetDlgItem(IDC_CHECK4))->SetCheck(atoi(pStr[3]));
((CButton*)GetDlgItem(IDC_CHECK5))->SetCheck(atoi(pStr[4]));
((CButton*)GetDlgItem(IDC_CHECK6))->SetCheck(atoi(pStr[5]));
((CButton*)GetDlgItem(IDC_CHECK7))->SetCheck(atoi(pStr[6]));
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(atoi(pStr[7]) - 1);
}
void CPage3::InitCtrl()
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK4))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK5))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK6))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK7))->SetCheck(false);
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(-1);
}
bool CPage3::IsOK()
{
return (((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK2))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK3))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK4))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK6))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK7))->GetCheck()) &&
(((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() >= 0);
}
/*************************************************************************
*
* GetCtrl()
*
* 功 能: 取气举排水采气节点分析的组合框和复选框状态
*
* 参 数: CString *pStr: 取状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage3::GetCtrl(CString *pStr)
{
pStr[0].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck());
pStr[1].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK2))->GetCheck());
pStr[2].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK3))->GetCheck());
pStr[3].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK4))->GetCheck());
pStr[4].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck());
pStr[5].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK6))->GetCheck());
pStr[6].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK7))->GetCheck());
pStr[7].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() + 1);
}
/*************************************************************************
*
* SetCtrl()
*
* 功 能: 设置气举排水采气优化设计的组合框和复选框状态
*
* 参 数: CString *pStr: 状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage4::SetCtrl(CString *pStr)
{
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(atoi(pStr[0]) - 1);
((CComboBox*)GetDlgItem(IDC_COMBO2))->SetCurSel(atoi(pStr[1]) - 1);
((CComboBox*)GetDlgItem(IDC_COMBO3))->SetCurSel(atoi(pStr[2]) - 1);
}
void CPage4::InitCtrl()
{
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(-1);
((CComboBox*)GetDlgItem(IDC_COMBO2))->SetCurSel(-1);
((CComboBox*)GetDlgItem(IDC_COMBO3))->SetCurSel(-1);
}
bool CPage4::IsOK()
{
return (((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() >= 0) &&
(((CComboBox*)GetDlgItem(IDC_COMBO2))->GetCurSel() >= 0) &&
(((CComboBox*)GetDlgItem(IDC_COMBO3))->GetCurSel() >= 0) ;
}
/*************************************************************************
*
* GetCtrl()
*
* 功 能: 取气举排水采气优化设计的组合框和复选框状态
*
* 参 数: CString *pStr: 取状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage4::GetCtrl(CString *pStr)
{
pStr[0].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() + 1);
pStr[1].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO2))->GetCurSel() + 1);
pStr[2].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO3))->GetCurSel() + 1);
}
/*************************************************************************
*
* SetCtrl()
*
* 功 能: 设置抽油机排水采气优化设计
*
* 参 数: CString *pStr: 状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage5::SetCtrl(CString *pStr)
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(atoi(pStr[0]));
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(atoi(pStr[1]));
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(atoi(pStr[2]));
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(atoi(pStr[3]) - 1);
((CComboBox*)GetDlgItem(IDC_COMBO2))->SetCurSel(atoi(pStr[4]) - 1);
((CComboBox*)GetDlgItem(IDC_COMBO3))->SetCurSel(atoi(pStr[5]) - 1);
}
void CPage5::InitCtrl()
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(false);
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(false);
((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(-1);
((CComboBox*)GetDlgItem(IDC_COMBO2))->SetCurSel(-1);
((CComboBox*)GetDlgItem(IDC_COMBO3))->SetCurSel(-1);
}
bool CPage5::IsOK()
{
return (((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK2))->GetCheck() ||
((CButton*)GetDlgItem(IDC_CHECK3))->GetCheck()) &&
(((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() >= 0) &&
(((CComboBox*)GetDlgItem(IDC_COMBO2))->GetCurSel() >= 0) &&
(((CComboBox*)GetDlgItem(IDC_COMBO3))->GetCurSel() >= 0) ;
}
/*************************************************************************
*
* GetCtrl()
*
* 功 能: 取抽油机排水采气优化设计
*
* 参 数: CString *pStr: 取状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage5::GetCtrl(CString *pStr)
{
pStr[0].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck());
pStr[1].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK2))->GetCheck());
pStr[2].Format(" %d\n", ((CButton*)GetDlgItem(IDC_CHECK3))->GetCheck());
pStr[3].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel() + 1);
pStr[4].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO2))->GetCurSel() + 1);
pStr[5].Format(" %d\n", ((CComboBox*)GetDlgItem(IDC_COMBO3))->GetCurSel() + 1);
}
/*************************************************************************
*
* SetCtrl()
*
* 功 能: 设置电潜泵排水采气节点分析
*
* 参 数: CString *pStr: 状态字符串
*
* 返回值: 无
*
*************************************************************************/
void CPage6::SetCtrl(CString *pStr)
{
((CButton*)GetDlgItem(IDC_CHECK1))->SetCheck(atoi(pStr[0]));
((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(atoi(pStr[1]));
((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(atoi(pStr[2]));
((CButton*)GetDlgItem(IDC_CHECK4))->SetCheck(atoi(pStr[3]));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -