Files
envi-code/SourceCode/Code2026/tg_shs/shs_kerncmd/FloorRectEditDlg.cpp
T

113 lines
2.4 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
// FloorRectEditDlg.cpp : 实现文件
2026-09-28 15:28:50 +08:00
//
#include "stdafx.h"
#include "FloorRectEditDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
2026-10-04 00:04:20 +08:00
// CFloorRectEditDlg 对话框
2026-09-28 15:28:50 +08:00
CFloorRectEditDlg::CFloorRectEditDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFloorRectEditDlg::IDD, pParent)
, m_csFloorName(_T(""))
, m_csFloorHeight(_T(""))
{
}
CFloorRectEditDlg::~CFloorRectEditDlg()
{
}
void CFloorRectEditDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_FLOORNAME, m_csFloorName);
DDX_Text(pDX, IDC_EDIT_FLOORHEIGHT, m_csFloorHeight);
}
BEGIN_MESSAGE_MAP(CFloorRectEditDlg, CDialog)
ON_BN_CLICKED(IDOK, OnBnClickedOk)
ON_EN_KILLFOCUS(IDC_EDIT_FLOORHEIGHT, OnEnKillfocusEditFloorheight)
ON_EN_KILLFOCUS(IDC_EDIT_FLOORNAME, OnEnKillfocusEditFloorname)
END_MESSAGE_MAP()
BOOL CFloorRectEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
2026-10-04 00:04:20 +08:00
// 设置对话框标题
2026-09-28 15:28:50 +08:00
CString csTitle;
2026-10-04 00:04:20 +08:00
csTitle.Format(_T("楼层参数 [%s]"), m_csProjectName);
2026-09-28 15:28:50 +08:00
SetWindowText(csTitle);
m_csPrompt = _T("");
GetDlgItem(IDC_STATIC_WARNING)->SetWindowText(m_csPrompt);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFloorRectEditDlg::OnEnKillfocusEditFloorheight()
{
}
void CFloorRectEditDlg::OnEnKillfocusEditFloorname()
{
}
void CFloorRectEditDlg::OnBnClickedOk()
{
OnOK();
}
2026-10-04 00:04:20 +08:00
// sg add 100121,楼层框
2026-09-28 15:28:50 +08:00
int EditFloorRect(AcDbObjectId id)
{
OPENOBJ_BEGIN(id, AcDb::kForRead, TDbFloorRect, pFloorRect);
if (pFloorRect != NULL)
{
2026-10-04 00:04:20 +08:00
CString csName = pFloorRect->GetFloorName(), // 楼层号
csProject = pFloorRect->GetSpare(); // 工程名称
2026-09-28 15:28:50 +08:00
double dHeight = pFloorRect->GetFloorHeight();
CString csFloorHeight;
2026-10-04 00:04:20 +08:00
csFloorHeight.Format(_T("%.0f"), dHeight); // 楼层标高
2026-09-28 15:28:50 +08:00
CFloorRectEditDlg dlg(acedGetAcadFrame());
dlg.m_csProjectName = csProject;
dlg.m_csFloorName = csName;
dlg.m_csFloorHeight = csFloorHeight;
CAcModuleResourceOverride vTemp;
if (dlg.DoModal() == IDOK)
{
if (pFloorRect->upgradeOpen() != Acad::eOk)
{
return RTERROR;
}
pFloorRect->assertWriteEnabled();
pFloorRect->SetFloorName(dlg.m_csFloorName);
dHeight = _tstof(dlg.m_csFloorHeight);
pFloorRect->SetFloorHeight(dHeight);
pFloorRect->downgradeOpen();
}
}
OPENOBJ_END();
return RTNORM;
}