Ejemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            G = e.Graphics;
            G.SmoothingMode     = SmoothingMode.HighQuality;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            base.OnPaint(e);
            G.Clear(BackColor);
            bool enabled = Enabled;

            if (enabled)
            {
                TB.ForeColor = ForeColor;
                bool flag = State == AloneTextBox.MouseState.Down;
                if (flag)
                {
                    using (Pen pen = new Pen(AloneLibrary.ColorFromHex("#78B7E6")))
                        G.DrawPath(pen, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 12, AloneLibrary.RoundingStyle.All));
                }
                else
                {
                    using (Pen pen2 = new Pen(AloneLibrary.ColorFromHex("#D0D5D9")))
                        G.DrawPath(pen2, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 12, AloneLibrary.RoundingStyle.All));
                }
            }
            else
            {
                TB.ForeColor = ForeColor;
                using (Pen pen3 = new Pen(AloneLibrary.ColorFromHex("#E1E1E2")))
                    G.DrawPath(pen3, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 12, AloneLibrary.RoundingStyle.All));
            }
            TB.TextAlign             = TextAlign;
            TB.UseSystemPasswordChar = UseSystemPasswordChar;
        }
Ejemplo n.º 2
0
 protected override void OnPaint(PaintEventArgs e)
 {
     G = e.Graphics;
     G.SmoothingMode     = SmoothingMode.HighQuality;
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
     base.OnPaint(e);
     G.Clear(_BorderColor);
     using (SolidBrush solidBrush = new SolidBrush(BackColor))
     {
         using (Pen pen = new Pen(_BorderColor))
         {
             using (SolidBrush solidBrush2 = new SolidBrush(ForeColor))
             {
                 using (Font font = new Font("Segoe UI", 9f))
                 {
                     G.FillPath(solidBrush, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
                     G.DrawPath(pen, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
                     G.DrawString(Text, font, solidBrush2, new Point(30, 6));
                 }
             }
         }
     }
     using (Image image = Image.FromStream(new MemoryStream(Convert.FromBase64String(B64))))
         G.DrawImage(image, new Rectangle(8, checked ((int)Math.Round(unchecked ((double)base.Height / 2.0 - 8.0))), 16, 16));
 }
Ejemplo n.º 3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            G = e.Graphics;
            G.SmoothingMode     = SmoothingMode.HighQuality;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            base.OnPaint(e);
            G.Clear(BackColor);
            bool enabled = Enabled;

            if (enabled)
            {
                using (SolidBrush solidBrush = new SolidBrush(AloneLibrary.ColorFromHex("#F3F4F7")))
                {
                    using (Pen pen = new Pen(AloneLibrary.ColorFromHex("#D0D5D9")))
                    {
                        using (SolidBrush solidBrush2 = new SolidBrush(ForeColor))
                        {
                            using (Font font = new Font("Segoe UI", 9f))
                            {
                                G.FillPath(solidBrush, AloneLibrary.RoundRect(new Rectangle(0, 0, 16, 16), 3, AloneLibrary.RoundingStyle.All));
                                G.DrawPath(pen, AloneLibrary.RoundRect(new Rectangle(0, 0, 16, 16), 3, AloneLibrary.RoundingStyle.All));
                                G.DrawString(Text, font, solidBrush2, new Point(25, 0));
                            }
                        }
                    }
                }
                bool @checked = Checked;
                if (@checked)
                {
                    using (Image image = Image.FromStream(new MemoryStream(Convert.FromBase64String(B64Enabled))))
                        G.DrawImage(image, new Rectangle(3, 3, 11, 11));
                }
            }
            else
            {
                using (SolidBrush solidBrush3 = new SolidBrush(AloneLibrary.ColorFromHex("#F5F5F8")))
                {
                    using (Pen pen2 = new Pen(AloneLibrary.ColorFromHex("#E1E1E2")))
                    {
                        using (SolidBrush solidBrush4 = new SolidBrush(AloneLibrary.ColorFromHex("#D0D3D7")))
                        {
                            using (Font font2 = new Font("Segoe UI", 9f))
                            {
                                G.FillPath(solidBrush3, AloneLibrary.RoundRect(new Rectangle(0, 0, 16, 16), 3, AloneLibrary.RoundingStyle.All));
                                G.DrawPath(pen2, AloneLibrary.RoundRect(new Rectangle(0, 0, 16, 16), 3, AloneLibrary.RoundingStyle.All));
                                G.DrawString(Text, font2, solidBrush4, new Point(25, 0));
                            }
                        }
                    }
                }
                bool checked2 = Checked;
                if (checked2)
                {
                    using (Image image2 = Image.FromStream(new MemoryStream(Convert.FromBase64String(B64Disabled))))
                        G.DrawImage(image2, new Rectangle(3, 3, 11, 11));
                }
            }
        }
Ejemplo n.º 4
0
 protected override void OnPaint(PaintEventArgs e)
 {
     G = e.Graphics;
     G.SmoothingMode     = SmoothingMode.HighQuality;
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
     base.OnPaint(e);
     if (Enabled)
     {
         AloneButton.MouseState state = State;
         if (state != AloneButton.MouseState.Over)
         {
             if (state != AloneButton.MouseState.Down)
             {
                 using (SolidBrush solidBrush = new SolidBrush(AloneLibrary.ColorFromHex("#F6F6F6")))
                     G.FillPath(solidBrush, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
             }
             else
             {
                 using (SolidBrush solidBrush2 = new SolidBrush(AloneLibrary.ColorFromHex("#F0F0F0")))
                     G.FillPath(solidBrush2, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
             }
         }
         else
         {
             using (SolidBrush solidBrush3 = new SolidBrush(AloneLibrary.ColorFromHex("#FDFDFD")))
                 G.FillPath(solidBrush3, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
         }
         using (Pen pen = new Pen(AloneLibrary.ColorFromHex("#C3C3C3")))
         {
             G.DrawPath(pen, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
             AloneLibrary.CenterString(G, Text, Font, ForeColor, AloneLibrary.FullRectangle(base.Size, false));
         }
         Cursor = Cursors.Hand;
     }
     else
     {
         using (SolidBrush solidBrush4 = new SolidBrush(AloneLibrary.ColorFromHex("#F3F4F7")))
         {
             using (Pen pen2 = new Pen(AloneLibrary.ColorFromHex("#DCDCDC")))
             {
                 G.FillPath(solidBrush4, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
                 G.DrawPath(pen2, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 3, AloneLibrary.RoundingStyle.All));
                 AloneLibrary.CenterString(G, Text, Font, AloneLibrary.ColorFromHex("#D0D3D7"), AloneLibrary.FullRectangle(base.Size, false));
             }
         }
         Cursor = Cursors.Default;
     }
 }
Ejemplo n.º 5
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics graphics = e.Graphics;

            graphics.SmoothingMode     = SmoothingMode.HighQuality;
            graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            base.OnPaint(e);
            graphics.Clear(BackColor);
            using (Pen pen = new Pen(_BorderColor))
                graphics.DrawPath(pen, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 6, AloneLibrary.RoundingStyle.All));
            bool flag = Value != 0;

            if (flag)
            {
                using (HatchBrush hatchBrush = new HatchBrush(HatchStyle.LightUpwardDiagonal, Stripes, BackgroundColor))
                    graphics.FillPath(hatchBrush, AloneLibrary.RoundRect(checked (new Rectangle(0, 0, (int)Math.Round(unchecked ((double)Value / (double)Maximum * (double)base.Width - 1.0)), base.Height - 1)), 6, AloneLibrary.RoundingStyle.All));
            }
        }
Ejemplo n.º 6
0
        protected override void OnPaint(PaintEventArgs e)
        {
            G = e.Graphics;
            G.SmoothingMode     = SmoothingMode.HighQuality;
            G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            base.OnPaint(e);
            G.Clear(Color.White);
            bool enabled = Enabled;

            checked
            {
                if (enabled)
                {
                    using (Pen pen = new Pen(AloneLibrary.ColorFromHex("#D0D5D9")))
                    {
                        using (SolidBrush solidBrush = new SolidBrush(AloneLibrary.ColorFromHex("#7C858E")))
                        {
                            using (Font font = new Font("Marlett", 13f))
                            {
                                G.DrawPath(pen, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 6, AloneLibrary.RoundingStyle.All));
                                G.DrawString("6", font, solidBrush, new Point(base.Width - 22, 3));
                            }
                        }
                    }
                }
                else
                {
                    using (Pen pen2 = new Pen(AloneLibrary.ColorFromHex("#E1E1E2")))
                    {
                        using (SolidBrush solidBrush2 = new SolidBrush(AloneLibrary.ColorFromHex("#D0D3D7")))
                        {
                            using (Font font2 = new Font("Marlett", 13f))
                            {
                                G.DrawPath(pen2, AloneLibrary.RoundRect(AloneLibrary.FullRectangle(base.Size, true), 6, AloneLibrary.RoundingStyle.All));
                                G.DrawString("6", font2, solidBrush2, new Point(base.Width - 22, 3));
                            }
                        }
                    }
                }
                bool flag = !Information.IsNothing(base.Items);
                if (flag)
                {
                    using (Font font3 = new Font("Segoe UI", 9f))
                    {
                        using (SolidBrush solidBrush3 = new SolidBrush(AloneLibrary.ColorFromHex("#7C858E")))
                        {
                            bool enabled2 = Enabled;
                            if (enabled2)
                            {
                                bool flag2 = SelectedIndex != -1;
                                if (flag2)
                                {
                                    G.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[SelectedIndex])), font3, solidBrush3, new Point(7, 4));
                                }
                                else
                                {
                                    try
                                    {
                                        G.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[0])), font3, solidBrush3, new Point(7, 4));
                                    }
                                    catch (Exception arg_272_0)
                                    {
                                        ProjectData.SetProjectError(arg_272_0);
                                        ProjectData.ClearProjectError();
                                    }
                                }
                            }
                            else
                            {
                                using (SolidBrush solidBrush4 = new SolidBrush(AloneLibrary.ColorFromHex("#D0D3D7")))
                                {
                                    bool flag3 = SelectedIndex != -1;
                                    if (flag3)
                                    {
                                        G.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[SelectedIndex])), font3, solidBrush4, new Point(7, 4));
                                    }
                                    else
                                    {
                                        G.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[0])), font3, solidBrush4, new Point(7, 4));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }