2017-07-01 22:36:17 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2017-08-23 13:38:40 -04:00
|
|
|
|
namespace Histacom2.Engine
|
2017-07-01 22:36:17 -04:00
|
|
|
|
{
|
|
|
|
|
public class Paintbrush
|
|
|
|
|
{
|
2017-07-02 16:44:11 -04:00
|
|
|
|
public static void PaintClassicBorders(object sender, PaintEventArgs e, int borderwidth)
|
2017-07-01 22:49:31 -04:00
|
|
|
|
{
|
2017-07-01 22:36:17 -04:00
|
|
|
|
ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle,
|
2017-08-07 14:04:08 -04:00
|
|
|
|
Color.White, borderwidth, ButtonBorderStyle.Solid,
|
|
|
|
|
Color.White, borderwidth, ButtonBorderStyle.Solid,
|
|
|
|
|
Color.Gray, borderwidth, ButtonBorderStyle.Solid,
|
|
|
|
|
Color.Gray, borderwidth, ButtonBorderStyle.Solid);
|
2017-07-01 22:36:17 -04:00
|
|
|
|
}
|
2017-07-13 20:13:35 -04:00
|
|
|
|
|
|
|
|
|
public static void PaintClassicBordersIndented(object sender, PaintEventArgs e, int borderwidth)
|
|
|
|
|
{
|
|
|
|
|
ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle,
|
2017-08-07 14:04:08 -04:00
|
|
|
|
Color.Gray, borderwidth, ButtonBorderStyle.Solid,
|
|
|
|
|
Color.Gray, borderwidth, ButtonBorderStyle.Solid,
|
|
|
|
|
Color.White, borderwidth, ButtonBorderStyle.Solid,
|
|
|
|
|
Color.White, borderwidth, ButtonBorderStyle.Solid);
|
2017-07-13 20:13:35 -04:00
|
|
|
|
}
|
2017-08-08 10:42:48 -04:00
|
|
|
|
|
|
|
|
|
public static void ExtendedToolStripSeparator_Paint(object sender, PaintEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
// Get the separator's width and height.
|
|
|
|
|
ToolStripSeparator toolStripSeparator = (ToolStripSeparator)sender;
|
|
|
|
|
int width = toolStripSeparator.Width;
|
|
|
|
|
int height = toolStripSeparator.Height;
|
|
|
|
|
|
|
|
|
|
// Choose the colors for drawing.
|
|
|
|
|
Color foreColor = Color.Gray;
|
|
|
|
|
Color backColor = Color.Silver;
|
|
|
|
|
|
|
|
|
|
// Fill the background.
|
|
|
|
|
e.Graphics.FillRectangle(new SolidBrush(backColor), 0, 0, width, height);
|
|
|
|
|
|
|
|
|
|
// Draw the line.
|
|
|
|
|
e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2);
|
|
|
|
|
}
|
2017-09-05 20:05:28 -04:00
|
|
|
|
|
|
|
|
|
public static Color GetLightFromColor(Color basecolor)
|
|
|
|
|
{
|
2017-09-05 21:13:06 -04:00
|
|
|
|
if (basecolor == Color.Silver) return Color.White;
|
2017-09-05 20:05:28 -04:00
|
|
|
|
if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(184, 184, 184);
|
2017-09-05 21:13:06 -04:00
|
|
|
|
if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(218, 223, 218);
|
|
|
|
|
return ControlPaint.Light(basecolor, 70);
|
2017-09-05 20:05:28 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Color GetDarkFromColor(Color basecolor)
|
|
|
|
|
{
|
2017-09-12 09:51:26 -04:00
|
|
|
|
if (basecolor == Color.Silver) return Color.Gray;
|
2017-09-05 20:05:28 -04:00
|
|
|
|
if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(72, 72, 72);
|
2017-09-05 21:13:06 -04:00
|
|
|
|
if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(95, 153, 95);
|
|
|
|
|
return ControlPaint.Dark(basecolor, 70);
|
2017-09-05 20:05:28 -04:00
|
|
|
|
}
|
2017-07-01 22:36:17 -04:00
|
|
|
|
}
|
|
|
|
|
}
|