1096 lines
29 KiB
C++
1096 lines
29 KiB
C++
#include "stdafx.h"
|
|
#include "crossstairdlg.h"
|
|
#include "resource.h"
|
|
#include "tchar.h"
|
|
|
|
|
|
//------------------------交叉楼梯-----------------------
|
|
//
|
|
int CCrossStairDlg::m_iSelectFloor=1;
|
|
int CCrossStairDlg::m_iSectStepNum=10;
|
|
CString CCrossStairDlg::m_strRailHeight=_T("900");
|
|
CString CCrossStairDlg::m_strRailWidth=_T("60");
|
|
CString CCrossStairDlg::m_strRailDistToSide=_T("0");
|
|
CString CCrossStairDlg::m_strStepWidth=_T("270");
|
|
CString CCrossStairDlg::m_strStairWidth=_T("1200");
|
|
CString CCrossStairDlg::m_strSpaceWidth=_T("2560");
|
|
CString CCrossStairDlg::m_strStairLength=_T("5400");
|
|
BOOL CCrossStairDlg::m_bRailOut=FALSE;
|
|
BOOL CCrossStairDlg::m_bHasCellar=FALSE;
|
|
BOOL CCrossStairDlg::m_bLeftDown=FALSE;
|
|
BOOL CCrossStairDlg::m_bHasOutRoof=FALSE;
|
|
BOOL CCrossStairDlg::m_bLeftUp=FALSE;
|
|
int CCrossStairDlg::m_iLRDown=0;
|
|
BOOL CCrossStairDlg::m_bAutoOutRail=FALSE;
|
|
BOOL CCrossStairDlg::m_bSelectUpDir=TRUE;//选择上楼的方向
|
|
CString CCrossStairDlg::m_strRailOutDis=_T("0");
|
|
BOOL CCrossStairDlg::m_bInsideRail=FALSE;
|
|
BOOL CCrossStairDlg::m_bHasInsideHandRail=TRUE;//有内侧扶手
|
|
//保留结果
|
|
int CCrossStairDlg::m_isaveStepNum=20;
|
|
CString CCrossStairDlg::m_strsaveStepHeight=_T("150");
|
|
CString CCrossStairDlg::m_strsaveStairHeight=_T("3000");
|
|
IMPLEMENT_DYNAMIC(CCrossStairDlg,CBaseStairDlg)
|
|
//所有的Radio,CheckButton的处理过程放在UpdateSel中完成
|
|
//更新UpdateImage操作
|
|
BEGIN_MESSAGE_MAP(CCrossStairDlg,CBaseStairDlg)
|
|
ON_BN_CLICKED(IDC_BSPACE_WIDTH,OnClickSpaceWidth)
|
|
ON_BN_CLICKED(IDC_BSTAIR_WIDTH,OnClickStairWidth)
|
|
ON_BN_CLICKED(IDC_INSIDERAIL,UpdateSel)//内侧栏杆
|
|
//对楼层选择的处理
|
|
ON_CONTROL_RANGE(BN_CLICKED,IDC_RADIO_FIRST,IDC_RADIO_TOP,OnControlRange)
|
|
ON_BN_CLICKED(IDC_HAS_CELLAR,OnClickHasCellar)
|
|
ON_BN_CLICKED(IDC_LEFT_DOWN,OnClickHasCellar)
|
|
ON_BN_CLICKED(IDC_RIGHT_DOWN,OnClickHasCellar)
|
|
ON_BN_CLICKED(IDC_HAS_ROOF,OnClickHasRoof)
|
|
ON_BN_CLICKED(IDC_LEFT_UP,OnClickHasRoof)
|
|
ON_BN_CLICKED(IDC_RIGHT_UP,OnClickHasRoof)
|
|
//选择上楼方向
|
|
ON_BN_CLICKED(IDC_LEFT_UPDIR,UpdateSel)
|
|
ON_BN_CLICKED(IDC_RIGHT_UPDIR,UpdateSel)
|
|
ON_BN_CLICKED(IDC_HAS_ARROW,UpdateSel)
|
|
//落地
|
|
ON_BN_CLICKED(IDC_ON_GROUND,UpdateSel)
|
|
//扶手
|
|
ON_BN_CLICKED(IDC_RAIL_AUTO,UpdateSel)
|
|
ON_BN_CLICKED(IDC_CHECK_HASINSIDERAIL,UpdateSel)//有内侧扶手
|
|
ON_EN_CHANGE(IDC_RAIL_HEIGHT,OnChangeRailHeight)
|
|
ON_EN_CHANGE(IDC_RAIL_WIDTH,OnChangeRailWidth)
|
|
ON_EN_CHANGE(IDC_RAIL_DISTTOSIDE,OnChangeRailDistoSide)
|
|
ON_EN_CHANGE(IDC_RAIL_OUTDIS,OnChangeRailOutDis)
|
|
//坡道
|
|
ON_BN_CLICKED(IDC_HAS_SLANT,UpdateSel)
|
|
//边梁
|
|
ON_BN_CLICKED(IDC_LEFT_BEAM,UpdateSel)
|
|
ON_BN_CLICKED(IDC_RIGHT_BEAM,UpdateSel)
|
|
//事件响应
|
|
ON_EN_CHANGE(IDC_STAIR_HEIGHT,OnChangeStairHeight)
|
|
ON_EN_CHANGE(IDC_STAIR_WIDTH,OnChangeStairWidth)
|
|
ON_EN_CHANGE(IDC_SPACE_WIDTH,OnChangeSpaceWidth)
|
|
|
|
ON_EN_CHANGE(IDC_STEP_WIDTH,OnChangeStepWidth)
|
|
ON_EN_CHANGE(IDC_STEP_NUM,OnChangeStepNum)
|
|
ON_EN_CHANGE(IDC_STEP_HEIGHT,OnChangeStepHeight)
|
|
ON_EN_CHANGE(IDC_POUSTEP_NUM,OnChangePouNum)
|
|
|
|
ON_CBN_SELCHANGE(IDC_STAIR_HEIGHTCOMBOX,OnSelChangeStairHeightComBox)
|
|
ON_CBN_EDITCHANGE(IDC_STAIR_HEIGHTCOMBOX,OnChangeStairHeightComBox)
|
|
ON_BN_CLICKED(IDC_OUTRAIL,OnClickRailOut)
|
|
//楼层高度失去焦点的操作
|
|
ON_CBN_KILLFOCUS(IDC_STAIR_HEIGHTCOMBOX,OnKFStairHeight)
|
|
//踏步高度失去焦点
|
|
ON_CBN_KILLFOCUS(IDC_STEP_NUM,OnKFStepNum)
|
|
ON_EN_KILLFOCUS(IDC_SPACE_WIDTH,OnKFSpaceWidth)
|
|
ON_EN_KILLFOCUS(IDC_STEP_HEIGHT,OnKFStepHeight)
|
|
|
|
ON_EN_KILLFOCUS(IDC_RAIL_HEIGHT,OnKFRailHeight)
|
|
ON_EN_KILLFOCUS(IDC_RAIL_WIDTH,OnKFRailWidth)
|
|
ON_EN_KILLFOCUS(IDC_RAIL_DISTTOSIDE,OnKFRailDistoSide)
|
|
ON_EN_KILLFOCUS(IDC_RAIL_OUTDIS,OnKFRailOutDis)
|
|
ON_EN_KILLFOCUS(IDC_STAIR_WIDTH,OnKFStairWidth)
|
|
ON_EN_KILLFOCUS(IDC_STEP_WIDTH,OnKFStepWidth)
|
|
ON_EN_KILLFOCUS(IDC_POUSTEP_NUM,OnKFPouNum)
|
|
|
|
ON_WM_CLOSE()
|
|
END_MESSAGE_MAP()
|
|
CCrossStairDlg::CCrossStairDlg(CWnd *pParent/* =NULL */):CBaseStairDlg(CCrossStairDlg::IDD, pParent),m_group1(0)
|
|
{
|
|
m_bHasArrow=TRUE;//标注
|
|
m_bGroupStatus=FALSE;//组状态
|
|
//平台长度的初始化
|
|
m_dSlabLength=1200;
|
|
m_dSlabLengthLR=1200;
|
|
m_dSlabLengthUR=1200;
|
|
Exchange(m_nStepNum,m_isaveStepNum);
|
|
Exchange(m_strStepHeight,m_strsaveStepHeight);
|
|
Exchange(m_strStairHeight,m_strsaveStairHeight);
|
|
//初始话
|
|
m_bEdit=FALSE;//处于非编辑状态
|
|
m_pBakObj=NULL;//为空状态
|
|
}
|
|
CCrossStairDlg::CCrossStairDlg(UINT idd,CWnd *pParent/*=NULL*/):CBaseStairDlg(idd,pParent),m_group1(0)
|
|
{
|
|
m_bHasArrow=TRUE;//标注
|
|
m_bGroupStatus=FALSE;//组状态
|
|
//平台长度的初始化
|
|
m_dSlabLength=1200;
|
|
m_dSlabLengthLR=1200;
|
|
m_dSlabLengthUR=1200;
|
|
Exchange(m_nStepNum,m_isaveStepNum);
|
|
Exchange(m_strStepHeight,m_strsaveStepHeight);
|
|
Exchange(m_strStairHeight,m_strsaveStairHeight);
|
|
//初始话
|
|
m_bEdit=FALSE;//处于非编辑状态
|
|
m_pBakObj=NULL;//为空状态
|
|
|
|
}
|
|
CCrossStairDlg::~CCrossStairDlg()
|
|
{
|
|
Exchange(m_nStepNum,m_isaveStepNum);
|
|
Exchange(m_strStepHeight,m_strsaveStepHeight);
|
|
Exchange(m_strStairHeight,m_strsaveStairHeight);
|
|
delete m_pBakObj;
|
|
}
|
|
BOOL CCrossStairDlg::OnInitDialog()
|
|
{
|
|
CBaseStairDlg::OnInitDialog();
|
|
spin.SetRange(1,m_nStepNum);
|
|
AddTip(IDC_NEED3D);
|
|
AddTip(IDC_NEED2D);
|
|
AddTip(IDC_STAIR_HEIGHT_STATIC,_T("楼梯高度始终等于所有踏步的高度总和,改变楼梯高度将使踏步数变化,同时可能微调踏步高度"));
|
|
AddTip(IDC_STEP_NUM_STATIC,_T("改变踏步数将使踏步高度反向变化"));
|
|
AddTip(IDC_STEP_HEIGHT_STATIC,_T("输入一个大概的近似踏步高度,系统将自动设置正确值;改变踏步高度将引起踏步数反向变化"));
|
|
UpdateSel();
|
|
return TRUE;
|
|
}
|
|
void CCrossStairDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CBaseStairDlg::DoDataExchange(pDX);
|
|
DDX_Text(pDX,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
DDX_Text(pDX,IDC_STEP_WIDTH,m_strStepWidth);
|
|
DDX_Text(pDX,IDC_STAIR_WIDTH,m_strStairWidth);
|
|
DDX_Text(pDX,IDC_RAIL_WIDTH,m_strRailWidth);
|
|
DDX_Text(pDX,IDC_RAIL_DISTTOSIDE,m_strRailDistToSide);
|
|
DDX_Text(pDX,IDC_RAIL_HEIGHT,m_strRailHeight);
|
|
DDX_Text(pDX,IDC_RAIL_OUTDIS,m_strRailOutDis);
|
|
DDX_Text(pDX,IDC_STATIC_WELLWID,m_strStairWellWidth);//梯井宽度
|
|
//楼层的设置
|
|
//楼梯高度的设置
|
|
DDX_CBString(pDX,IDC_STAIR_HEIGHTCOMBOX,m_strStairHeight);
|
|
DDX_Control(pDX,IDC_STAIR_HEIGHTCOMBOX,m_ctrlStairHeight);
|
|
DDX_Radio(pDX,IDC_RADIO_FIRST,m_iSelectFloor);
|
|
DDX_Check(pDX,IDC_HAS_CELLAR,m_bHasCellar);
|
|
DDX_Radio(pDX,IDC_LEFT_DOWN,m_bLeftDown);
|
|
DDX_Check(pDX,IDC_HAS_ROOF,m_bHasOutRoof);
|
|
DDX_Radio(pDX,IDC_LEFT_UP,m_bLeftUp);
|
|
//上楼方向
|
|
DDX_Radio(pDX,IDC_LEFT_UPDIR,m_bSelectUpDir);
|
|
DDX_Check(pDX,IDC_HAS_ARROW,m_bHasArrow);
|
|
//扶手
|
|
DDX_Text(pDX,IDC_RAIL_HEIGHT,m_strRailHeight);
|
|
DDX_Text(pDX,IDC_RAIL_WIDTH,m_strRailWidth);
|
|
DDX_Text(pDX,IDC_RAIL_DISTTOSIDE,m_strRailDistToSide);
|
|
|
|
DDX_Control(pDX,IDC_SPIN2,spin);
|
|
DDX_Text(pDX,IDC_STAIR_WIDTH,m_strStairWidth);
|
|
DDX_Text(pDX,IDC_SPACE_WIDTH,m_strSpaceWidth);
|
|
DDX_Text(pDX,IDC_STAIR_LENGTH,m_strStairLength);
|
|
DDX_Check(pDX,IDC_INSIDERAIL,m_bInsideRail);//内侧栏杆
|
|
DDX_Check(pDX,IDC_CHECK_HASINSIDERAIL,m_bHasInsideHandRail);//has inside handrail
|
|
|
|
//边梁
|
|
DDX_Check(pDX,IDC_LEFT_BEAM,m_bLeftBeam);
|
|
DDX_Check(pDX,IDC_RIGHT_BEAM,m_bRightBeam);
|
|
|
|
DDX_Check(pDX,IDC_OUTRAIL,m_bRailOut);
|
|
DDX_Check(pDX,IDC_RAIL_AUTO,m_bAutoOutRail);//是否自动生成扶手
|
|
|
|
DDX_Control(pDX,IDC_GROUP1,m_group1);
|
|
DDX_GroupStatus(pDX,IDC_GROUP1,m_bGroupStatus);
|
|
|
|
//是否有剖断
|
|
}
|
|
void CCrossStairDlg::OnClickSpaceWidth()
|
|
{//获取梯间宽的函数
|
|
double dDist=::_tstof(m_strSpaceWidth);
|
|
BeginEditorCommand();
|
|
int nRet=GetDist(_T("\n楼梯间宽度"), dDist, RSG_NOZERO|RSG_NONEG|RSG_2D);
|
|
CompleteEditorCommand();
|
|
if (nRet==RTNORM)
|
|
{
|
|
if (dDist<2.0*_MIN_STAIRWIDTH)
|
|
{
|
|
::AfxMessageBox(_T("梯间宽度不正确"));
|
|
return;
|
|
}
|
|
m_strSpaceWidth.Format(_T("%.2f"),dDist);
|
|
if (dDist<::_tstof(m_strStairWidth)*2)
|
|
{
|
|
m_strStairWidth.Format(_T("%.2f"),_tstof(m_strSpaceWidth)/2);
|
|
}
|
|
m_strStairWellWidth=Dist2Str(::_tstof(m_strSpaceWidth)-2.0*::_tstof(m_strStairWidth));
|
|
UpdateData(FALSE);
|
|
UpdateImage();
|
|
}
|
|
return;
|
|
}
|
|
void CCrossStairDlg::OnClickStairWidth()
|
|
{//获取梯段宽
|
|
double dDist=::_tstof(m_strStairWidth);
|
|
BeginEditorCommand();
|
|
int nRet=GetDist(_T("\n梯段宽度"), dDist, RSG_NOZERO|RSG_NONEG|RSG_2D);
|
|
CompleteEditorCommand();
|
|
if (nRet==RTNORM)
|
|
{
|
|
if (dDist>_tstof(m_strSpaceWidth)*0.5)
|
|
{
|
|
::AfxMessageBox(_T("梯段宽度不正确"));
|
|
return;
|
|
}
|
|
m_strStairWidth.Format(_T("%.2f"),dDist);
|
|
m_strStairWellWidth=Dist2Str(::_tstof(m_strSpaceWidth)-2.0*::_tstof(m_strStairWidth));
|
|
UpdateData(FALSE);
|
|
UpdateImage();
|
|
}
|
|
return;
|
|
}
|
|
void CCrossStairDlg::Obj2Dlg(const TDbEntity *pStep)
|
|
{
|
|
TDbCrossStair *pStair=TDbCrossStair::cast(pStep);
|
|
// [8/14/2008 nsh]
|
|
//--------------------------------
|
|
m_bEdit=TRUE;
|
|
m_pBakObj=(TDbCrossStair*)(pStair->clone());//专递值
|
|
//--------------------------------
|
|
//VERIFY(pStair);
|
|
//踏步操作
|
|
m_strStepHeight.Format(_T("%.2f"),pStair->GetStepHeight());
|
|
m_strStepWidth=Dist2Str(pStair->GetStepWidth());
|
|
m_nStepNum=pStair->GetStepNum();
|
|
m_strStairWidth=Dist2Str(pStair->GetStairWidth());
|
|
m_strStairHeight=Dist2Str(pStair->GetStairHeight());
|
|
m_strRailDistToSide=Dist2Str(pStair->GetRailDistToSide());
|
|
m_strRailOutDis=Dist2Str(pStair->GetRailDist());
|
|
int iFloor=pStair->GetStairFlag();
|
|
int iSide=pStair->GetSideFlag();
|
|
switch(iFloor)
|
|
{
|
|
case 0:
|
|
{
|
|
m_iSelectFloor=0;
|
|
if (iSide==1){m_bHasCellar=TRUE,m_bLeftDown=FALSE;}
|
|
else if (iSide==2){m_bHasCellar=TRUE,m_bLeftDown=TRUE;}
|
|
}
|
|
break;
|
|
case 1:
|
|
{
|
|
m_iSelectFloor=1;
|
|
}
|
|
break;
|
|
case 2:
|
|
{
|
|
m_iSelectFloor=2;
|
|
if (iSide==1){m_bHasOutRoof=TRUE,m_bLeftUp=FALSE;}
|
|
else if (iSide==2){m_bHasOutRoof=TRUE,m_bLeftUp=TRUE;}
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
m_strSpaceWidth=Dist2Str(pStair->GetSpaceWidth());
|
|
m_iSectStepNum=pStair->GetSectStepNum();
|
|
m_bAutoOutRail=pStair->IsAutoOutRail();
|
|
/*m_bLeftBeam=pStair->HasSideBeam(0);
|
|
m_bRightBeam=pStair->HasSideBeam(1);*/
|
|
m_bLeftBeam=pStair->IsInSideBeam();
|
|
m_bRightBeam=pStair->IsOutSideBeam();
|
|
|
|
m_bSelectUpDir=pStair->GetStartSide();
|
|
m_bRailOut=pStair->IsOutRail();
|
|
m_bAsAscent=pStair->IsAscent();
|
|
m_bOnGround=pStair->IsOnGround();
|
|
m_bSelectUpDir=pStair->GetStartSide();
|
|
m_bHasArrow=pStair->IsArrow();//标注
|
|
m_bInsideRail=pStair->IsAutoRail();
|
|
m_bHasInsideHandRail=pStair->IsInRail();//内侧扶手
|
|
m_strRailWidth=Dist2Str(pStair->GetRailWidth());
|
|
m_strRailHeight=Dist2Str(pStair->GetRailHeight());
|
|
//读取平台长度
|
|
m_dSlabLength=pStair->GetSlabSize();
|
|
m_dSlabLengthUR=pStair->GetSlabSizeUR();
|
|
m_dSlabLengthLR=pStair->GetSlabSizeLR();
|
|
//梯井宽度
|
|
m_strStairWellWidth=Dist2Str(::_tstof(m_strSpaceWidth)-2.0*::_tstof(m_strStairWidth));
|
|
return;
|
|
}
|
|
void CCrossStairDlg::Dlg2Obj(AcDbEntity *pStep)
|
|
{
|
|
TDbCrossStair *pStair=TDbCrossStair::cast(pStep);
|
|
//VERIFY(pStair);
|
|
pStair->SetStepHeight(::_tstof(m_strStepHeight));
|
|
pStair->SetStepWidth(::_tstof(m_strStepWidth));
|
|
pStair->SetStepNum(m_nStepNum);
|
|
pStair->SetStairWidth(::_tstof(m_strStairWidth));
|
|
pStair->SetRailWidth(::_tstof(m_strRailWidth));
|
|
pStair->SetRailHeight(::_tstof(m_strRailHeight));
|
|
pStair->SetRailDistToSide(::_tstof(m_strRailDistToSide));
|
|
pStair->SetRailDist(::_tstof(m_strRailOutDis));
|
|
pStair->SetStairFlag(m_iSelectFloor);
|
|
pStair->SetSpaceWidth(::_tstof(m_strSpaceWidth));
|
|
pStair->SetOutRail(m_bRailOut);
|
|
pStair->SetSideFlag(m_iLRDown);
|
|
pStair->SetSectStepNum(m_iSectStepNum);//剖切的读取可能会出现问题
|
|
pStair->SetStartSide(m_bSelectUpDir);
|
|
pStair->SetAscent(m_bAsAscent);
|
|
pStair->SetSlant(m_bHasSlant);//是否加防滑线
|
|
pStair->SetAutoOutRail(m_bRailOut?m_bAutoOutRail:FALSE);//是否自动生成栏杆
|
|
pStair->SetOnGround(m_bOnGround);
|
|
/*pStair->SetSideBeam(0,m_bLeftBeam);
|
|
pStair->SetSideBeam(1,m_bRightBeam);*/
|
|
pStair->SetInSideBeam(m_bLeftBeam);
|
|
pStair->SetOutSideBeam(m_bRightBeam);
|
|
pStair->SetViewCtrl(m_iViewCtrl);
|
|
//pStair->SetAutoRail(m_bInsideRail);
|
|
pStair->SetArrow(m_bHasArrow);
|
|
pStair->SetAutoRail(m_bHasInsideHandRail?m_bInsideRail:FALSE);//测试,内测栏杆
|
|
pStair->SetInRail(m_bHasInsideHandRail);//内侧扶手
|
|
//写入平台长度
|
|
pStair->SetSlabSize(m_dSlabLength);
|
|
pStair->SetSlabSizeUR(m_dSlabLengthUR);
|
|
pStair->SetSlabSizeLR(m_dSlabLengthLR);
|
|
// [8/14/2008 nsh]
|
|
//------------------------
|
|
if (m_bEdit)
|
|
{
|
|
delete m_pBakObj;
|
|
m_pBakObj=(TDbCrossStair*)(pStair->clone());
|
|
}
|
|
|
|
//------------------------
|
|
return;
|
|
}
|
|
AcDbEntity* CCrossStairDlg::NewObject()
|
|
{
|
|
TDbCrossStair *pEnt;
|
|
if (m_pBakObj==NULL)
|
|
{
|
|
pEnt=new TDbCrossStair;
|
|
pEnt->setLayer(InitLayer(LAY_STAIR));
|
|
pEnt->SetLayerHand3d(InitLayer(LAY_HANDRAIL));
|
|
pEnt->SetLayerRail3d(InitLayer(LAY_RAIL));
|
|
pEnt->SetLayerText(InitLayer(LAY_TEXT));
|
|
pEnt->SetTextStyle(InitTextStyle(TS_DIM));
|
|
pEnt->SetLayerArrow(InitLayer(LAY_OTHER_DIM));
|
|
|
|
//add by xlc on 090205 解决用户坐标系下预览文字倾斜的问题
|
|
pEnt->SetLayoutRotation(0);
|
|
|
|
return pEnt;
|
|
}
|
|
else
|
|
{
|
|
return (AcDbEntity*)(m_pBakObj->clone());
|
|
}
|
|
|
|
}
|
|
bool CCrossStairDlg::UpdateEdit(UINT ctrlID,bool bReportError/* =false */)
|
|
{//应用于Change事件
|
|
CWnd *pImageBox=GetDlgItem(IDC_PREVIEW);
|
|
if (!pImageBox)
|
|
return false;
|
|
if (GetSafeHwnd()==NULL)
|
|
return false;
|
|
|
|
CEdit *pEdit=(CEdit*)GetDlgItem(ctrlID);
|
|
if (pEdit==NULL)
|
|
return false;
|
|
|
|
static bool bUpdating=false;
|
|
if (bUpdating)
|
|
return false;
|
|
bUpdating=true;
|
|
|
|
CDataExchange dxOut(this,false);
|
|
CString temp;
|
|
pEdit->GetWindowText(temp);
|
|
switch(ctrlID)
|
|
{//以下分布的处理ID
|
|
case IDC_STAIR_WIDTH:
|
|
{//梯段宽
|
|
if (2*::_tstof(temp)<::_tstof(m_strSpaceWidth) && temp!=_T("") && ::_tstof(temp)>_DIST_SNAP)
|
|
{
|
|
m_strStairWidth=temp;
|
|
DDX_Text(&dxOut,IDC_STAIR_WIDTH,m_strStairWidth);
|
|
//梯井宽度
|
|
m_strStairWellWidth=Dist2Str(::_tstof(m_strSpaceWidth)-2.0*::_tstof(m_strStairWidth));
|
|
DDX_Text(&dxOut,IDC_STATIC_WELLWID,m_strStairWellWidth);
|
|
}
|
|
|
|
else
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("梯段宽不正确!"));
|
|
DDX_Text(&dxOut,IDC_STAIR_WIDTH,m_strStairWidth);
|
|
pEdit->SetFocus();
|
|
}
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
}
|
|
break;
|
|
case IDC_SPACE_WIDTH:
|
|
{//梯间宽
|
|
if (::_tstof(temp)>=2.0*_MIN_STAIRWIDTH)
|
|
{
|
|
m_strSpaceWidth=temp;
|
|
DDX_Text(&dxOut,IDC_SPACE_WIDTH,m_strSpaceWidth);
|
|
if (_tstof(m_strSpaceWidth)<_tstof(m_strStairWidth)*2)
|
|
{
|
|
m_strStairWidth.Format(_T("%.2f"),_tstof(m_strSpaceWidth)/2);
|
|
DDX_Text(&dxOut,IDC_STAIR_WIDTH,m_strStairWidth);
|
|
}
|
|
//梯井宽度
|
|
m_strStairWellWidth=Dist2Str(::_tstof(m_strSpaceWidth)-2.0*::_tstof(m_strStairWidth));
|
|
DDX_Text(&dxOut,IDC_STATIC_WELLWID,m_strStairWellWidth);
|
|
}
|
|
|
|
else
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("梯间宽不正确!"));
|
|
DDX_Text(&dxOut,IDC_SPACE_WIDTH,m_strSpaceWidth);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
}
|
|
break;
|
|
case IDC_STEP_HEIGHT:
|
|
{//踏步高
|
|
if (::_tstof(temp)<_DIST_SNAP|| (int)(::_tstof(m_strStairHeight)/::_tstof(temp))<2 ||temp==_T(""))
|
|
{
|
|
bUpdating=FALSE;
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("踏步高不正确!"));
|
|
DDX_Text(&dxOut,IDC_STEP_HEIGHT,m_strStepHeight);
|
|
pEdit->SetFocus();
|
|
}
|
|
return false;
|
|
}
|
|
int num=(int)(_tstof(m_strStairHeight)/_tstof(temp)+0.5);
|
|
if (_tstof(temp)>0&&num>1) {
|
|
m_nStepNum=num;
|
|
m_strStepHeight.Format(_T("%.2f"),_tstof(m_strStairHeight)/m_nStepNum);
|
|
DDX_Text(&dxOut,IDC_STEP_NUM,m_nStepNum);
|
|
if (bReportError)
|
|
DDX_Text(&dxOut,IDC_STEP_HEIGHT,m_strStepHeight);//自动调整
|
|
UpdateImage();
|
|
}
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_STEP_WIDTH:
|
|
{//踏步宽度
|
|
if (::_tstof(temp)>_DIST_SNAP && temp!=_T(""))
|
|
{
|
|
m_strStepWidth=temp;
|
|
DDX_Text(&dxOut,IDC_STEP_WIDTH,m_strStepWidth);
|
|
m_strStairLength=Dist2Str(_tstof(temp)*(m_bAsAscent? m_nStepNum : m_nStepNum-1));
|
|
DDX_Text(&dxOut,IDC_STAIR_LENGTH,m_strStairLength);
|
|
}
|
|
|
|
else
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("踏步宽度不正确!"));
|
|
DDX_Text(&dxOut,IDC_STEP_WIDTH,m_strStepWidth);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
}
|
|
break;
|
|
case IDC_STEP_NUM:
|
|
{//踏步数目
|
|
if (::_ttoi(temp)<2)
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("踏步数目不正确!"));
|
|
DDX_Text(&dxOut,IDC_STEP_NUM,m_nStepNum);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
//对剖切步数的控制
|
|
m_nStepNum=::_ttoi(temp);
|
|
m_strStepHeight.Format(_T("%.2f"),_tstof(m_strStairHeight)/m_nStepNum);
|
|
DDX_Text(&dxOut,IDC_STEP_HEIGHT,m_strStepHeight);
|
|
m_iSectStepNum=m_nStepNum/2;
|
|
DDX_Text(&dxOut,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
if (m_iSectStepNum>m_nStepNum)
|
|
{
|
|
m_iSectStepNum=m_nStepNum/2 +1;
|
|
DDX_Text(&dxOut,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
}
|
|
DDX_Text(&dxOut,IDC_STEP_NUM,m_nStepNum);
|
|
spin.SetRange(1,m_nStepNum);
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_RAIL_OUTDIS:
|
|
{//扶手伸出距离
|
|
if (::_tstof(temp)*2<-(::_tstof(m_strStepWidth))*m_nStepNum)
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("扶手伸出距离不正确!"));
|
|
DDX_Text(&dxOut,IDC_RAIL_OUTDIS,m_strRailOutDis);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
|
|
m_strRailOutDis=temp;
|
|
/*if (CheckENChange(IDC_RAIL_OUTDIS,temp))
|
|
return false;*/
|
|
DDX_Text(&dxOut,IDC_RAIL_OUTDIS,m_strRailOutDis);
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_RAIL_HEIGHT:
|
|
{//扶手高度
|
|
if (::_tstof(temp)<_DIST_SNAP)
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("扶手高度不正确!"));
|
|
DDX_Text(&dxOut,IDC_RAIL_HEIGHT,m_strRailHeight);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
m_strRailHeight=temp;
|
|
DDX_Text(&dxOut,IDC_RAIL_HEIGHT,m_strRailHeight);
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_RAIL_WIDTH:
|
|
{//扶手宽度
|
|
if (::_tstof(temp)<_DIST_SNAP||::_tstof(temp)*2>::_tstof(m_strStairWidth))
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("扶手宽度不正确!"));
|
|
DDX_Text(&dxOut,IDC_RAIL_WIDTH,m_strRailWidth);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
m_strRailWidth=temp;
|
|
DDX_Text(&dxOut,IDC_RAIL_WIDTH,m_strRailWidth);
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_RAIL_DISTTOSIDE:
|
|
{//扶手距边
|
|
if ((-::_tstof(temp)*2>::_tstof(m_strSpaceWidth)-2.0*::_tstof(m_strStairWidth)
|
|
||::_tstof(temp)*2>::_tstof(m_strStairWidth)))
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("扶手距边不正确!"));
|
|
DDX_Text(&dxOut,IDC_RAIL_DISTTOSIDE,m_strRailDistToSide);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
m_strRailDistToSide=temp;
|
|
DDX_Text(&dxOut,IDC_RAIL_DISTTOSIDE,m_strRailDistToSide);
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_POUSTEP_NUM:
|
|
{//剖切步数
|
|
if (::_tstof(temp)<1||::_tstof(temp)>m_nStepNum)
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("剖切步数不正确"));
|
|
DDX_Text(&dxOut,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
pEdit->SetFocus();
|
|
}
|
|
|
|
bUpdating=FALSE;
|
|
return false;
|
|
}
|
|
spin.SetRange(1,m_nStepNum);
|
|
m_iSectStepNum =::_ttoi(temp);
|
|
DDX_Text(&dxOut,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
if (bReportError){}
|
|
}
|
|
break;
|
|
case IDC_STAIR_HEIGHTCOMBOX:
|
|
{
|
|
// static CString strTemp;
|
|
// strTemp=m_strStairHeight;
|
|
// CDataExchange dxIn(this,TRUE);
|
|
// DDX_CBString(&dxIn,IDC_STAIR_HEIGHTCOMBOX,m_strStairHeight);
|
|
// m_ctrlStairHeight.GetLBText(m_ctrlStairHeight.GetCurSel(),temp);
|
|
// if (::_tstof(temp)<0 || temp=="")
|
|
// {
|
|
// if (bReportError)
|
|
// {
|
|
// ::AfxMessageBox(_T("楼梯高度不正确"));
|
|
// m_strStairHeight.Format(_T("%.2f"),_tstof(m_strStepHeight)*m_nStepNum);
|
|
// DDX_Text(&dxOut,IDC_STAIR_HEIGHTCOMBOX,m_strStairHeight);
|
|
// pEdit->SetFocus();
|
|
// }
|
|
//
|
|
// bUpdating=FALSE;
|
|
// return false;
|
|
// }
|
|
//
|
|
// m_strStairHeight=temp;
|
|
// DDX_Text(&dxOut,IDC_STAIR_HEIGHTCOMBOX,m_strStairHeight);
|
|
// m_nStepNum=(int)(_tstof(m_strStairHeight)/_tstof(m_strStepHeight)+0.5);
|
|
// DDX_Text(&dxOut,IDC_STEP_NUM,m_nStepNum);
|
|
// m_iSectStepNum=m_nStepNum/2;
|
|
// DDX_Text(&dxOut,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
// m_strStepHeight.Format(_T("%.2f"),::_tstof(m_strStairHeight)/m_nStepNum);
|
|
// DDX_Text(&dxOut,IDC_STEP_HEIGHT,m_strStepHeight);
|
|
if (_tstof(temp)>=2.0*_tstof(m_strStepHeight)-_DIST_SNAP && ::_tstof(temp)<=10000) {//最少当前2踏步高
|
|
m_strStairHeight=temp;
|
|
DDX_Text(&dxOut,IDC_STAIR_HEIGHTCOMBOX,m_strStairHeight);
|
|
m_nStepNum=(int)(_tstof(m_strStairHeight)/_tstof(m_strStepHeight)+0.5);
|
|
DDX_Text(&dxOut,IDC_STEP_NUM,m_nStepNum);
|
|
m_strStepHeight.Format(_T("%.2f"),(_tstof(m_strStairHeight)/m_nStepNum));
|
|
DDX_Text(&dxOut,IDC_STEP_HEIGHT,m_strStepHeight);
|
|
if (m_iSectStepNum>m_nStepNum)
|
|
{
|
|
m_iSectStepNum = int(m_nStepNum/2);
|
|
DDX_Text(&dxOut,IDC_POUSTEP_NUM,m_iSectStepNum);
|
|
}
|
|
UpdateImage();
|
|
}
|
|
else
|
|
{
|
|
if (bReportError)
|
|
{
|
|
::AfxMessageBox(_T("楼梯高度不正确"));
|
|
m_strStairHeight.Format(_T("%.2f"),_tstof(m_strStepHeight)*m_nStepNum);
|
|
DDX_CBString(&dxOut,IDC_STAIR_HEIGHTCOMBOX,m_strStairHeight);
|
|
pEdit->SetFocus();
|
|
}
|
|
bUpdating=false;
|
|
return false;
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
bUpdating=FALSE;
|
|
UpdateImage();
|
|
return false;
|
|
}
|
|
void CCrossStairDlg::OnControlRange(UINT ctrlID)
|
|
{
|
|
UpdateSel();
|
|
}
|
|
void CCrossStairDlg::UpdateSel()
|
|
{
|
|
//楼层处理
|
|
CBaseStairDlg::UpdateSel();
|
|
UpdateData();
|
|
switch(m_iSelectFloor)
|
|
{
|
|
case 0:
|
|
{
|
|
this->GetDlgItem(IDC_HAS_CELLAR)->EnableWindow(TRUE);
|
|
this->GetDlgItem(IDC_HAS_ROOF)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_LEFT_UP)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_UP)->EnableWindow(FALSE);
|
|
if (m_bHasCellar)
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_DOWN)->EnableWindow(TRUE);
|
|
this->GetDlgItem(IDC_RIGHT_DOWN)->EnableWindow(TRUE);
|
|
m_iLRDown=(m_bLeftDown==FALSE)?1:2;
|
|
}
|
|
else
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_DOWN)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_DOWN)->EnableWindow(FALSE);
|
|
m_iLRDown=0;
|
|
}
|
|
}
|
|
break;
|
|
case 1:
|
|
{
|
|
this->GetDlgItem(IDC_HAS_CELLAR)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_LEFT_DOWN)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_DOWN)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_HAS_ROOF)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_LEFT_UP)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_UP)->EnableWindow(FALSE);
|
|
m_iLRDown=0;
|
|
m_iLRUp=0;
|
|
}
|
|
break;
|
|
case 2:
|
|
{
|
|
this->GetDlgItem(IDC_HAS_CELLAR)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_LEFT_DOWN)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_DOWN)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_HAS_ROOF)->EnableWindow(TRUE);
|
|
if (m_bHasOutRoof)
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_UP)->EnableWindow(TRUE);
|
|
this->GetDlgItem(IDC_RIGHT_UP)->EnableWindow(TRUE);
|
|
m_iLRUp=(m_bLeftUp==FALSE)?1:2;
|
|
m_iLRDown=m_iLRUp;
|
|
}
|
|
else
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_UP)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_UP)->EnableWindow(FALSE);
|
|
m_iLRUp=0;
|
|
m_iLRDown=0;
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
//以下控制外侧扶手和自动生成栏杆的操作
|
|
this->GetDlgItem(IDC_RAIL_AUTO)->EnableWindow(m_bRailOut);
|
|
//以下对2D or 3D的显示
|
|
if (m_bNeed2D && m_bNeed3D) m_iViewCtrl=0;
|
|
else if (!m_bNeed2D && m_bNeed3D) m_iViewCtrl=2;
|
|
else if (m_bNeed2D && !m_bNeed3D) m_iViewCtrl=1;
|
|
else m_iViewCtrl=0;
|
|
this->GetDlgItem(IDC_INSIDERAIL)->EnableWindow(m_bHasInsideHandRail);
|
|
|
|
// 修改描述:各种楼梯对话框中的“标注上楼方向”一项
|
|
// 应在“需要2D”一项勾选后才变成可选择状态。(2097)
|
|
// 修改人,修改时间:Zyu modify on 100325
|
|
GetDlgItem(IDC_HAS_ARROW)->EnableWindow(m_bNeed2D);
|
|
|
|
//梯井宽度计算
|
|
m_strStairWellWidth=Dist2Str(::_tstof(m_strSpaceWidth)-2*::_tstof(m_strStairWidth));
|
|
|
|
UpdateData(FALSE);
|
|
UpdateImage();
|
|
return;
|
|
}
|
|
//事件处理函数
|
|
void CCrossStairDlg::OnChangeStairHeight()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_STAIR_HEIGHT)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_STAIR_HEIGHT);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeStairWidth()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_STAIR_WIDTH)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_STAIR_WIDTH);
|
|
}
|
|
}
|
|
void CCrossStairDlg ::OnChangeSpaceWidth()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_SPACE_WIDTH)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_SPACE_WIDTH,false);
|
|
}
|
|
}
|
|
|
|
void CCrossStairDlg::OnChangeStepWidth()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_STEP_WIDTH)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_STEP_WIDTH);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeStepNum()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_STEP_NUM)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_STEP_NUM);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnKFStepNum()
|
|
{
|
|
//modiby by xlc on 090317
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
CString strText;
|
|
GetDlgItem(IDC_STEP_NUM)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-m_nStepNum)<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_STEP_NUM,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeStepHeight()
|
|
{
|
|
// UpdateEdit(IDC_STEP_HEIGHT,false);
|
|
}
|
|
void CCrossStairDlg::OnKFStepHeight()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_STEP_HEIGHT)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strStepHeight))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_STEP_HEIGHT,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg ::OnChangePouNum()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_POUSTEP_NUM)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_POUSTEP_NUM);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeRailDistoSide()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_RAIL_DISTTOSIDE)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_RAIL_DISTTOSIDE);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeRailHeight()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_RAIL_HEIGHT)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_RAIL_HEIGHT);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeRailOutDis()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_RAIL_OUTDIS)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_RAIL_OUTDIS);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnChangeRailWidth()
|
|
{
|
|
CString temp;
|
|
this->GetDlgItem(IDC_RAIL_WIDTH)->GetWindowText(temp);
|
|
if (temp!=_T(""))
|
|
{
|
|
UpdateEdit(IDC_RAIL_WIDTH);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnClickRailOut()
|
|
{
|
|
UpdateData(TRUE);
|
|
this->GetDlgItem(IDC_RAIL_AUTO)->EnableWindow(m_bRailOut);
|
|
UpdateImage();
|
|
}
|
|
//楼梯高度的ComBox的处理
|
|
void CCrossStairDlg::OnSelChangeStairHeightComBox()
|
|
{
|
|
UpdateEdit(IDC_STAIR_HEIGHTCOMBOX);
|
|
}
|
|
void CCrossStairDlg::OnChangeStairHeightComBox()
|
|
{
|
|
// CString temp;
|
|
// this->GetDlgItem(IDC_STAIR_HEIGHTCOMBOX)->GetWindowText(temp);
|
|
// if (temp!=_T(""))
|
|
// {
|
|
// UpdateEdit(IDC_STAIR_HEIGHTCOMBOX);
|
|
// }
|
|
}
|
|
void CCrossStairDlg::OnKFStairHeight()
|
|
{//楼层高度失去焦点的操作
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
CString strText;
|
|
GetDlgItem(IDC_STAIR_HEIGHTCOMBOX)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strStairHeight))<_DIST_SNAP)
|
|
return;
|
|
UpdateEdit(IDC_STAIR_HEIGHTCOMBOX,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnClickHasCellar()
|
|
{//有地下室
|
|
UpdateData(TRUE);
|
|
if (m_bHasCellar)
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_DOWN)->EnableWindow(TRUE);
|
|
this->GetDlgItem(IDC_RIGHT_DOWN)->EnableWindow(TRUE);
|
|
m_iLRDown=(m_bLeftDown==FALSE)?1:2;
|
|
}
|
|
else
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_DOWN)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_DOWN)->EnableWindow(FALSE);
|
|
m_iLRDown=0;
|
|
}
|
|
UpdateImage();
|
|
}
|
|
void CCrossStairDlg::OnClickHasRoof()
|
|
{//有出屋顶
|
|
UpdateData(TRUE);
|
|
if (m_bHasOutRoof)
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_UP)->EnableWindow(TRUE);
|
|
this->GetDlgItem(IDC_RIGHT_UP)->EnableWindow(TRUE);
|
|
m_iLRUp=(m_bLeftUp==FALSE)?1:2;
|
|
m_iLRDown=m_iLRUp;
|
|
}
|
|
else
|
|
{
|
|
this->GetDlgItem(IDC_LEFT_UP)->EnableWindow(FALSE);
|
|
this->GetDlgItem(IDC_RIGHT_UP)->EnableWindow(FALSE);
|
|
m_iLRUp=0;
|
|
m_iLRDown=0;
|
|
}
|
|
UpdateImage();
|
|
}
|
|
BOOL CCrossStairDlg::CheckENChange(UINT ctrlID,const CString pStr)
|
|
{
|
|
CString temp;
|
|
this->GetDlgItemText(ctrlID,temp);
|
|
if (temp==pStr)
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
void CCrossStairDlg::OnClose()
|
|
{
|
|
GetDlgItem(IDCANCEL)->SetFocus();
|
|
CBaseStairDlg::OnClose();
|
|
}
|
|
|
|
|
|
void CCrossStairDlg::OnKFStairWidth()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_STAIR_WIDTH)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strStairWidth))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_STAIR_WIDTH,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg ::OnKFSpaceWidth()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_SPACE_WIDTH)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strSpaceWidth))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_SPACE_WIDTH,true);
|
|
}
|
|
}
|
|
|
|
void CCrossStairDlg::OnKFStepWidth()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_STEP_WIDTH)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strStepWidth))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_STEP_WIDTH,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg ::OnKFPouNum()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_POUSTEP_NUM)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-m_iSectStepNum)<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_POUSTEP_NUM,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnKFRailDistoSide()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_RAIL_DISTTOSIDE)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strRailDistToSide))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_RAIL_DISTTOSIDE,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnKFRailHeight()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_RAIL_HEIGHT)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strRailHeight))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_RAIL_HEIGHT,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnKFRailOutDis()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_RAIL_OUTDIS)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strRailOutDis))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_RAIL_OUTDIS,true);
|
|
}
|
|
}
|
|
void CCrossStairDlg::OnKFRailWidth()
|
|
{
|
|
if (GetFocus()!=GetDlgItem(IDCANCEL))
|
|
{
|
|
//modiby by xlc on 090317
|
|
CString strText;
|
|
GetDlgItem(IDC_RAIL_WIDTH)->GetWindowText(strText);
|
|
if (fabs(_tstof(strText)-_tstof(m_strRailWidth))<_DIST_SNAP)
|
|
return;
|
|
|
|
UpdateEdit(IDC_RAIL_WIDTH,true);
|
|
}
|
|
}
|