From 9107510c4985ceb781640163bbb82ab6de2fa35e Mon Sep 17 00:00:00 2001 From: AShifter Date: Sun, 24 Sep 2017 12:32:50 -0600 Subject: Add proper WM and Remove old source Added a proper, working WM. I also got rid of the old source as we could just make a new repo for that. --- ShiftOS.Engine/WindowManager/ShiftWM.cs | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ShiftOS.Engine/WindowManager/ShiftWM.cs (limited to 'ShiftOS.Engine/WindowManager/ShiftWM.cs') diff --git a/ShiftOS.Engine/WindowManager/ShiftWM.cs b/ShiftOS.Engine/WindowManager/ShiftWM.cs new file mode 100644 index 0000000..373a87b --- /dev/null +++ b/ShiftOS.Engine/WindowManager/ShiftWM.cs @@ -0,0 +1,37 @@ +using System.Windows.Forms; + +namespace ShiftOS.Engine.WindowManager +{ + public class ShiftWM + { + public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection(); + + public ShiftWindow Init(UserControl content, string title, bool ShowAsInfobox = false, bool resize = true) + { + // Setup Window + ShiftWindow app = new ShiftWindow(); + app.Text = title; + app.Title.Text = title; + app.Width = content.Width + app.left.Width + app.right.Width; + app.Height = content.Height + app.bottom.Height + app.top.Height; + + // Setup UC + content.Parent = app.programContent; + content.BringToFront(); + content.Dock = DockStyle.Fill; + + // Check if icon is null (NYI) + /* + if (icon == null) + { + app.programIcon.Hide(); + app.programIcon.Image = Engine.Properties.Resources.nullIcon; + app.Title.Location = new Point(2, 1); + } + else app.programIcon.Image = icon; + */ + app.Show(); + return app; + } + } +} -- cgit v1.2.3