Esempio n. 1
0
        protected override void PaintTabGroupBackground(System.Drawing.Graphics g, Office2007RibbonTabGroupColorTable colorTable, System.Drawing.Rectangle bounds, System.Drawing.Rectangle groupBounds, bool glassEnabled)
        {
            if (colorTable == null)
                return;

            // Draw title rectangle part of the group
            Rectangle r = bounds;
            r.Height -= 2;

            // GDI+ bug
            Rectangle rFill = r;
            rFill.Width--;
            rFill.Height--;

            // First draw background
            DisplayHelp.FillRectangle(g, rFill, colorTable.Background);//.Start, colorTable.Background.End, 90, new float[] { 0f, 1f, 1f }, new float[] { 0f, .4f, 1f });

            r = bounds;
            SmoothingMode sm = g.SmoothingMode;
            g.SmoothingMode = SmoothingMode.Default;

            Rectangle rAll = groupBounds;

            if (!colorTable.Border.IsEmpty)
            {
                r.Height += 18;
                using (SolidBrush brush = new SolidBrush(colorTable.Border.Start))
                {
                    // Draw border top
                    g.FillRectangle(brush, rAll.X+1, rAll.Y, rAll.Width-2, 4);
                }

                // Draw border ... Left first
                DisplayHelp.FillRectangle(g, new Rectangle(rAll.X+1, r.Y, 1, r.Height), colorTable.Border);
                // Then right
                DisplayHelp.FillRectangle(g, new Rectangle(rAll.Right - 1, r.Y, 1, r.Height), colorTable.Border);
                
                using (Pen pen = new Pen(Color.FromArgb(92, Color.White)))
                {
                    g.DrawLine(pen, rAll.X, r.Y, rAll.X, r.Height - 2);
                    g.DrawLine(pen, rAll.Right, r.Y, rAll.Right, r.Height - 2);
                }
            }
            g.SmoothingMode = sm;
        }
Esempio n. 2
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupGreen(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();

            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0xB7C2C5)*/, factory.GetColor(0xB5DAB0));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0x6CB954)), Color.Transparent);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));
            tg.Text = factory.GetColor(0x333333);

            return tg;
        }
Esempio n. 3
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupMagenta(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0xBDBBC2)*/, factory.GetColor(0xDFADB1));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0xF26259)), Color.Transparent);
            tg.Text = factory.GetColor(0x333333);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));

            return tg;
        }
Esempio n. 4
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupDefault(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0xC1C6C1)*/, factory.GetColor(0xF3EB96));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0xFEE51D)), Color.Transparent);
            tg.Text = factory.GetColor(0x333333);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));

            return tg;
        }
Esempio n. 5
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupBlackOrange(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();

            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0x414038)*/, factory.GetColor(0xA69B41));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(255, factory.GetColor(0xFFE300)), Color.Transparent);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));
            tg.Text = factory.GetColor(0xFFFFFF);

            return tg;
        }
Esempio n. 6
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupMagenta(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(0xC55790), Color.Transparent);
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0x000000);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0xC90077), Color.Transparent);

            return tg;
        }
Esempio n. 7
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupGreen(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(0xE6F3E6));
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0x49A349);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0x49A349));

            return tg;
        }
Esempio n. 8
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupOrange(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(0xFFF8ED));
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0xCF5C0A);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0xFF9D00));

            return tg;
        }
Esempio n. 9
0
		/// <summary>
		/// Adds new object to the collection.
		/// </summary>
		/// <param name="Office2007RibbonTabItemColorTable">Object to add.</param>
		/// <returns>Index of newly added object.</returns>
		public int Add(Office2007RibbonTabGroupColorTable colorTable)
		{
            return List.Add(colorTable);
		}
Esempio n. 10
0
		/// <summary>
		/// Copies contained items to the Office2007RibbonTabItemColorTable array.
		/// </summary>
		/// <param name="array">Array to copy to.</param>
		internal void CopyTo(Office2007RibbonTabGroupColorTable[] array)
		{
			List.CopyTo(array,0);
		}
Esempio n. 11
0
        //protected override void OnRemoveComplete(int index,object value)
        //{
        //    base.OnRemoveComplete(index,value);
        //    Office2007RibbonTabItemColorTable me=value as Office2007RibbonTabItemColorTable;
        //    if (m_Parent != null)
        //    {
        //        me.SetParent(null);
        //        m_Parent.IsSizeValid = false;
        //    }
        //}
        //protected override void OnInsertComplete(int index,object value)
        //{
        //    base.OnInsertComplete(index,value);
        //    Office2007RibbonTabItemColorTable me=value as Office2007RibbonTabItemColorTable;
        //    if (m_Parent != null)
        //    {
        //        me.SetParent(m_Parent);
        //        m_Parent.IsSizeValid = false;
        //    }
        //}

		/// <summary>
		/// Copies collection into the specified array.
		/// </summary>
		/// <param name="array">Array to copy collection to.</param>
		/// <param name="index">Starting index.</param>
		public void CopyTo(Office2007RibbonTabGroupColorTable[] array, int index) 
		{
			List.CopyTo(array, index);
		}
Esempio n. 12
0
        protected virtual void PaintTabGroupBackground(Graphics g, Office2007RibbonTabGroupColorTable colorTable, Rectangle bounds, Rectangle groupBounds, bool glassEnabled)
        {
            if (colorTable == null)
                return;

            // Draw title rectangle part of the group
            Rectangle r = bounds;
            r.Height -= 2;

            // GDI+ bug
            Rectangle rFill = r;
            rFill.Width--;
            //rFill.Height--;

            // First draw background
            DisplayHelp.FillRectangle(g, rFill, colorTable.Background.Start, colorTable.Background.End, 90, new float[] { 0f, .10f, .9f }, new float[] { 0f, (glassEnabled?.4f:.70f), 1f });

            // Draw highlight
            if (!colorTable.BackgroundHighlight.IsEmpty && r.Width > 0 && r.Height > 0)
            {
                //Rectangle hr = new Rectangle(r.X, r.Bottom - 3, r.Width - 1, 3);
                //DisplayHelp.FillRectangle(g, hr, colorTable.BackgroundHighlight.Start, colorTable.BackgroundHighlight.End);
                Rectangle ellipse = new Rectangle(r.X - r.Width * 3, r.Y, r.Width * 7, (int)(r.Height * 4.5f));
                GraphicsPath path = new GraphicsPath();
                path.AddEllipse(ellipse);
                PathGradientBrush brush = new PathGradientBrush(path);
                brush.CenterColor = colorTable.BackgroundHighlight.Start;
                brush.SurroundColors = new Color[] { colorTable.BackgroundHighlight.End };
                brush.CenterPoint = new PointF(ellipse.X + ellipse.Width / 2, r.Bottom);
                Blend blend = new Blend();
                blend.Factors = new float[] { 0f, .05f, 1f };
                blend.Positions = new float[] { .0f, .8f, 1f };
                brush.Blend = blend;
                path.Dispose();
                //rFill.Height++;
                g.FillRectangle(brush, rFill);
                brush.Dispose();
                path.Dispose();
            }
            // Underline highlight
            using (Pen pen = new Pen(Color.FromArgb(64, System.Windows.Forms.ControlPaint.Dark(colorTable.BackgroundHighlight.Start))))
                g.DrawLine(pen, r.X, r.Bottom, r.Right - 1, r.Bottom);

            r = bounds;
            SmoothingMode sm = g.SmoothingMode;
            g.SmoothingMode = SmoothingMode.Default;

            Rectangle rAll = groupBounds;

            if (!colorTable.Border.IsEmpty)
            {
                //using(SolidBrush brush=new SolidBrush(colorTable.Border.Start))
                //{
                //    // Draw border top
                //    g.FillRectangle(brush, bounds.X, bounds.Y, bounds.Width, 4);
                //}

                // Draw border ... Left first
                DisplayHelp.FillRectangle(g, new Rectangle(rAll.X, r.Y, 1, r.Height), colorTable.Border);

                // Then right
                DisplayHelp.FillRectangle(g, new Rectangle(rAll.Right - 1, r.Y, 1, r.Height), colorTable.Border);

                // Draw borders on the bottom...
                // Left first
                DisplayHelp.FillRectangle(g, new Rectangle(rAll.X, r.Bottom - 1, 1, rAll.Height - r.Height), colorTable.Border.End, Color.Transparent, 90);

                // Then right
                DisplayHelp.FillRectangle(g, new Rectangle(rAll.Right - 1, r.Bottom - 1, 1, rAll.Height - r.Height), colorTable.Border.End, Color.Transparent, 90);
            }
            g.SmoothingMode = sm;
        }
Esempio n. 13
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupBlueOrange(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();

            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0xCDDFF1)*/, factory.GetColor(0xECEFA9));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0xFFE619)), Color.Transparent);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));
            tg.Text = factory.GetColor(0x15428B);

            return tg;
        }
Esempio n. 14
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupBlueGreen(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();

            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0xC8DDF2)*/, factory.GetColor(0xA6E28E));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0x6BB954)), Color.Transparent);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));
            tg.Text = factory.GetColor(0x15428B);

            return tg;
        }
Esempio n. 15
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupOrange(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();

            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0xC0C3C0)*/, factory.GetColor(0xEFDDA0));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0xF3B51B)), Color.Transparent);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));
            tg.Text = factory.GetColor(0x333333);

            return tg;
        }
Esempio n. 16
0
		/// <summary>
		/// Inserts new object into the collection.
		/// </summary>
		/// <param name="index">Position of the object.</param>
		/// <param name="value">Object to insert.</param>
		public void Insert(int index, Office2007RibbonTabGroupColorTable value) 
		{
			List.Insert(index, value);
		}
Esempio n. 17
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupDefault(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(0xF6F1FC));
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0x935ED3);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0x935ED3));

            return tg;
        }
Esempio n. 18
0
		/// <summary>
		/// Returns index of the object inside of the collection.
		/// </summary>
		/// <param name="value">Reference to the object.</param>
		/// <returns>Index of the object.</returns>
		public int IndexOf(Office2007RibbonTabGroupColorTable value) 
		{
			return List.IndexOf(value);
		}
Esempio n. 19
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupMagenta(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(0xFCF0F7));
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0xC9599C);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0xC9599C));

            return tg;
        }
Esempio n. 20
0
		/// <summary>
		/// Returns whether collection contains specified object.
		/// </summary>
		/// <param name="value">Object to look for.</param>
		/// <returns>true if object is part of the collection, otherwise false.</returns>
		public bool Contains(Office2007RibbonTabGroupColorTable value) 
		{
			return List.Contains(value);
		}
Esempio n. 21
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupDefault(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(0x4488E5), Color.Transparent);
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0x000000);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0x1F48A1), Color.Transparent);

            return tg;
        }
Esempio n. 22
0
		/// <summary>
		/// Removes specified object from the collection.
		/// </summary>
		/// <param name="value"></param>
		public void Remove(Office2007RibbonTabGroupColorTable value) 
		{
			List.Remove(value);
		}
Esempio n. 23
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupOrange(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(factory.GetColor(192, 0xFF9D00), Color.Transparent);
            tg.BackgroundHighlight = LinearGradientColorTable.Empty;
            tg.Text = factory.GetColor(0x000000);
            tg.Border = new LinearGradientColorTable(factory.GetColor(0xD67519), Color.Transparent);

            return tg;
        }
Esempio n. 24
0
        public static Office2007RibbonTabGroupColorTable GetRibbonTabGroupBlackMagenta(ColorFactory factory)
        {
            Office2007RibbonTabGroupColorTable tg = new Office2007RibbonTabGroupColorTable();
            tg.Background = new LinearGradientColorTable(Color.Transparent /*factory.GetColor(0x3C3B3C)*/, factory.GetColor(0x90708F));
            tg.BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(64, factory.GetColor(0xAF7DA2)), Color.Transparent);
            tg.Text = factory.GetColor(0xFFFFFF);
            tg.Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));

            return tg;
        }