Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
GUI - Stop Window from Window and Taskbar, MultiWindowUpdate FIXED
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeFence committed Feb 25, 2024
1 parent 3cf7c13 commit f0ce917
Show file tree
Hide file tree
Showing 52 changed files with 5,527 additions and 5,416 deletions.
Binary file modified .vs/PatchOS/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file modified .vs/PatchOS/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/PatchOS/v17/.suo
Binary file not shown.
114 changes: 99 additions & 15 deletions .vs/PatchOS/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
{
"Version": 1,
"WorkspaceRootPath": "E:\\Dokumenty\\PATCHOS\\Repository\\PatchOSProject\\",
"WorkspaceRootPath": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|e:\\dokumenty\\patchos\\repository\\patchosproject\\patchos\\files\\kernel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\kernel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\drivers\\gui\\ui\\windowmgr.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\drivers\\gui\\ui\\windowmgr.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|e:\\dokumenty\\patchos\\repository\\patchosproject\\patchos\\files\\drivers\\gui\\desktop.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\drivers\\gui\\desktop.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\drivers\\gui\\desktop.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\drivers\\gui\\ui\\window.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\drivers\\gui\\ui\\window.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\drivers\\gui\\ui\\controls\\panel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\drivers\\gui\\ui\\controls\\panel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\apps\\menu.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\apps\\menu.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\kernel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\kernel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|c:\\users\\defaultadministrator\\desktop\\patchos repository\\patchosproject\\patchos\\files\\drivers\\gui\\ui\\control.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{76B12514-E07D-4AAB-98D5-6CA1BFF9B159}|PatchOS\\PatchOS.csproj|solutionrelative:patchos\\files\\drivers\\gui\\ui\\control.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
Expand All @@ -18,38 +38,102 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Desktop.cs",
"DocumentMoniker": "E:\\Dokumenty\\PATCHOS\\Repository\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\Desktop.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\Desktop.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Drivers\\GUI\\Desktop.cs",
"ToolTip": "E:\\Dokumenty\\PATCHOS\\Repository\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\Desktop.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\Desktop.cs",
"RelativeToolTip": "PatchOS\\Files\\Drivers\\GUI\\Desktop.cs",
"ViewState": "AQIAAAcAAAAAAAAAAAAUwJMAAAAAAAAA",
"ViewState": "AQIAACoAAAAAAAAAAAAiwFYAAABoAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-01-29T18:54:46.495Z",
"IsPinned": true
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"DocumentIndex": 5,
"Title": "Kernel.cs",
"DocumentMoniker": "E:\\Dokumenty\\PATCHOS\\Repository\\PatchOSProject\\PatchOS\\Files\\Kernel.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Kernel.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Kernel.cs",
"ToolTip": "E:\\Dokumenty\\PATCHOS\\Repository\\PatchOSProject\\PatchOS\\Files\\Kernel.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Kernel.cs",
"RelativeToolTip": "PatchOS\\Files\\Kernel.cs",
"ViewState": "AQIAALAAAAAAAAAAAAAAALYAAAAtAAAA",
"ViewState": "AQIAAFAAAAAAAAAAAAAmwF0AAAAVAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-01-30T13:04:29.964Z",
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
"$type": "Document",
"DocumentIndex": 2,
"Title": "Window.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\Window.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Drivers\\GUI\\UI\\Window.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\Window.cs",
"RelativeToolTip": "PatchOS\\Files\\Drivers\\GUI\\UI\\Window.cs",
"ViewState": "AQIAAB0AAAAAAAAAAAAEwDYAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-02-25T11:40:25.731Z",
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "WindowMgr.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\WindowMgr.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Drivers\\GUI\\UI\\WindowMgr.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\WindowMgr.cs",
"RelativeToolTip": "PatchOS\\Files\\Drivers\\GUI\\UI\\WindowMgr.cs",
"ViewState": "AQIAAA4AAAAAAAAAAAAQwB8AAAAJAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-02-25T11:37:49.631Z",
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "Panel.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\Controls\\Panel.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Drivers\\GUI\\UI\\Controls\\Panel.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\Controls\\Panel.cs",
"RelativeToolTip": "PatchOS\\Files\\Drivers\\GUI\\UI\\Controls\\Panel.cs",
"ViewState": "AQIAAAMAAAAAAAAAAAAAAAkAAAARAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-02-25T12:20:11.99Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "Control.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\Control.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Drivers\\GUI\\UI\\Control.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Drivers\\GUI\\UI\\Control.cs",
"RelativeToolTip": "PatchOS\\Files\\Drivers\\GUI\\UI\\Control.cs",
"ViewState": "AQIAABEAAAAAAAAAAAAQwB4AAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-02-25T12:17:42.865Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "Menu.cs",
"DocumentMoniker": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Apps\\Menu.cs",
"RelativeDocumentMoniker": "PatchOS\\Files\\Apps\\Menu.cs",
"ToolTip": "C:\\Users\\defaultAdministrator\\Desktop\\PatchOS REPOSITORY\\PatchOSProject\\PatchOS\\Files\\Apps\\Menu.cs",
"RelativeToolTip": "PatchOS\\Files\\Apps\\Menu.cs",
"ViewState": "AQIAAC0AAAAAAAAAAAAowDsAAAANAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-02-25T12:13:14.144Z",
"EditorCaption": ""
}
]
}
Expand Down
Binary file modified .vs/ProjectEvaluation/patchos.metadata.v7.bin
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/patchos.projects.v7.bin
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1009.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1010.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1011.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1012.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1013.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1014.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1015.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1016.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1017.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1018.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1019.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1020.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1021.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1022.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1023.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1024.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1025.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1026.iso
Binary file not shown.
Binary file added Other/PatchOS1Builds/PatchOS1Build1027.iso
Binary file not shown.
4 changes: 4 additions & 0 deletions PatchOS/Files/Apps/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public static void Update()
{
fps.Text = Desktop.FPS.ToString();
fpsFgPanel.Widt = Desktop.FPS * 2;
if(Welcome.IsClicked)
{
PatchOS.Files.Apps.Welcome.Start();
}
if (ShutdownDialog.IsClicked)
{
PatchOS.Files.Apps.ShutdownDialog.Start();
Expand Down
1 change: 1 addition & 0 deletions PatchOS/Files/Apps/ShutdownDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Cosmos.System.Graphics;
using PatchOS.Process;
using System.Diagnostics.Tracing;
using PatchOS.Files.Drivers.GUI;

namespace PatchOS.Files.Apps
{
Expand Down
5 changes: 5 additions & 0 deletions PatchOS/Files/Drivers/GUI/Desktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ void DrawPar()
{
ASC16.DrawACSIIString(Kernel.Canvas, ProcessManager.running[i].name, System.Drawing.Color.Green, 5, (uint)(300 + (i * 16)));
}

for(int i = 0; i < ListPar.Count; i++)
{
ASC16.DrawACSIIString(Kernel.Canvas, ListPar[i], System.Drawing.Color.Purple, 5, (uint)(400 + (i * 16)));
}
}

}
Expand Down
5 changes: 4 additions & 1 deletion PatchOS/Files/Drivers/GUI/UI/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ public abstract class Control

public Color Accent;

public Action act;

public int X;
public int Y;

public int Width;
public int Height;

internal Control(int X, int Y, ushort Width, ushort Height)
internal Control(int X, int Y, ushort Width, ushort Height, Action action = null)
{
OnClick = delegate
{
Expand All @@ -45,6 +47,7 @@ internal Control(int X, int Y, ushort Width, ushort Height)
Accent = Color.CoolGreen;
this.X = X;
this.Y = Y;
act = action;
}

public abstract void Update(Canvas Canvas, int X,int Y, bool sel);
Expand Down
10 changes: 5 additions & 5 deletions PatchOS/Files/Drivers/GUI/UI/Controls/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public Button(int X, int Y, ushort Width, ushort Height, ushort Radius, string T

public override void Update(Canvas canvas, int X, int Y, bool sel)
{
canvas.DrawFilledRectangle(Bg, X + Xpos , Y + Ypos , W, H);
canvas.DrawRectangle(Outline, X + Xpos , Y + Ypos , W, H);
ASC16.DrawACSIIString(canvas, Text, Fg, (uint)(X + W / 2 + Xpos) - (uint)((Text.Length / 2) * 8), (uint)(Y + H / 4 + Ypos - 1));
canvas.DrawFilledRectangle(Bg, X + Xpos, Y + Ypos, W, H);
canvas.DrawRectangle(Outline, X + Xpos, Y + Ypos, W, H);
ASC16.DrawACSIIString(canvas, Text, Fg, (uint)(X + W / 2 + Xpos) - (uint)((Text.Length / 2) * 8), (uint)(Y + H / 4 + Ypos - 1));
if (MouseEx.IsMouseWithin(X + Xpos, Y + Ypos, (ushort)W, (ushort)H))
{
if (MouseManager.MouseState == MouseState.Left && sel)
{
IsClicked = true;
canvas.DrawFilledRectangle(System.Drawing.Color.SteelBlue, X + Xpos , Y + Ypos , W, H );
canvas.DrawRectangle(Outline, X + Xpos , Y + Ypos , W, H);
canvas.DrawFilledRectangle(System.Drawing.Color.SteelBlue, X + Xpos, Y + Ypos, W, H);
canvas.DrawRectangle(Outline, X + Xpos, Y + Ypos, W, H);
ASC16.DrawACSIIString(canvas, Text, Fg, (uint)(X + W / 2 + Xpos) - (uint)((Text.Length / 2) * 8), (uint)(Y + H / 4 + Ypos - 1));
}
else
Expand Down
22 changes: 7 additions & 15 deletions PatchOS/Files/Drivers/GUI/UI/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Window : Control

public bool IsSelected = false;

public static int ID;
public int ID;

public string Title = "";

Expand All @@ -44,20 +44,18 @@ public class Window : Control
internal int IY;

public Bitmap Icon;
public static Action act;
public DesignType Wtype;
public PermitionsType Ptype;

public Window(int X, int Y, ushort Width, ushort Height, string TitleStr, Action action, DesignType type, PermitionsType perType, Bitmap Icon) : base(X, Y, Width, Height)
public Window(int X, int Y, ushort Width, ushort Height, string TitleStr, Action action, DesignType type, PermitionsType perType, Bitmap Icon) : base(X, Y, Width, Height, action)
{
process = new WindowProcess(TitleStr);
ShelfControls = new List<Control>();
Controls = new List<Control>();
Title = TitleStr;
if(DesignType.Blank == type)
{
PanelW = Width;
PanelH = Height;

}
else
{
Expand All @@ -66,21 +64,17 @@ public Window(int X, int Y, ushort Width, ushort Height, string TitleStr, Action
}
WinW = Width;
WinH = Height;
act = action;
Wtype = type;
Ptype = perType;
this.Icon = Icon;
}
public void ProcessControls(int X, int Y, List<Control> Controls, ConsoleKeyInfo? Key, bool sel)
{
if(process.Continue)
for (int i = 0; i < Controls.Count; i++)
{
for(int i = 0; i < Controls.Count; i++)
{
Controls[i].Update(Kernel.Canvas, X, Y, sel);
SYS32.ErrorStatusAdd("WINDOW " + Title);
}
Controls[i].Update(Kernel.Canvas, X, Y, sel);
}
SYS32.ErrorStatusAdd("WINDOW " + Title);
}

public override void Update(Canvas Canvas, int X, int Y, bool sel)
Expand Down Expand Up @@ -113,7 +107,6 @@ public override void Update(Canvas Canvas, int X, int Y, bool sel)
ASC16.DrawACSIIString(Kernel.Canvas, Title, System.Drawing.Color.White, (uint)(base.X + 8), (uint)(base.Y + 8));
break;


case DesignType.Classic:
if (Ptype == PermitionsType.User)
{
Expand All @@ -133,7 +126,6 @@ public override void Update(Canvas Canvas, int X, int Y, bool sel)
ASC16.DrawACSIIString(Kernel.Canvas, Title, System.Drawing.Color.White, (uint)(base.X + 8), (uint)(base.Y + 8));
break;


case DesignType.Modern:
if (Ptype == PermitionsType.User)
{
Expand Down Expand Up @@ -188,7 +180,7 @@ public override void Update(Canvas Canvas, int X, int Y, bool sel)
ProcessControls(base.X, base.Y, Controls, key7, sel);
break;
}
act();
base.act();
}
catch (Exception ex)
{
Expand Down
17 changes: 12 additions & 5 deletions PatchOS/Files/Drivers/GUI/UI/WindowMgr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ static WindowManager()
public static void Add(Window window)
{
Windows.Add(window);
ProcessManager.Run(new WindowProcess(window.Title));
ProcessManager.Run(window.process);
Selected = window.Title;
}

public static void Stop(Window window)
public static void Stop(Window window)
{
ProcessManager.running[ProcessManager.running.IndexOf(window.process)].Stop();
window.process.Stop();
Windows.Remove(window);
try
{
Selected = Windows[Windows.Count - 1].Title;
}
catch(Exception ex) { }
Desktop.ListPar.Add("Stop");
}

Expand All @@ -42,8 +47,10 @@ public static void Update(Canvas Canvas)
bool SelDone = false;
bool Once = false;
//Selected = "";
int i = 0;
foreach (Window window in Windows)
{
i++;
window.IsSelected = false;
if (MouseManager.MouseState != MouseState.Left)
{
Expand All @@ -62,6 +69,7 @@ public static void Update(Canvas Canvas)
if (MouseManager.MouseState == MouseState.Left && Desktop.prevMouseState != MouseState.Left)
{
Stop(window);
SelDone = true;
}
}
else
Expand Down Expand Up @@ -105,7 +113,6 @@ public static void Update(Canvas Canvas)
Once = true;
}
else { window.IsSelected = false; }

window.Update(Canvas, window.X, window.Y, Selected == window.Title);
}

Expand Down
Loading

0 comments on commit f0ce917

Please sign in to comment.