Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

114 lines
2.4 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// FloorRectEditDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "FloorRectEditDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CFloorRectEditDlg 对话框
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();
// 设置对话框标题
CString csTitle;
csTitle.Format(_T("楼层参数 [%s]"), m_csProjectName);
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();
}
// sg add 100121,楼层框
int EditFloorRect(AcDbObjectId id)
{
OPENOBJ_BEGIN(id, AcDb::kForRead, TDbFloorRect, pFloorRect);
if (pFloorRect != NULL)
{
CString csName = pFloorRect->GetFloorName(), // 楼层号
csProject = pFloorRect->GetSpare(); // 工程名称
double dHeight = pFloorRect->GetFloorHeight();
CString csFloorHeight;
csFloorHeight.Format(_T("%.0f"), dHeight); // 楼层标高
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;
}