Esempio n. 1
0
        internal static void SetLabelOptions(this IPropertyManagerPageLabel label, FontStyle_e style, string font, KnownColor?textColor)
        {
            if (style.HasFlag(FontStyle_e.Bold))
            {
                label.Bold[0, (short)(label.Caption.Length - 1)] = true;
            }

            if (style.HasFlag(FontStyle_e.Italic))
            {
                label.Italic[0, (short)(label.Caption.Length - 1)] = true;
            }

            if (style.HasFlag(FontStyle_e.Underline))
            {
                label.Underline[0, (short)(label.Caption.Length - 1)] = (int)swPropMgrPageLabelUnderlineStyle_e.swPropMgrPageLabel_SolidUnderline;
            }

            if (!string.IsNullOrEmpty(font))
            {
                label.Font[0, (short)(label.Caption.Length - 1)] = font;
            }

            if (textColor.HasValue)
            {
                label.CharacterColor[0, (short)(label.Caption.Length - 1)] = ColorUtils.ToColorRef(Color.FromKnownColor(textColor.Value));
            }
        }
Esempio n. 2
0
 internal PropertyManagerPageTextBlockControl(int id, object tag,
                                              IPropertyManagerPageLabel textBlock, FontStyle_e fontStyle, string font, KnownColor?textColor,
                                              SwPropertyManagerPageHandler handler, IPropertyManagerPageLabel label, IMetadata[] metadata)
     : base(textBlock, id, tag, handler, label, metadata)
 {
     m_FontStyle = fontStyle;
     m_Font      = font;
     m_TextColor = textColor;
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor for text block options
 /// </summary>
 /// <param name="textAlignment">Text block font alignment</param>
 /// <param name="fontStyle">Font style</param>
 /// <param name="font">Font name</param>
 public TextBlockOptionsAttribute(TextAlignment_e textAlignment = TextAlignment_e.Default, FontStyle_e fontStyle = FontStyle_e.Default, string font = "")
 {
     TextAlignment = textAlignment;
     FontStyle     = fontStyle;
     Font          = font;
 }
Esempio n. 4
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="caption">Label caption</param>
 /// <param name="align">Label alignment</param>
 /// <param name="fontStyle">Font style</param>
 public LabelAttribute(string caption, ControlLeftAlign_e align = ControlLeftAlign_e.LeftEdge, FontStyle_e fontStyle = FontStyle_e.Default)
 {
     Caption   = caption;
     Align     = align;
     FontStyle = fontStyle;
 }