179 lines
3.6 KiB
C++
179 lines
3.6 KiB
C++
#if !defined(AFX_INTERSECTPOINTNUMBERDLG_H__B92B95C5_906F_42BC_A57D_00B09BDC0755__INCLUDED_)
|
|
#define AFX_INTERSECTPOINTNUMBERDLG_H__B92B95C5_906F_42BC_A57D_00B09BDC0755__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include "resource.h"
|
|
#include "SymbDialog.h"
|
|
|
|
extern AcDbObjectId InitTextStyle(TTextStyle ts, AcDbDatabase *pDb = NULL);
|
|
extern AcDbObjectId InitTextStyle(const TCHAR *pszStyle, AcDbDatabase *pDb = NULL);
|
|
class CIntersectPointNumberDlg : public CModelessDialog
|
|
{
|
|
|
|
public:
|
|
|
|
CIntersectPointNumberDlg(int iType, CWnd* pParent = NULL);
|
|
|
|
double m_nHeight;
|
|
AcDbObjectId m_idStyle;
|
|
XStringList m_lstStyle;
|
|
CComboBox m_comboStyle;
|
|
CString m_strStyle;
|
|
|
|
bool IsDestroy();
|
|
// 数字串加1
|
|
void AutoAdd(CString &strNumber);
|
|
// 编号加1
|
|
void Add();
|
|
|
|
CString GetNumber()
|
|
{
|
|
UpdateData(TRUE);
|
|
return m_strWndEdtNumber;
|
|
}
|
|
|
|
void SetNumber(const CString &strNumber)
|
|
{
|
|
m_strWndEdtNumber = strNumber;
|
|
}
|
|
|
|
CString GetPrefix()
|
|
{
|
|
UpdateData(TRUE);
|
|
return m_strWndEdtPrefix;
|
|
}
|
|
|
|
void SetPrefix(const CString& strPrefix)
|
|
{
|
|
m_strWndEdtPrefix = strPrefix;
|
|
}
|
|
|
|
int GetTextAlign()
|
|
{
|
|
UpdateData(TRUE);
|
|
return m_nWndCmbTextPos;
|
|
}
|
|
|
|
void SetTextAlign(int nAlign)
|
|
{
|
|
m_nWndCmbTextPos = nAlign;
|
|
}
|
|
|
|
double GetHeight()
|
|
{
|
|
UpdateData(TRUE);
|
|
return m_nHeight;
|
|
}
|
|
|
|
AcDbObjectId GetStyleId()
|
|
{
|
|
UpdateData(TRUE);
|
|
m_idStyle = GlobalFunc::GetTextStyleId(m_strStyle);
|
|
return m_idStyle;
|
|
}
|
|
|
|
void InitStyleId()
|
|
{
|
|
m_strStyle = g_Option::instance().g_csSingleTextStyle;
|
|
|
|
// 检查当前记忆的文字样式是否被PU掉
|
|
{
|
|
bool bExist = false;
|
|
|
|
AcDbDatabase *pCurDwg = acdbCurDwg();
|
|
AcDbTextStyleTable* pTT = NULL;
|
|
VERIFY(pCurDwg->getSymbolTable(pTT, AcDb::kForRead)==Acad::eOk);
|
|
|
|
AcDbTextStyleTableIterator* pIter= NULL;
|
|
VERIFY(pTT->newIterator(pIter)==Acad::eOk);
|
|
pTT->close();
|
|
|
|
for (pIter->start(); !pIter->done(); pIter->step())
|
|
{
|
|
AcDbTextStyleTableRecord* pTTR;
|
|
if (pIter->getRecord(pTTR, AcDb::kForRead) != Acad::eOk)
|
|
continue;
|
|
|
|
const TCHAR* pName = NULL;
|
|
if (pTTR->getName(pName) == Acad::eOk && pName != NULL)
|
|
{
|
|
if (_tcsicmp(pName, m_strStyle) == 0) // 如果存在该样式
|
|
{
|
|
pTTR->close();
|
|
bExist = true;
|
|
continue;
|
|
}
|
|
}
|
|
pTTR->close();
|
|
}
|
|
delete pIter;
|
|
|
|
if (!bExist)
|
|
{
|
|
TCHAR sStyle[256]=_T("");
|
|
xg_getvar(_T("TEXTSTYLE"), sStyle);
|
|
m_strStyle = sStyle;
|
|
}
|
|
}
|
|
|
|
// 文字样式不存在
|
|
if (m_strStyle == _T(""))
|
|
{
|
|
TCHAR sStyle[256]=_T("");
|
|
xg_getvar(_T("TEXTSTYLE"), sStyle);
|
|
m_strStyle = sStyle;
|
|
}
|
|
|
|
m_idStyle = GlobalFunc::GetTextStyleId(m_strStyle);
|
|
m_comboStyle.SetCurSel(m_comboStyle.FindStringExact(0, m_strStyle));
|
|
}
|
|
|
|
void LoadTextStyle();
|
|
|
|
DECLARE_DYNAMIC(CIntersectPointNumberDlg)
|
|
//{{AFX_DATA(CIntersectPointNumberDlg)
|
|
enum { IDD = IDD_INTERSECTPOINT_NUMBER };
|
|
CString m_strWndEdtNumber;
|
|
CString m_strWndEdtPrefix;
|
|
int m_nWndCmbTextPos;
|
|
//}}AFX_DATA
|
|
|
|
//{{AFX_VIRTUAL(CIntersectPointNumberDlg)
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX);
|
|
//}}AFX_VIRTUAL
|
|
|
|
public:
|
|
|
|
enum ALIGN
|
|
{
|
|
eLeft = 0,
|
|
eLeftUp,
|
|
eUp,
|
|
eRightUp,
|
|
eRight,
|
|
eRightDown,
|
|
eDown,
|
|
eLeftDown,
|
|
};
|
|
|
|
protected:
|
|
|
|
//{{AFX_MSG(CIntersectPointNumberDlg)
|
|
afx_msg LONG_PTR onAcadKeepFocus(UINT_PTR, LONG_PTR);
|
|
afx_msg void OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult);
|
|
afx_msg void OnClose();
|
|
afx_msg void OnDestroy();
|
|
//}}AFX_MSG
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
private:
|
|
|
|
bool m_bDestroy;
|
|
};
|
|
|
|
#endif // !defined(AFX_INTERSECTPOINTNUMBERDLG_H__B92B95C5_906F_42BC_A57D_00B09BDC0755__INCLUDED_)
|