diff --git a/Base/Base.csproj b/Base/Base.csproj index 9813a82..a26f79f 100644 --- a/Base/Base.csproj +++ b/Base/Base.csproj @@ -12,9 +12,9 @@ True ThatOneNerd.Graphing ThatOneNerd.Graphing - 1.0.0 + 1.1.0 That_One_Nerd - A fairly adept graphing calculator made in Windows Forms. + A fairly adept graphing calculator made in Windows Forms. MIT https://github.com/That-One-Nerd/Graphing README.md @@ -22,6 +22,8 @@ MIT True snupkg + View the GitHub release for the changelog: +https://github.com/That-One-Nerd/Graphing/releases/tag/1.1.0 diff --git a/Base/Base.csproj.user b/Base/Base.csproj.user index f3bd93a..4bb9e32 100644 --- a/Base/Base.csproj.user +++ b/Base/Base.csproj.user @@ -1,6 +1,12 @@  + + <_LastSelectedProfileId>C:\Users\kyley\Desktop\Coding\C#\Graphing\Base\Properties\PublishProfiles\FolderProfile.pubxml + + + UserControl + Form @@ -10,5 +16,8 @@ Form + + Form + \ No newline at end of file diff --git a/Base/Extensions/FormattingExtensions.cs b/Base/Extensions/FormattingExtensions.cs new file mode 100644 index 0000000..baf27c2 --- /dev/null +++ b/Base/Extensions/FormattingExtensions.cs @@ -0,0 +1,32 @@ +namespace Graphing.Extensions; + +public static class FormattingExtensions +{ + private static readonly string[] sizeUnits = + [ + " bytes", + " KB", + " MB", + " GB", + " TB", + " PB", + ]; + + public static string FormatAsBytes(this long bytes) + { + double val = bytes; + int unitIndex = 0; + + while (val > 1024) + { + unitIndex++; + val /= 1024; + } + + string result; + if (unitIndex == 0) result = val.ToString("0"); + else result = val.ToString("0.00"); + + return result + sizeUnits[unitIndex]; + } +} diff --git a/Base/Forms/Controls/PieChart.Designer.cs b/Base/Forms/Controls/PieChart.Designer.cs new file mode 100644 index 0000000..18b52e0 --- /dev/null +++ b/Base/Forms/Controls/PieChart.Designer.cs @@ -0,0 +1,44 @@ +namespace Graphing.Forms.Controls +{ + partial class PieChart + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + SuspendLayout(); + // + // PieChart + // + AutoScaleDimensions = new SizeF(13F, 32F); + AutoScaleMode = AutoScaleMode.Font; + Name = "PieChart"; + Size = new Size(500, 500); + ResumeLayout(false); + } + + #endregion + } +} diff --git a/Base/Forms/Controls/PieChart.cs b/Base/Forms/Controls/PieChart.cs new file mode 100644 index 0000000..19d0e71 --- /dev/null +++ b/Base/Forms/Controls/PieChart.cs @@ -0,0 +1,59 @@ +using System.Drawing.Drawing2D; + +namespace Graphing.Forms.Controls; + +public partial class PieChart : UserControl +{ + public List<(Color, double)> Values { get; set; } + + public PieChart() + { + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.UserPaint, true); + + Values = []; + InitializeComponent(); + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics g = e.Graphics; + g.SmoothingMode = SmoothingMode.HighQuality; + int size = Math.Min(Width, Height); + Rectangle rect = new(5, 5, size - 10, size - 10); + + double sum = 0; + foreach ((Color, double v) item in Values) + sum += item.v; + + // Draw them. + double current = 0; + foreach ((Color color, double value) item in Values) + { + double start = 360 * current / sum, + end = 360 * (current + item.value) / sum; + + Brush filler = new SolidBrush(item.color); + g.FillPie(filler, rect, (float)start, (float)(end - start)); + + current += item.value; + } + + // Draw the outline. + Pen outlinePartsPen = new(Color.FromArgb(unchecked((int)0xFF_202020)), 3); + current = 0; + foreach ((Color, double value) item in Values) + { + double start = 360 * current / sum, + end = 360 * (current + item.value) / sum; + g.DrawPie(outlinePartsPen, rect, (float)start, (float)(end - start)); + + current += item.value; + } + + // Outline + Pen outlinePen = new(Color.FromArgb(unchecked((int)0xFF_202020)), 5); + g.DrawEllipse(outlinePen, rect); + } +} diff --git a/Base/Forms/Controls/PieChart.resx b/Base/Forms/Controls/PieChart.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/Base/Forms/Controls/PieChart.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Base/Forms/GraphForm.Designer.cs b/Base/Forms/GraphForm.Designer.cs index 23704fe..15c0cfe 100644 --- a/Base/Forms/GraphForm.Designer.cs +++ b/Base/Forms/GraphForm.Designer.cs @@ -39,6 +39,8 @@ MenuEquations = new ToolStripMenuItem(); MenuEquationsDerivative = new ToolStripMenuItem(); MenuEquationsIntegral = new ToolStripMenuItem(); + MenuMisc = new ToolStripMenuItem(); + MenuMiscCaches = new ToolStripMenuItem(); GraphMenu.SuspendLayout(); SuspendLayout(); // @@ -58,7 +60,7 @@ // GraphMenu // GraphMenu.ImageScalingSize = new Size(32, 32); - GraphMenu.Items.AddRange(new ToolStripItem[] { MenuViewport, MenuColors, MenuEquations }); + GraphMenu.Items.AddRange(new ToolStripItem[] { MenuViewport, MenuColors, MenuEquations, MenuMisc }); GraphMenu.Location = new Point(0, 0); GraphMenu.Name = "GraphMenu"; GraphMenu.Size = new Size(1449, 42); @@ -125,6 +127,20 @@ MenuEquationsIntegral.Size = new Size(360, 44); MenuEquationsIntegral.Text = "Compute Integral"; // + // MenuMisc + // + MenuMisc.DropDownItems.AddRange(new ToolStripItem[] { MenuMiscCaches }); + MenuMisc.Name = "MenuMisc"; + MenuMisc.Size = new Size(83, 38); + MenuMisc.Text = "Misc"; + // + // MenuMiscCaches + // + MenuMiscCaches.Name = "MenuMiscCaches"; + MenuMiscCaches.Size = new Size(359, 44); + MenuMiscCaches.Text = "View Caches"; + MenuMiscCaches.Click += MenuMiscCaches_Click; + // // GraphForm // AutoScaleDimensions = new SizeF(13F, 32F); @@ -154,5 +170,7 @@ private ToolStripMenuItem MenuEquations; private ToolStripMenuItem MenuEquationsDerivative; private ToolStripMenuItem MenuEquationsIntegral; + private ToolStripMenuItem MenuMisc; + private ToolStripMenuItem MenuMiscCaches; } } \ No newline at end of file diff --git a/Base/Forms/GraphForm.cs b/Base/Forms/GraphForm.cs index 66fe8a5..5991244 100644 --- a/Base/Forms/GraphForm.cs +++ b/Base/Forms/GraphForm.cs @@ -1,9 +1,16 @@ -using Graphing.Graphables; +using Graphing.Extensions; +using Graphing.Graphables; +using System.Drawing.Drawing2D; +using System.Text; namespace Graphing.Forms; public partial class GraphForm : Form { + public static readonly Color MainAxisColor = Color.Black; + public static readonly Color SemiAxisColor = Color.FromArgb(unchecked((int)0xFF_999999)); + public static readonly Color QuarterAxisColor = Color.FromArgb(unchecked((int)0xFF_E0E0E0)); + public Float2 ScreenCenter { get; private set; } public Float2 Dpi { get; private set; } @@ -94,7 +101,7 @@ public partial class GraphForm : Form double axisScale = Math.Pow(2, Math.Round(Math.Log2(ZoomLevel))); // Draw horizontal/vertical quarter-axis. - Brush quarterBrush = new SolidBrush(Color.FromArgb(unchecked((int)0xFF_E0E0E0))); + Brush quarterBrush = new SolidBrush(QuarterAxisColor); Pen quarterPen = new(quarterBrush, 2); for (double x = Math.Ceiling(MinVisibleGraph.x * 4 / axisScale) * axisScale / 4; x <= Math.Floor(MaxVisibleGraph.x * 4 / axisScale) * axisScale / 4; x += axisScale / 4) @@ -111,7 +118,7 @@ public partial class GraphForm : Form } // Draw horizontal/vertical semi-axis. - Brush semiBrush = new SolidBrush(Color.FromArgb(unchecked((int)0xFF_999999))); + Brush semiBrush = new SolidBrush(SemiAxisColor); Pen semiPen = new(semiBrush, 2); for (double x = Math.Ceiling(MinVisibleGraph.x / axisScale) * axisScale; x <= Math.Floor(MaxVisibleGraph.x / axisScale) * axisScale; x += axisScale) @@ -127,7 +134,7 @@ public partial class GraphForm : Form g.DrawLine(semiPen, startPos, endPos); } - Brush mainLineBrush = new SolidBrush(Color.Black); + Brush mainLineBrush = new SolidBrush(MainAxisColor); Pen mainLinePen = new(mainLineBrush, 3); // Draw the main axis (on top of the semi axis). @@ -143,6 +150,7 @@ public partial class GraphForm : Form protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; + g.SmoothingMode = SmoothingMode.HighQuality; Brush background = new SolidBrush(Color.White); g.FillRectangle(background, e.ClipRectangle); @@ -152,19 +160,9 @@ public partial class GraphForm : Form // Draw the actual graphs. for (int i = 0; i < ables.Count; i++) { - IEnumerable lines = ables[i].GetItemsToRender(this); + IEnumerable lines = ables[i].GetItemsToRender(this); Brush graphBrush = new SolidBrush(ables[i].Color); - Pen penBrush = new(graphBrush, 3); - - foreach (Line2d l in lines) - { - if (!double.IsNormal(l.a.x) || !double.IsNormal(l.a.y) || - !double.IsNormal(l.b.x) || !double.IsNormal(l.b.y)) continue; - - Int2 start = GraphSpaceToScreenSpace(l.a), - end = GraphSpaceToScreenSpace(l.b); - g.DrawLine(penBrush, start, end); - } + foreach (IGraphPart gp in lines) gp.Render(this, g, graphBrush); } base.OnPaint(e); @@ -175,9 +173,9 @@ public partial class GraphForm : Form Invalidate(false); } - public void Graph(Graphable able) + public void Graph(params Graphable[] able) { - ables.Add(able); + ables.AddRange(able); RegenerateMenuItems(); Invalidate(false); } @@ -257,14 +255,14 @@ public partial class GraphForm : Form colorItem.Click += (o, e) => GraphColorPickerButton_Click(able); MenuColors.DropDownItems.Add(colorItem); - if (able is Equation) + if (able is Equation equ) { ToolStripMenuItem derivativeItem = new() { ForeColor = able.Color, Text = able.Name }; - derivativeItem.Click += (o, e) => EquationComputeDerivative_Click((able as Equation)!); + derivativeItem.Click += (o, e) => EquationComputeDerivative_Click(equ); MenuEquationsDerivative.DropDownItems.Add(derivativeItem); ToolStripMenuItem integralItem = new() @@ -272,7 +270,7 @@ public partial class GraphForm : Form ForeColor = able.Color, Text = able.Name }; - integralItem.Click += (o, e) => EquationComputeIntegral_Click((able as Equation)!); + integralItem.Click += (o, e) => EquationComputeIntegral_Click(equ); MenuEquationsIntegral.DropDownItems.Add(integralItem); } } @@ -346,7 +344,7 @@ public partial class GraphForm : Form static double Integrate(EquationDelegate e, double lower, double upper) { // TODO: a better rendering method could make this much faster. - const double step = 1e-1; + const double step = 1e-2; double factor = 1; if (upper < lower) @@ -364,4 +362,16 @@ public partial class GraphForm : Form return sum * factor; } } + + private void MenuMiscCaches_Click(object? sender, EventArgs e) + { + ViewCacheForm cacheForm = new(this) + { + StartPosition = FormStartPosition.Manual + }; + + cacheForm.Location = new Point(Location.X + ClientRectangle.Width + 10, + Location.Y + (ClientRectangle.Height - cacheForm.ClientRectangle.Height) / 2); + cacheForm.Show(); + } } diff --git a/Base/Forms/SetZoomForm.cs b/Base/Forms/SetZoomForm.cs index 30e2567..1d30ee4 100644 --- a/Base/Forms/SetZoomForm.cs +++ b/Base/Forms/SetZoomForm.cs @@ -1,131 +1,119 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Numerics; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +namespace Graphing.Forms; -namespace Graphing.Forms +public partial class SetZoomForm : Form { - public partial class SetZoomForm : Form + private double minZoomRange; + private double maxZoomRange; + + private double zoomLevel; + + private readonly GraphForm form; + + public SetZoomForm(GraphForm form) { - private double minZoomRange; - private double maxZoomRange; + InitializeComponent(); - private double zoomLevel; + minZoomRange = 1 / (form.ZoomLevel * 2); + maxZoomRange = 2 / form.ZoomLevel; + zoomLevel = 1 / form.ZoomLevel; - private readonly GraphForm form; + ZoomTrackBar.Value = (int)(ZoomToFactor(zoomLevel) * (ZoomTrackBar.Maximum - ZoomTrackBar.Minimum) + ZoomTrackBar.Minimum); - public SetZoomForm(GraphForm form) + this.form = form; + } + + protected override void OnPaint(PaintEventArgs e) + { + ZoomMaxValue.Text = maxZoomRange.ToString("0.00"); + ZoomMinValue.Text = minZoomRange.ToString("0.00"); + + ValueLabel.Text = $"{zoomLevel:0.00}x"; + + base.OnPaint(e); + + form.ZoomLevel = 1 / zoomLevel; + form.Invalidate(false); + } + + private double FactorToZoom(double factor) + { + return minZoomRange + (factor * factor) * (maxZoomRange - minZoomRange); + } + private double ZoomToFactor(double zoom) + { + double sqrValue = (zoom - minZoomRange) / (maxZoomRange - minZoomRange); + return Math.Sign(sqrValue) * Math.Sqrt(Math.Abs(sqrValue)); + } + + private void ZoomTrackBar_Scroll(object? sender, EventArgs e) + { + double factor = (ZoomTrackBar.Value - ZoomTrackBar.Minimum) / (double)(ZoomTrackBar.Maximum - ZoomTrackBar.Minimum); + zoomLevel = FactorToZoom(factor); + + Invalidate(true); + } + + private void ZoomMinValue_TextChanged(object? sender, EventArgs e) + { + double original = minZoomRange; + try { - InitializeComponent(); + double value; + if (string.IsNullOrWhiteSpace(ZoomMinValue.Text) || + ZoomMinValue.Text.EndsWith('.')) + { + return; + } + else + { + value = double.Parse(ZoomMinValue.Text); + if (value < 1e-2 || value > 1e3 || value > maxZoomRange) throw new(); + } - minZoomRange = 1 / (form.ZoomLevel * 2); - maxZoomRange = 2 / form.ZoomLevel; - zoomLevel = 1 / form.ZoomLevel; - - ZoomTrackBar.Value = (int)(ZoomToFactor(zoomLevel) * (ZoomTrackBar.Maximum - ZoomTrackBar.Minimum) + ZoomTrackBar.Minimum); - - this.form = form; - } - - protected override void OnPaint(PaintEventArgs e) - { - ZoomMaxValue.Text = maxZoomRange.ToString("0.00"); - ZoomMinValue.Text = minZoomRange.ToString("0.00"); - - ValueLabel.Text = $"{zoomLevel:0.00}x"; - - base.OnPaint(e); - - form.ZoomLevel = 1 / zoomLevel; - form.Invalidate(false); - } - - private double FactorToZoom(double factor) - { - return minZoomRange + (factor * factor) * (maxZoomRange - minZoomRange); - } - private double ZoomToFactor(double zoom) - { - double sqrValue = (zoom - minZoomRange) / (maxZoomRange - minZoomRange); - return Math.Sign(sqrValue) * Math.Sqrt(Math.Abs(sqrValue)); - } - - private void ZoomTrackBar_Scroll(object? sender, EventArgs e) - { + minZoomRange = value; + ZoomTrackBar.Value = (int)Math.Clamp(ZoomToFactor(zoomLevel) * (ZoomTrackBar.Maximum - ZoomTrackBar.Minimum) + ZoomTrackBar.Minimum, ZoomTrackBar.Minimum, ZoomTrackBar.Maximum); double factor = (ZoomTrackBar.Value - ZoomTrackBar.Minimum) / (double)(ZoomTrackBar.Maximum - ZoomTrackBar.Minimum); - zoomLevel = FactorToZoom(factor); + double newZoom = FactorToZoom(factor); - Invalidate(true); + zoomLevel = newZoom; + if (newZoom != factor) Invalidate(true); } - - private void ZoomMinValue_TextChanged(object? sender, EventArgs e) + catch { - double original = minZoomRange; - try - { - double value; - if (string.IsNullOrWhiteSpace(ZoomMinValue.Text) || - ZoomMinValue.Text.EndsWith('.')) - { - return; - } - else - { - value = double.Parse(ZoomMinValue.Text); - if (value < 1e-2 || value > 1e3 || value > maxZoomRange) throw new(); - } - - minZoomRange = value; - ZoomTrackBar.Value = (int)Math.Clamp(ZoomToFactor(zoomLevel) * (ZoomTrackBar.Maximum - ZoomTrackBar.Minimum) + ZoomTrackBar.Minimum, ZoomTrackBar.Minimum, ZoomTrackBar.Maximum); - double factor = (ZoomTrackBar.Value - ZoomTrackBar.Minimum) / (double)(ZoomTrackBar.Maximum - ZoomTrackBar.Minimum); - double newZoom = FactorToZoom(factor); - - zoomLevel = newZoom; - if (newZoom != factor) Invalidate(true); - } - catch - { - minZoomRange = original; - ZoomMinValue.Text = minZoomRange.ToString("0.00"); - } + minZoomRange = original; + ZoomMinValue.Text = minZoomRange.ToString("0.00"); } + } - private void ZoomMaxValue_TextChanged(object sender, EventArgs e) + private void ZoomMaxValue_TextChanged(object sender, EventArgs e) + { + double original = maxZoomRange; + try { - double original = maxZoomRange; - try + double value; + if (string.IsNullOrWhiteSpace(ZoomMaxValue.Text) || + ZoomMaxValue.Text.EndsWith('.')) { - double value; - if (string.IsNullOrWhiteSpace(ZoomMaxValue.Text) || - ZoomMaxValue.Text.EndsWith('.')) - { - return; - } - else - { - value = double.Parse(ZoomMaxValue.Text); - if (value < 1e-2 || value > 1e3 || value < minZoomRange) throw new(); - } - - maxZoomRange = value; - ZoomTrackBar.Value = (int)Math.Clamp(ZoomToFactor(zoomLevel) * (ZoomTrackBar.Maximum - ZoomTrackBar.Minimum) + ZoomTrackBar.Minimum, ZoomTrackBar.Minimum, ZoomTrackBar.Maximum); - double factor = (ZoomTrackBar.Value - ZoomTrackBar.Minimum) / (double)(ZoomTrackBar.Maximum - ZoomTrackBar.Minimum); - double newZoom = FactorToZoom(factor); - - zoomLevel = newZoom; - if (newZoom != factor) Invalidate(true); + return; } - catch + else { - maxZoomRange = original; - ZoomMaxValue.Text = maxZoomRange.ToString("0.00"); + value = double.Parse(ZoomMaxValue.Text); + if (value < 1e-2 || value > 1e3 || value < minZoomRange) throw new(); } + + maxZoomRange = value; + ZoomTrackBar.Value = (int)Math.Clamp(ZoomToFactor(zoomLevel) * (ZoomTrackBar.Maximum - ZoomTrackBar.Minimum) + ZoomTrackBar.Minimum, ZoomTrackBar.Minimum, ZoomTrackBar.Maximum); + double factor = (ZoomTrackBar.Value - ZoomTrackBar.Minimum) / (double)(ZoomTrackBar.Maximum - ZoomTrackBar.Minimum); + double newZoom = FactorToZoom(factor); + + zoomLevel = newZoom; + if (newZoom != factor) Invalidate(true); + } + catch + { + maxZoomRange = original; + ZoomMaxValue.Text = maxZoomRange.ToString("0.00"); } } } diff --git a/Base/Forms/ViewCacheForm.Designer.cs b/Base/Forms/ViewCacheForm.Designer.cs new file mode 100644 index 0000000..c847e6b --- /dev/null +++ b/Base/Forms/ViewCacheForm.Designer.cs @@ -0,0 +1,97 @@ +namespace Graphing.Forms +{ + partial class ViewCacheForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewCacheForm)); + CachePie = new Controls.PieChart(); + TotalCacheText = new Label(); + EraseAllCacheButton = new Button(); + SpecificCachePanel = new Panel(); + SuspendLayout(); + // + // CachePie + // + CachePie.Location = new Point(50, 50); + CachePie.Name = "CachePie"; + CachePie.Size = new Size(450, 450); + CachePie.TabIndex = 0; + // + // TotalCacheText + // + TotalCacheText.Font = new Font("Segoe UI Semibold", 10.125F, FontStyle.Bold, GraphicsUnit.Point, 0); + TotalCacheText.Location = new Point(62, 540); + TotalCacheText.Name = "TotalCacheText"; + TotalCacheText.Size = new Size(425, 45); + TotalCacheText.TabIndex = 1; + TotalCacheText.Text = "Total Cache: Something"; + TotalCacheText.TextAlign = ContentAlignment.TopCenter; + // + // EraseAllCacheButton + // + EraseAllCacheButton.Location = new Point(200, 580); + EraseAllCacheButton.Name = "EraseAllCacheButton"; + EraseAllCacheButton.Size = new Size(150, 46); + EraseAllCacheButton.TabIndex = 2; + EraseAllCacheButton.Text = "Erase All"; + EraseAllCacheButton.UseVisualStyleBackColor = true; + EraseAllCacheButton.Click += EraseAllCacheButton_Click; + // + // SpecificCachePanel + // + SpecificCachePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + SpecificCachePanel.AutoScroll = true; + SpecificCachePanel.Location = new Point(520, 12); + SpecificCachePanel.Name = "SpecificCachePanel"; + SpecificCachePanel.Size = new Size(542, 657); + SpecificCachePanel.TabIndex = 3; + // + // ViewCacheForm + // + AutoScaleDimensions = new SizeF(13F, 32F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1074, 679); + Controls.Add(SpecificCachePanel); + Controls.Add(EraseAllCacheButton); + Controls.Add(TotalCacheText); + Controls.Add(CachePie); + FormBorderStyle = FormBorderStyle.SizableToolWindow; + MinimumSize = new Size(885, 750); + Name = "ViewCacheForm"; + Text = "Graph Caches"; + ResumeLayout(false); + } + + #endregion + + private Controls.PieChart CachePie; + private Label TotalCacheText; + private Button EraseAllCacheButton; + private Panel SpecificCachePanel; + } +} \ No newline at end of file diff --git a/Base/Forms/ViewCacheForm.cs b/Base/Forms/ViewCacheForm.cs new file mode 100644 index 0000000..55cd1e4 --- /dev/null +++ b/Base/Forms/ViewCacheForm.cs @@ -0,0 +1,89 @@ +using Graphing.Extensions; + +namespace Graphing.Forms; + +public partial class ViewCacheForm : Form +{ + private readonly GraphForm refForm; + + private readonly List