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

📄 dialog2.cpp

📁 1.通过鼠标拖拽和弹出对话框完成实体、属性、联系的绘制以及各参数设定 2.对绘制的实体、属性、联系提供合法性检查 3.对绘制的图形进行拖动、重设大小、删除 4.通过属性对话框对实体、属性、联系的
💻 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 + -