You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB
C++

#pragma once
#include "item.h"
namespace NItem
{
class CItemText : public CItem
{
public:
CItemText(CSigmaDoc * ppDoc);
virtual ~CItemText(void);
void OnDraw(CXyDC* pDC) override;
void OnDraw(CXyDC* pXyDC, CDC *pDC) override;
virtual void OnDrawScreen(CXyDC* pDC, CDC* pScreenDC);
void OnLButtonDown(CDC* pDC, UINT nFlags, CPoint point, int vk) override;
void Create();
void Create(CText* pText, COLORREF color);
void EditText(COne* pOne);
void EndEdit(int nReturn);
void SetText(CString & text);
void SetTextHeight(double textHeight);
void SetTextWidth(double textWidth);
void SetAngle(double angle);
void SetFont(LOGFONT * font);
void CopyFont(LOGFONT * font);
void SetColor(int r, int g, int b);
//是否开启文字的上下标
void SetScript(BOOL bScript);
void SetTextInfo(CString & text, double textHeight
, double textWidth, double angle, LOGFONT * font
, int r, int g, int b, BOOL bScript);
void GetTextInfo(CString & text, double & textHeight
, double & textWidth, double & angle, LOGFONT * font
, int & r, int & g, int & b, BOOL & bScript);
//CTextDlg TextDlg;
//属性项
//virtual BOOL InitPropertyGrid(CXTPPropertyGrid& grid);
//BOOL IniPublicGrid(CXTPPropertyGrid& grid, CPropertyGridItemAdd &ItemAdd);
//virtual BOOL OnGridItemChangeValue(CXTPPropertyGridItem* pItem);
//virtual void OnInplaceButtonDown(CXTPPropertyGridItem* pItem);
void SetMode(CText* pValue);
void GetMode(CText* pValue);
void SetPosition(double x, double y);
private:
void Reset();
private:
LOGFONT m_font;
BOOL m_bAlone;
COLORREF color;
int m_nAlignsV;
int m_nAlignsH;
CSize8 m_szText; //文字尺寸
int m_nFrame;
BOOL m_bIsDlgEdit;
CText* m_pText;
COLORREF m_textColor;
};
}