Example #1
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 5, Width - 1, 10, 5);
            GP2 = theme.CreateRound(1, 6, Width - 3, 8, 5);

            R1  = new Rectangle(0, 7, Width - 1, 5);
            GB1 = new LinearGradientBrush(R1, Color.FromArgb(45, 45, 45), Color.FromArgb(50, 50, 50), 90f);

            I1 = Convert.ToInt32((_Value - _Minimum) / (_Maximum - _Minimum) * (Width - 11));
            R2 = new Rectangle(I1, 0, 10, 20);

            G.SetClip(GP2);
            G.FillRectangle(GB1, R1);

            R3  = new Rectangle(1, 7, R2.X + R2.Width - 2, 8);
            GB2 = new LinearGradientBrush(R3, Color.FromArgb(51, 181, 229), Color.FromArgb(0, 153, 204), 90f);

            G.SmoothingMode = SmoothingMode.None;
            G.FillRectangle(GB2, R3);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            for (int I = 0; I <= R3.Width - 15; I += 5)
            {
                G.DrawLine(P1, I, 0, I + 15, Height);
            }

            G.ResetClip();

            G.DrawPath(P2, GP1);
            G.DrawPath(P3, GP2);

            GP3 = theme.CreateRound(R2, 5);
            GP4 = theme.CreateRound(R2.X + 1, R2.Y + 1, R2.Width - 2, R2.Height - 2, 5);
            GB3 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(60, 60, 60), Color.FromArgb(55, 55, 55), 90f);

            G.FillPath(GB3, GP3);
            G.DrawPath(P3, GP3);
            G.DrawPath(P4, GP4);
        }
Example #2
0
        private void DrawBox(int x, int index, bool leftEllipse, bool rightEllipse)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            R1 = new Rectangle(x, 0, ItemWidth - 4, Height - 1);

            GP1 = theme.CreateRound(R1, 7);
            GP2 = theme.CreateRound(R1.X + 1, R1.Y + 1, R1.Width - 2, R1.Height - 2, 7);

            string T = Convert.ToString(index + 1);

            if (leftEllipse)
            {
                T = ".. " + T;
            }
            if (rightEllipse)
            {
                T = T + " ..";
            }

            SZ1 = G.MeasureString(T, Font).ToSize();
            PT1 = new Point(R1.X + (R1.Width / 2 - SZ1.Width / 2), R1.Y + (R1.Height / 2 - SZ1.Height / 2));

            if (index == _SelectedIndex)
            {
                G.FillPath(B1, GP1);

                Font F = new Font(Font, FontStyle.Underline);
                G.DrawString(T, F, Brushes.Black, PT1.X + 1, PT1.Y + 1);
                G.DrawString(T, F, Brushes.WhiteSmoke, PT1);
                F.Dispose();

                G.DrawPath(P1, GP2);
                G.DrawPath(P2, GP1);
            }
            else
            {
                G.FillPath(B2, GP1);

                G.DrawString(T, Font, Brushes.Black, PT1.X + 1, PT1.Y + 1);
                G.DrawString(T, Font, Brushes.WhiteSmoke, PT1);

                G.DrawPath(P3, GP2);
                G.DrawPath(P1, GP1);
            }
        }
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();


            theme.G = e.Graphics;
            theme.G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            theme.G.Clear(BackColor);
            theme.G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            if (IsMouseDown)
            {
                PB1                = new PathGradientBrush(GP1);
                PB1.CenterColor    = Color.FromArgb(60, 60, 60);
                PB1.SurroundColors = new Color[] { Color.FromArgb(55, 55, 55) };
                PB1.FocusScales    = new PointF(0.8f, 0.5f);

                theme.G.FillPath(PB1, GP1);
            }
            else
            {
                GB1 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(60, 60, 60), Color.FromArgb(55, 55, 55), 90f);
                theme.G.FillPath(GB1, GP1);
            }

            theme.G.DrawPath(P1, GP1);
            theme.G.DrawPath(P2, GP2);

            SZ1 = theme.G.MeasureString(Text, Font);
            PT1 = new PointF(5, Height / 2 - SZ1.Height / 2);

            if (IsMouseDown)
            {
                PT1.X += 1f;
                PT1.Y += 1f;
            }

            theme.G.DrawString(Text, Font, Brushes.Black, PT1.X + 1, PT1.Y + 1);
            theme.G.DrawString(Text, Font, Brushes.WhiteSmoke, PT1);
        }
Example #4
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();

            theme.G = e.Graphics;

            theme.G.Clear(BackColor);
            theme.G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            R1  = new Rectangle(0, 2, Width - 1, Height - 1);
            GB1 = new LinearGradientBrush(R1, Color.FromArgb(45, 45, 45), Color.FromArgb(50, 50, 50), 90f);

            theme.G.SetClip(GP1);
            theme.G.FillRectangle(GB1, R1);

            I1 = Convert.ToInt32((_Value - _Minimum) / (_Maximum - _Minimum) * (Width - 3));

            if (I1 > 1)
            {
                GP3 = theme.CreateRound(1, 1, I1, Height - 3, 7);

                R2  = new Rectangle(1, 1, I1, Height - 3);
                GB2 = new LinearGradientBrush(R2, Color.FromArgb(51, 181, 229), Color.FromArgb(0, 153, 204), 90f);

                theme.G.FillPath(GB2, GP3);
                theme.G.DrawPath(P1, GP3);

                theme.G.SetClip(GP3);
                theme.G.SmoothingMode = SmoothingMode.None;

                theme.G.FillRectangle(B1, R2.X, R2.Y + 1, R2.Width, R2.Height / 2);

                theme.G.SmoothingMode = SmoothingMode.AntiAlias;
                theme.G.ResetClip();
            }

            theme.G.DrawPath(P2, GP1);
            theme.G.DrawPath(P1, GP2);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            PB1                = new PathGradientBrush(GP1);
            PB1.CenterColor    = Color.FromArgb(50, 50, 50);
            PB1.SurroundColors = new Color[] { Color.FromArgb(45, 45, 45) };
            PB1.FocusScales    = new PointF(0.9f, 0.5f);

            G.FillPath(PB1, GP1);

            G.DrawPath(P1, GP1);
            G.DrawPath(P2, GP2);

            G.SmoothingMode = SmoothingMode.None;

            for (int I = 0; I <= Table.Length - 1; I++)
            {
                int C = Math.Max((int)Table[I], (int)75);

                int X = ((I % RowSize) * ItemSize) + WA.X;
                int Y = ((I / RowSize) * ItemSize) + WA.Y;

                B2 = new SolidBrush(Color.FromArgb(C, C, C));

                G.FillRectangle(B1, X + 1, Y + 1, DrawSize, DrawSize);
                G.FillRectangle(B2, X, Y, DrawSize, DrawSize);

                B2.Dispose();
            }
        }
Example #6
0
        protected override void OnPaint(PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            GB1 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(60, 60, 60), Color.FromArgb(55, 55, 55), 90f);
            G.SetClip(GP1);
            G.FillRectangle(GB1, ClientRectangle);
            G.ResetClip();

            G.DrawPath(P1, GP1);
            G.DrawPath(P4, GP2);

            SZ1 = G.MeasureString(Text, Font);
            PT1 = new PointF(5, Height / 2 - SZ1.Height / 2);

            G.DrawString(Text, Font, Brushes.Black, PT1.X + 1, PT1.Y + 1);
            G.DrawString(Text, Font, Brushes.WhiteSmoke, PT1);

            G.DrawLine(P3, Width - 15, 10, Width - 11, 13);
            G.DrawLine(P3, Width - 7, 10, Width - 11, 13);
            G.DrawLine(Pens.Black, Width - 11, 13, Width - 11, 14);

            G.DrawLine(P2, Width - 16, 9, Width - 12, 12);
            G.DrawLine(P2, Width - 8, 9, Width - 12, 12);
            G.DrawLine(Pens.WhiteSmoke, Width - 12, 12, Width - 12, 13);

            G.DrawLine(P1, Width - 22, 0, Width - 22, Height);
            G.DrawLine(P4, Width - 23, 1, Width - 23, Height - 2);
            G.DrawLine(P4, Width - 21, 1, Width - 21, Height - 2);
        }
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 2, Height - 5, Height - 5, 5);
            GP2 = theme.CreateRound(1, 3, Height - 7, Height - 7, 5);

            PB1                = new PathGradientBrush(GP1);
            PB1.CenterColor    = Color.FromArgb(50, 50, 50);
            PB1.SurroundColors = new Color[] { Color.FromArgb(45, 45, 45) };
            PB1.FocusScales    = new PointF(0.3f, 0.3f);

            G.FillPath(PB1, GP1);
            G.DrawPath(P11, GP1);
            G.DrawPath(P22, GP2);

            if (_Checked)
            {
                G.DrawLine(P3, 5, Height - 9, 8, Height - 7);
                G.DrawLine(P3, 7, Height - 7, Height - 8, 7);

                G.DrawLine(P4, 4, Height - 10, 7, Height - 8);
                G.DrawLine(P4, 6, Height - 8, Height - 9, 6);
            }

            SZ1 = G.MeasureString(Text, Font);
            PT1 = new PointF(Height - 3, Height / 2 - SZ1.Height / 2);

            G.DrawString(Text, Font, Brushes.Black, PT1.X + 1, PT1.Y + 1);
            G.DrawString(Text, Font, Brushes.WhiteSmoke, PT1);
        }
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            PB1                = new PathGradientBrush(GP1);
            PB1.CenterColor    = Color.FromArgb(50, 50, 50);
            PB1.SurroundColors = new Color[] { Color.FromArgb(45, 45, 45) };
            PB1.FocusScales    = new PointF(0.9f, 0.5f);

            G.FillPath(PB1, GP1);

            G.DrawPath(P2, GP1);
            G.DrawPath(P1, GP2);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            G.DrawPath(P1, GP1);
            G.DrawPath(P2, GP2);

            SZ1 = G.MeasureString(_Title, _TitleFont, Width, StringFormat.GenericTypographic);
            SZ2 = G.MeasureString(_SubTitle, _SubTitleFont, Width, StringFormat.GenericTypographic);

            G.DrawString(_Title, _TitleFont, Brushes.Black, 6, 6);
            G.DrawString(_Title, _TitleFont, B1, 5, 5);

            PT1 = new PointF(6f, SZ1.Height + 4f);

            G.DrawString(_SubTitle, _SubTitleFont, Brushes.Black, PT1.X + 1, PT1.Y + 1);
            G.DrawString(_SubTitle, _SubTitleFont, Brushes.WhiteSmoke, PT1.X, PT1.Y);

            if (_DrawSeperator)
            {
                int Y = Convert.ToInt32(PT1.Y + SZ2.Height) + 8;

                G.DrawLine(P1, 4, Y, Width - 5, Y);
                G.DrawLine(P2, 4, Y + 1, Width - 5, Y + 1);
            }
        }
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            G.Clear(BackColor);
            G.SmoothingMode = SmoothingMode.AntiAlias;

            GP1 = theme.CreateRound(0, 0, Width - 1, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, Width - 3, Height - 3, 7);

            PB1                = new PathGradientBrush(GP1);
            PB1.CenterColor    = Color.FromArgb(50, 50, 50);
            PB1.SurroundColors = new Color[] { Color.FromArgb(45, 45, 45) };
            PB1.FocusScales    = new PointF(0.3f, 0.3f);

            G.FillPath(PB1, GP1);
            G.DrawPath(P1, GP1);
            G.DrawPath(P2, GP2);

            R1 = new Rectangle(5, 0, Width - 10, Height + 2);
            R2 = new Rectangle(6, 1, Width - 10, Height + 2);

            R3 = new Rectangle(1, 1, (Width / 2) - 1, Height - 3);

            if (_Checked)
            {
                G.DrawString("On", Font, Brushes.Black, R2, SF1);
                G.DrawString("On", Font, Brushes.WhiteSmoke, R1, SF1);

                R3.X += (Width / 2) - 1;
            }
            else
            {
                G.DrawString("Off", Font, B1, R2, SF2);
                G.DrawString("Off", Font, B2, R1, SF2);
            }

            GP3 = theme.CreateRound(R3, 7);
            GP4 = theme.CreateRound(R3.X + 1, R3.Y + 1, R3.Width - 2, R3.Height - 2, 7);

            GB1 = new LinearGradientBrush(ClientRectangle, Color.FromArgb(60, 60, 60), Color.FromArgb(55, 55, 55), 90f);

            G.FillPath(GB1, GP3);
            G.DrawPath(P2, GP3);
            G.DrawPath(P3, GP4);

            Offset = R3.X + (R3.Width / 2) - 3;

            for (int I = 0; I <= 1; I++)
            {
                if (_Checked)
                {
                    G.FillRectangle(B1, Offset + (I * 5), 7, 2, Height - 14);
                }
                else
                {
                    G.FillRectangle(B3, Offset + (I * 5), 7, 2, Height - 14);
                }

                G.SmoothingMode = SmoothingMode.None;

                if (_Checked)
                {
                    G.FillRectangle(B4, Offset + (I * 5), 7, 2, Height - 14);
                }
                else
                {
                    G.FillRectangle(B5, Offset + (I * 5), 7, 2, Height - 14);
                }

                G.SmoothingMode = SmoothingMode.AntiAlias;
            }
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            ThemeModule theme = new ThemeModule();
            var         G     = theme.G;

            G = e.Graphics;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            G.Clear(Color.FromArgb(50, 50, 50));
            G.SmoothingMode = SmoothingMode.AntiAlias;

            ItemHeight = ItemSize.Height + 2;

            GP1 = theme.CreateRound(0, 0, ItemHeight + 3, Height - 1, 7);
            GP2 = theme.CreateRound(1, 1, ItemHeight + 3, Height - 3, 7);

            PB1                = new PathGradientBrush(GP1);
            PB1.CenterColor    = Color.FromArgb(50, 50, 50);
            PB1.SurroundColors = new Color[] { Color.FromArgb(45, 45, 45) };
            PB1.FocusScales    = new PointF(0.8f, 0.95f);

            G.FillPath(PB1, GP1);

            G.DrawPath(P1, GP1);
            G.DrawPath(P2, GP2);

            for (int I = 0; I <= TabCount - 1; I++)
            {
                R1         = GetTabRect(I);
                R1.Y      += 2;
                R1.Height -= 3;
                R1.Width  += 1;
                R1.X      -= 1;

                TP1    = TabPages[I];
                Offset = 0;

                if (SelectedIndex == I)
                {
                    G.FillRectangle(B1, R1);

                    for (int J = 0; J <= 1; J++)
                    {
                        G.FillRectangle(B2, R1.X + 5 + (J * 5), R1.Y + 6, 2, R1.Height - 9);

                        G.SmoothingMode = SmoothingMode.None;
                        G.FillRectangle(B3, R1.X + 5 + (J * 5), R1.Y + 5, 2, R1.Height - 9);
                        G.SmoothingMode = SmoothingMode.AntiAlias;

                        Offset += 5;
                    }

                    G.DrawRectangle(P3, R1.X + 1, R1.Y - 1, R1.Width, R1.Height + 2);
                    G.DrawRectangle(P1, R1.X + 1, R1.Y + 1, R1.Width - 2, R1.Height - 2);
                    G.DrawRectangle(P2, R1);
                }
                else
                {
                    for (int J = 0; J <= 1; J++)
                    {
                        G.FillRectangle(B2, R1.X + 5 + (J * 5), R1.Y + 6, 2, R1.Height - 9);

                        G.SmoothingMode = SmoothingMode.None;
                        G.FillRectangle(B4, R1.X + 5 + (J * 5), R1.Y + 5, 2, R1.Height - 9);
                        G.SmoothingMode = SmoothingMode.AntiAlias;

                        Offset += 5;
                    }
                }

                R1.X += 5 + Offset;

                R2    = R1;
                R2.Y += 1;
                R2.X += 1;

                G.DrawString(TP1.Text, Font, Brushes.Black, R2, SF1);
                G.DrawString(TP1.Text, Font, Brushes.WhiteSmoke, R1, SF1);
            }

            GP3 = theme.CreateRound(ItemHeight, 0, Width - ItemHeight - 1, Height - 1, 7);
            GP4 = theme.CreateRound(ItemHeight + 1, 1, Width - ItemHeight - 3, Height - 3, 7);

            G.DrawPath(P2, GP3);
            G.DrawPath(P1, GP4);
        }