2026-10-04 00:04:20 +08:00
|
|
|
|
// UndergroundRampDlg.cpp : 实现文件
|
2026-09-28 15:28:50 +08:00
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "UndergroundRampDlg.h"
|
|
|
|
|
|
#include "UnderGroundView.h"
|
|
|
|
|
|
#include "GlwGlobalVariable.h"
|
|
|
|
|
|
#include "GlwUGRampDataManage.h"
|
|
|
|
|
|
#define UIFRAME_API __declspec( dllimport )
|
|
|
|
|
|
#include "DataLoadAndSave.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
|
{
|
2026-10-04 00:04:20 +08:00
|
|
|
|
#define TARCH20_SYMBOL_KEY_UNDERGROUNDRAMP _T("UnderGroundRamp_CString") //注册表项
|
|
|
|
|
|
#define TARCH20_SYMBOL_TERMNAME _T("AllControlWndData\\SymbolWndData") //键
|
2026-09-28 15:28:50 +08:00
|
|
|
|
#define DIVSTRING _T("^@^")
|
|
|
|
|
|
|
|
|
|
|
|
#if ADS <= 18
|
|
|
|
|
|
double _ttof(LPCTSTR psz)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!psz) return .0;
|
|
|
|
|
|
USES_CONVERSION;
|
|
|
|
|
|
return atof(W2A(psz));
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
CString format(int i)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
str.Format(_T("%d"), i);
|
|
|
|
|
|
return str;
|
|
|
|
|
|
}
|
|
|
|
|
|
CString format(bool bValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
str.Format(_T("%d"), (int)bValue);
|
|
|
|
|
|
return str;
|
|
|
|
|
|
}
|
|
|
|
|
|
CString format(double dValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
str.Format(_T("%.f"),dValue);
|
|
|
|
|
|
return str;
|
|
|
|
|
|
}
|
|
|
|
|
|
CString MergeStr(const std::vector<CString>& subStr)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString str = _T("");
|
|
|
|
|
|
CString strTemp = _T("");
|
|
|
|
|
|
std::vector<CString>::const_iterator iter = subStr.begin();
|
|
|
|
|
|
if (iter == subStr.end())
|
|
|
|
|
|
return str;
|
|
|
|
|
|
strTemp = *iter;
|
|
|
|
|
|
if (strTemp.IsEmpty()) strTemp = _T(" ");
|
|
|
|
|
|
str += strTemp;
|
|
|
|
|
|
++iter;
|
|
|
|
|
|
for (iter; iter != subStr.end(); ++iter)
|
|
|
|
|
|
{
|
|
|
|
|
|
strTemp = *iter;
|
|
|
|
|
|
if (strTemp.IsEmpty()) strTemp = _T(" ");
|
|
|
|
|
|
str += DIVSTRING + strTemp;
|
|
|
|
|
|
}
|
|
|
|
|
|
return str;
|
|
|
|
|
|
}
|
|
|
|
|
|
int SplitString(LPCTSTR pszOri, LPCTSTR pszSplit, std::vector<CString> &vec)
|
|
|
|
|
|
{
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!pszOri) break;
|
|
|
|
|
|
vec.clear();
|
|
|
|
|
|
|
|
|
|
|
|
if (!pszSplit)
|
|
|
|
|
|
{
|
|
|
|
|
|
vec.push_back(pszOri);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CString sOri(pszOri), sSplit(pszSplit), sRel(_T(""));
|
|
|
|
|
|
int nSplitLen(sSplit.GetLength()), nFindPos(0), nRel(0);
|
|
|
|
|
|
while ((nFindPos = sOri.Find(sSplit, 0)) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
sRel = sOri.Mid(0, nFindPos);
|
|
|
|
|
|
vec.push_back(sRel);
|
|
|
|
|
|
sOri = sOri.Right(sOri.GetLength() - nFindPos - nSplitLen);
|
|
|
|
|
|
++nRel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!sOri.IsEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
vec.push_back(sOri);
|
|
|
|
|
|
++nRel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return nRel;
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CUndergroundRampDlg* CUndergroundRampDlg::g_pCurDlg = NULL;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
double CUndergroundRampDlg::m_wndEdtWidth(4000.0); //宽度
|
|
|
|
|
|
double CUndergroundRampDlg::m_wndEdtRadius (6000.0); //转弯半径
|
2026-09-28 15:28:50 +08:00
|
|
|
|
int CUndergroundRampDlg::m_iLocationLine(0);
|
|
|
|
|
|
int CUndergroundRampDlg::m_iLocation(3);
|
|
|
|
|
|
int CUndergroundRampDlg::m_iViewStyle(6);
|
|
|
|
|
|
BOOL CUndergroundRampDlg::m_bRoadMidline = FALSE;
|
|
|
|
|
|
BOOL CUndergroundRampDlg::m_bLableArrow = FALSE;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// CUndergroundRampDlg 对话框
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CUndergroundRampDlg, CModelessDialog)
|
|
|
|
|
|
|
|
|
|
|
|
CUndergroundRampDlg::CUndergroundRampDlg(CWnd* pParent /*=NULL*/)
|
|
|
|
|
|
: CModelessDialog(CUndergroundRampDlg::IDD, pParent)
|
|
|
|
|
|
{
|
|
|
|
|
|
g_pCurDlg = this;
|
|
|
|
|
|
LoadRegeditSaveData();
|
|
|
|
|
|
if (DocGetMeterUnitDraw())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndEdtWidth = m_wndEdtWidth / 1000 + (m_wndEdtWidth - (m_wndEdtWidth / 1000) * 1000);
|
|
|
|
|
|
m_wndEdtRadius = m_wndEdtRadius / 1000 + (m_wndEdtRadius - (m_wndEdtRadius / 1000) * 1000);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CUndergroundRampDlg::~CUndergroundRampDlg()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (DocGetMeterUnitDraw())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndEdtWidth = m_wndEdtWidth * 1000;
|
|
|
|
|
|
m_wndEdtRadius = m_wndEdtRadius * 1000;
|
|
|
|
|
|
}
|
|
|
|
|
|
SaveToRegeditData();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
|
{
|
|
|
|
|
|
CModelessDialog::DoDataExchange(pDX);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDT_UNGR_WIDTH, m_wndEdtWidth);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDT_UNGR_RADIUS, m_wndEdtRadius);
|
|
|
|
|
|
DDX_Control(pDX, IDC_CHK_UNGR_MIDLINE, m_wndChkMidline);
|
|
|
|
|
|
DDX_Control(pDX, IDC_CHK_UNGR_LABLEARROW, m_wndChkLableArrow);
|
|
|
|
|
|
DDX_Control(pDX, IDC_PIC_UNGR_VIEWS, m_wndPreview);
|
|
|
|
|
|
DDX_Radio(pDX, IDC_RAD_UNGR_MIDLINE, m_iLocationLine);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CUndergroundRampDlg, CModelessDialog)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RAD_UNGR_MIDLINE, OnBnClickedRadUngrMidline)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RAD_UNGR_LEFTLINE, OnBnClickedRadUngrLeftline)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RAD_UNGR_RIGHTLINE, OnBnClickedRadUngrRightline)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_CHK_UNGR_MIDLINE, OnBnClickedChkUngrMidline)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_CHK_UNGR_LABLEARROW, OnBnClickedChkUngrLablearrow)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RAD_UNGR_ENTER, OnBnClickedRadUngrEnter)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RAD_UNGR_EXIT, OnBnClickedRadUngrExit)
|
|
|
|
|
|
ON_EN_KILLFOCUS(IDC_EDT_UNGR_WIDTH, OnEnKillfocusEdtUngrWidth)
|
|
|
|
|
|
ON_EN_KILLFOCUS(IDC_EDT_UNGR_RADIUS, OnEnKillfocusEdtUngrRadius)
|
|
|
|
|
|
ON_WM_CTLCOLOR()
|
|
|
|
|
|
ON_STN_CLICKED(IDC_PIC_UNGR_STYLES, OnStnClickedPicUngrStyles)
|
|
|
|
|
|
ON_STN_CLICKED(IDC_PIC_UNGR_VIEWS, OnStnClickedPicUngrViews)
|
|
|
|
|
|
ON_WM_SETCURSOR()
|
|
|
|
|
|
ON_WM_CLOSE()
|
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// CUndergroundRampDlg 消息处理程序
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CUndergroundRampDlg::OnInitDialog()
|
|
|
|
|
|
{
|
|
|
|
|
|
CModelessDialog::OnInitDialog();
|
|
|
|
|
|
/*UpdateData(FALSE);*/
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 获取当前的绘图单位 bIsMetre=true:M;bIsMetre=false:mm
|
2026-09-28 15:28:50 +08:00
|
|
|
|
BOOL bIsMetre = DocGetMeterUnitDraw();
|
|
|
|
|
|
if (bIsMetre)
|
2026-10-04 00:04:20 +08:00
|
|
|
|
this->SetWindowText(_T("地下坡道(单位:M)")); // 对话框标题设置
|
2026-09-28 15:28:50 +08:00
|
|
|
|
else
|
2026-10-04 00:04:20 +08:00
|
|
|
|
this->SetWindowText(_T("地下坡道(单位:mm)"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
if (m_bLableArrow)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndChkLableArrow.SetCheck(1);
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_ENTER))->EnableWindow(TRUE);
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_EXIT))->EnableWindow(TRUE);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndChkLableArrow.SetCheck(0);
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_ENTER))->EnableWindow(FALSE);
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_EXIT))->EnableWindow(FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (m_bRoadMidline)
|
|
|
|
|
|
m_wndChkMidline.SetCheck(1);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//switch (m_iLocationLine)//定位线位置
|
2026-09-28 15:28:50 +08:00
|
|
|
|
//{
|
|
|
|
|
|
//case MIDLINE:
|
|
|
|
|
|
// ((CButton*)GetDlgItem(IDC_RAD_UNGR_MIDLINE))->SetCheck(1);
|
|
|
|
|
|
// break;
|
|
|
|
|
|
//case LEFTLINE:
|
|
|
|
|
|
// ((CButton*)GetDlgItem(IDC_RAD_UNGR_LEFTLINE))->SetCheck(1);
|
|
|
|
|
|
// break;
|
|
|
|
|
|
//case RIGHTLINE:
|
|
|
|
|
|
// ((CButton*)GetDlgItem(IDC_RAD_UNGR_RIGHTLINE))->SetCheck(1);
|
|
|
|
|
|
// break;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
switch (m_iLocation)//箭头位置
|
2026-09-28 15:28:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
case ENTER:
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_ENTER))->SetCheck(1);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case EXITS:
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_EXIT))->SetCheck(1);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
SetView();
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::OnBnClickedRadUngrMidline()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iLocationLine = MIDLINE;
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetLOPLoc(m_iLocationLine);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::OnBnClickedRadUngrLeftline()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iLocationLine = LEFTLINE;
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetLOPLoc(m_iLocationLine);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::OnBnClickedRadUngrRightline()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iLocationLine = RIGHTLINE;
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetLOPLoc(m_iLocationLine);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//点击 绘制道路中线
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void CUndergroundRampDlg::OnBnClickedChkUngrMidline()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_wndChkMidline.GetCheck())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndChkMidline.SetCheck(1);
|
|
|
|
|
|
m_bRoadMidline = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndChkMidline.SetCheck(0);
|
|
|
|
|
|
m_bRoadMidline = FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetIsDrawMidLine(m_bRoadMidline);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//箭头
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void CUndergroundRampDlg::OnBnClickedChkUngrLablearrow()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_wndChkLableArrow.GetCheck())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndChkLableArrow.SetCheck(1);
|
|
|
|
|
|
m_bLableArrow = TRUE;
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_ENTER))->EnableWindow(TRUE);
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_EXIT))->EnableWindow(TRUE);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_wndChkLableArrow.SetCheck(0);
|
|
|
|
|
|
m_bLableArrow = FALSE;
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_ENTER))->EnableWindow(FALSE);
|
|
|
|
|
|
((CButton*)GetDlgItem(IDC_RAD_UNGR_EXIT))->EnableWindow(FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetIsDimArrow(m_bLableArrow);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//点击 入口
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void CUndergroundRampDlg::OnBnClickedRadUngrEnter()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iLocation = ENTER;
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetArrowDrec(m_iLocation);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::OnBnClickedRadUngrExit()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iLocation = EXITS;
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetArrowDrec(m_iLocation);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::OnEnKillfocusEdtUngrWidth()
|
|
|
|
|
|
{
|
|
|
|
|
|
double dTmp = m_wndEdtWidth;
|
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
if (m_wndEdtWidth <= 0)
|
|
|
|
|
|
{
|
2026-10-04 00:04:20 +08:00
|
|
|
|
MessageBox(_T("请输入大于0的数值!"), _T("AutoCAD"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
m_wndEdtWidth = dTmp;
|
|
|
|
|
|
}
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
if(!GET_GLOBAL_VARIABLE(GlwUGRampDataManage))
|
|
|
|
|
|
SET_GLOBAL_VARIABLE(GlwUGRampDataManage, new GlwUGRampDataManage);
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetRampWidth(m_wndEdtWidth);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::OnEnKillfocusEdtUngrRadius()
|
|
|
|
|
|
{
|
|
|
|
|
|
double dTmp = m_wndEdtRadius;
|
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
if (m_wndEdtRadius <= 0)
|
|
|
|
|
|
{
|
2026-10-04 00:04:20 +08:00
|
|
|
|
MessageBox(_T("请输入大于0的数值!"), _T("AutoCAD"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
m_wndEdtRadius = dTmp;
|
|
|
|
|
|
}
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
if(!GET_GLOBAL_VARIABLE(GlwUGRampDataManage))
|
|
|
|
|
|
SET_GLOBAL_VARIABLE(GlwUGRampDataManage, new GlwUGRampDataManage);
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetTurningRad(m_wndEdtRadius);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HBRUSH CUndergroundRampDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
|
|
|
|
|
{
|
|
|
|
|
|
HBRUSH hbr = CModelessDialog::OnCtlColor(pDC, pWnd, nCtlColor);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// TODO: 在此更改 DC 的任何特性
|
2026-09-28 15:28:50 +08:00
|
|
|
|
// if (pWnd->m_hWnd == ((CButton*)GetDlgItem(IDC_GRP_UNGR_LOCATION))->m_hWnd)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CRect rc;
|
|
|
|
|
|
// ((CButton*)GetDlgItem(IDC_GRP_UNGR_LOCATION))->GetClientRect(&rc);
|
|
|
|
|
|
// pDC->SetBkMode(TRANSPARENT);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// pDC->SetTextColor(RGB(255, 0, 0));//红色字体
|
2026-09-28 15:28:50 +08:00
|
|
|
|
// // Return our CBrush object
|
|
|
|
|
|
// hbr = 0;//m_brushRed;//red
|
|
|
|
|
|
// }
|
|
|
|
|
|
// return (HBRUSH)::GetStockObject(NULL_BRUSH);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
|
2026-09-28 15:28:50 +08:00
|
|
|
|
return hbr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//点击图片弹窗
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void CUndergroundRampDlg::OnStnClickedPicUngrStyles()
|
|
|
|
|
|
{
|
|
|
|
|
|
CUnderGroundView dlg;
|
|
|
|
|
|
if(IDOK == dlg.DoModal())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iViewStyle = dlg.GetViewStyle();
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if (m_iViewStyle < 0 || m_iViewStyle > 8)//安全检查
|
2026-09-28 15:28:50 +08:00
|
|
|
|
m_iViewStyle = 1;
|
|
|
|
|
|
SetView();
|
|
|
|
|
|
if(!GET_GLOBAL_VARIABLE(GlwUGRampDataManage))
|
|
|
|
|
|
SET_GLOBAL_VARIABLE(GlwUGRampDataManage, new GlwUGRampDataManage);
|
|
|
|
|
|
GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage);
|
|
|
|
|
|
pRampDataManage->SetDrawStyle(m_iViewStyle);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
void CUndergroundRampDlg::OnStnClickedPicUngrViews()
|
|
|
|
|
|
{
|
|
|
|
|
|
OnStnClickedPicUngrStyles();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 设置图片
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void CUndergroundRampDlg::SetView()
|
|
|
|
|
|
{
|
|
|
|
|
|
CAcModuleResourceOverride vTemp;
|
|
|
|
|
|
CBitmap bmp;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
switch (m_iViewStyle)//预览图片
|
2026-09-28 15:28:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
case VIEW1:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR1);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW2:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR2);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW3:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR3);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW4:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR4);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW5:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR5);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW6:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR6);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW7:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR7);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW8:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR8);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case VIEW9:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR9);
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
bmp.LoadBitmap(IDB_BMP_UNGR1);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
HBITMAP hBmp = m_wndPreview.SetBitmap(bmp);
|
|
|
|
|
|
::DeleteObject(hBmp);
|
|
|
|
|
|
bmp.Detach();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CUndergroundRampDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWnd *pSlideWnd = GetDlgItem(IDC_PIC_UNGR_VIEWS);
|
|
|
|
|
|
if (pWnd && pWnd->m_hWnd == pSlideWnd->m_hWnd)
|
|
|
|
|
|
{
|
|
|
|
|
|
CAcModuleResourceOverride vTemp;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
HCURSOR hIcon = AfxGetApp()->LoadCursor(IDC_CURSOR_HAND);//标准鼠标箭头图标IDC_HAND无效
|
2026-09-28 15:28:50 +08:00
|
|
|
|
SetCursor(hIcon);
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
return CModelessDialog::OnSetCursor(pWnd, nHitTest, message);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CUndergroundRampDlg::GetViewStyle()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_iViewStyle;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double CUndergroundRampDlg::GetWidth()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_wndEdtWidth;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double CUndergroundRampDlg::GetRadius()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_wndEdtRadius;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CUndergroundRampDlg::GetLocationLine()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_iLocationLine;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CUndergroundRampDlg::GetMidline()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_bRoadMidline;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CUndergroundRampDlg::GetLableArrow()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_bLableArrow;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CUndergroundRampDlg::GetArrowLoc()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_iLocation;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::UpdataLoctionLine(int nLocationLine)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_iLocationLine = nLocationLine;
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
void CUndergroundRampDlg::OnClose()
|
|
|
|
|
|
{
|
|
|
|
|
|
acedPostCommand(_T("\33\33"));
|
|
|
|
|
|
}
|
|
|
|
|
|
void CUndergroundRampDlg::LoadRegeditSaveData()
|
|
|
|
|
|
{
|
|
|
|
|
|
CString strTmp;
|
|
|
|
|
|
DataLoadAndSave::readRecordDataCString(TARCH20_SYMBOL_KEY_UNDERGROUNDRAMP, strTmp, TARCH20_SYMBOL_TERMNAME);
|
|
|
|
|
|
if (strTmp.IsEmpty())
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//将str划分为vector<CString>使用 DIVSTRING 为分隔符
|
2026-09-28 15:28:50 +08:00
|
|
|
|
std::vector<CString> strWndData;
|
|
|
|
|
|
SplitString(strTmp, DIVSTRING, strWndData);
|
|
|
|
|
|
|
|
|
|
|
|
if (strWndData.size() <7)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_wndEdtWidth = _ttoi(strWndData[0]);
|
|
|
|
|
|
m_wndEdtRadius = _ttof(strWndData[1]);
|
|
|
|
|
|
m_iLocationLine = _ttoi(strWndData[2]); //3
|
|
|
|
|
|
m_iLocation = _ttoi(strWndData[3]);
|
|
|
|
|
|
m_bRoadMidline = _ttoi(strWndData[4]);
|
|
|
|
|
|
m_bLableArrow = _ttoi(strWndData[5]); //6
|
|
|
|
|
|
m_iViewStyle = _ttoi(strWndData[6]);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CUndergroundRampDlg::SaveToRegeditData()
|
|
|
|
|
|
{
|
|
|
|
|
|
std::vector<CString> strWndData;
|
|
|
|
|
|
strWndData.clear();
|
|
|
|
|
|
strWndData.push_back(format(m_wndEdtWidth));
|
|
|
|
|
|
strWndData.push_back(format(m_wndEdtRadius));
|
|
|
|
|
|
strWndData.push_back(format(m_iLocationLine));
|
|
|
|
|
|
strWndData.push_back(format(m_iLocation));
|
|
|
|
|
|
strWndData.push_back(format(m_bRoadMidline));
|
|
|
|
|
|
strWndData.push_back(format(m_bLableArrow));
|
|
|
|
|
|
strWndData.push_back(format(m_iViewStyle));
|
2026-10-04 00:04:20 +08:00
|
|
|
|
CString strTmp = MergeStr(strWndData);//组合字符串
|
2026-09-28 15:28:50 +08:00
|
|
|
|
DataLoadAndSave::writeRecordDataCString(TARCH20_SYMBOL_KEY_UNDERGROUNDRAMP, strTmp, TARCH20_SYMBOL_TERMNAME);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|