// PtProp.cpp : implementation file // #include "stdafx.h" #include "femm.h" #include "beladrawDoc.h" #include "bd_PtProp.h" #include "bd_NodeProp.h" #include "bd_MatDlg.h" #include "bd_BdryDlg.h" #include "bd_CircProp.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // bdCPtProp dialog bdCPtProp::bdCPtProp(CWnd* pParent /*=NULL*/) : CDialog(bdCPtProp::IDD, pParent) { //{{AFX_DATA_INIT(bdCPtProp) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void bdCPtProp::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(bdCPtProp) DDX_Control(pDX, IDC_NAME_LIST, m_namelist); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(bdCPtProp, CDialog) //{{AFX_MSG_MAP(bdCPtProp) ON_BN_CLICKED(IDC_ADD_PROP, OnAddProp) ON_BN_CLICKED(IDC_DEL_PROP, OnDelProp) ON_BN_CLICKED(IDC_MOD_PROP, OnModProp) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // bdCPtProp message handlers void bdCPtProp::OnAddProp() { // Code to deal with adding a Point Property. if (PropType==0){ CPointProp PProp; CArray &nodeproplist=*pnodeproplist; bdCNodeProp zDlg; for(int nn=0;nn &circproplist=*pcircproplist; bdCCircProp zDlg; for(int nn=0;nn &lineproplist=*plineproplist; bdCBdryDlg zDlg; for(int nn=0;nn &blockproplist=*pblockproplist; bdCMatDlg zDlg; for(int nn=0;nn &nodeproplist=*pnodeproplist; int k=m_namelist.GetCurSel(); if((k!=CB_ERR) && (nodeproplist.GetSize()!=0)) { nodeproplist.RemoveAt(k); m_namelist.DeleteString(k); m_namelist.SetCurSel(0); } } if (PropType==3){ CArray &circproplist=*pcircproplist; int k=m_namelist.GetCurSel(); if((k!=CB_ERR) && (circproplist.GetSize()!=0)) { circproplist.RemoveAt(k); m_namelist.DeleteString(k); m_namelist.SetCurSel(0); } } if (PropType==1){ CArray &lineproplist=*plineproplist; int k=m_namelist.GetCurSel(); if((k!=CB_ERR) && (lineproplist.GetSize()!=0)) { lineproplist.RemoveAt(k); m_namelist.DeleteString(k); m_namelist.SetCurSel(0); } } if (PropType==2){ CArray &blockproplist=*pblockproplist; int k=m_namelist.GetCurSel(); if((k!=CB_ERR) && (blockproplist.GetSize()!=0)) { blockproplist.RemoveAt(k); m_namelist.DeleteString(k); m_namelist.SetCurSel(0); } } } void bdCPtProp::OnModProp() { // TODO: Add your control notification handler code here if (PropType==0){ CArray &nodeproplist=*pnodeproplist; bdCNodeProp zDlg; if (nodeproplist.GetSize()==0) return; int k=m_namelist.GetCurSel(); if (k==CB_ERR) return; zDlg.m_vp=nodeproplist[k].V; zDlg.m_qp=nodeproplist[k].qp; zDlg.m_nodename=nodeproplist[k].PointName; for(int nn=0;nn &circproplist=*pcircproplist; if (circproplist.GetSize()==0) return; int k=m_namelist.GetCurSel(); if (k==CB_ERR) return; bdCCircProp zDlg; zDlg.m_circname = circproplist[k].CircName; zDlg.m_circtype = circproplist[k].CircType; zDlg.m_q = circproplist[k].q; zDlg.m_v = circproplist[k].V; for(int nn=0;nn &lineproplist=*plineproplist; bdCBdryDlg zDlg; if (lineproplist.GetSize()==0) return; int k=m_namelist.GetCurSel(); if (k==CB_ERR) return; zDlg.m_v =lineproplist[k].V; zDlg.m_qs =lineproplist[k].qs; zDlg.m_c0 =lineproplist[k].c0; zDlg.m_c1 =lineproplist[k].c1; zDlg.BdryFormat=lineproplist[k].BdryFormat; zDlg.m_BdryName=lineproplist[k].BdryName; for(int nn=0;nn &blockproplist=*pblockproplist; bdCMatDlg zDlg; if (blockproplist.GetSize()==0) return; int k=m_namelist.GetCurSel(); if (k==CB_ERR) return; zDlg.m_ex=blockproplist[k].ex; zDlg.m_ey=blockproplist[k].ey; zDlg.m_qv=blockproplist[k].qv; zDlg.m_BlockName=blockproplist[k].BlockName; for(int nn=0;nn &nodeproplist=*pnodeproplist; for(i=0;i0) m_namelist.SetCurSel(0); } if (PropType==1){ CArray &lineproplist=*plineproplist; for(i=0;i0) m_namelist.SetCurSel(0); } if (PropType==2){ CArray &blockproplist=*pblockproplist; for(i=0;i0) m_namelist.SetCurSel(0); } if (PropType==3){ CArray &circproplist=*pcircproplist; for(i=0;i0) m_namelist.SetCurSel(0); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }