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

📄 circprop.cpp

📁 一个2D电磁场FEM计算的VC++源程序
💻 CPP
字号:
// CircProp.cpp : implementation file
//

#include "stdafx.h"
#include "femme.h"
#include "CircProp.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCircProp dialog


CCircProp::CCircProp(CWnd* pParent /*=NULL*/)
	: CDialog(CCircProp::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCircProp)
	m_circname = _T("");
	m_totcurrent_im = 0.0;
	m_totcurrent_re = 0.0;
	//}}AFX_DATA_INIT
}


void CCircProp::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCircProp)
	DDX_Control(pDX, IDC_STATIC_BF5, m_bf1);
	DDX_Text(pDX, IDC_CIRCNAME, m_circname);
	DDX_Text(pDX, IDC_TOTCURRENT_IM, m_totcurrent_im);
	DDX_Text(pDX, IDC_TOTCURRENT_RE, m_totcurrent_re);
	//}}AFX_DATA_MAP
	DDX_Control(pDX, IDC_CIRCNAME, m_idc_circname);
	DDX_Control(pDX, IDC_TOTCURRENT_IM, m_idc_totcurrent_im);
	DDX_Control(pDX, IDC_TOTCURRENT_RE, m_idc_totcurrent_re);
}


BEGIN_MESSAGE_MAP(CCircProp, CDialog)
	//{{AFX_MSG_MAP(CCircProp)
	ON_BN_CLICKED(IDC_RADIOAMP, OnRadioamp)
	ON_BN_CLICKED(IDC_RADIOVOLT, OnRadiovolt)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCircProp message handlers

void CCircProp::OnRadioamp() 
{
	m_circtype=0;
}

void CCircProp::OnRadiovolt() 
{
	m_circtype=1;
}

BOOL CCircProp::OnInitDialog() 
{
	CDialog::OnInitDialog();
	  
	int SetEm;

	bfont.CreateFont(0, 0, 0, 0, FW_BOLD, FALSE, 0, 0,
        ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
        DEFAULT_QUALITY, FF_ROMAN, "TimesNewRoman");
	m_bf1.SetFont(&bfont);
	
	SetEm=IDC_RADIOAMP;
	if(m_circtype==1){
		SetEm=IDC_RADIOVOLT;
		OnRadiovolt();
	}
	else OnRadioamp();

   CheckRadioButton(
    IDC_RADIOVOLT,// identifier of first radio button in group
    IDC_RADIOAMP,	// identifier of last radio button in group
    SetEm	// identifier of radio button to select
   );
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCircProp::OnOK()
{
	UpdateData();
	for(int nn=0;nn<namelist.GetSize();nn++)
	{
		if (m_circname==namelist[nn]){
			MsgBox("The name \"%s\" has already been used.\nSelect a different name for this property.",m_circname);
			return;
		}
	}

	CDialog::OnOK();
}

⌨️ 快捷键说明

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