123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509 |
- using System.Drawing;
- using System.Drawing.Text;
- namespace Microsoft.Windows.Forms
- {
- public partial class Sprite
- {
- private string m_Text = null;
- /// <summary>
- /// 文本
- /// </summary>
- public string Text
- {
- get
- {
- return this.m_Text;
- }
- set
- {
- if (value != this.m_Text)
- {
- this.m_Text = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextOffset = Point.Empty;
- /// <summary>
- /// 文本偏移
- /// </summary>
- public Point TextOffset
- {
- get
- {
- return this.m_TextOffset;
- }
- set
- {
- if (value != this.m_TextOffset)
- {
- this.m_TextOffset = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextOffsetHovered = Point.Empty;
- /// <summary>
- /// 鼠标移上时在TextOffset上再次偏移
- /// </summary>
- public Point TextOffsetHovered
- {
- get
- {
- return this.m_TextOffsetHovered;
- }
- set
- {
- if (value != this.m_TextOffsetHovered)
- {
- this.m_TextOffsetHovered = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextOffsetPressed = Point.Empty;
- /// <summary>
- /// 鼠标按下时在TextOffset上再次偏移
- /// </summary>
- public Point TextOffsetPressed
- {
- get
- {
- return this.m_TextOffsetPressed;
- }
- set
- {
- if (value != this.m_TextOffsetPressed)
- {
- this.m_TextOffsetPressed = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextOffsetFocused = Point.Empty;
- /// <summary>
- /// 获取焦点时在TextOffset上再次偏移
- /// </summary>
- public Point TextOffsetFocused
- {
- get
- {
- return this.m_TextOffsetFocused;
- }
- set
- {
- if (value != this.m_TextOffsetFocused)
- {
- this.m_TextOffsetFocused = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextOffsetDisabled = Point.Empty;
- /// <summary>
- /// 禁用时在TextOffset上再次偏移
- /// </summary>
- public Point TextOffsetDisabled
- {
- get
- {
- return this.m_TextOffsetDisabled;
- }
- set
- {
- if (value != this.m_TextOffsetDisabled)
- {
- this.m_TextOffsetDisabled = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextOffsetHighlight = Point.Empty;
- /// <summary>
- /// 高亮时在TextOffset上再次偏移
- /// </summary>
- public Point TextOffsetHighlight
- {
- get
- {
- return this.m_TextOffsetHighlight;
- }
- set
- {
- if (value != this.m_TextOffsetHighlight)
- {
- this.m_TextOffsetHighlight = value;
- this.Feedback();
- }
- }
- }
- private Font m_Font = DefaultTheme.Font;
- /// <summary>
- /// 字体.该字体为全局静态变量,不要释放
- /// </summary>
- public Font Font
- {
- get
- {
- return this.m_Font;
- }
- set
- {
- if (value != this.m_Font)
- {
- this.m_Font = value;
- this.Feedback();
- }
- }
- }
- private Color m_ForeColor = DefaultTheme.ForeColor;
- /// <summary>
- /// 前景色
- /// </summary>
- public Color ForeColor
- {
- get
- {
- return this.m_ForeColor;
- }
- set
- {
- if (value != this.m_ForeColor)
- {
- this.m_ForeColor = value;
- this.Feedback();
- }
- }
- }
- private Color m_ForeColorHovered = DefaultTheme.ForeColor + DefaultTheme.ForeColorHoveredVector;
- /// <summary>
- /// 前景鼠标移上颜色向量
- /// </summary>
- public Color ForeColorHovered
- {
- get
- {
- return this.m_ForeColorHovered;
- }
- set
- {
- if (value != this.m_ForeColorHovered)
- {
- this.m_ForeColorHovered = value;
- this.Feedback();
- }
- }
- }
- private Color m_ForeColorPressed = DefaultTheme.ForeColor + DefaultTheme.ForeColorPressedVector;
- /// <summary>
- /// 前景鼠标按下颜色向量
- /// </summary>
- public Color ForeColorPressed
- {
- get
- {
- return this.m_ForeColorPressed;
- }
- set
- {
- if (value != this.m_ForeColorPressed)
- {
- this.m_ForeColorPressed = value;
- this.Feedback();
- }
- }
- }
- private Color m_ForeColorFocused = DefaultTheme.ForeColor + DefaultTheme.ForeColorFocusedVector;
- /// <summary>
- /// 前景获取焦点颜色向量
- /// </summary>
- public Color ForeColorFocused
- {
- get
- {
- return this.m_ForeColorFocused;
- }
- set
- {
- if (value != this.m_ForeColorFocused)
- {
- this.m_ForeColorFocused = value;
- this.Feedback();
- }
- }
- }
- private Color m_ForeColorDisabled = DefaultTheme.ForeColor + DefaultTheme.ForeColorDisabledVector;
- /// <summary>
- /// 前景状态禁用颜色向量
- /// </summary>
- public Color ForeColorDisabled
- {
- get
- {
- return this.m_ForeColorDisabled;
- }
- set
- {
- if (value != this.m_ForeColorDisabled)
- {
- this.m_ForeColorDisabled = value;
- this.Feedback();
- }
- }
- }
- private Color m_ForeColorHighlight = DefaultTheme.ForeColor + DefaultTheme.ForeColorHighlightVector;
- /// <summary>
- /// 前景高亮颜色向量
- /// </summary>
- public Color ForeColorHighlight
- {
- get
- {
- return this.m_ForeColorHighlight;
- }
- set
- {
- if (value != this.m_ForeColorHighlight)
- {
- this.m_ForeColorHighlight = value;
- this.Feedback();
- }
- }
- }
- private TextRenderingHint m_TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
- /// <summary>
- /// 文本呈现质量
- /// </summary>
- public TextRenderingHint TextRenderingHint
- {
- get
- {
- return this.m_TextRenderingHint;
- }
- set
- {
- if (value != this.m_TextRenderingHint)
- {
- this.m_TextRenderingHint = value;
- this.Feedback();
- }
- }
- }
- private ContentAlignment m_TextAlign = ContentAlignment.MiddleCenter;
- /// <summary>
- /// 文本对齐方式
- /// </summary>
- public ContentAlignment TextAlign
- {
- get
- {
- return this.m_TextAlign;
- }
- set
- {
- if (value != this.m_TextAlign)
- {
- this.m_TextAlign = value;
- this.Feedback();
- }
- }
- }
- private float m_TextRotateAngle = 0f;
- /// <summary>
- /// 文本旋转角度
- /// </summary>
- public float TextRotateAngle
- {
- get
- {
- return this.m_TextRotateAngle;
- }
- set
- {
- if (value != this.m_TextRotateAngle)
- {
- this.m_TextRotateAngle = value;
- this.Feedback();
- }
- }
- }
- private bool m_TextGrayOnDisabled = true;
- /// <summary>
- /// 状态禁用时文本是否变灰
- /// </summary>
- public bool TextGrayOnDisabled
- {
- get
- {
- return this.m_TextGrayOnDisabled;
- }
- set
- {
- if (value != this.m_TextGrayOnDisabled)
- {
- this.m_TextGrayOnDisabled = value;
- this.Feedback();
- }
- }
- }
- private ShadowShapeStyle m_TextShadowShapeStyle = ShadowShapeStyle.None;
- /// <summary>
- /// 文本阴影描边样式
- /// </summary>
- public ShadowShapeStyle TextShadowShapeStyle
- {
- get
- {
- return this.m_TextShadowShapeStyle;
- }
- set
- {
- if (value != this.m_TextShadowShapeStyle)
- {
- this.m_TextShadowShapeStyle = value;
- this.Feedback();
- }
- }
- }
- private Color m_TextShadowColor = DefaultTheme.LightLightForeColor;
- /// <summary>
- /// 阴影颜色
- /// </summary>
- public Color TextShadowColor
- {
- get
- {
- return this.m_TextShadowColor;
- }
- set
- {
- if (value != this.m_TextShadowColor)
- {
- this.m_TextShadowColor = value;
- this.Feedback();
- }
- }
- }
- private Point m_TextShadowMatrixOffset = Point.Empty;
- /// <summary>
- /// 阴影偏移量
- /// </summary>
- public Point TextShadowMatrixOffset
- {
- get
- {
- return this.m_TextShadowMatrixOffset;
- }
- set
- {
- if (value != this.m_TextShadowMatrixOffset)
- {
- this.m_TextShadowMatrixOffset = value;
- this.Feedback();
- }
- }
- }
- private Color m_TextShapeOfShadowColor = DefaultTheme.LightLightForeColor;
- /// <summary>
- /// 阴影描边颜色
- /// </summary>
- public Color TextShapeOfShadowColor
- {
- get
- {
- return this.m_TextShapeOfShadowColor;
- }
- set
- {
- if (value != this.m_TextShapeOfShadowColor)
- {
- this.m_TextShapeOfShadowColor = value;
- this.Feedback();
- }
- }
- }
- private float m_TextShapeOfShadowWidth = 0f;
- /// <summary>
- /// 阴影描边宽度
- /// </summary>
- public float TextShapeOfShadowWidth
- {
- get
- {
- return this.m_TextShapeOfShadowWidth;
- }
- set
- {
- if (value != this.m_TextShapeOfShadowWidth)
- {
- this.m_TextShapeOfShadowWidth = value;
- this.Feedback();
- }
- }
- }
- private Color m_TextShapeOfTextColor = DefaultTheme.LightLightForeColor;
- /// <summary>
- /// 文本描边颜色
- /// </summary>
- public Color TextShapeOfTextColor
- {
- get
- {
- return this.m_TextShapeOfTextColor;
- }
- set
- {
- if (value != this.m_TextShapeOfTextColor)
- {
- this.m_TextShapeOfTextColor = value;
- this.Feedback();
- }
- }
- }
- private float m_TextShapeOfTextWidth = 0f;
- /// <summary>
- /// 文本描边宽度
- /// </summary>
- public float TextShapeOfTextWidth
- {
- get
- {
- return this.m_TextShapeOfTextWidth;
- }
- set
- {
- if (value != this.m_TextShapeOfTextWidth)
- {
- this.m_TextShapeOfTextWidth = value;
- this.Feedback();
- }
- }
- }
- }
- }
|