mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
GUI测试+Lua增加计时器
This commit is contained in:
@@ -184,6 +184,9 @@ namespace CMLeonOS.shell
|
||||
case "lua":
|
||||
shell.ExecuteLuaScript(args);
|
||||
break;
|
||||
case "testgui":
|
||||
shell.ProcessTestGui();
|
||||
break;
|
||||
default:
|
||||
shell.ShowError($"Unknown command: {command}");
|
||||
break;
|
||||
|
||||
44
shell/Commands/TestGuiCommand.cs
Normal file
44
shell/Commands/TestGuiCommand.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Sys = Cosmos.System;
|
||||
using Cosmos.System.Graphics;
|
||||
|
||||
namespace CMLeonOS.Commands
|
||||
{
|
||||
public static class TestGuiCommand
|
||||
{
|
||||
public static void RunTestGui()
|
||||
{
|
||||
Canvas canvas;
|
||||
|
||||
Console.WriteLine("Cosmos booted successfully. Let's go in Graphical Mode");
|
||||
|
||||
canvas = FullScreenCanvas.GetFullScreenCanvas(new Mode(640, 480, ColorDepth.ColorDepth32));
|
||||
|
||||
canvas.Clear(global::System.Drawing.Color.FromArgb(0, 0, 255));
|
||||
|
||||
try
|
||||
{
|
||||
canvas.DrawPoint(global::System.Drawing.Color.FromArgb(255, 0, 0), 69, 69);
|
||||
|
||||
canvas.DrawLine(global::System.Drawing.Color.FromArgb(173, 255, 47), 250, 100, 400, 100);
|
||||
|
||||
canvas.DrawLine(global::System.Drawing.Color.FromArgb(205, 92, 92), 350, 150, 350, 250);
|
||||
|
||||
canvas.DrawLine(global::System.Drawing.Color.FromArgb(245, 245, 220), 250, 150, 400, 250);
|
||||
|
||||
canvas.DrawRectangle(global::System.Drawing.Color.FromArgb(219, 112, 147), 350, 350, 80, 60);
|
||||
|
||||
canvas.DrawRectangle(global::System.Drawing.Color.FromArgb(50, 205, 50), 450, 450, 80, 60);
|
||||
|
||||
canvas.Display();
|
||||
|
||||
Console.WriteLine("Press any key to return to shell...");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Exception occurred: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1216,6 +1216,11 @@ namespace CMLeonOS
|
||||
Commands.Script.LuaCommand.ExecuteLuaScript(args, fileSystem, this, ShowError, ShowWarning);
|
||||
}
|
||||
|
||||
public void ProcessTestGui()
|
||||
{
|
||||
Commands.TestGuiCommand.RunTestGui();
|
||||
}
|
||||
|
||||
public void SetDnsServer(string args)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(args))
|
||||
|
||||
Reference in New Issue
Block a user