577 lines
17 KiB
C++
577 lines
17 KiB
C++
// PipeStandEditDlg.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include <dbSymbolAnnotate.h>
|
|
|
|
#include "PipeStandEditDlg.h"
|
|
#include "DbVPipeDim.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
extern CString GetVPipeLayerByIdx(int iLayer);
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CPipeStandEditDlg dialog
|
|
//***************************************************************************************************
|
|
// 编辑立管
|
|
//***************************************************************************************************
|
|
|
|
//在平面图,有多个立管
|
|
int EditAllVerticalPipe(AcDbObjectId id, PickSet &ss)
|
|
{
|
|
long len = ss.Length();
|
|
double nHigh(-999), nLow(999);
|
|
Entity entHigh, entLow;
|
|
XPoint ptUcs;
|
|
for(long i=0;i<len;i++){
|
|
Entity ent = ss[i];
|
|
OPENOBJ_BEGIN(ent, AcDb::kForRead, TDbPipe, pPipe);
|
|
if(pPipe){
|
|
double nS = pPipe->StartPoint().z / 1000;
|
|
double nE = pPipe->EndPoint().z / 1000;
|
|
ptUcs = pPipe->StartPoint();
|
|
if(nS > nE){
|
|
if(nS > nHigh){
|
|
nHigh = nS;
|
|
entHigh = ent;
|
|
}
|
|
if(nE < nLow){
|
|
nLow = nE;
|
|
entLow = ent;
|
|
}
|
|
}
|
|
else{
|
|
if(nE > nHigh){
|
|
entHigh = ent;
|
|
nHigh = nE;
|
|
}
|
|
if(nS < nLow){
|
|
entLow = ent;
|
|
nLow = nS;
|
|
}
|
|
}
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
CTemporaryResourceOverride vTemp;
|
|
CPipeStandEditDlg dlg;
|
|
dlg.m_nElevationS = nHigh;
|
|
dlg.m_nElevationE = nLow;
|
|
|
|
CString csLayer, csName;
|
|
ads_name ent;
|
|
acdbGetAdsName(ent, id);
|
|
csName = ReadXdata(ent, _T("PIPE-SERIAL"));
|
|
dlg.m_csName = csName;
|
|
OPENOBJ_BEGIN(id, AcDb::kForRead, TDbPipe, pPipe);
|
|
if(!pPipe)
|
|
return RTERROR;
|
|
TCHAR *layer;
|
|
layer = pPipe->layer();
|
|
dlg.m_iMaterial = pPipe->GetMaterial();
|
|
csLayer = layer;
|
|
dlg.m_csDn.Format(_T("%.0f"), pPipe->GetDnDiameter());
|
|
dlg.m_nRadius = pPipe->GetRadius();
|
|
dlg.m_nRadiusIn = pPipe->GetRadiusIn();
|
|
delete [] layer;
|
|
OPENOBJ_END();
|
|
|
|
|
|
dlg.m_iLayer = GetPipeLayerIdxByName(csLayer);
|
|
|
|
if(dlg.DoModal() != IDOK)
|
|
return RTNORM;
|
|
if(fabs(nHigh - dlg.m_nElevationS) > 0.001){
|
|
|
|
OPENOBJ_BEGIN(entHigh, AcDb::kForWrite, TDbPipe, pPipe);
|
|
if(pPipe){
|
|
XPoint ptTmp = pPipe->StartPoint();
|
|
XPoint ptTmp2 = pPipe->EndPoint();
|
|
if(ptTmp.z >= dlg.m_nElevationS*1000 && ptTmp2.z >= dlg.m_nElevationS*1000){
|
|
adsout << _T("\n标高设置不合适!");
|
|
}
|
|
else{
|
|
if(ptTmp.z > ptTmp2.z)
|
|
ptTmp.z = dlg.m_nElevationS*1000;
|
|
else
|
|
ptTmp2.z = dlg.m_nElevationS*1000;
|
|
pPipe->SetStartPoint(ptTmp);
|
|
pPipe->SetEndPoint(ptTmp2);
|
|
}
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
if(fabs(nLow - dlg.m_nElevationE) > 0.001){
|
|
OPENOBJ_BEGIN(entLow, AcDb::kForWrite, TDbPipe, pPipe);
|
|
if(pPipe){
|
|
XPoint ptTmp = pPipe->StartPoint();
|
|
XPoint ptTmp2 = pPipe->EndPoint();
|
|
if(ptTmp.z <= dlg.m_nElevationE*1000 && ptTmp2.z <= dlg.m_nElevationE*1000){
|
|
adsout << _T("\n标高设置不合适!");
|
|
}
|
|
else{
|
|
if(ptTmp.z < ptTmp2.z)
|
|
ptTmp.z = dlg.m_nElevationE*1000;
|
|
else
|
|
ptTmp2.z = dlg.m_nElevationE*1000;
|
|
pPipe->SetStartPoint(ptTmp);
|
|
pPipe->SetEndPoint(ptTmp2);
|
|
}
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
|
|
|
|
for(i=0;i<len;i++){
|
|
Entity ent2 = ss[i];
|
|
OPENOBJ_BEGIN(ent2, AcDb::kForWrite, TDbPipe, pPipe);
|
|
if(pPipe){
|
|
pPipe->SetMaterial(dlg.m_iMaterial);
|
|
// XPoint ptTmp = pPipe->StartPoint();
|
|
// XPoint ptTmp2 = pPipe->EndPoint();
|
|
// ptUcs = ptTmp;
|
|
// ptTmp.z = dlg.m_nElevationS*1000;
|
|
// ptTmp2.z = dlg.m_nElevationE*1000;
|
|
// pPipe->SetStartPoint(ptTmp);
|
|
// pPipe->SetEndPoint(ptTmp2);
|
|
|
|
|
|
if(dlg.m_csDn == _T("不标注")){
|
|
pPipe->EnableDrawLabel(FALSE);
|
|
}
|
|
else{
|
|
double nDn = _tstof(dlg.m_csDn);
|
|
pPipe->SetDnDiameter(nDn);
|
|
}
|
|
InitPipeLayer((const TCHAR*)GetVPipeLayerByIdx(dlg.m_iLayer));
|
|
CString csLay = GetVPipeLayerByIdx(dlg.m_iLayer);
|
|
if(csLay != csLayer){
|
|
pPipe->setLayer((const TCHAR*)csLay);
|
|
pPipe->setColorIndex(256);
|
|
pPipe->SetSysType(GetPipeSysByLayer(csLay));
|
|
}
|
|
|
|
if(fabs(dlg.m_nRadius - pPipe->GetRadius()) > 0.01)
|
|
pPipe->SetRadius(dlg.m_nRadius);
|
|
|
|
if(dlg.m_iStyle == 1)
|
|
pPipe->SetRadiusIn(dlg.m_nRadiusIn);
|
|
else if(dlg.m_iStyle == 2)
|
|
pPipe->SetRadiusIn(-1);
|
|
else
|
|
pPipe->SetRadiusIn(0);
|
|
|
|
}
|
|
OPENOBJ_END();
|
|
|
|
if(csName != dlg.m_csName){
|
|
WriteXdata(ent, _T("PIPE-SERIAL"), dlg.m_csName);
|
|
ptUcs.z = 0;
|
|
ptUcs = Wcs2Ucs(ptUcs);
|
|
PickSet ss2(SS_FREE);
|
|
RBList rbMaskDim(RTDXF0, _T("ATS_COMPOSING"), 8, LAY_VPIPE_DIM, NULL);
|
|
GetPointPickSet(ptUcs, ss2, rbMaskDim, 50);
|
|
long dd = ss2.Length();
|
|
if(ss2.Length() == 1){
|
|
OPENOBJ_BEGIN(ss2[0L], AcDb::kForWrite, TDbSymbComposing, pDim);
|
|
if(pDim){
|
|
CString csDim = pDim->GetText();
|
|
int idx = csDim.Find(_T("-"));
|
|
CString csLeft = csDim.Left(idx);
|
|
csLeft.Format(_T("%s-%s"),csLeft, dlg.m_csName);
|
|
pDim->SetText(csLeft);
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
|
|
}
|
|
|
|
UpdateMultDim(ent2);
|
|
}
|
|
|
|
return RTNORM;
|
|
}
|
|
|
|
//如果只有一个立管,或者是三维编辑
|
|
int EditVerticalPipe(AcDbObjectId id)
|
|
{
|
|
// XPoint ptStart;
|
|
// OPENOBJ_BEGIN(id, AcDb::kForRead, TDbPipe, pPipe);
|
|
// if(pPipe){
|
|
// ptStart = pPipe->StartPoint();
|
|
// }
|
|
// OPENOBJ_END();
|
|
PickSet ss(SS_FREE);
|
|
GetAllVertPipeByPt(ss, id);
|
|
long len = ss.Length();
|
|
double dMeter(1);
|
|
if(!DocGetMeterUnitDraw())
|
|
dMeter = 1000;
|
|
|
|
XPoint vtViewDir;
|
|
xg_getvar(_T("VIEWDIR"), vtViewDir);
|
|
if(vtViewDir == XPoint(0,0,1) && len > 1)
|
|
return EditAllVerticalPipe(id, ss);
|
|
CTemporaryResourceOverride vTemp;
|
|
CPipeStandEditDlg dlg;
|
|
CString csLayer, csName;
|
|
ads_name ent;
|
|
double dRadiusIn(0);
|
|
acdbGetAdsName(ent, id);
|
|
csName = ReadXdata(ent, _T("PIPE-SERIAL"));
|
|
dlg.m_csName = csName;
|
|
OPENOBJ_BEGIN(id, AcDb::kForRead, TDbPipe, pPipe);
|
|
if(!pPipe)
|
|
return RTERROR;
|
|
TCHAR *layer;
|
|
dlg.m_nElevationS = pPipe->StartPoint().z / dMeter;
|
|
dlg.m_nElevationE = pPipe->EndPoint().z / dMeter;
|
|
layer = pPipe->layer();
|
|
dlg.m_iMaterial = pPipe->GetMaterial();
|
|
csLayer = layer;
|
|
dlg.m_csDn.Format(_T("%.0f"), pPipe->GetDnDiameter());
|
|
dlg.m_nRadius = pPipe->GetRadius();
|
|
dlg.m_nRadiusIn = pPipe->GetRadiusIn();
|
|
dRadiusIn = pPipe->GetRadiusIn();//-2, 是国标扣弯,0,是传统扣弯
|
|
dlg.m_csLable = pPipe->GetLabel();
|
|
delete [] layer;
|
|
OPENOBJ_END();
|
|
|
|
|
|
|
|
dlg.m_iLayer = GetPipeLayerIdxByName(csLayer);
|
|
|
|
if(dlg.DoModal() != IDOK)
|
|
return RTNORM;
|
|
|
|
XPoint ptUcs;
|
|
OPENOBJ_BEGIN(id, AcDb::kForWrite, TDbPipe, pPipe);
|
|
if(pPipe){
|
|
pPipe->SetLabel(dlg.m_csLable);
|
|
pPipe->SetMaterial(dlg.m_iMaterial);
|
|
XPoint ptTmp = pPipe->StartPoint();
|
|
XPoint ptTmp2 = pPipe->EndPoint();
|
|
ptUcs = ptTmp;
|
|
ptTmp.z = dlg.m_nElevationS*dMeter;
|
|
ptTmp2.z = dlg.m_nElevationE*dMeter;
|
|
pPipe->SetStartPoint(ptTmp);
|
|
pPipe->SetEndPoint(ptTmp2);
|
|
if(dlg.m_csDn == _T("不标注")){
|
|
pPipe->EnableDrawLabel(FALSE);
|
|
}
|
|
else{
|
|
double nDn = _tstof(dlg.m_csDn);
|
|
pPipe->SetDnDiameter(nDn);
|
|
}
|
|
InitPipeLayer((const TCHAR*)GetVPipeLayerByIdx(dlg.m_iLayer));
|
|
CString csLay = GetVPipeLayerByIdx(dlg.m_iLayer);
|
|
CString csLay2 = GetPipeLayerByIdx(dlg.m_iLayer);//sr 2010-1-6 add 扣弯的图层随管线
|
|
if(csLay != csLayer && csLay2 != csLayer && csLay != _T(""))
|
|
{
|
|
pPipe->setLayer((const TCHAR*)csLay);
|
|
pPipe->setColorIndex(256);
|
|
pPipe->SetSysType(GetPipeSysByLayer(csLay));
|
|
}
|
|
|
|
if(fabs(dlg.m_nRadius - pPipe->GetRadius()) > 0.01)
|
|
pPipe->SetRadius(dlg.m_nRadius);
|
|
|
|
if(dlg.m_iStyle == 1)
|
|
pPipe->SetRadiusIn(dlg.m_nRadiusIn);
|
|
else if(dlg.m_iStyle == 2)
|
|
pPipe->SetRadiusIn(-1);
|
|
else if(dlg.m_iStyle == 3)
|
|
pPipe->SetRadiusIn(-3);
|
|
else{
|
|
if(dRadiusIn < -1.9)
|
|
pPipe->SetRadiusIn(-2);
|
|
else if(fabs(dRadiusIn) < 0.001)
|
|
pPipe->SetRadiusIn(0);
|
|
else{//按当前设置
|
|
if(!g_bStandPipeArc)
|
|
pPipe->SetRadiusIn(-2);
|
|
else
|
|
pPipe->SetRadiusIn(0);//传统扣弯
|
|
}
|
|
}
|
|
}
|
|
OPENOBJ_END();
|
|
|
|
if(csName != dlg.m_csName){
|
|
WriteXdata(ent, _T("PIPE-SERIAL"), dlg.m_csName);
|
|
ptUcs.z = 0;
|
|
ptUcs = Wcs2Ucs(ptUcs);
|
|
PickSet ss(SS_FREE);
|
|
RBList rbMaskDim(RTDXF0, _T("ATS_COMPOSING,ATS_MULTILEADER"), 8, LAY_VPIPE_DIM, NULL);
|
|
GetPointPickSet(ptUcs, ss, rbMaskDim, 50);
|
|
if(ss.Length() == 1){
|
|
OPENOBJ_BEGIN(ss[0L], AcDb::kForWrite, TDbSymbComposing, pDim);
|
|
if(pDim){
|
|
CString csDim = pDim->GetText();
|
|
int idx = -1;
|
|
idx = csDim.Find(_T("-"));
|
|
if(idx < 0)
|
|
idx = csDim.Find(_T("L"));
|
|
CString csLeft = csDim.Left(idx+1);
|
|
csLeft.Format(_T("%s%s"),csLeft, dlg.m_csName);
|
|
pDim->SetText(csLeft);
|
|
double nLeng = pDim->GetDefaultTextBaseLen();
|
|
double nLeng2 = pDim->GetTextBaseLen();
|
|
|
|
nLeng = pDim->GetDefaultTextBaseLen()*1.1;
|
|
if(nLeng2 < 0)
|
|
nLeng= -1*nLeng;
|
|
pDim->SetTextBaseLen(nLeng);
|
|
}
|
|
OPENOBJ_END();
|
|
OPENOBJ_BEGIN(ss[0L], AcDb::kForWrite, TDbSymbMultiLeader, pDim);
|
|
if(pDim){
|
|
CString csDim = pDim->GetText1();
|
|
int idx = -1;
|
|
idx = csDim.Find(_T("-"));
|
|
if(idx < 0)
|
|
idx = csDim.Find(_T("L"));
|
|
CString csLeft = csDim.Left(idx+1);
|
|
csLeft.Format(_T("%s%s"),csLeft, dlg.m_csName);
|
|
pDim->SetText1(csLeft);
|
|
double nLeng = pDim->GetDefaultTextBaseLen();
|
|
double nLeng2 = pDim->GetTextBaseLen();
|
|
|
|
nLeng = pDim->GetDefaultTextBaseLen()*1.1;
|
|
if(nLeng2 < 0)
|
|
nLeng= -1*nLeng;
|
|
pDim->SetTextBaseLen(nLeng);
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
|
|
}
|
|
|
|
UpdateMultDim(ent);
|
|
|
|
//更新立管标注
|
|
//得到所有的立管标注
|
|
bool bIsDim = false;
|
|
PickSet ssAll(SS_FREE);
|
|
RBList rbMaskVPipe(RTDXF0, _T("ATS_VPIPEDIM"),NULL);
|
|
ssAll.Get(_T("A"),NULL,NULL,rbMaskVPipe);
|
|
long lLen = ssAll.Length();
|
|
PickSet ssRenew(SS_FREE);
|
|
CString sText;
|
|
for (long i = 0; i < lLen; ++i)
|
|
{
|
|
OPENOBJ_BEGIN(ssAll[i], AcDb::kForRead, TDbVPipeDim, pDim);
|
|
if (pDim != NULL)
|
|
{
|
|
AcDbObjectId idDim = pDim->GetVPipeId();
|
|
if (idDim == id)
|
|
{
|
|
pDim->upgradeOpen();
|
|
pDim->SaveCurText();
|
|
pDim->downgradeOpen();
|
|
ssRenew += ssAll[i];
|
|
bIsDim = true;
|
|
break;
|
|
}
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
|
|
UpdateGraphic(ssRenew);
|
|
return RTNORM;
|
|
|
|
}
|
|
|
|
|
|
CPipeStandEditDlg::CPipeStandEditDlg(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CPipeStandEditDlg::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CPipeStandEditDlg)
|
|
m_iLayer = -1;
|
|
m_nElevationS = 0.0;
|
|
m_nElevationE = 0.0;
|
|
m_csName = _T("");
|
|
m_nRadius = 0.0;
|
|
m_nRadiusIn = 0.0;
|
|
m_iMaterial = -1;
|
|
m_csDn = _T("");
|
|
m_iStyle = 0;
|
|
m_csLable = _T("");
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
|
|
void CPipeStandEditDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CPipeStandEditDlg)
|
|
DDX_Control(pDX, IDC_COMBO_LAYER, m_comboLay);
|
|
DDX_Control(pDX, IDC_COMBO_MATERIAL, m_comboMat);
|
|
DDX_CBIndex(pDX, IDC_COMBO_LAYER, m_iLayer);
|
|
DDX_Text(pDX, IDC_EDIT_ELEVATION, m_nElevationS);
|
|
DDX_Text(pDX, IDC_EDIT_ELEVATION2, m_nElevationE);
|
|
DDX_Text(pDX, IDC_EDIT_NAME, m_csName);
|
|
DDX_Text(pDX, IDC_EDIT_RADIUS, m_nRadius);
|
|
DDX_Text(pDX, IDC_EDIT_RADIUSIN, m_nRadiusIn);
|
|
DDX_CBIndex(pDX, IDC_COMBO_MATERIAL, m_iMaterial);
|
|
DDX_CBString(pDX, IDC_COMBO_DN, m_csDn);
|
|
DDX_Radio(pDX, IDC_RADIO_STYLE1, m_iStyle);
|
|
// DDX_CBString(pDX, IDC_COMBO_DN2, m_csLable); cet 2011.12.8 del
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CPipeStandEditDlg, CDialog)
|
|
//{{AFX_MSG_MAP(CPipeStandEditDlg)
|
|
ON_BN_CLICKED(IDC_RADIO_STYLE1, OnRadioStyle1)
|
|
ON_BN_CLICKED(IDC_RADIO_STYLE2, OnRadioStyle2)
|
|
ON_BN_CLICKED(IIDC_RADIO_STYLE3, OnRadioStyle3)
|
|
ON_BN_CLICKED(IIDC_RADIO_STYLE4, OnRadioStyle4)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CPipeStandEditDlg message handlers
|
|
|
|
BOOL CPipeStandEditDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
int iold = m_iMaterial;
|
|
XStringList lstMat;
|
|
GetPipeMaterialList(lstMat);
|
|
for(int i=0;i<lstMat.Length();i++){
|
|
m_comboMat.AddString(lstMat[i]);
|
|
}
|
|
m_iMaterial = iold;
|
|
m_comboLay.AddString(LAY_PIPE_FEED);
|
|
m_comboLay.AddString(LAY_PIPE_HEADFEED);
|
|
m_comboLay.AddString(LAY_PIPE_HEADBACK);
|
|
m_comboLay.AddString(LAY_PIPE_DIRT);
|
|
m_comboLay.AddString(LAY_PIPE_USELESS);
|
|
m_comboLay.AddString(LAY_PIPE_RAIN);
|
|
m_comboLay.AddString(LAY_PIPE_USED);
|
|
m_comboLay.AddString(LAY_PIPE_FIRE);
|
|
m_comboLay.AddString(LAY_PIPE_SPRINKLE);
|
|
m_comboLay.AddString(LAY_PIPE_COAGULATE);
|
|
m_comboLay.AddString(LAY_PIPE_DRINK);
|
|
m_comboLay.AddString(LAY_PIPE_PRESSDIRT);
|
|
m_comboLay.AddString(LAY_PIPE_PRESSUSELESS);
|
|
m_comboLay.AddString(LAY_PIPE_PRESSRAIN);
|
|
m_comboLay.AddString(LAY_PIPE_OTHER);
|
|
m_comboLay.AddString(LAY_PIPE_USER1);
|
|
m_comboLay.AddString(LAY_PIPE_USER2);
|
|
|
|
m_comboLay.AddString(LAY_PIPE_FEED2);
|
|
m_comboLay.AddString(LAY_PIPE_FEED3);
|
|
m_comboLay.AddString(LAY_PIPE_HEADFEED2);
|
|
m_comboLay.AddString(LAY_PIPE_HEADFEED3);
|
|
m_comboLay.AddString(LAY_PIPE_HEADBACK2);
|
|
m_comboLay.AddString(LAY_PIPE_HEADBACK3);
|
|
m_comboLay.AddString(LAY_PIPE_FIRE2);
|
|
m_comboLay.AddString(LAY_PIPE_FIRE3);
|
|
m_comboLay.AddString(LAY_PIPE_SPRINKLE2);
|
|
m_comboLay.AddString(LAY_PIPE_SPRINKLE3);
|
|
m_comboLay.AddString(LAY_PIPE_USED2);
|
|
m_comboLay.AddString(LAY_PIPE_USED3);
|
|
// cet 2011.12.8 add
|
|
m_comboLay.AddString(LAY_PIPE_USER3);
|
|
m_comboLay.AddString(LAY_PIPE_USER4);
|
|
m_comboLay.AddString(LAY_PIPE_USER5);
|
|
m_comboLay.AddString(LAY_PIPE_USER6);
|
|
m_comboLay.AddString(LAY_PIPE_USER7);
|
|
m_comboLay.AddString(LAY_PIPE_USER8);
|
|
|
|
if(m_nRadiusIn > 0.001)
|
|
m_iStyle = 1;
|
|
else if(fabs(m_nRadiusIn + 1) < 0.001)
|
|
m_iStyle = 2;
|
|
else if(fabs(m_nRadiusIn + 3) < 0.001)
|
|
m_iStyle = 3;
|
|
else
|
|
m_iStyle = 0;
|
|
|
|
CWnd *pWnd = GetDlgItem(IDC_EDIT_RADIUSIN);
|
|
if(m_iStyle == 1)
|
|
pWnd->EnableWindow(TRUE);
|
|
else
|
|
pWnd->EnableWindow(FALSE);
|
|
|
|
InitDn(); // cet 2011.12.8 add
|
|
UpdateData(FALSE);
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CPipeStandEditDlg::OnRadioStyle1()
|
|
{
|
|
UpdateData(TRUE);
|
|
CWnd *pWnd = GetDlgItem(IDC_EDIT_RADIUSIN);
|
|
pWnd->EnableWindow(FALSE);
|
|
}
|
|
|
|
void CPipeStandEditDlg::OnRadioStyle2()
|
|
{
|
|
UpdateData(TRUE);
|
|
CWnd *pWnd = GetDlgItem(IDC_EDIT_RADIUSIN);
|
|
pWnd->EnableWindow(TRUE);
|
|
m_nRadiusIn = m_nRadius / 2;
|
|
UpdateData(FALSE);
|
|
}
|
|
|
|
void CPipeStandEditDlg::OnRadioStyle3()
|
|
{
|
|
UpdateData(TRUE);
|
|
CWnd *pWnd = GetDlgItem(IDC_EDIT_RADIUSIN);
|
|
pWnd->EnableWindow(FALSE);
|
|
}
|
|
|
|
|
|
|
|
void CPipeStandEditDlg::OnRadioStyle4()
|
|
{
|
|
UpdateData(TRUE);
|
|
CWnd *pWnd = GetDlgItem(IDC_EDIT_RADIUSIN);
|
|
pWnd->EnableWindow(FALSE);
|
|
}
|
|
|
|
void CPipeStandEditDlg::InitDn()
|
|
{
|
|
CComboBox *pBox = (CComboBox*)GetDlgItem(IDC_COMBO_DN2);
|
|
if (pBox != NULL)
|
|
{
|
|
CString sText;
|
|
for (int i = 0; i < pBox->GetCount(); i++)
|
|
{
|
|
pBox->GetLBText(i, sText);
|
|
if (m_csLable.Compare(sText) == 0)
|
|
{
|
|
pBox->SetCurSel(i);
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (i == pBox->GetCount())
|
|
{
|
|
pBox->SetCurSel(-1);
|
|
}
|
|
}
|
|
}
|
|
|
|
void CPipeStandEditDlg::OnOK()
|
|
{
|
|
UpdateData(TRUE);
|
|
CWnd *pWnd = GetDlgItem(IDC_COMBO_DN2);
|
|
if (pWnd != NULL)
|
|
{
|
|
pWnd->GetWindowText(m_csLable);
|
|
}
|
|
CDialog::OnOK();
|
|
}
|