Beispiel #1
0
        public DesignerFlatTabPageVerbCollection(IComponent component)
        {
            if (!(component is FlatTabPage))
            {
                throw new ArgumentNullException(nameof(component));
            }

            _control = (FlatTabPage)component;

            Add(new DesignerVerb("Инвертировать цвета градиента", (o, e) => _invertGradientColor()));
        }
Beispiel #2
0
        public DesignerFlatTabPageActionList(IComponent component)
            : base(component)
        {
            if (!(component is FlatTabPage))
            {
                throw new ArgumentNullException(nameof(component));
            }

            _control   = (FlatTabPage)component;
            _uiService = (DesignerActionUIService)GetService(typeof(DesignerActionUIService));
        }
Beispiel #3
0
        //-------------------------------------------------------------------------
        private void _drawTab(Graphics graphics, FlatTabPage tabPage, Rectangle tabPageRectangle)
        {
            var newRadiusCorner = tabPageRectangle.Height / ((_radiusCorner == 0) ? 1.0f : _radiusCorner);

            using (var graphicsPath = _createGraphicsPathByRectangle(tabPageRectangle, newRadiusCorner))
            {
                using (var brush = new LinearGradientBrush(
                           tabPageRectangle,
                           Color.FromArgb(tabPage.StartGradientAlpha, tabPage.StartGradientColor),
                           Color.FromArgb(tabPage.EndGradientAlpha, tabPage.EndGradientColor),
                           tabPage.AngleGradient
                           ))
                {
                    brush.WrapMode = WrapMode.TileFlipXY;
                    graphics.FillPathByTransform(brush, graphicsPath, tabPageRectangle.X, tabPageRectangle.Y);
                }

                using (var pen = new Pen(_colorContoure))
                { graphics.DrawPathByTransform(pen, graphicsPath, tabPageRectangle.X, tabPageRectangle.Y); }
            }

            using (var brush = new SolidBrush(tabPage.ColorText))
            { graphics.DrawString(tabPage.Text, Font, brush, new RectangleF(tabPageRectangle.X, tabPageRectangle.Y, tabPageRectangle.Width, tabPageRectangle.Height - (SelectedIndex == tabPage.Index ? 4 : 0)), _stringFormat); }
        }