aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Engine
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-11-25 08:59:48 -0700
committerAShifter <[email protected]>2017-11-25 08:59:48 -0700
commitc81573594f509177214bbc9b64427c8aabdc30a6 (patch)
tree0f16be1fffc1e1557adafbd1baa9ff7aa16a3381 /ShiftOS.Engine
parent90b1bdca5f8f2bf634a0b83ed9b623843ada5661 (diff)
downloadshiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.gz
shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.bz2
shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.zip
Add SaveSystem, FullScreen Terminal and stuff
Git had a horrible seizure and removed our repo but Alex-TIMEHACK helped us get it back.
Diffstat (limited to 'ShiftOS.Engine')
-rw-r--r--ShiftOS.Engine/CodepointUpgrade.cs17
-rw-r--r--ShiftOS.Engine/SaveSystem.cs75
-rw-r--r--ShiftOS.Engine/ShiftOS.Engine.csproj7
-rw-r--r--ShiftOS.Engine/UI/ShiftButton.Designer.cs11
-rw-r--r--ShiftOS.Engine/UI/ShiftButton.cs60
-rw-r--r--ShiftOS.Engine/UI/ShiftButton.resx123
-rw-r--r--ShiftOS.Engine/UI/ShiftStripRenderer.cs21
-rw-r--r--ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs90
-rw-r--r--ShiftOS.Engine/WindowManager/InfoboxTemplate.cs39
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftSkinData.cs47
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWM.cs54
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWindow.cs12
12 files changed, 438 insertions, 118 deletions
diff --git a/ShiftOS.Engine/CodepointUpgrade.cs b/ShiftOS.Engine/CodepointUpgrade.cs
new file mode 100644
index 0000000..9f4f0f1
--- /dev/null
+++ b/ShiftOS.Engine/CodepointUpgrade.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ShiftOS.Engine;
+
+namespace ShiftOS.Engine
+{
+ public class CodepointUpgrade
+ {
+ public interface ICodepointUpgrade
+ {
+ int codePoints { get; set; }
+ }
+ }
+}
diff --git a/ShiftOS.Engine/SaveSystem.cs b/ShiftOS.Engine/SaveSystem.cs
index 59ddf4b..51924d0 100644
--- a/ShiftOS.Engine/SaveSystem.cs
+++ b/ShiftOS.Engine/SaveSystem.cs
@@ -16,6 +16,13 @@ namespace ShiftOS.Engine
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ShiftOS-Rewind");
}
}
+ public static string dataDir
+ {
+ get
+ {
+ return gameDir + "\\Data";
+ }
+ }
public static string fontDir
{
get
@@ -23,5 +30,73 @@ namespace ShiftOS.Engine
return gameDir + "\\Fonts";
}
}
+ public static string baseGameDir
+ {
+ get
+ {
+ return gameDir + "\\GameData";
+ }
+ }
+ public static string homeDir
+ {
+ get
+ {
+ return baseGameDir + "\\Home";
+ }
+ }
+ public static string desktopDir
+ {
+ get
+ {
+ return homeDir + "\\Desktop";
+ }
+ }
+ public static string docDir
+ {
+ get
+ {
+ return homeDir + "\\Documents";
+ }
+ }
+ public static string downloadsDir
+ {
+ get
+ {
+ return homeDir + "\\Downloads";
+ }
+ }
+ public static string musicDir
+ {
+ get
+ {
+ return homeDir + "\\Music";
+ }
+ }
+ public static string picDir
+ {
+ get { return homeDir + "\\Pictures"; }
+ }
+ public static class User
+ {
+ public static int codePoints
+ {
+ get
+ {
+ return 0;
+ }
+ set
+ {
+
+ }
+ }
+ public static void AddToCodePoints(int amountToAdd)
+ {
+ codePoints += amountToAdd;
+ using (var fs = File.OpenWrite(dataDir + "\\userCodePoints.whoa"))
+ {
+ Whoa.Whoa.SerialiseObject(fs, codePoints);
+ }
+ }
+ }
}
}
diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj
index faff407..fe4a06e 100644
--- a/ShiftOS.Engine/ShiftOS.Engine.csproj
+++ b/ShiftOS.Engine/ShiftOS.Engine.csproj
@@ -55,6 +55,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Compile Include="CodepointUpgrade.cs" />
<Compile Include="Misc\EventList.cs" />
<Compile Include="Misc\IniFile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -78,11 +79,12 @@
<Compile Include="ShiftFS\IShiftNode.cs" />
<Compile Include="Misc\Tools.cs" />
<Compile Include="UI\ShiftButton.cs">
- <SubType>UserControl</SubType>
+ <SubType>Component</SubType>
</Compile>
<Compile Include="UI\ShiftButton.Designer.cs">
<DependentUpon>ShiftButton.cs</DependentUpon>
</Compile>
+ <Compile Include="UI\ShiftStripRenderer.cs" />
<Compile Include="WindowManager\InfoboxTemplate.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -107,6 +109,9 @@
<EmbeddedResource Include="ShiftFS\FileGUI\FileOpener.resx">
<DependentUpon>FileOpener.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="UI\ShiftButton.resx">
+ <DependentUpon>ShiftButton.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="WindowManager\InfoboxTemplate.resx">
<DependentUpon>InfoboxTemplate.cs</DependentUpon>
</EmbeddedResource>
diff --git a/ShiftOS.Engine/UI/ShiftButton.Designer.cs b/ShiftOS.Engine/UI/ShiftButton.Designer.cs
index a84ba4a..c746a5e 100644
--- a/ShiftOS.Engine/UI/ShiftButton.Designer.cs
+++ b/ShiftOS.Engine/UI/ShiftButton.Designer.cs
@@ -2,7 +2,7 @@
{
partial class ShiftButton
{
- /// <summary>
+ /// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
@@ -22,14 +22,15 @@
#region Component Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
+ /// <summary>
+ /// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
- components = new System.ComponentModel.Container();
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.SuspendLayout();
+ this.ResumeLayout(false);
+
}
#endregion
diff --git a/ShiftOS.Engine/UI/ShiftButton.cs b/ShiftOS.Engine/UI/ShiftButton.cs
index ebf6e2b..8e4104d 100644
--- a/ShiftOS.Engine/UI/ShiftButton.cs
+++ b/ShiftOS.Engine/UI/ShiftButton.cs
@@ -1,8 +1,6 @@
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;
@@ -10,11 +8,63 @@ using System.Windows.Forms;
namespace ShiftOS.Engine.UI
{
- public partial class ShiftButton : UserControl
+ public partial class ShiftButton : Button
{
- public ShiftButton()
+ private static Font _normalFont = new Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+
+ private static Color _back = System.Drawing.Color.Black;
+ private static Color _border = System.Drawing.Color.White;
+ private static Color _activeBorder = System.Drawing.Color.Black;
+ private static Color _fore = System.Drawing.Color.Black;
+ private static Padding _margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
+ private static Padding _padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
+
+ private static Size _minSize = new System.Drawing.Size(75, 23);
+
+ private bool _active;
+
+ public ShiftButton(): base()
+ {
+ base.Font = _normalFont;
+ base.BackColor = _border;
+ base.ForeColor = _fore;
+ base.FlatAppearance.BorderColor = _back;
+ base.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ base.Margin = _margin;
+ base.Padding = _padding;
+ base.MinimumSize = _minSize;
+ }
+
+ protected override void OnControlAdded(ControlEventArgs e)
+ {
+ base.OnControlAdded(e);
+ UseVisualStyleBackColor = false;
+ }
+
+ protected override void OnMouseEnter(System.EventArgs e)
+ {
+ base.OnMouseEnter(e);
+ if (!_active)
+ base.FlatAppearance.BorderColor = _activeBorder;
+ }
+
+ protected override void OnMouseLeave(System.EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ if (!_active)
+ base.FlatAppearance.BorderColor = _border;
+ }
+
+ public void SetStateActive()
+ {
+ _active = true;
+ base.FlatAppearance.BorderColor = _activeBorder;
+ }
+
+ public void SetStateNormal()
{
- InitializeComponent();
+ _active = false;
+ base.FlatAppearance.BorderColor = _border;
}
}
}
diff --git a/ShiftOS.Engine/UI/ShiftButton.resx b/ShiftOS.Engine/UI/ShiftButton.resx
new file mode 100644
index 0000000..e5858cc
--- /dev/null
+++ b/ShiftOS.Engine/UI/ShiftButton.resx
@@ -0,0 +1,123 @@
+<?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>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </metadata>
+</root> \ No newline at end of file
diff --git a/ShiftOS.Engine/UI/ShiftStripRenderer.cs b/ShiftOS.Engine/UI/ShiftStripRenderer.cs
new file mode 100644
index 0000000..7b8498f
--- /dev/null
+++ b/ShiftOS.Engine/UI/ShiftStripRenderer.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS.Engine.UI
+{
+ public class ShiftStripRenderer : ToolStripProfessionalRenderer
+ {
+ protected override void OnRenderLabelBackground(ToolStripItemRenderEventArgs e)
+ {
+ using (var b = new SolidBrush(e.Item.BackColor))
+ {
+ e.Graphics.FillRectangle(b, new Rectangle(Point.Empty, e.Item.Size));
+ }
+ }
+ }
+}
diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs
index 58c191e..3279179 100644
--- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs
+++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs
@@ -29,42 +29,14 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- this.btnOpt1 = new System.Windows.Forms.Button();
- this.btnOpt2 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.changeSize = new System.Windows.Forms.Timer(this.components);
- this.label1 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.TextBox();
+ this.btnOpt2 = new ShiftOS.Engine.UI.ShiftButton();
+ this.btnOpt1 = new ShiftOS.Engine.UI.ShiftButton();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
- // btnOpt1
- //
- this.btnOpt1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.btnOpt1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnOpt1.Font = new System.Drawing.Font("Lucida Console", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btnOpt1.Location = new System.Drawing.Point(73, 170);
- this.btnOpt1.Name = "btnOpt1";
- this.btnOpt1.Size = new System.Drawing.Size(117, 23);
- this.btnOpt1.TabIndex = 0;
- this.btnOpt1.Text = "button1";
- this.btnOpt1.UseVisualStyleBackColor = true;
- this.btnOpt1.Click += new System.EventHandler(this.btnOpt1_Click);
- //
- // btnOpt2
- //
- this.btnOpt2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.btnOpt2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnOpt2.Font = new System.Drawing.Font("Lucida Console", 9F);
- this.btnOpt2.Location = new System.Drawing.Point(243, 170);
- this.btnOpt2.Name = "btnOpt2";
- this.btnOpt2.Size = new System.Drawing.Size(117, 23);
- this.btnOpt2.TabIndex = 1;
- this.btnOpt2.Text = "button2";
- this.btnOpt2.UseVisualStyleBackColor = true;
- this.btnOpt2.Click += new System.EventHandler(this.btnOpt2_Click);
- //
// pictureBox1
//
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -83,22 +55,57 @@
//
// label1
//
- this.label1.AutoSize = true;
- this.label1.Font = new System.Drawing.Font("Lucida Console", 9.25F);
- this.label1.Location = new System.Drawing.Point(107, 48);
+ this.label1.BackColor = System.Drawing.Color.White;
+ this.label1.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.label1.Font = new System.Drawing.Font("Lucida Console", 8.25F);
+ this.label1.Location = new System.Drawing.Point(90, 35);
+ this.label1.Multiline = true;
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(55, 13);
- this.label1.TabIndex = 3;
- this.label1.Text = "label1";
+ this.label1.Size = new System.Drawing.Size(256, 125);
+ this.label1.TabIndex = 6;
+ //
+ // btnOpt2
+ //
+ this.btnOpt2.BackColor = System.Drawing.SystemColors.Control;
+ this.btnOpt2.FlatAppearance.BorderColor = System.Drawing.Color.Black;
+ this.btnOpt2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnOpt2.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnOpt2.ForeColor = System.Drawing.Color.Black;
+ this.btnOpt2.Location = new System.Drawing.Point(229, 163);
+ this.btnOpt2.Margin = new System.Windows.Forms.Padding(0);
+ this.btnOpt2.MinimumSize = new System.Drawing.Size(75, 23);
+ this.btnOpt2.Name = "btnOpt2";
+ this.btnOpt2.Padding = new System.Windows.Forms.Padding(3);
+ this.btnOpt2.Size = new System.Drawing.Size(117, 31);
+ this.btnOpt2.TabIndex = 5;
+ this.btnOpt2.Text = "shiftButton2";
+ this.btnOpt2.UseVisualStyleBackColor = false;
+ //
+ // btnOpt1
+ //
+ this.btnOpt1.BackColor = System.Drawing.SystemColors.Control;
+ this.btnOpt1.FlatAppearance.BorderColor = System.Drawing.Color.Black;
+ this.btnOpt1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnOpt1.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnOpt1.ForeColor = System.Drawing.Color.Black;
+ this.btnOpt1.Location = new System.Drawing.Point(90, 163);
+ this.btnOpt1.Margin = new System.Windows.Forms.Padding(0);
+ this.btnOpt1.MinimumSize = new System.Drawing.Size(75, 23);
+ this.btnOpt1.Name = "btnOpt1";
+ this.btnOpt1.Padding = new System.Windows.Forms.Padding(3);
+ this.btnOpt1.Size = new System.Drawing.Size(117, 31);
+ this.btnOpt1.TabIndex = 4;
+ this.btnOpt1.Text = "shiftButton1";
+ this.btnOpt1.UseVisualStyleBackColor = false;
//
// InfoboxTemplate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label1);
- this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btnOpt2);
this.Controls.Add(this.btnOpt1);
+ this.Controls.Add(this.pictureBox1);
this.Name = "InfoboxTemplate";
this.Size = new System.Drawing.Size(438, 210);
this.Load += new System.EventHandler(this.InfoboxTemplate_Load);
@@ -109,11 +116,10 @@
}
#endregion
-
- public System.Windows.Forms.Button btnOpt1;
- public System.Windows.Forms.Button btnOpt2;
public System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Timer changeSize;
- public System.Windows.Forms.Label label1;
+ private UI.ShiftButton btnOpt1;
+ private UI.ShiftButton btnOpt2;
+ public System.Windows.Forms.TextBox label1;
}
}
diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
index 5d55cf2..72bb530 100644
--- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
+++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
@@ -23,32 +23,25 @@ namespace ShiftOS.Engine.WindowManager
Cancel,
Ok
}
-
- int _buttonChoice;
- int _buttonSelected;
Stream _str;
public InfoboxTemplate(ButtonType type)
{
InitializeComponent();
-
switch (type)
{
case ButtonType.Ok:
btnOpt1.Text = "OK";
btnOpt2.Hide();
- btnOpt1.Location = new Point(109, 134);
- _buttonChoice = 1;
+ btnOpt1.Location = new Point(156, 163);
break;
case ButtonType.OkCancel:
btnOpt1.Text = "OK";
btnOpt2.Text = "Cancel";
- _buttonChoice = 2;
break;
case ButtonType.YesNo:
btnOpt1.Text = "Yes";
btnOpt2.Text = "No";
- _buttonChoice = 3;
break;
}
}
@@ -58,11 +51,12 @@ namespace ShiftOS.Engine.WindowManager
switch (btnOpt1.Text)
{
case "OK":
- ParentForm?.Close();
+ btnOpt1.DialogResult = System.Windows.Forms.DialogResult.OK;
+ ParentForm?.Close();
break;
case "Yes":
- _buttonSelected = 2;
- ParentForm?.Close();
+ btnOpt1.DialogResult = System.Windows.Forms.DialogResult.Yes;
+ ParentForm?.Close();
break;
}
}
@@ -72,11 +66,12 @@ namespace ShiftOS.Engine.WindowManager
switch (btnOpt2.Text)
{
case "No":
- _buttonSelected = 3;
- break;
+ btnOpt2.DialogResult = System.Windows.Forms.DialogResult.No;
+ ParentForm?.Close();
+ break;
case "Cancel":
- _buttonSelected = 4;
- break;
+ btnOpt2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ break;
}
}
@@ -89,6 +84,16 @@ namespace ShiftOS.Engine.WindowManager
}
void InfoboxTemplate_Load(object sender, EventArgs e)
- => Play();
- }
+ {
+ Play();
+ SizeAndLoad(label1.Size.Width, label1.Size.Width);
+ }
+ private Size SizeAndLoad(int x, int y)
+ {
+ this.Size = new Size(x, y);
+ Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2;
+ Top = (Screen.PrimaryScreen.Bounds.Top - Height) / 2;
+ return Size;
+ }
+ }
} \ No newline at end of file
diff --git a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs
index 165f5bb..cfaf4be 100644
--- a/ShiftOS.Engine/WindowManager/ShiftSkinData.cs
+++ b/ShiftOS.Engine/WindowManager/ShiftSkinData.cs
@@ -5,19 +5,36 @@ namespace ShiftOS.Engine.WindowManager
public abstract class ShiftSkinData
{
// ColorData
- public static Color LeftTopCornerColor = Color.Empty;
- public static Color TitleBarColor = Color.Empty;
- public static Color RightTopCornerColor = Color.Empty;
- public static Color BtnCloseColor = Color.Empty;
- public static Color BtnMaxColor = Color.Empty;
- public static Color BtnMinColor = Color.Empty;
- public static Color BtnCloseHoverColor = Color.Empty;
- public static Color BtnMaxHoverColor = Color.Empty;
- public static Color BtnMinHoverColor = Color.Empty;
- public static Color LeftSideColor = Color.Empty;
- public static Color RightSideColor = Color.Empty;
- public static Color LeftBottomCornerColor = Color.Empty;
- public static Color BottomSideColor = Color.Empty;
- public static Color RightBottomCornerColor = Color.Empty;
- }
+ public static skinColors Colors = new skinColors();
+ public static skinTextures Images = new skinTextures();
+ }
+
+ public class skinTextures
+ {
+ public skinTextures()
+ {
+
+ }
+ }
+}
+
+namespace ShiftOS.Engine.WindowManager
+{
+ public class skinColors
+ {
+ public Color LeftTopCornerColor;
+ public Color TitleBarColor;
+ public Color RightTopCornerColor;
+ public Color BtnCloseColor;
+ public Color BtnMaxColor;
+ public Color BtnMinColor;
+ public Color BtnCloseHoverColor;
+ public Color BtnMaxHoverColor;
+ public Color BtnMinHoverColor;
+ public Color LeftSideColor;
+ public Color RightSideColor;
+ public Color LeftBottomCornerColor;
+ public Color BottomSideColor;
+ public Color RightBottomCornerColor;
+ }
} \ No newline at end of file
diff --git a/ShiftOS.Engine/WindowManager/ShiftWM.cs b/ShiftOS.Engine/WindowManager/ShiftWM.cs
index 4b57961..a910c0c 100644
--- a/ShiftOS.Engine/WindowManager/ShiftWM.cs
+++ b/ShiftOS.Engine/WindowManager/ShiftWM.cs
@@ -43,36 +43,36 @@ namespace ShiftOS.Engine.WindowManager
app.Width = content.Width + app.leftSide.Width + app.rightSide.Width;
app.Height = content.Height + app.bottomSide.Height + app.titleBar.Height;
- if (ShiftSkinData.TitleBarColor == Color.Empty)
+ if (ShiftSkinData.Colors.TitleBarColor == Color.Empty)
{
- var borderColor = Color.FromArgb(64, 64, 64);
- ShiftSkinData.BtnCloseColor = Color.Black;
- ShiftSkinData.BtnCloseHoverColor = Color.FromArgb(40, 40, 40);
- ShiftSkinData.BtnMaxColor = Color.Black;
- ShiftSkinData.BtnMaxHoverColor = Color.FromArgb(40, 40, 40);
- ShiftSkinData.BtnMinColor = Color.Black;
- ShiftSkinData.BtnMinHoverColor = Color.FromArgb(40, 40, 40);
- ShiftSkinData.LeftTopCornerColor = borderColor;
- ShiftSkinData.TitleBarColor = borderColor;
- ShiftSkinData.RightTopCornerColor = borderColor;
- ShiftSkinData.LeftSideColor = borderColor;
- ShiftSkinData.RightSideColor = borderColor;
- ShiftSkinData.LeftBottomCornerColor = borderColor;
- ShiftSkinData.BottomSideColor = borderColor;
- ShiftSkinData.RightBottomCornerColor = borderColor;
+ Color borderColor = Color.FromArgb(64, 64, 64);
+ ShiftSkinData.Colors.BtnCloseColor = Color.Black;
+ ShiftSkinData.Colors.BtnCloseHoverColor = Color.FromArgb(40, 40, 40);
+ ShiftSkinData.Colors.BtnMaxColor = Color.Black;
+ ShiftSkinData.Colors.BtnMaxHoverColor = Color.FromArgb(40, 40, 40);
+ ShiftSkinData.Colors.BtnMinColor = Color.Black;
+ ShiftSkinData.Colors.BtnMinHoverColor = Color.FromArgb(40, 40, 40);
+ ShiftSkinData.Colors.LeftTopCornerColor = borderColor;
+ ShiftSkinData.Colors.TitleBarColor = borderColor;
+ ShiftSkinData.Colors.RightTopCornerColor = borderColor;
+ ShiftSkinData.Colors.LeftSideColor = borderColor;
+ ShiftSkinData.Colors.RightSideColor = borderColor;
+ ShiftSkinData.Colors.LeftBottomCornerColor = borderColor;
+ ShiftSkinData.Colors.BottomSideColor = borderColor;
+ ShiftSkinData.Colors.RightBottomCornerColor = borderColor;
}
- app.btnClose.BackColor = ShiftSkinData.BtnCloseColor;
- app.btnMax.BackColor = ShiftSkinData.BtnMaxColor;
- app.btnMin.BackColor = ShiftSkinData.BtnMinColor;
- app.leftTopCorner.BackColor = ShiftSkinData.LeftTopCornerColor;
- app.titleBar.BackColor = ShiftSkinData.TitleBarColor;
- app.rightTopCorner.BackColor = ShiftSkinData.RightTopCornerColor;
- app.leftSide.BackColor = ShiftSkinData.LeftSideColor;
- app.rightSide.BackColor = ShiftSkinData.RightSideColor;
- app.leftBottomCorner.BackColor = ShiftSkinData.LeftBottomCornerColor;
- app.bottomSide.BackColor = ShiftSkinData.BottomSideColor;
- app.rightBottomCorner.BackColor = ShiftSkinData.RightBottomCornerColor;
+ app.btnClose.BackColor = ShiftSkinData.Colors.BtnCloseColor;
+ app.btnMax.BackColor = ShiftSkinData.Colors.BtnMaxColor;
+ app.btnMin.BackColor = ShiftSkinData.Colors.BtnMinColor;
+ app.leftTopCorner.BackColor = ShiftSkinData.Colors.LeftTopCornerColor;
+ app.titleBar.BackColor = ShiftSkinData.Colors.TitleBarColor;
+ app.rightTopCorner.BackColor = ShiftSkinData.Colors.RightTopCornerColor;
+ app.leftSide.BackColor = ShiftSkinData.Colors.LeftSideColor;
+ app.rightSide.BackColor = ShiftSkinData.Colors.RightSideColor;
+ app.leftBottomCorner.BackColor = ShiftSkinData.Colors.LeftBottomCornerColor;
+ app.bottomSide.BackColor = ShiftSkinData.Colors.BottomSideColor;
+ app.rightBottomCorner.BackColor = ShiftSkinData.Colors.RightBottomCornerColor;
// Icon Setup
diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.cs
index e407e33..95ae4a9 100644
--- a/ShiftOS.Engine/WindowManager/ShiftWindow.cs
+++ b/ShiftOS.Engine/WindowManager/ShiftWindow.cs
@@ -52,23 +52,23 @@ namespace ShiftOS.Engine.WindowManager
=> Close();
void closebutton_MouseEnter(object sender, EventArgs e)
- => btnClose.BackColor = ShiftSkinData.BtnCloseHoverColor;
+ => btnClose.BackColor = ShiftSkinData.Colors.BtnCloseHoverColor;
void closebutton_MouseLeave(object sender, EventArgs e)
- => btnClose.BackColor = ShiftSkinData.BtnCloseColor;
+ => btnClose.BackColor = ShiftSkinData.Colors.BtnCloseColor;
void maximizebutton_MouseEnter(object sender, EventArgs e)
- => btnMax.BackColor = ShiftSkinData.BtnMaxHoverColor;
+ => btnMax.BackColor = ShiftSkinData.Colors.BtnMaxHoverColor;
void maximizebutton_MouseLeave(object sender, EventArgs e)
- => btnMax.BackColor = ShiftSkinData.BtnMaxColor;
+ => btnMax.BackColor = ShiftSkinData.Colors.BtnMaxColor;
void minimizebutton_MouseEnter(object sender, EventArgs e)
- => btnMin.BackColor = ShiftSkinData.BtnMinHoverColor;
+ => btnMin.BackColor = ShiftSkinData.Colors.BtnMinHoverColor;
void minimizebutton_MouseLeave(object sender, EventArgs e)
- => btnMin.BackColor = ShiftSkinData.BtnMinColor;
+ => btnMin.BackColor = ShiftSkinData.Colors.BtnMinColor;
/*
private void closebutton_MouseDown(object sender, MouseEventArgs e)