aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Engine/WindowManager
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-09-24 12:32:50 -0600
committerAShifter <[email protected]>2017-09-24 12:32:50 -0600
commit9107510c4985ceb781640163bbb82ab6de2fa35e (patch)
treec6a440b7ed182df8f8d1e5d0fdf55e28cf74055f /ShiftOS.Engine/WindowManager
parent2992686ec723fa4c854b6de27007a284b484a92e (diff)
downloadshiftos-rewind-9107510c4985ceb781640163bbb82ab6de2fa35e.tar.gz
shiftos-rewind-9107510c4985ceb781640163bbb82ab6de2fa35e.tar.bz2
shiftos-rewind-9107510c4985ceb781640163bbb82ab6de2fa35e.zip
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.
Diffstat (limited to 'ShiftOS.Engine/WindowManager')
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWM.cs37
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs251
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWindow.cs20
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWindow.resx120
4 files changed, 428 insertions, 0 deletions
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;
+ }
+ }
+}
diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs
new file mode 100644
index 0000000..dacc931
--- /dev/null
+++ b/ShiftOS.Engine/WindowManager/ShiftWindow.Designer.cs
@@ -0,0 +1,251 @@
+namespace ShiftOS.Engine.WindowManager
+{
+ partial class ShiftWindow
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.program = new System.Windows.Forms.Panel();
+ this.bottomleftcorner = new System.Windows.Forms.Panel();
+ this.toprightcorner = new System.Windows.Forms.Panel();
+ this.bottomrightcorner = new System.Windows.Forms.Panel();
+ this.topleftcorner = new System.Windows.Forms.Panel();
+ this.bottom = new System.Windows.Forms.Panel();
+ this.top = new System.Windows.Forms.Panel();
+ this.programIcon = new System.Windows.Forms.PictureBox();
+ this.maximizebutton = new System.Windows.Forms.PictureBox();
+ this.minimizebutton = new System.Windows.Forms.PictureBox();
+ this.Title = new System.Windows.Forms.Label();
+ this.closebutton = new System.Windows.Forms.PictureBox();
+ this.right = new System.Windows.Forms.Panel();
+ this.left = new System.Windows.Forms.Panel();
+ this.programContent = new System.Windows.Forms.Panel();
+ this.program.SuspendLayout();
+ this.top.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.closebutton)).BeginInit();
+ this.SuspendLayout();
+ //
+ // program
+ //
+ this.program.BackColor = System.Drawing.Color.White;
+ this.program.Controls.Add(this.programContent);
+ this.program.Controls.Add(this.bottomleftcorner);
+ this.program.Controls.Add(this.toprightcorner);
+ this.program.Controls.Add(this.bottomrightcorner);
+ this.program.Controls.Add(this.topleftcorner);
+ this.program.Controls.Add(this.bottom);
+ this.program.Controls.Add(this.top);
+ this.program.Controls.Add(this.right);
+ this.program.Controls.Add(this.left);
+ this.program.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.program.Location = new System.Drawing.Point(0, 0);
+ this.program.Name = "program";
+ this.program.Size = new System.Drawing.Size(284, 261);
+ this.program.TabIndex = 11;
+ //
+ // bottomleftcorner
+ //
+ this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.bottomleftcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.bottomleftcorner.Location = new System.Drawing.Point(0, 257);
+ this.bottomleftcorner.Name = "bottomleftcorner";
+ this.bottomleftcorner.Size = new System.Drawing.Size(5, 4);
+ this.bottomleftcorner.TabIndex = 10;
+ //
+ // toprightcorner
+ //
+ this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.toprightcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.toprightcorner.Location = new System.Drawing.Point(278, 0);
+ this.toprightcorner.Name = "toprightcorner";
+ this.toprightcorner.Size = new System.Drawing.Size(6, 30);
+ this.toprightcorner.TabIndex = 9;
+ //
+ // bottomrightcorner
+ //
+ this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.bottomrightcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
+ this.bottomrightcorner.Location = new System.Drawing.Point(280, 257);
+ this.bottomrightcorner.Name = "bottomrightcorner";
+ this.bottomrightcorner.Size = new System.Drawing.Size(4, 4);
+ this.bottomrightcorner.TabIndex = 4;
+ //
+ // topleftcorner
+ //
+ this.topleftcorner.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.topleftcorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
+ this.topleftcorner.Location = new System.Drawing.Point(0, 0);
+ this.topleftcorner.Name = "topleftcorner";
+ this.topleftcorner.Size = new System.Drawing.Size(7, 30);
+ this.topleftcorner.TabIndex = 8;
+ //
+ // bottom
+ //
+ this.bottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.bottom.Cursor = System.Windows.Forms.Cursors.SizeNS;
+ this.bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.bottom.Location = new System.Drawing.Point(4, 257);
+ this.bottom.Name = "bottom";
+ this.bottom.Size = new System.Drawing.Size(276, 4);
+ this.bottom.TabIndex = 3;
+ //
+ // top
+ //
+ this.top.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.top.Controls.Add(this.programIcon);
+ this.top.Controls.Add(this.maximizebutton);
+ this.top.Controls.Add(this.minimizebutton);
+ this.top.Controls.Add(this.Title);
+ this.top.Controls.Add(this.closebutton);
+ this.top.Dock = System.Windows.Forms.DockStyle.Top;
+ this.top.ForeColor = System.Drawing.SystemColors.ControlText;
+ this.top.Location = new System.Drawing.Point(4, 0);
+ this.top.Name = "top";
+ this.top.Size = new System.Drawing.Size(276, 30);
+ this.top.TabIndex = 0;
+ //
+ // programIcon
+ //
+ this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.programIcon.ErrorImage = null;
+ this.programIcon.InitialImage = null;
+ this.programIcon.Location = new System.Drawing.Point(6, 7);
+ this.programIcon.Name = "programIcon";
+ this.programIcon.Size = new System.Drawing.Size(16, 16);
+ this.programIcon.TabIndex = 7;
+ this.programIcon.TabStop = false;
+ //
+ // maximizebutton
+ //
+ this.maximizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.maximizebutton.BackColor = System.Drawing.Color.Black;
+ this.maximizebutton.Location = new System.Drawing.Point(228, 5);
+ this.maximizebutton.Name = "maximizebutton";
+ this.maximizebutton.Size = new System.Drawing.Size(21, 21);
+ this.maximizebutton.TabIndex = 6;
+ this.maximizebutton.TabStop = false;
+ //
+ // minimizebutton
+ //
+ this.minimizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.minimizebutton.BackColor = System.Drawing.Color.Black;
+ this.minimizebutton.Location = new System.Drawing.Point(205, 5);
+ this.minimizebutton.Name = "minimizebutton";
+ this.minimizebutton.Size = new System.Drawing.Size(21, 21);
+ this.minimizebutton.TabIndex = 5;
+ this.minimizebutton.TabStop = false;
+ //
+ // Title
+ //
+ this.Title.AutoSize = true;
+ this.Title.BackColor = System.Drawing.Color.Transparent;
+ this.Title.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Title.ForeColor = System.Drawing.Color.White;
+ this.Title.Location = new System.Drawing.Point(25, 8);
+ this.Title.Name = "Title";
+ this.Title.Size = new System.Drawing.Size(106, 14);
+ this.Title.TabIndex = 3;
+ this.Title.Text = "Application Title";
+ //
+ // closebutton
+ //
+ this.closebutton.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.closebutton.BackColor = System.Drawing.Color.Black;
+ this.closebutton.Location = new System.Drawing.Point(251, 5);
+ this.closebutton.Name = "closebutton";
+ this.closebutton.Size = new System.Drawing.Size(21, 21);
+ this.closebutton.TabIndex = 4;
+ this.closebutton.TabStop = false;
+ //
+ // right
+ //
+ this.right.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.right.Cursor = System.Windows.Forms.Cursors.SizeWE;
+ this.right.Dock = System.Windows.Forms.DockStyle.Right;
+ this.right.Location = new System.Drawing.Point(280, 0);
+ this.right.Name = "right";
+ this.right.Size = new System.Drawing.Size(4, 261);
+ this.right.TabIndex = 2;
+ //
+ // left
+ //
+ this.left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.left.Dock = System.Windows.Forms.DockStyle.Left;
+ this.left.Location = new System.Drawing.Point(0, 0);
+ this.left.Name = "left";
+ this.left.Size = new System.Drawing.Size(4, 261);
+ this.left.TabIndex = 1;
+ //
+ // programContent
+ //
+ this.programContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.programContent.Location = new System.Drawing.Point(4, 30);
+ this.programContent.Name = "programContent";
+ this.programContent.Size = new System.Drawing.Size(276, 227);
+ this.programContent.TabIndex = 11;
+ //
+ // ShiftWindow
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(284, 261);
+ this.Controls.Add(this.program);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+ this.Name = "ShiftWindow";
+ this.program.ResumeLayout(false);
+ this.top.ResumeLayout(false);
+ this.top.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.programIcon)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.closebutton)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ internal System.Windows.Forms.Panel program;
+ internal System.Windows.Forms.Panel bottomleftcorner;
+ internal System.Windows.Forms.Panel toprightcorner;
+ internal System.Windows.Forms.Panel bottomrightcorner;
+ internal System.Windows.Forms.Panel topleftcorner;
+ internal System.Windows.Forms.Panel bottom;
+ internal System.Windows.Forms.Panel top;
+ public System.Windows.Forms.PictureBox programIcon;
+ internal System.Windows.Forms.PictureBox maximizebutton;
+ internal System.Windows.Forms.PictureBox minimizebutton;
+ internal System.Windows.Forms.Label Title;
+ internal System.Windows.Forms.PictureBox closebutton;
+ internal System.Windows.Forms.Panel right;
+ internal System.Windows.Forms.Panel left;
+ public System.Windows.Forms.Panel programContent;
+ }
+}
diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.cs
new file mode 100644
index 0000000..6f9c90d
--- /dev/null
+++ b/ShiftOS.Engine/WindowManager/ShiftWindow.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS.Engine.WindowManager
+{
+ public partial class ShiftWindow : Form
+ {
+ public ShiftWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.resx b/ShiftOS.Engine/WindowManager/ShiftWindow.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.Engine/WindowManager/ShiftWindow.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file