diff options
| author | FloppyDiskDrive <[email protected]> | 2017-11-19 10:21:34 -0600 |
|---|---|---|
| committer | FloppyDiskDrive <[email protected]> | 2017-11-19 10:21:34 -0600 |
| commit | 4534ff6252d2cd442d2180b024a94db1f4379f41 (patch) | |
| tree | a5619fd34dcbcb1953b2cb6cc9c035c516dc29e4 /ShiftOS.Engine | |
| parent | 4c4ff1e06cecac8a52ac347e029ac19f1be4e244 (diff) | |
| download | shiftos-rewind-4534ff6252d2cd442d2180b024a94db1f4379f41.tar.gz shiftos-rewind-4534ff6252d2cd442d2180b024a94db1f4379f41.tar.bz2 shiftos-rewind-4534ff6252d2cd442d2180b024a94db1f4379f41.zip | |
Added new extremely buggy ShiftButton.
Diffstat (limited to 'ShiftOS.Engine')
| -rw-r--r-- | ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.Designer.cs | 48 | ||||
| -rw-r--r-- | ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.cs | 26 | ||||
| -rw-r--r-- | ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.resx | 120 | ||||
| -rw-r--r-- | ShiftOS.Engine/ShiftOS.Engine.csproj | 15 | ||||
| -rw-r--r-- | ShiftOS.Engine/UI/ShiftButton.Designer.cs | 36 | ||||
| -rw-r--r-- | ShiftOS.Engine/UI/ShiftButton.cs | 55 | ||||
| -rw-r--r-- | ShiftOS.Engine/WindowManager/InfoboxTemplate.cs | 3 | ||||
| -rw-r--r-- | ShiftOS.Engine/WindowManager/ShiftButton.resx | 126 |
8 files changed, 428 insertions, 1 deletions
diff --git a/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.Designer.cs b/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.Designer.cs new file mode 100644 index 0000000..7eca5d3 --- /dev/null +++ b/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.Designer.cs @@ -0,0 +1,48 @@ +namespace ShiftOS.Engine.ShiftFS.FileGUI +{ + partial class FileOpener + { + /// <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.SuspendLayout(); + // + // FileOpener + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "FileOpener"; + this.Size = new System.Drawing.Size(368, 283); + this.ResumeLayout(false); + + } + + #endregion + + + } +} diff --git a/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.cs b/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.cs new file mode 100644 index 0000000..1947f6f --- /dev/null +++ b/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.cs @@ -0,0 +1,26 @@ +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.ShiftFS.FileGUI +{ + public partial class FileOpener : UserControl + { + public FileOpener() + { + InitializeComponent(); + + } + + private void shiftButton1_Click(object sender, EventArgs e) + { + MessageBox.Show("yay"); + } + } +} diff --git a/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.resx b/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.Engine/ShiftFS/FileGUI/FileOpener.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.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index 88ad0cf..aa9d370 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -63,6 +63,12 @@ <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> + <Compile Include="ShiftFS\FileGUI\FileOpener.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="ShiftFS\FileGUI\FileOpener.Designer.cs"> + <DependentUpon>FileOpener.cs</DependentUpon> + </Compile> <Compile Include="ShiftFS\ShiftDirectory.cs" /> <Compile Include="ShiftFS\ShiftFileStream.cs" /> <Compile Include="ShiftFS\ShiftTree.cs" /> @@ -70,6 +76,12 @@ <Compile Include="ShiftFS\ShiftFS.cs" /> <Compile Include="ShiftFS\IShiftNode.cs" /> <Compile Include="Misc\Tools.cs" /> + <Compile Include="UI\ShiftButton.cs"> + <SubType>Component</SubType> + </Compile> + <Compile Include="UI\ShiftButton.Designer.cs"> + <DependentUpon>ShiftButton.cs</DependentUpon> + </Compile> <Compile Include="WindowManager\InfoboxTemplate.cs"> <SubType>UserControl</SubType> </Compile> @@ -91,6 +103,9 @@ <LastGenOutput>Resources.Designer.cs</LastGenOutput> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="ShiftFS\FileGUI\FileOpener.resx"> + <DependentUpon>FileOpener.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 new file mode 100644 index 0000000..c744a90 --- /dev/null +++ b/ShiftOS.Engine/UI/ShiftButton.Designer.cs @@ -0,0 +1,36 @@ +namespace ShiftOS.Engine.UI +{ + partial class ShiftButton + { + /// <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() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/ShiftOS.Engine/UI/ShiftButton.cs b/ShiftOS.Engine/UI/ShiftButton.cs new file mode 100644 index 0000000..a025a40 --- /dev/null +++ b/ShiftOS.Engine/UI/ShiftButton.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.Engine.UI +{ + public partial class ShiftButton : Control, IButtonControl + { + private bool _pressing = false; + private Color _lightBack; + public ShiftButton() + { + InitializeComponent(); + } + + public DialogResult DialogResult { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public void NotifyDefault(bool value) + { + + } + + public void PerformClick() + { + this.OnClick(new EventArgs()); + } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + this.Font = new Font("Lucida Console", 9, FontStyle.Regular); + _lightBack = Color.WhiteSmoke; + var g = pe.Graphics; + g.Clear(BackColor); + g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + var sf = new StringFormat(); + + if (_pressing) + { + g.FillRectangle(new SolidBrush(Color.White), 0, 0, Width, Height); + g.DrawString(Text, Font, new SolidBrush(Color.Black), ((Width / 2) + 1), (Height / 2) + 1); + } + else + { + g.FillRectangle(new SolidBrush(Color.WhiteSmoke), 0, 0, Width, Height); + } + } + } +} diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs index c2b45e0..16e84eb 100644 --- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs +++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs @@ -4,6 +4,7 @@ using System.IO; using System.Media; using System.Windows.Forms; using ShiftOS.Engine.Properties; +using ShiftOS.Engine.UI; namespace ShiftOS.Engine.WindowManager { @@ -31,7 +32,7 @@ namespace ShiftOS.Engine.WindowManager public InfoboxTemplate(ButtonType type) { InitializeComponent(); - + switch (type) { case ButtonType.Ok: diff --git a/ShiftOS.Engine/WindowManager/ShiftButton.resx b/ShiftOS.Engine/WindowManager/ShiftButton.resx new file mode 100644 index 0000000..aa2bacc --- /dev/null +++ b/ShiftOS.Engine/WindowManager/ShiftButton.resx @@ -0,0 +1,126 @@ +<?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="button1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <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 |
