From d8cdc9dfe54fd9c553d8acd31b1eb9f6be27ae33 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Sun, 29 Mar 2026 21:23:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=AF=E8=A7=86=E5=8C=96?= =?UTF-8?q?=E7=BC=96=E7=A8=8B=E8=BD=AF=E4=BB=B6=EF=BC=88CodeBlocks?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BuildTime.txt | 2 +- GitCommit.txt | 2 +- Gui/AppManager.cs | 1 + Gui/Apps/CodeBlocks.cs | 537 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 540 insertions(+), 2 deletions(-) create mode 100644 Gui/Apps/CodeBlocks.cs diff --git a/BuildTime.txt b/BuildTime.txt index 3a7f7b3..8634bc7 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-03-29 20:23:53 \ No newline at end of file +2026-03-29 21:14:20 \ No newline at end of file diff --git a/GitCommit.txt b/GitCommit.txt index a4544c3..ec9abb1 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -36f467d \ No newline at end of file +9f12c64 \ No newline at end of file diff --git a/Gui/AppManager.cs b/Gui/AppManager.cs index 95d2a5b..c103d3c 100644 --- a/Gui/AppManager.cs +++ b/Gui/AppManager.cs @@ -143,6 +143,7 @@ namespace CMLeonOS.Gui RegisterApp(new AppMetadata("UILib Gallery", () => { return new UILibGallery(); }, Icons.Icon_Default, Color.FromArgb(25, 25, 25))); RegisterApp(new AppMetadata("Music Editor", () => { return new MusicEditor(); }, Icons.Icon_Default, Color.FromArgb(25, 25, 25))); RegisterApp(new AppMetadata("Function Grapher", () => { return new FunctionGrapher(); }, Icons.Icon_Default, Color.FromArgb(25, 25, 25))); + RegisterApp(new AppMetadata("CodeBlocks", () => { return new CodeBlocks(); }, Icons.Icon_Default, Color.FromArgb(25, 25, 25))); Logger.Logger.Instance.Info("AppManager", $"{AppMetadatas.Count} apps were registered."); diff --git a/Gui/Apps/CodeBlocks.cs b/Gui/Apps/CodeBlocks.cs new file mode 100644 index 0000000..2ca1e9c --- /dev/null +++ b/Gui/Apps/CodeBlocks.cs @@ -0,0 +1,537 @@ +using CMLeonOS; +using CMLeonOS.Gui.UILib; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; + +namespace CMLeonOS.Gui.Apps +{ + internal class CodeBlocks : Process + { + internal CodeBlocks() : base("CodeBlocks", ProcessType.Application) { } + + private const string ProjectMagic = "CBLK1"; + + private class Block + { + internal string Type; + internal int A; + internal int B; + internal string Text; + } + + private AppWindow window; + private readonly WindowManager wm = ProcessManager.GetProcess(); + + private Table paletteTable; + private Table programTable; + private Table outputTable; + private TextBox argTextBox; + private NumericUpDown argA; + private NumericUpDown argB; + private TextBox statusBox; + private FileBrowser fileBrowser; + private readonly List