コード例 #1
0
ファイル: Button.cs プロジェクト: Sauler/FlaxAPI
        /// <summary>
        /// Initializes a new instance of the <see cref="Button"/> class.
        /// </summary>
        /// <param name="x">Position X coordinate</param>
        /// <param name="y">Position Y coordinate</param>
        /// <param name="width">Width</param>
        /// <param name="height">Height</param>
        public Button(float x, float y, float width = 120, float height = DefaultHeight)
            : base(x, y, width, height)
        {
            var style = Style.Current;

            Font                       = new FontReference(style.FontMedium);
            BackgroundColor            = style.BackgroundNormal;
            BorderColor                = style.BorderNormal;
            BackgroundColorSelected    = style.BackgroundSelected;
            BorderColorSelected        = style.BorderSelected;
            BackgroundColorHighlighted = style.BackgroundHighlighted;
            BorderColorHighlighted     = style.BorderHighlighted;
        }
コード例 #2
0
        public ITablePartStyle SetFont(OpenXmlFontRef fontRef)
        {
            TableCellTextStyle tableCellTextStyle = this.tableCellTextStyleGenerator(true);

            tableCellTextStyle.RemoveAllChildren <FontReference>();
            tableCellTextStyle.RemoveAllChildren <Fonts>();

            FontReference element = new FontReference
            {
                Index = (FontCollectionIndexValues)fontRef.Index
            };

            if (fontRef.Color != null)
            {
                element.AppendChild(fontRef.Color.CreateColorElement());
            }

            tableCellTextStyle.PrependChild(element);

            return(this.result);
        }