147 lines
4.2 KiB
C++
147 lines
4.2 KiB
C++
#if !defined(AFX_MUTIROWTEXTDLG_H__541B162D_EE03_4274_93E5_A7B06601C745__INCLUDED_)
|
|
#define AFX_MUTIROWTEXTDLG_H__541B162D_EE03_4274_93E5_A7B06601C745__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
// MutiRowTextDlg.h : header file
|
|
//
|
|
|
|
|
|
#include "CharToolbarDlg.h"
|
|
#include "DbMTextNew.h"
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CMutiRowTextDlg dialog
|
|
|
|
class CMutiRowTextDlg : public CCharToolbarDlg
|
|
{
|
|
// Construction
|
|
public:
|
|
DECLARE_DYNAMIC(CMutiRowTextDlg)
|
|
CMutiRowTextDlg(BOOL bEdit, CWnd* pParent = NULL); // standard constructor
|
|
|
|
// Dialog Data
|
|
//{{AFX_DATA(CMutiRowTextDlg)
|
|
enum { IDD = IDD_MUTIROW_TEXT };
|
|
CButton m_ctrlOk;
|
|
CButton m_ctrlCancel;
|
|
CEdit m_editInputText;
|
|
CComboBox m_comboFontStyle;
|
|
CComboBox m_comboAlign;
|
|
CComboBox m_comboPageStyle;
|
|
//CString m_strInputText;
|
|
CString m_strHeight;
|
|
CString m_strPageWidth;
|
|
CString m_strPageHeight;
|
|
CString m_strPageDist;
|
|
// modify by xly on 101222 记录多行文字的转角
|
|
//CString m_strRotation;
|
|
static CString m_strRotation;
|
|
|
|
CString m_strLineSpace;
|
|
int m_nPageStyle;
|
|
//}}AFX_DATA
|
|
|
|
XStringList m_lstStyle;
|
|
CString m_strStyle;
|
|
CSize sizeDlg;
|
|
BOOL m_bInit;
|
|
BOOL m_bEditObj;
|
|
|
|
UINT m_nOldSizeX, m_nOldSizeY;
|
|
AcGePoint3d m_ptCur;
|
|
AcDbObjectId m_id;
|
|
CDataExchange *pDXLoad;
|
|
|
|
// zxl 2013.02.22 add 查找替换
|
|
CString m_strSearch;
|
|
CString m_strInstead;
|
|
int m_nSearchStart;// zxl 2013.02.22 add 每次查找的起始位置
|
|
int m_nSelPos;// zxl 2013.02.22 add 第一次查找的起始位置
|
|
bool m_bFromS;// zxl 2013.02.22 add 是否从头开始查找
|
|
int m_nSearchNum;// zxl 2013.02.22 add 查找到得文字数量
|
|
int m_nInsteadNum;// zxl 2013.02.22 add 替换的文字数量
|
|
|
|
CColorButton m_btnColor;
|
|
int m_nColorIndex;// zxl 2013.02.22 add 当前文字颜色
|
|
double m_dCurTextHeight;// zxl 2013.02.22 add 当前文字高度
|
|
|
|
std::vector<COLORREF> m_vecCol;
|
|
std::vector<double> m_vecHeight;
|
|
std::vector<bool> m_vecUnderLine;
|
|
|
|
// zxl 2013.02.22 add 设定文字颜色
|
|
void OnSetTextColor();
|
|
// zxl 2013.02.22 add 获取文字颜色
|
|
COLORREF GetCurColor(const int nPosCur);
|
|
|
|
void GetDefaultTextProp();
|
|
void SetDlgTextProp();
|
|
void SetTextProp(CString &sText);
|
|
|
|
void ResetSize();
|
|
//BOOL GetPosition(int& h, int& l);
|
|
void LoadTextStyle();
|
|
virtual void Dlg2Obj(TDbMTextNew *pText);
|
|
virtual void Obj2Dlg(TDbMTextNew *pText);
|
|
void SetCursorPos(const AcGePoint3d ptCur);
|
|
void SetCurTextId(const AcDbObjectId id);
|
|
// 根据文字样式获取文字宽度
|
|
double GetTextWidth(TDbMTextNew *pText, const CString &csWord);
|
|
|
|
// 根据文字宽度 构造多线段
|
|
void ModifyPolyLine(const double &nAng, const double &dLen, XPoly2D &poly);
|
|
|
|
// zxl 2013.02.22 add 设定当前光标位置
|
|
int SetCursorPostion(const int nPos,const CString &csText);
|
|
// zxl 2013.02.22 add 设定文字高度
|
|
void OnSetTextHeight();
|
|
void OutPutMessageBox();
|
|
|
|
BOOL PreTranslateMessage(MSG* pMsg);
|
|
void SaveText();// 保存当前文字
|
|
afx_msg virtual void OnChar(UINT nID); // ON_COMMAND_RANGE handler
|
|
|
|
//afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
|
|
//virtual afx_msg void OnChar(UINT nID); // ON_COMMAND_RANGE handler
|
|
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(CMutiRowTextDlg)
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
|
//}}AFX_VIRTUAL
|
|
|
|
// Implementation
|
|
protected:
|
|
|
|
// Generated message map functions
|
|
//{{AFX_MSG(CMutiRowTextDlg)
|
|
virtual BOOL OnInitDialog();
|
|
virtual void OnOK();
|
|
virtual void OnCancel();
|
|
afx_msg void OnButtonPagewidth();
|
|
afx_msg void OnButtonTextHeight();
|
|
afx_msg void OnButtonPageDist();
|
|
afx_msg void OnButtonPageHeight();
|
|
afx_msg void OnButtonAddArow();
|
|
afx_msg void OnBtnSearch();
|
|
afx_msg void OnBtnInstead();
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
|
afx_msg void Copy();
|
|
afx_msg void Cut();
|
|
afx_msg void Undo();
|
|
afx_msg void SelAll();
|
|
afx_msg void Paste();
|
|
afx_msg void Delete();
|
|
//}}AFX_MSG
|
|
DECLARE_MESSAGE_MAP()
|
|
};
|
|
|
|
//{{AFX_INSERT_LOCATION}}
|
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
|
|
|
#endif // !defined(AFX_MUTIROWTEXTDLG_H__541B162D_EE03_4274_93E5_A7B06601C745__INCLUDED_)
|