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

📄 dplotdlg1.cpp

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

#include "stdafx.h"
#include "femmview.h"
#include "DPlotDlg1.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDPlotDlg1 dialog


CDPlotDlg1::CDPlotDlg1(CWnd* pParent /*=NULL*/)
	: CDialog(CDPlotDlg1::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDPlotDlg1)
	m_showlegend = FALSE;
	m_ub1 = 0.0;
	m_lb1 = 0.0;
	m_gscale = FALSE;
	//}}AFX_DATA_INIT
}


void CDPlotDlg1::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDPlotDlg1)
	DDX_Check(pDX, IDC_SHOW_LEG1, m_showlegend);
	DDX_Text(pDX, IDC_UB1, m_ub1);
	DDX_Text(pDX, IDC_LB1, m_lb1);
	DDX_Check(pDX, IDC_GSCALE, m_gscale);
	//}}AFX_DATA_MAP
	DDX_Control(pDX, IDC_UB1, m_IDC_ub1);
	DDX_Control(pDX, IDC_LB1, m_IDC_lb1);
}


BEGIN_MESSAGE_MAP(CDPlotDlg1, CDialog)
	//{{AFX_MSG_MAP(CDPlotDlg1)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
	ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
	ON_BN_CLICKED(IDC_RESBTN1, OnResbtn1)
	ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
	ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
	ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDPlotDlg1 message handlers

void CDPlotDlg1::OnRadio1() 
{
	btnState=2;
	OnResbtn1();
}

void CDPlotDlg1::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	btnState=3;
	OnResbtn1();
}

void CDPlotDlg1::OnRadio3() 
{
	// TODO: Add your control notification handler code here
	btnState=1;
	OnResbtn1();
}

void CDPlotDlg1::OnRadio4() 
{
	// TODO: Add your control notification handler code here
	btnState=0;
}

void CDPlotDlg1::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

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

	if(btnState==0) SetEm=IDC_RADIO4;
	if(btnState==1) SetEm=IDC_RADIO3;
	if(btnState==2) SetEm=IDC_RADIO1;
	if(btnState==3) SetEm=IDC_RADIO2;
	if(btnState==4) SetEm=IDC_RADIO7;
	if(btnState==5) SetEm=IDC_RADIO5;
	if(btnState==6) SetEm=IDC_RADIO6;

   CheckRadioButton(
    IDC_RADIO1,// identifier of first radio button in group
    IDC_RADIO7,	// identifier of last radio button in group
    SetEm	// identifier of radio button to select
   );

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

void CDPlotDlg1::OnResbtn1() 
{
	// TODO: Add your control notification handler code here
	if (btnState==0){ m_lb1=Bm_l; m_ub1=Bm_h;}
	if (btnState==1){ m_lb1=Bm_l; m_ub1=Bm_h;}
	if (btnState==2){ m_lb1=Br_l; m_ub1=Br_h;}
	if (btnState==3){ m_lb1=Bi_l; m_ub1=Bi_h;}

	if (btnState==4){ m_lb1=Jm_l; m_ub1=Jm_h;}
	if (btnState==5){ m_lb1=Jr_l; m_ub1=Jr_h;}
	if (btnState==6){ m_lb1=Ji_l; m_ub1=Ji_h;}
	
	UpdateData(FALSE);
}

void CDPlotDlg1::OnRadio5() 
{
	btnState=5;
	OnResbtn1();
	
}

void CDPlotDlg1::OnRadio6() 
{
	btnState=6;
	OnResbtn1();
}

void CDPlotDlg1::OnRadio7() 
{
	btnState=4;
	OnResbtn1();
}

⌨️ 快捷键说明

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