diff options
| author | FloppyDiskDrive <[email protected]> | 2017-10-01 09:49:14 -0500 |
|---|---|---|
| committer | FloppyDiskDrive <[email protected]> | 2017-10-01 09:49:14 -0500 |
| commit | c23e42cc396d4fc55799d659bae2149cc183dbf6 (patch) | |
| tree | 42363d4b2085946f4e6f3b38ae9b9334521a2c28 /ShiftOS.Main | |
| parent | f2ed0c673c2d3f0e021b0307a22792af66fd217d (diff) | |
| download | shiftos-rewind-c23e42cc396d4fc55799d659bae2149cc183dbf6.tar.gz shiftos-rewind-c23e42cc396d4fc55799d659bae2149cc183dbf6.tar.bz2 shiftos-rewind-c23e42cc396d4fc55799d659bae2149cc183dbf6.zip | |
Added a fuckton of changes
New infobox icons, new WIP port of Snakey, we are getting closer to a
pre-alpha!
Diffstat (limited to 'ShiftOS.Main')
| -rw-r--r-- | ShiftOS.Main/HijackScreen.Designer.cs | 7 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS.Main.csproj | 9 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs | 10 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs | 93 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/Snakey.cs | 123 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/Snakey.resx | 120 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs | 168 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/TestForm.cs | 24 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Desktop.Designer.cs | 137 | ||||
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Desktop.cs | 10 |
10 files changed, 537 insertions, 164 deletions
diff --git a/ShiftOS.Main/HijackScreen.Designer.cs b/ShiftOS.Main/HijackScreen.Designer.cs index fab31dc..c0e5de9 100644 --- a/ShiftOS.Main/HijackScreen.Designer.cs +++ b/ShiftOS.Main/HijackScreen.Designer.cs @@ -28,12 +28,11 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); - this.conversationtimer = new System.Windows.Forms.Timer(this.components); - this.hackeffecttimer = new System.Windows.Forms.Timer(this.components); + this.conversationtimer = new System.Windows.Forms.Timer(); + this.hackeffecttimer = new System.Windows.Forms.Timer(); this.lblHijack = new System.Windows.Forms.Label(); - this.textgen = new System.Windows.Forms.Timer(this.components); + this.textgen = new System.Windows.Forms.Timer(); this.lblhackwords = new System.Windows.Forms.Label(); this.SuspendLayout(); // diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index c814c14..84d64ab 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -70,6 +70,12 @@ <Compile Include="ShiftOS\Apps\ShifterStuff\Shifter.Designer.cs"> <DependentUpon>Shifter.cs</DependentUpon> </Compile> + <Compile Include="ShiftOS\Apps\Snakey.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="ShiftOS\Apps\Snakey.Designer.cs"> + <DependentUpon>Snakey.cs</DependentUpon> + </Compile> <Compile Include="ShiftOS\Apps\TestForm.cs"> <SubType>Form</SubType> </Compile> @@ -104,6 +110,9 @@ <EmbeddedResource Include="ShiftOS\Apps\ShifterStuff\Shifter.resx"> <DependentUpon>Shifter.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="ShiftOS\Apps\Snakey.resx"> + <DependentUpon>Snakey.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="ShiftOS\Apps\TestForm.resx"> <DependentUpon>TestForm.cs</DependentUpon> </EmbeddedResource> diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index 697e22e..5eb5faa 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs @@ -27,12 +27,12 @@ namespace ShiftOS.Main.ShiftOS.Apps } catch(FormatException ex) { - ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok); + ShiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } if (_colorType1 > 255 || _colorType2 > 255 || _colorType3 > 255) { - ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok); + ShiftWM.StartInfoboxSession("Error!", "A value cannot be greater than 255!", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } else { @@ -40,12 +40,12 @@ namespace ShiftOS.Main.ShiftOS.Apps { ShiftWindow sw = new ShiftWindow(); _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3); - BackColor = _finalColor; - ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok); + ShiftWM.SetTitleBarColor(_finalColor); + ShiftWM.StartInfoboxSession("Success!", "Changed color to:\n" + _colorType1.ToString() + ", " + _colorType2.ToString() + ", " + _colorType3.ToString() + ".", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Info); } catch (Exception) { - ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok); + ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } } } diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs new file mode 100644 index 0000000..bef7a6b --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/Snakey.Designer.cs @@ -0,0 +1,93 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class Snakey + { + /// <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.length = new System.Windows.Forms.Label(); + this.speed = new System.Windows.Forms.Label(); + this.score = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // length + // + this.length.AutoSize = true; + this.length.BackColor = System.Drawing.Color.Transparent; + this.length.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.length.ForeColor = System.Drawing.Color.White; + this.length.Location = new System.Drawing.Point(573, 18); + this.length.Name = "length"; + this.length.Size = new System.Drawing.Size(76, 20); + this.length.TabIndex = 16; + this.length.Text = "Length: 5"; + // + // speed + // + this.speed.AutoSize = true; + this.speed.BackColor = System.Drawing.Color.Transparent; + this.speed.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.speed.ForeColor = System.Drawing.Color.White; + this.speed.Location = new System.Drawing.Point(287, 18); + this.speed.Name = "speed"; + this.speed.Size = new System.Drawing.Size(73, 20); + this.speed.TabIndex = 15; + this.speed.Text = "Speed: 1"; + // + // score + // + this.score.AutoSize = true; + this.score.BackColor = System.Drawing.Color.Transparent; + this.score.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.score.ForeColor = System.Drawing.Color.White; + this.score.Location = new System.Drawing.Point(24, 18); + this.score.Name = "score"; + this.score.Size = new System.Drawing.Size(100, 20); + this.score.TabIndex = 14; + this.score.Text = "Total Points: "; + // + // Snakey + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.Controls.Add(this.length); + this.Controls.Add(this.speed); + this.Controls.Add(this.score); + this.Name = "Snakey"; + this.Size = new System.Drawing.Size(673, 447); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + internal System.Windows.Forms.Label length; + internal System.Windows.Forms.Label speed; + internal System.Windows.Forms.Label score; + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.cs b/ShiftOS.Main/ShiftOS/Apps/Snakey.cs new file mode 100644 index 0000000..d8d4a98 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/Snakey.cs @@ -0,0 +1,123 @@ +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; +using System.Drawing.Drawing2D; +using ShiftOS.Engine; +using ShiftOS.Main.Properties; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class Snakey : UserControl + { + public Snakey() + { + InitializeComponent(); + } + private struct structSnake + { + public Rectangle rect; + public int x; + public int y; + } + private enum directions + { + Rightward, + Downward, + Leftward, + Upward + } + #region Various-Objects + private const int INTIAL_SNAKE_RECT_COUNT = 5; + private const int COLUMN_COUNT = 65; + private const int ROW_COUNT = 47; + private int curRecCount; + private Rectangle[,] Rects; + + + private bool [,] isSnakePart; + private List<structSnake> snake; + private Brush snakeBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); + private Brush backBrush = new SolidBrush(Color.FromArgb(1, 1, 1)); + private Brush tokenBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); + private directions curDirection; + private Bitmap buffer; + private int columnCount; + private int rowCount; + private int snakePoints; + private double snakeSpeed; + private int snakeLength; + private Rectangle token; + #endregion + private int xyIndexToRect(int X, int Y) + { + return (Y * (columnCount)) + X; + } + private void rectToIndexXY(double index, double X, double Y) + { + X = index % (columnCount); + Y = Math.Round(index / columnCount); + } + private void initSnake() + { + int x; + int y; + int index; + snake = new List<structSnake>(); + structSnake sSnake = new structSnake(); + x = ((columnCount) - 10 / 2); + y = ((rowCount) - 6) / 2; + Point snakePosition = new Point(x, y); + index = xyIndexToRect(x, y); + for (int i = 0; i < INTIAL_SNAKE_RECT_COUNT; i++) + { + rectToIndexXY(index + (i - 1), x, y); + sSnake.rect = Rects[x, y]; + sSnake.x = x; + sSnake.y = y; + snake.Add(sSnake); + } + snakeLength = INTIAL_SNAKE_RECT_COUNT; + snakeSpeed = 1; + length.Text = "Length: " + snakeLength.ToString(); + speed.Text = "Speed: " + snakeSpeed.ToString(); + } + private void selectRectangles() + { + Graphics g = Graphics.FromImage(Resources.snakeyback); + int i; + structSnake sSnake = new structSnake(); + for (i = 0; i < INTIAL_SNAKE_RECT_COUNT; i++) + { + sSnake = snake[i]; + g.FillRectangle(snakeBrush, sSnake.rect); + isSnakePart[sSnake.x, sSnake.y] = true; + } + buffer = new Bitmap(Resources.snakeyback); + g.Dispose(); + Refresh(); + } + private void initRectangles() + { + int i; + int j; + columnCount = COLUMN_COUNT; + rowCount = ROW_COUNT; + Rects = new Rectangle[columnCount, rowCount]; + isSnakePart = new bool[columnCount, rowCount]; + for (j = 0; j < rowCount; j++) + { + for (i = 0; i < columnCount; i++) + { + //TO-DO: I can't really port this over right now. Commiting soon. -FDD + } + } + } + } +} + diff --git a/ShiftOS.Main/ShiftOS/Apps/Snakey.resx b/ShiftOS.Main/ShiftOS/Apps/Snakey.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/Snakey.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 diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs index 50bcb58..53765bd 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs @@ -28,60 +28,57 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.systemIconsBindingSource = new System.Windows.Forms.BindingSource(this.components); - ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(18, 20); - this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(388, 26); - this.textBox1.TabIndex = 0; - this.textBox1.Text = "Title"; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(18, 60); - this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(388, 26); - this.textBox2.TabIndex = 1; - this.textBox2.Text = "Contents"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(13, 149); - this.button1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(192, 35); - this.button1.TabIndex = 2; - this.button1.Text = "Create Window"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(217, 149); - this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(189, 35); - this.button2.TabIndex = 4; - this.button2.Text = "Test Shifter"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { + this.components = new System.ComponentModel.Container(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.systemIconsBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.panel1 = new System.Windows.Forms.Panel(); + ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).BeginInit(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(12, 13); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(260, 20); + this.textBox1.TabIndex = 0; + this.textBox1.Text = "Title"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(12, 39); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(260, 20); + this.textBox2.TabIndex = 1; + this.textBox2.Text = "Contents"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(9, 97); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(128, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Create Window"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.Button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(145, 97); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(126, 23); + this.button2.TabIndex = 4; + this.button2.Text = "Test Shifter"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { "Application", "Asterisk", "Error", @@ -92,31 +89,41 @@ "Shield", "Warning", "WinLogo"}); - this.comboBox1.Location = new System.Drawing.Point(18, 104); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(388, 28); - this.comboBox1.TabIndex = 5; - // - // systemIconsBindingSource - // - this.systemIconsBindingSource.DataSource = typeof(System.Drawing.SystemIcons); - // - // TestForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(426, 198); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.Name = "TestForm"; - this.Text = "TestForm"; - ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.comboBox1.Location = new System.Drawing.Point(12, 68); + this.comboBox1.Margin = new System.Windows.Forms.Padding(2); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(260, 21); + this.comboBox1.TabIndex = 5; + // + // systemIconsBindingSource + // + this.systemIconsBindingSource.DataSource = typeof(System.Drawing.SystemIcons); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.SystemColors.ControlDarkDark; + this.panel1.Location = new System.Drawing.Point(71, 138); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(200, 37); + this.panel1.TabIndex = 6; + this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove); + // + // TestForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 175); + this.Controls.Add(this.panel1); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Name = "TestForm"; + this.Text = "TestForm"; + ((System.ComponentModel.ISupportInitialize)(this.systemIconsBindingSource)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -128,5 +135,6 @@ private System.Windows.Forms.Button button2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.BindingSource systemIconsBindingSource; - } + private System.Windows.Forms.Panel panel1; + } }
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs index 1fd3b18..e8360e0 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs @@ -10,6 +10,7 @@ namespace ShiftOS.Main { public partial class TestForm : Form { + Point loc; public TestForm() { InitializeComponent(); @@ -17,16 +18,25 @@ namespace ShiftOS.Main private void Button1_Click(object sender, EventArgs e) { - ShiftDemo demo = new ShiftDemo {label1 = {Text = textBox2.Text}}; + ShiftDemo demo = new ShiftDemo { label1 = { Text = textBox2.Text } }; - var item = typeof(SystemIcons).GetProperties() - .First(p => p.Name == comboBox1.SelectedItem as string); + var item = typeof(SystemIcons).GetProperties() + .First(p => p.Name == comboBox1.SelectedItem as string); - ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); - ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); + ShiftWM.Init(demo, textBox1.Text, (item.GetMethod.Invoke(null, new object[0]) as Icon)); + ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok, InfoboxTemplate.ErrorIcon.Critical); } - private void button2_Click(object sender, EventArgs e) - => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); + private void button2_Click(object sender, EventArgs e) + => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); + + private void panel1_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + loc = new Point(Cursor.Position.X, Cursor.Position.Y); + this.Location = loc; + } + } } } diff --git a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs index dac30c6..35cf33e 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs @@ -28,75 +28,78 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.listView1 = new System.Windows.Forms.ListView(); - this.taskbar = new System.Windows.Forms.ToolStrip(); - this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.taskbar.SuspendLayout(); - this.SuspendLayout(); - // - // listView1 - // - this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView1.Location = new System.Drawing.Point(0, 0); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(1962, 1236); - this.listView1.TabIndex = 0; - this.listView1.UseCompatibleStateImageBehavior = false; - // - // taskbar - // - this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; - this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); - this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + this.listView1 = new System.Windows.Forms.ListView(); + this.taskbar = new System.Windows.Forms.ToolStrip(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.taskbar.SuspendLayout(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(913, 489); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + // + // taskbar + // + this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton1, this.taskbarClock}); - this.taskbar.Location = new System.Drawing.Point(0, 1204); - this.taskbar.Name = "taskbar"; - this.taskbar.Size = new System.Drawing.Size(1962, 32); - this.taskbar.TabIndex = 1; - this.taskbar.Text = "toolStrip1"; - // - // toolStripDropDownButton1 - // - this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; - this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(131, 29); - this.toolStripDropDownButton1.Tag = ((uint)(0u)); - this.toolStripDropDownButton1.Text = "Programs"; - // - // taskbarClock - // - this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; - this.taskbarClock.Name = "taskbarClock"; - this.taskbarClock.Size = new System.Drawing.Size(70, 29); - this.taskbarClock.Tag = ((uint)(0u)); - this.taskbarClock.Text = "0:00"; - // - // timer1 - // - this.timer1.Interval = 1000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // Desktop - // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1962, 1236); - this.Controls.Add(this.taskbar); - this.Controls.Add(this.listView1); - this.Name = "Desktop"; - this.Text = "Desktop"; - this.taskbar.ResumeLayout(false); - this.taskbar.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.taskbar.Location = new System.Drawing.Point(0, 458); + this.taskbar.Name = "taskbar"; + this.taskbar.Size = new System.Drawing.Size(913, 31); + this.taskbar.TabIndex = 1; + this.taskbar.Text = "toolStrip1"; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(95, 28); + this.toolStripDropDownButton1.Tag = ((uint)(0u)); + this.toolStripDropDownButton1.Text = "Programs"; + this.toolStripDropDownButton1.Click += new System.EventHandler(this.toolStripDropDownButton1_Click); + // + // taskbarClock + // + this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; + this.taskbarClock.Name = "taskbarClock"; + this.taskbarClock.Size = new System.Drawing.Size(52, 28); + this.taskbarClock.Tag = ((uint)(0u)); + this.taskbarClock.Text = "0:00"; + // + // timer1 + // + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // Desktop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(913, 489); + this.Controls.Add(this.taskbar); + this.Controls.Add(this.listView1); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Name = "Desktop"; + this.Text = "Desktop"; + this.taskbar.ResumeLayout(false); + this.taskbar.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs index 494222a..1ea4183 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.cs @@ -8,6 +8,9 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.ShiftOS.Apps; +using ShiftOS.Main.Properties; +using ShiftOS.Engine; namespace ShiftOS.Main.ShiftOS { @@ -57,5 +60,10 @@ namespace ShiftOS.Main.ShiftOS private void timer1_Tick(object sender, EventArgs e) => taskbarClock.Text = $"{DateTime.Now:t}"; - } + + private void toolStripDropDownButton1_Click(object sender, EventArgs e) + { + ShiftWM.Init(new Snakey(), "Snakey - WIP", Resources.iconSnakey.ToIcon(), false, true); + } + } } |
