From e0bce6d55f65a58c659ffbba7fa6570057891b33 Mon Sep 17 00:00:00 2001 From: LilDosto Date: Thu, 29 Oct 2026 01:10:39 +0300 Subject: [PATCH] feat(ui): redesign right panel into card-based entity manager and release v3.2.0 --- README.md | 8 +- installer/setup.iss | 4 +- .../Controls/GraphPlotterControl.Designer.cs | 242 +++++++------ .../Controls/GraphPlotterControl.cs | 318 +++++++++++++++++- src/ttCalculator/MainForm.Designer.cs | 2 +- src/ttCalculator/ThemeHelper.cs | 7 +- src/ttCalculator/ttCalculator.csproj | 2 +- tests/ttCalculator.Tests/Program.cs | 2 +- 8 files changed, 449 insertions(+), 136 deletions(-) diff --git a/README.md b/README.md index 708a96e..952d9b2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 📐 ttCalculator v3.1.0 +# 📐 ttCalculator v3.2.0 [![GitHub release](https://img.shields.io/github/v/release/LilDosto/ttCalculator?color=brightgreen&label=S%C3%BCr%C3%BCm)](https://github.com/LilDosto/ttCalculator/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) @@ -13,11 +13,11 @@ Tüm matematiksel çekirdek, otomatik test paketinden **%100 başarıyla (0 hata ## 🚀 Hızlı Başlangıç & Kurulum -1. **[Releases](https://github.com/LilDosto/ttCalculator/releases/tag/v3.1.0)** sayfasına gidin. +1. **[Releases](https://github.com/LilDosto/ttCalculator/releases/tag/v3.2.0)** sayfasına gidin. 2. İhtiyacınıza göre indirin: - - **`ttCalculator-v3.1.0-Setup.exe` (Önerilen)**: Standart Windows kurulum sihirbazı. Masaüstüne ve Başlat Menüsüne kısayol oluşturur, Denetim Masası / Program Ekle-Kaldır entegrasyonu sağlar. + - **`ttCalculator-v3.2.0-Setup.exe` (Önerilen)**: Standart Windows kurulum sihirbazı. Masaüstüne ve Başlat Menüsüne kısayol oluşturur, Denetim Masası / Program Ekle-Kaldır entegrasyonu sağlar. - **`ttCalculator.exe`**: Kurulumsuz doğrudan çalıştırılabilen tek dosya taşınabilir (portable) sürüm. - - **`ttCalculator-v3.1.0-win-x64.zip`**: Taşınabilir arşiv paketi. + - **`ttCalculator-v3.2.0-win-x64.zip`**: Taşınabilir arşiv paketi. 3. Çift tıklayarak doğrudan çalıştırın — ek bağımlılık gerektirmez! --- diff --git a/installer/setup.iss b/installer/setup.iss index d9ffb33..2cd5210 100644 --- a/installer/setup.iss +++ b/installer/setup.iss @@ -1,6 +1,6 @@ ; Script generated by Antigravity for ttCalculator #define MyAppName "ttCalculator" -#define MyAppVersion "3.1.0" +#define MyAppVersion "3.2.0" #define MyAppPublisher "LilDosto" #define MyAppURL "https://github.com/LilDosto/ttCalculator" #define MyAppExeName "ttCalculator.exe" @@ -25,7 +25,7 @@ DefaultGroupName={#MyAppName} AllowNoIcons=yes LicenseFile=..\LICENSE OutputDir=..\Release -OutputBaseFilename=ttCalculator-v3.1.0-Setup +OutputBaseFilename=ttCalculator-v3.2.0-Setup SetupIconFile=..\Release\logo.ico Compression=lzma2/ultra64 SolidCompression=yes diff --git a/src/ttCalculator/Controls/GraphPlotterControl.Designer.cs b/src/ttCalculator/Controls/GraphPlotterControl.Designer.cs index 80168b8..4a6d038 100644 --- a/src/ttCalculator/Controls/GraphPlotterControl.Designer.cs +++ b/src/ttCalculator/Controls/GraphPlotterControl.Designer.cs @@ -65,18 +65,25 @@ namespace MathApp.Controls this.tabTools = new TabPage(); this.tabShapes = new TabPage(); - // Function Tab Controls + // Function Tab Controls (Card-based modern list) this.lstCurves = new ListBox(); + this.pnlCurvesContainer = new Panel(); + this.pnlCurvesBottomBar = new Panel(); + this.lblCurvesCount = new Label(); + this.btnCurveClearAll = new Button(); + this.btnCurveColor = new Button(); this.cmbCurveStyle = new ComboBox(); this.cmbCurveThickness = new ComboBox(); this.btnCurveToggle = new Button(); this.btnCurveDelete = new Button(); this.btnCurveEdit = new Button(); - this.btnCurveClearAll = new Button(); - // Points Tab Controls + // Points Tab Controls (Card-based modern list) this.lstPoints = new ListBox(); + this.pnlPointsContainer = new Panel(); + this.pnlPointsBottom = new Panel(); + this.lblPointsCount = new Label(); this.lblPtX = new Label(); this.txtPtX = new TextBox(); this.lblPtY = new Label(); @@ -308,9 +315,9 @@ namespace MathApp.Controls this.pnlControls.Controls.Add(this.chkShowAsymptotes); this.pnlControls.Controls.Add(this.pnlControlsBorder); - // pnlRightSide (Tabbed Manager) + // pnlRightSide (Tabbed Manager - Desmos/GeoGebra Card Architecture) this.pnlRightSide.Dock = DockStyle.Right; - this.pnlRightSide.Width = 320; + this.pnlRightSide.Width = 350; this.pnlRightSide.BackColor = ThemeHelper.CardBackground; this.pnlRightSide.Padding = new Padding(4); @@ -322,167 +329,150 @@ namespace MathApp.Controls this.tabManager.Controls.Add(this.tabShapes); this.pnlRightSide.Controls.Add(this.tabManager); - // tabFunctions + // ==================== TAB 1: EĞRİLER (Curves Card List) ==================== this.tabFunctions.Text = "Eğriler"; - this.tabFunctions.BackColor = ThemeHelper.DarkBackground; - this.tabFunctions.Padding = new Padding(8); + this.tabFunctions.BackColor = Color.FromArgb(11, 15, 28); + this.tabFunctions.Padding = new Padding(0); - this.lstCurves.Dock = DockStyle.Top; - this.lstCurves.Height = 220; - this.lstCurves.BackColor = Color.FromArgb(11, 17, 32); - this.lstCurves.ForeColor = Color.White; - this.lstCurves.Font = new Font("Consolas", 9.5F); + this.pnlCurvesBottomBar.Dock = DockStyle.Bottom; + this.pnlCurvesBottomBar.Height = 36; + this.pnlCurvesBottomBar.BackColor = Color.FromArgb(15, 23, 42); + this.pnlCurvesBottomBar.Padding = new Padding(8, 4, 8, 4); - this.btnCurveColor.Text = "Renk"; - this.btnCurveColor.Size = new Size(70, 26); - this.btnCurveColor.Location = new Point(8, 230); - this.btnCurveColor.BackColor = Color.FromArgb(30, 41, 59); - this.btnCurveColor.ForeColor = Color.White; - this.btnCurveColor.FlatStyle = FlatStyle.Flat; + this.lblCurvesCount.Text = "Toplam 0 Eğri"; + this.lblCurvesCount.Location = new Point(8, 9); + this.lblCurvesCount.AutoSize = true; + this.lblCurvesCount.ForeColor = Color.FromArgb(148, 163, 184); + this.lblCurvesCount.Font = new Font("Segoe UI", 8.5F); - this.cmbCurveStyle.Location = new Point(82, 230); - this.cmbCurveStyle.Size = new Size(110, 25); - this.cmbCurveStyle.DropDownStyle = ComboBoxStyle.DropDownList; - this.cmbCurveStyle.BackColor = ThemeHelper.CardBackground; - this.cmbCurveStyle.ForeColor = Color.White; - - this.cmbCurveThickness.Location = new Point(196, 230); - this.cmbCurveThickness.Size = new Size(95, 25); - this.cmbCurveThickness.DropDownStyle = ComboBoxStyle.DropDownList; - this.cmbCurveThickness.BackColor = ThemeHelper.CardBackground; - this.cmbCurveThickness.ForeColor = Color.White; - - this.btnCurveToggle.Text = "Göster/Gizle"; - this.btnCurveToggle.Size = new Size(135, 28); - this.btnCurveToggle.Location = new Point(8, 265); - this.btnCurveToggle.BackColor = Color.FromArgb(14, 116, 144); - this.btnCurveToggle.ForeColor = Color.White; - this.btnCurveToggle.FlatStyle = FlatStyle.Flat; - - this.btnCurveDelete.Text = "Eğriyi Sil"; - this.btnCurveDelete.Size = new Size(135, 28); - this.btnCurveDelete.Location = new Point(155, 265); - this.btnCurveDelete.BackColor = Color.FromArgb(185, 28, 28); - this.btnCurveDelete.ForeColor = Color.White; - this.btnCurveDelete.FlatStyle = FlatStyle.Flat; - - this.btnCurveEdit.Text = "Düzenle"; - this.btnCurveEdit.Size = new Size(135, 28); - this.btnCurveEdit.Location = new Point(8, 300); - this.btnCurveEdit.BackColor = Color.FromArgb(40, 58, 85); - this.btnCurveEdit.ForeColor = Color.White; - this.btnCurveEdit.FlatStyle = FlatStyle.Flat; - - this.btnCurveClearAll.Text = "Tümünü Sil"; - this.btnCurveClearAll.Size = new Size(135, 28); - this.btnCurveClearAll.Location = new Point(155, 300); + this.btnCurveClearAll.Text = "Tümünü Temizle"; + this.btnCurveClearAll.Size = new Size(110, 26); + this.btnCurveClearAll.Location = new Point(220, 5); this.btnCurveClearAll.BackColor = Color.FromArgb(127, 29, 29); this.btnCurveClearAll.ForeColor = Color.White; this.btnCurveClearAll.FlatStyle = FlatStyle.Flat; + this.btnCurveClearAll.Font = new Font("Segoe UI", 8F); + this.btnCurveClearAll.Cursor = Cursors.Hand; + this.btnCurveClearAll.FlatAppearance.BorderSize = 0; - this.tabFunctions.Controls.Add(this.lstCurves); - this.tabFunctions.Controls.Add(this.btnCurveColor); - this.tabFunctions.Controls.Add(this.cmbCurveStyle); - this.tabFunctions.Controls.Add(this.cmbCurveThickness); - this.tabFunctions.Controls.Add(this.btnCurveToggle); - this.tabFunctions.Controls.Add(this.btnCurveDelete); - this.tabFunctions.Controls.Add(this.btnCurveEdit); - this.tabFunctions.Controls.Add(this.btnCurveClearAll); + this.pnlCurvesBottomBar.Controls.Add(this.lblCurvesCount); + this.pnlCurvesBottomBar.Controls.Add(this.btnCurveClearAll); - // tabPoints + this.pnlCurvesContainer.Dock = DockStyle.Fill; + this.pnlCurvesContainer.AutoScroll = true; + this.pnlCurvesContainer.BackColor = Color.FromArgb(11, 17, 32); + this.pnlCurvesContainer.Padding = new Padding(4); + + this.tabFunctions.Controls.Add(this.pnlCurvesContainer); + this.tabFunctions.Controls.Add(this.pnlCurvesBottomBar); + + // ==================== TAB 2: NOKTALAR (Points Card List) ==================== this.tabPoints.Text = "Noktalar"; - this.tabPoints.BackColor = ThemeHelper.DarkBackground; - this.tabPoints.Padding = new Padding(8); + this.tabPoints.BackColor = Color.FromArgb(11, 15, 28); + this.tabPoints.Padding = new Padding(0); - this.lstPoints.Dock = DockStyle.Top; - this.lstPoints.Height = 180; - this.lstPoints.BackColor = Color.FromArgb(11, 17, 32); - this.lstPoints.ForeColor = Color.White; - this.lstPoints.Font = new Font("Consolas", 9.5F); + this.pnlPointsBottom.Dock = DockStyle.Bottom; + this.pnlPointsBottom.Height = 92; + this.pnlPointsBottom.BackColor = Color.FromArgb(15, 23, 42); + this.pnlPointsBottom.Padding = new Padding(6); + // Row 1 inputs this.lblPtX.Text = "X:"; - this.lblPtX.Location = new Point(8, 192); + this.lblPtX.Location = new Point(6, 9); this.lblPtX.AutoSize = true; this.lblPtX.ForeColor = ThemeHelper.LightText; + this.lblPtX.Font = new Font("Segoe UI", 8.5F); - this.txtPtX.Location = new Point(28, 189); - this.txtPtX.Size = new Size(60, 24); + this.txtPtX.Location = new Point(22, 6); + this.txtPtX.Size = new Size(42, 24); this.txtPtX.Text = "0"; this.txtPtX.Font = new Font("Consolas", 9F); this.txtPtX.BackColor = ThemeHelper.CardBackground; this.txtPtX.ForeColor = Color.White; + this.txtPtX.BorderStyle = BorderStyle.FixedSingle; this.lblPtY.Text = "Y:"; - this.lblPtY.Location = new Point(96, 192); + this.lblPtY.Location = new Point(68, 9); this.lblPtY.AutoSize = true; this.lblPtY.ForeColor = ThemeHelper.LightText; + this.lblPtY.Font = new Font("Segoe UI", 8.5F); - this.txtPtY.Location = new Point(116, 189); - this.txtPtY.Size = new Size(60, 24); + this.txtPtY.Location = new Point(84, 6); + this.txtPtY.Size = new Size(42, 24); this.txtPtY.Text = "0"; this.txtPtY.Font = new Font("Consolas", 9F); this.txtPtY.BackColor = ThemeHelper.CardBackground; this.txtPtY.ForeColor = Color.White; + this.txtPtY.BorderStyle = BorderStyle.FixedSingle; - this.btnPtColor.Text = "Renk"; - this.btnPtColor.Location = new Point(184, 188); - this.btnPtColor.Size = new Size(48, 25); - this.btnPtColor.BackColor = Color.FromArgb(250, 204, 21); - this.btnPtColor.FlatStyle = FlatStyle.Flat; - - this.btnAddPoint.Text = "+ Ekle"; - this.btnAddPoint.Location = new Point(236, 188); - this.btnAddPoint.Size = new Size(58, 25); - this.btnAddPoint.BackColor = ThemeHelper.AccentBlue; - this.btnAddPoint.ForeColor = Color.White; - this.btnAddPoint.FlatStyle = FlatStyle.Flat; - - this.lblPtShape.Text = "Şekil:"; - this.lblPtShape.Location = new Point(8, 225); - this.lblPtShape.AutoSize = true; - this.lblPtShape.ForeColor = ThemeHelper.LightText; - - this.cmbPtShape.Location = new Point(50, 222); - this.cmbPtShape.Size = new Size(130, 24); + this.cmbPtShape.Location = new Point(130, 6); + this.cmbPtShape.Size = new Size(82, 24); this.cmbPtShape.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbPtShape.BackColor = ThemeHelper.CardBackground; this.cmbPtShape.ForeColor = Color.White; - this.btnDeletePoint.Text = "Seçiliyi Sil"; - this.btnDeletePoint.Location = new Point(8, 255); - this.btnDeletePoint.Size = new Size(135, 27); - this.btnDeletePoint.BackColor = Color.FromArgb(185, 28, 28); - this.btnDeletePoint.ForeColor = Color.White; - this.btnDeletePoint.FlatStyle = FlatStyle.Flat; + this.btnPtColor.Text = ""; + this.btnPtColor.Location = new Point(216, 6); + this.btnPtColor.Size = new Size(28, 24); + this.btnPtColor.BackColor = Color.FromArgb(250, 204, 21); + this.btnPtColor.FlatStyle = FlatStyle.Flat; + this.btnPtColor.Cursor = Cursors.Hand; + + this.btnAddPoint.Text = "+ Ekle"; + this.btnAddPoint.Location = new Point(248, 6); + this.btnAddPoint.Size = new Size(60, 24); + this.btnAddPoint.BackColor = ThemeHelper.AccentBlue; + this.btnAddPoint.ForeColor = Color.White; + this.btnAddPoint.FlatStyle = FlatStyle.Flat; + this.btnAddPoint.Font = new Font("Segoe UI Semibold", 8.2F, FontStyle.Bold); + this.btnAddPoint.Cursor = Cursors.Hand; + this.btnAddPoint.FlatAppearance.BorderSize = 0; + + // Row 2 summary & clear + this.lblPointsCount.Text = "Toplam 0 Nokta"; + this.lblPointsCount.Location = new Point(6, 38); + this.lblPointsCount.AutoSize = true; + this.lblPointsCount.ForeColor = Color.FromArgb(148, 163, 184); + this.lblPointsCount.Font = new Font("Segoe UI", 8.5F); this.btnClearPoints.Text = "Tümünü Sil"; - this.btnClearPoints.Location = new Point(152, 255); - this.btnClearPoints.Size = new Size(135, 27); + this.btnClearPoints.Location = new Point(226, 34); + this.btnClearPoints.Size = new Size(82, 24); this.btnClearPoints.BackColor = Color.FromArgb(127, 29, 29); this.btnClearPoints.ForeColor = Color.White; this.btnClearPoints.FlatStyle = FlatStyle.Flat; + this.btnClearPoints.Font = new Font("Segoe UI", 8F); + this.btnClearPoints.Cursor = Cursors.Hand; + this.btnClearPoints.FlatAppearance.BorderSize = 0; - this.lblPointHint.Text = "İpucu: Grafik tuvalinde bir noktanın üzerine sağ tıklayarak da o noktayı silebilirsiniz."; - this.lblPointHint.Location = new Point(8, 295); - this.lblPointHint.Size = new Size(280, 50); + // Row 3 hint + this.lblPointHint.Text = "İpucu: Tuvalde noktanın üzerine sağ tıklayarak da silebilirsiniz."; + this.lblPointHint.Location = new Point(6, 66); + this.lblPointHint.Size = new Size(330, 20); this.lblPointHint.ForeColor = ThemeHelper.MutedText; - this.lblPointHint.Font = new Font("Segoe UI", 8.5F); + this.lblPointHint.Font = new Font("Segoe UI", 7.8F); - this.tabPoints.Controls.Add(this.lstPoints); - this.tabPoints.Controls.Add(this.lblPtX); - this.tabPoints.Controls.Add(this.txtPtX); - this.tabPoints.Controls.Add(this.lblPtY); - this.tabPoints.Controls.Add(this.txtPtY); - this.tabPoints.Controls.Add(this.btnPtColor); - this.tabPoints.Controls.Add(this.btnAddPoint); - this.tabPoints.Controls.Add(this.lblPtShape); - this.tabPoints.Controls.Add(this.cmbPtShape); - this.tabPoints.Controls.Add(this.btnDeletePoint); - this.tabPoints.Controls.Add(this.btnClearPoints); - this.tabPoints.Controls.Add(this.lblPointHint); + this.pnlPointsBottom.Controls.Add(this.lblPtX); + this.pnlPointsBottom.Controls.Add(this.txtPtX); + this.pnlPointsBottom.Controls.Add(this.lblPtY); + this.pnlPointsBottom.Controls.Add(this.txtPtY); + this.pnlPointsBottom.Controls.Add(this.cmbPtShape); + this.pnlPointsBottom.Controls.Add(this.btnPtColor); + this.pnlPointsBottom.Controls.Add(this.btnAddPoint); + this.pnlPointsBottom.Controls.Add(this.lblPointsCount); + this.pnlPointsBottom.Controls.Add(this.btnClearPoints); + this.pnlPointsBottom.Controls.Add(this.lblPointHint); - // tabSliders - this.tabSliders.Text = "Parametreler"; + this.pnlPointsContainer.Dock = DockStyle.Fill; + this.pnlPointsContainer.AutoScroll = true; + this.pnlPointsContainer.BackColor = Color.FromArgb(11, 17, 32); + this.pnlPointsContainer.Padding = new Padding(4); + + this.tabPoints.Controls.Add(this.pnlPointsContainer); + this.tabPoints.Controls.Add(this.pnlPointsBottom); + + // ==================== TAB 3: SÜRGÜLER (Sliders) ==================== + this.tabSliders.Text = "Sürgüler"; this.tabSliders.BackColor = ThemeHelper.DarkBackground; this.tabSliders.Padding = new Padding(8); @@ -816,6 +806,9 @@ namespace MathApp.Controls private TabPage tabShapes; private ListBox lstCurves; + private Panel pnlCurvesContainer; + private Panel pnlCurvesBottomBar; + private Label lblCurvesCount; private Button btnCurveColor; private ComboBox cmbCurveStyle; private ComboBox cmbCurveThickness; @@ -825,6 +818,9 @@ namespace MathApp.Controls private Button btnCurveClearAll; private ListBox lstPoints; + private Panel pnlPointsContainer; + private Panel pnlPointsBottom; + private Label lblPointsCount; private Label lblPtX; private TextBox txtPtX; private Label lblPtY; diff --git a/src/ttCalculator/Controls/GraphPlotterControl.cs b/src/ttCalculator/Controls/GraphPlotterControl.cs index 12755bd..8fec453 100644 --- a/src/ttCalculator/Controls/GraphPlotterControl.cs +++ b/src/ttCalculator/Controls/GraphPlotterControl.cs @@ -482,6 +482,206 @@ namespace MathApp.Controls lstCurves.EndUpdate(); if (_curves.Count > 0 && lstCurves.SelectedIndex < 0) lstCurves.SelectedIndex = _curves.Count - 1; + + if (pnlCurvesContainer == null) return; + + pnlCurvesContainer.SuspendLayout(); + pnlCurvesContainer.Controls.Clear(); + + if (_curves.Count == 0) + { + Label lblEmpty = new Label + { + Text = "Henüz eğri eklenmedi.\n\nÜst paneldeki 'f(x) =' kutusuna formül yazıp\n'+ Ekle / Çiz' butonuna basarak eğri ekleyebilirsiniz.", + Dock = DockStyle.Fill, + TextAlign = ContentAlignment.MiddleCenter, + ForeColor = Color.FromArgb(100, 116, 139), + Font = new Font("Segoe UI", 9F) + }; + pnlCurvesContainer.Controls.Add(lblEmpty); + } + else + { + for (int i = _curves.Count - 1; i >= 0; i--) + { + var curve = _curves[i]; + pnlCurvesContainer.Controls.Add(CreateCurveCard(curve)); + } + } + + if (lblCurvesCount != null) + lblCurvesCount.Text = $"Toplam {_curves.Count} Eğri"; + + pnlCurvesContainer.ResumeLayout(); + } + + private Panel CreateCurveCard(PlotCurve curve) + { + Panel card = new Panel + { + Dock = DockStyle.Top, + Height = 52, + BackColor = Color.FromArgb(22, 32, 50), + Padding = new Padding(4) + }; + + Panel div = new Panel + { + Dock = DockStyle.Bottom, + Height = 1, + BackColor = Color.FromArgb(35, 48, 72) + }; + card.Controls.Add(div); + + // Color picker swatch + Button btnColor = new Button + { + Location = new Point(8, 14), + Size = new Size(20, 20), + BackColor = curve.Color, + FlatStyle = FlatStyle.Flat, + Cursor = Cursors.Hand, + UseVisualStyleBackColor = false + }; + btnColor.FlatAppearance.BorderSize = 1; + btnColor.FlatAppearance.BorderColor = Color.FromArgb(100, 116, 139); + btnColor.Click += (s, e) => + { + using (ColorDialog cd = new ColorDialog { Color = curve.Color }) + { + if (cd.ShowDialog() == DialogResult.OK) + { + curve.Color = cd.Color; + btnColor.BackColor = cd.Color; + pnlCanvas.Invalidate(); + } + } + }; + card.Controls.Add(btnColor); + + // Badge & equation + string badgeText = curve.IsPolar ? "r(θ)" : (curve.IsVerticalLine ? "x =" : "y ="); + Color badgeColor = curve.IsPolar ? Color.FromArgb(56, 189, 248) : Color.FromArgb(168, 85, 247); + + Label lblBadge = new Label + { + Location = new Point(34, 10), + AutoSize = true, + Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold), + ForeColor = badgeColor, + Text = badgeText + }; + card.Controls.Add(lblBadge); + + Label lblEq = new Label + { + Location = new Point(62, 8), + Size = new Size(155, 20), + Font = new Font("Consolas", 9.5F, FontStyle.Bold), + ForeColor = curve.Visible ? Color.White : Color.FromArgb(100, 116, 139), + Text = curve.IsVerticalLine ? $"{curve.VerticalX:F2}" : curve.Equation + }; + card.Controls.Add(lblEq); + + string domainText = curve.ClampDomain ? $"[{curve.DomainMinX:F1}, {curve.DomainMaxX:F1}]" : "Tüm Aralık"; + string styleText = curve.DashStyle switch { DashStyle.Dash => "Kesikli", DashStyle.Dot => "Noktalı", _ => "Düz" }; + Label lblDetails = new Label + { + Location = new Point(34, 28), + Size = new Size(185, 16), + Font = new Font("Segoe UI", 7.5F), + ForeColor = Color.FromArgb(148, 163, 184), + Text = $"{domainText} • {styleText} • {curve.Thickness:F0}px" + }; + card.Controls.Add(lblDetails); + + // Visibility button + Button btnVis = new Button + { + Location = new Point(224, 12), + Size = new Size(34, 24), + FlatStyle = FlatStyle.Flat, + Text = curve.Visible ? "Açık" : "Gizli", + Font = new Font("Segoe UI Semibold", 7.5F, FontStyle.Bold), + BackColor = curve.Visible ? Color.FromArgb(20, 50, 75) : Color.FromArgb(30, 35, 48), + ForeColor = curve.Visible ? Color.FromArgb(56, 189, 248) : Color.FromArgb(100, 116, 139), + Cursor = Cursors.Hand, + UseVisualStyleBackColor = false + }; + btnVis.FlatAppearance.BorderSize = 1; + btnVis.FlatAppearance.BorderColor = curve.Visible ? Color.FromArgb(14, 165, 233) : Color.FromArgb(51, 65, 85); + btnVis.Click += (s, e) => + { + curve.Visible = !curve.Visible; + RefreshCurvesList(); + DetectCriticalPoints(); + pnlCanvas.Invalidate(); + }; + card.Controls.Add(btnVis); + + // Edit button + Button btnEdit = new Button + { + Location = new Point(262, 12), + Size = new Size(40, 24), + FlatStyle = FlatStyle.Flat, + Text = "Yükle", + Font = new Font("Segoe UI", 7.5F), + BackColor = Color.FromArgb(30, 41, 64), + ForeColor = Color.FromArgb(226, 232, 240), + Cursor = Cursors.Hand, + UseVisualStyleBackColor = false + }; + btnEdit.FlatAppearance.BorderSize = 1; + btnEdit.FlatAppearance.BorderColor = Color.FromArgb(51, 65, 85); + btnEdit.Click += (s, e) => + { + if (!curve.IsVerticalLine) + { + txtEquation.Text = curve.Equation; + chkPolar.Checked = curve.IsPolar; + if (curve.ClampDomain) + { + chkClampRange.Checked = true; + txtMinX.Text = curve.DomainMinX.ToString("0.##", CultureInfo.InvariantCulture); + txtMaxX.Text = curve.DomainMaxX.ToString("0.##", CultureInfo.InvariantCulture); + } + else + { + chkClampRange.Checked = false; + } + txtEquation.Focus(); + lblStatus.Text = $"Eğri düzenleme için kutuya aktarıldı: {curve.Equation}"; + } + }; + card.Controls.Add(btnEdit); + + // Delete button + Button btnDel = new Button + { + Location = new Point(306, 12), + Size = new Size(26, 24), + FlatStyle = FlatStyle.Flat, + Text = "✕", + Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold), + BackColor = Color.FromArgb(45, 20, 25), + ForeColor = Color.FromArgb(244, 63, 94), + Cursor = Cursors.Hand, + UseVisualStyleBackColor = false + }; + btnDel.FlatAppearance.BorderSize = 1; + btnDel.FlatAppearance.BorderColor = Color.FromArgb(127, 29, 29); + btnDel.Click += (s, e) => + { + _curves.Remove(curve); + RefreshCurvesList(); + RefreshToolCombos(); + DetectCriticalPoints(); + pnlCanvas.Invalidate(); + }; + card.Controls.Add(btnDel); + + return card; } private void RefreshToolCombos() @@ -1506,6 +1706,122 @@ namespace MathApp.Controls lstPoints.Items.Add(p); } lstPoints.EndUpdate(); + + if (pnlPointsContainer == null) return; + + pnlPointsContainer.SuspendLayout(); + pnlPointsContainer.Controls.Clear(); + + if (_points.Count == 0) + { + Label lblEmpty = new Label + { + Text = "Henüz serbest nokta eklenmedi.\n\nGrafik tuvali üzerine tıklayarak veya aşağıdaki giriş alanından koordinat belirterek nokta ekleyebilirsiniz.", + Dock = DockStyle.Fill, + TextAlign = ContentAlignment.MiddleCenter, + ForeColor = Color.FromArgb(100, 116, 139), + Font = new Font("Segoe UI", 9F) + }; + pnlPointsContainer.Controls.Add(lblEmpty); + } + else + { + for (int i = _points.Count - 1; i >= 0; i--) + { + var pt = _points[i]; + pnlPointsContainer.Controls.Add(CreatePointCard(pt)); + } + } + + if (lblPointsCount != null) + lblPointsCount.Text = $"Toplam {_points.Count} Nokta"; + + pnlPointsContainer.ResumeLayout(); + } + + private Panel CreatePointCard(PlotPoint pt) + { + Panel card = new Panel + { + Dock = DockStyle.Top, + Height = 38, + BackColor = Color.FromArgb(22, 32, 50), + Padding = new Padding(4) + }; + + Panel div = new Panel + { + Dock = DockStyle.Bottom, + Height = 1, + BackColor = Color.FromArgb(35, 48, 72) + }; + card.Controls.Add(div); + + // Shape and color icon swatch + string shapeIcon = pt.Shape switch + { + PointShape.Square => "■", + PointShape.Diamond => "◆", + PointShape.Cross => "+", + _ => "●" + }; + + Label lblIcon = new Label + { + Location = new Point(8, 8), + Size = new Size(20, 20), + ForeColor = pt.Color, + Font = new Font("Segoe UI", 11F, FontStyle.Bold), + Text = shapeIcon, + TextAlign = ContentAlignment.MiddleCenter + }; + card.Controls.Add(lblIcon); + + // Coordinate label + Label lblCoord = new Label + { + Location = new Point(34, 9), + Size = new Size(180, 20), + Font = new Font("Consolas", 9.5F, FontStyle.Bold), + ForeColor = Color.White, + Text = $"(X: {pt.X:F2}, Y: {pt.Y:F2})" + }; + card.Controls.Add(lblCoord); + + Label lblShapeName = new Label + { + Location = new Point(216, 10), + Size = new Size(80, 18), + Font = new Font("Segoe UI", 8F), + ForeColor = Color.FromArgb(148, 163, 184), + Text = $"{pt.Shape}" + }; + card.Controls.Add(lblShapeName); + + // Delete button + Button btnDel = new Button + { + Location = new Point(308, 7), + Size = new Size(26, 24), + FlatStyle = FlatStyle.Flat, + Text = "✕", + Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold), + BackColor = Color.FromArgb(45, 20, 25), + ForeColor = Color.FromArgb(244, 63, 94), + Cursor = Cursors.Hand, + UseVisualStyleBackColor = false + }; + btnDel.FlatAppearance.BorderSize = 1; + btnDel.FlatAppearance.BorderColor = Color.FromArgb(127, 29, 29); + btnDel.Click += (s, e) => + { + _points.Remove(pt); + RefreshPointsList(); + pnlCanvas.Invalidate(); + }; + card.Controls.Add(btnDel); + + return card; } private void BtnAddPoint_Click(object sender, EventArgs e) @@ -1631,7 +1947,7 @@ namespace MathApp.Controls { var validCurves = _curves.Where(c => c.Visible && !c.IsVerticalLine && !c.IsPolar).ToList(); StringBuilder sb = new StringBuilder(); - sb.AppendLine("% ttCalculator v3.1 LaTeX Pgfplots / TikZ Kodu"); + sb.AppendLine("% ttCalculator v3.2 LaTeX Pgfplots / TikZ Kodu"); sb.AppendLine("\\begin{tikzpicture}"); sb.AppendLine("\\begin{axis}["); sb.AppendLine($" xmin={rangeMinX:F1}, xmax={rangeMaxX:F1},"); diff --git a/src/ttCalculator/MainForm.Designer.cs b/src/ttCalculator/MainForm.Designer.cs index 5aa5681..e0bcfdb 100644 --- a/src/ttCalculator/MainForm.Designer.cs +++ b/src/ttCalculator/MainForm.Designer.cs @@ -156,7 +156,7 @@ namespace MathApp // Footer version label this.lblVersion.Dock = DockStyle.Bottom; this.lblVersion.Height = 28; - this.lblVersion.Text = "v3.1 • 128-bit Decimal Motoru • 60 FPS"; + this.lblVersion.Text = "v3.2 • 128-bit Decimal Motoru • 60 FPS"; this.lblVersion.Font = new Font("Segoe UI", 8F); this.lblVersion.ForeColor = Color.FromArgb(100, 116, 139); this.lblVersion.TextAlign = ContentAlignment.MiddleCenter; diff --git a/src/ttCalculator/ThemeHelper.cs b/src/ttCalculator/ThemeHelper.cs index 115022d..15636f6 100644 --- a/src/ttCalculator/ThemeHelper.cs +++ b/src/ttCalculator/ThemeHelper.cs @@ -214,7 +214,7 @@ namespace MathApp tabControl.DrawMode = TabDrawMode.OwnerDrawFixed; tabControl.SizeMode = TabSizeMode.Fixed; - tabControl.ItemSize = new Size(Math.Max(58, (tabControl.Width > 50 ? tabControl.Width - 14 : 306) / Math.Max(1, tabControl.TabCount)), 32); + tabControl.ItemSize = new Size(Math.Max(64, (tabControl.Width > 50 ? tabControl.Width - 10 : 338) / Math.Max(1, tabControl.TabCount)), 32); tabControl.DrawItem += (s, e) => { @@ -242,13 +242,14 @@ namespace MathApp } Color textColor = isSelected ? Color.FromArgb(56, 189, 248) : MutedText; - using (Font font = new Font("Segoe UI Semibold", 8.5F, isSelected ? FontStyle.Bold : FontStyle.Regular)) + using (Font font = new Font("Segoe UI Semibold", 8.2F, isSelected ? FontStyle.Bold : FontStyle.Regular)) using (Brush textBrush = new SolidBrush(textColor)) { StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center + LineAlignment = StringAlignment.Center, + FormatFlags = StringFormatFlags.NoWrap }; g.DrawString(page.Text, font, textBrush, tabRect, sf); } diff --git a/src/ttCalculator/ttCalculator.csproj b/src/ttCalculator/ttCalculator.csproj index cccd65e..95d82f1 100644 --- a/src/ttCalculator/ttCalculator.csproj +++ b/src/ttCalculator/ttCalculator.csproj @@ -9,7 +9,7 @@ logo.ico ttCalculator ttCalculator - Gelişmiş Matematik & Nümerik Analiz Stüdyosu - 3.1.0 + 3.2.0 ttCalculator diff --git a/tests/ttCalculator.Tests/Program.cs b/tests/ttCalculator.Tests/Program.cs index de70965..d7630f8 100644 --- a/tests/ttCalculator.Tests/Program.cs +++ b/tests/ttCalculator.Tests/Program.cs @@ -11,7 +11,7 @@ namespace MathApp.Tests static void Main(string[] args) { Console.WriteLine("================================================="); - Console.WriteLine("ttCalculator v3.1 Graph Plotter Studio Verification"); + Console.WriteLine("ttCalculator v3.2 Graph Plotter Studio Verification"); Console.WriteLine("================================================="); int passed = 0;