📄 dialog2.cpp
字号:
// Dialog2.cpp : implementation file
//
#include "stdafx.h"
#include "database.h"
#include "Dialog2.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialog2 dialog
CDialog2::CDialog2(CWnd* pParent /*=NULL*/)
: CDialog(CDialog2::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog2)
m_attributename = _T("");
m_datalength = _T("20");
m_nametype = _T("");
mainkey=1;
canempty=1;
m_attributefather = _T("");
father=NULL;
//}}AFX_DATA_INIT
}
void CDialog2::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialog2)
DDX_Control(pDX, IDC_COMBO2, m_com);
DDX_Text(pDX, IDC_EDIT1, m_attributename);
DDX_Text(pDX, IDC_EDIT3, m_datalength);
DDX_CBString(pDX, IDC_COMBO1, m_nametype);
DDX_CBString(pDX, IDC_COMBO2, m_attributefather);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialog2, CDialog)
//{{AFX_MSG_MAP(CDialog2)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialog2 message handlers
void CDialog2::OnRadio1()
{
// TODO: Add your control notification handler code here
canempty=1;
}
void CDialog2::OnRadio2()
{
// TODO: Add your control notification handler code here
canempty=2;
}
void CDialog2::OnRadio3()
{
// TODO: Add your control notification handler code here
mainkey=1;
}
void CDialog2::OnRadio4()
{
// TODO: Add your control notification handler code here
mainkey=2;
}
BOOL CDialog2::OnInitDialog()
{
CDialog::OnInitDialog();
if(canempty==1)
{
CWnd* a=this->GetDlgItem(IDC_RADIO1);
CButton* a1=(CButton*)a;
a1->SetCheck(true);
}
else if(canempty==2)
{
CWnd* a=this->GetDlgItem(IDC_RADIO2);
CButton* a1=(CButton*)a;
a1->SetCheck(true);
}
if(mainkey==1)
{
CWnd* b=this->GetDlgItem(IDC_RADIO3);
CButton* b1=(CButton*)b;
b1->SetCheck(true);
}
else if(mainkey==2)
{
CWnd* b=this->GetDlgItem(IDC_RADIO4);
CButton* b1=(CButton*)b;
b1->SetCheck(true);
}
CWnd* c=this->GetDlgItem(IDC_COMBO1);
CComboBox* c1=(CComboBox*)c;
if(m_nametype=="")
c1->SetCurSel(1);
while(father!=NULL)
{
if(father->type==1||father->type==2)
m_com.AddString(father->name);
father=father->nextelement;
}
// TODO: Add extra initialization here
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 + -