diff options
Diffstat (limited to 'source/WindowsFormsApplication1/Controls')
3 files changed, 416 insertions, 0 deletions
diff --git a/source/WindowsFormsApplication1/Controls/infobox (copy).cs b/source/WindowsFormsApplication1/Controls/infobox (copy).cs new file mode 100644 index 0000000..77d4d2a --- /dev/null +++ b/source/WindowsFormsApplication1/Controls/infobox (copy).cs @@ -0,0 +1,113 @@ +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 ShiftUI; + +namespace ShiftOS +{ + public partial class infobox : Form + { + /// <summary> + /// Creates a new Infobox instance. + /// </summary> + /// <param name="Message">Message to display.</param> + /// <param name="mode">UI mode.</param> + public infobox(string Message, InfoboxMode mode) + { + InitializeComponent(); + + message = Message; + displayMode = mode; + } + + public string Result = "Cancelled"; + public enum InfoboxMode + { + YesNo, + TextEntry, + Info, + } + public InfoboxMode displayMode = InfoboxMode.Info; + private string message = "This is an infobox."; + public string TextEntry + { + get + { + return txtuserinput.Text; + } + } + + + + + + private void btnyes_Click(object sender, EventArgs e) + { + Result = "Yes"; + this.Close(); + } + + private void btnno_Click(object sender, EventArgs e) + { + Result = "No"; + this.Close(); + } + + private void btnok_Click(object sender, EventArgs e) + { + Result = "OK"; + this.Close(); + } + + private void infobox_Load(object sender, EventArgs e) + { + + switch(displayMode) + { + case InfoboxMode.Info: + txtmessage.Show(); + txtmessage.BringToFront(); + txtmessage.Text = message; + this.pnlyesno.Hide(); + this.txtuserinput.Hide(); + break; + case InfoboxMode.YesNo: + txtmessage.Show(); + txtmessage.BringToFront(); + txtmessage.Text = message; + this.pnlyesno.Show(); + this.pnlyesno.BringToFront(); + this.txtuserinput.Hide(); + break; + case InfoboxMode.TextEntry: + txtmessage.Hide(); + lblintructtext.Show(); + lblintructtext.BringToFront(); + lblintructtext.Text = message; + this.pnlyesno.Hide(); + this.txtuserinput.Show(); + this.txtuserinput.BringToFront(); + break; + } + txtuserinput.KeyDown += (object s, KeyEventArgs a) => + { + if (a.KeyCode == Keys.Enter) + { + a.SuppressKeyPress = true; + btnok_Click(s, (EventArgs)a); + } + }; + if (API.InfoboxesPlaySounds) + { + API.PlaySound(Properties.Resources.infobox); + } + } + + + } +} diff --git a/source/WindowsFormsApplication1/Controls/infobox (copy).resx b/source/WindowsFormsApplication1/Controls/infobox (copy).resx new file mode 100644 index 0000000..ffb4fb5 --- /dev/null +++ b/source/WindowsFormsApplication1/Controls/infobox (copy).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, ShiftUI, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, ShiftUI, ...</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, ShiftUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, ShiftUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/source/WindowsFormsApplication1/Controls/infobox.Designer (copy).cs b/source/WindowsFormsApplication1/Controls/infobox.Designer (copy).cs new file mode 100644 index 0000000..d1c7e55 --- /dev/null +++ b/source/WindowsFormsApplication1/Controls/infobox.Designer (copy).cs @@ -0,0 +1,183 @@ +using System; + +namespace ShiftOS +{ + partial class infobox + { + /// <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); + } + + private void InitializeComponent() + { + this.pgcontents = new ShiftUI.Panel(); + this.txtuserinput = new ShiftUI.TextBox(); + this.btnok = new ShiftUI.Button(); + this.txtmessage = new ShiftUI.Label(); + this.pboximage = new ShiftUI.PictureBox(); + this.lblintructtext = new ShiftUI.Label(); + this.pnlyesno = new ShiftUI.Panel(); + this.btnno = new ShiftUI.Button(); + this.btnyes = new ShiftUI.Button(); + this.pgcontents.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pboximage)).BeginInit(); + this.pnlyesno.SuspendLayout(); + this.SuspendLayout(); + // + // pgcontents + // + this.pgcontents.BackColor = System.Drawing.Color.White; + this.pgcontents.Widgets.Add(this.txtuserinput); + this.pgcontents.Widgets.Add(this.btnok); + this.pgcontents.Widgets.Add(this.txtmessage); + this.pgcontents.Widgets.Add(this.pboximage); + this.pgcontents.Widgets.Add(this.lblintructtext); + this.pgcontents.Widgets.Add(this.pnlyesno); + this.pgcontents.Dock = ShiftUI.DockStyle.Fill; + this.pgcontents.Location = new System.Drawing.Point(0, 0); + this.pgcontents.Name = "pgcontents"; + this.pgcontents.Size = new System.Drawing.Size(371, 154); + this.pgcontents.TabIndex = 20; + // + // txtuserinput + // + //this.txtuserinput.Anchor = ShiftUI.AnchorStyles.Bottom; + this.txtuserinput.BorderStyle = ShiftUI.BorderStyle.FixedSingle; + this.txtuserinput.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtuserinput.Location = new System.Drawing.Point(103, 56); + this.txtuserinput.Multiline = true; + this.txtuserinput.Name = "txtuserinput"; + this.txtuserinput.Size = new System.Drawing.Size(256, 23); + this.txtuserinput.TabIndex = 8; + this.txtuserinput.TextAlign = ShiftUI.HorizontalAlignment.Center; + this.txtuserinput.Visible = false; + // + // btnok + // + //this.btnok.Anchor = ((ShiftUI.AnchorStyles)(((ShiftUI.AnchorStyles.Bottom | ShiftUI.AnchorStyles.Left) | ShiftUI.AnchorStyles.Right))); + this.btnok.FlatStyle = ShiftUI.FlatStyle.Standard; + this.btnok.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnok.ForeColor = System.Drawing.Color.Black; + this.btnok.Location = new System.Drawing.Point(134, 88); + this.btnok.Name = "btnok"; + this.btnok.Size = new System.Drawing.Size(109, 30); + this.btnok.TabIndex = 7; + this.btnok.TabStop = false; + this.btnok.Text = "Ok"; + this.btnok.UseVisualStyleBackColor = true; + this.btnok.Click += new System.EventHandler(this.btnok_Click); + // + // txtmessage + // + //this.txtmessage.Anchor = ((ShiftUI.AnchorStyles)(((ShiftUI.AnchorStyles.Top | ShiftUI.AnchorStyles.Bottom) | ShiftUI.AnchorStyles.Right))); + this.txtmessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtmessage.Location = new System.Drawing.Point(102, 7); + this.txtmessage.Name = "txtmessage"; + this.txtmessage.Size = new System.Drawing.Size(266, 75); + this.txtmessage.TabIndex = 2; + this.txtmessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // pboximage + // + this.pboximage.Image = global::ShiftOS.Properties.Resources.Symbolinfo1; + this.pboximage.Location = new System.Drawing.Point(12, 17); + this.pboximage.Name = "pboximage"; + this.pboximage.Size = new System.Drawing.Size(80, 70); + this.pboximage.TabIndex = 0; + this.pboximage.TabStop = false; + // + // lblintructtext + // + //this.lblintructtext.Anchor = ((ShiftUI.AnchorStyles)(((ShiftUI.AnchorStyles.Top | ShiftUI.AnchorStyles.Bottom) | ShiftUI.AnchorStyles.Right))); + this.lblintructtext.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.lblintructtext.Location = new System.Drawing.Point(105, 7); + this.lblintructtext.Name = "lblintructtext"; + this.lblintructtext.Size = new System.Drawing.Size(256, 56); + this.lblintructtext.TabIndex = 9; + this.lblintructtext.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.lblintructtext.Visible = false; + // + // pnlyesno + // + //this.pnlyesno.Anchor = ((ShiftUI.AnchorStyles)(((ShiftUI.AnchorStyles.Bottom | ShiftUI.AnchorStyles.Left) | ShiftUI.AnchorStyles.Right))); + this.pnlyesno.Widgets.Add(this.btnno); + this.pnlyesno.Widgets.Add(this.btnyes); + this.pnlyesno.Location = new System.Drawing.Point(57, 85); + this.pnlyesno.Name = "pnlyesno"; + this.pnlyesno.Size = new System.Drawing.Size(269, 33); + this.pnlyesno.TabIndex = 10; + this.pnlyesno.Visible = false; + // + // btnno + // + this.btnno.FlatStyle = ShiftUI.FlatStyle.Standard; + this.btnno.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnno.ForeColor = System.Drawing.Color.Black; + this.btnno.Location = new System.Drawing.Point(142, 2); + this.btnno.Name = "btnno"; + this.btnno.Size = new System.Drawing.Size(105, 30); + this.btnno.TabIndex = 9; + this.btnno.TabStop = false; + this.btnno.Text = "No"; + this.btnno.UseVisualStyleBackColor = true; + this.btnno.Click += new System.EventHandler(this.btnno_Click); + // + // btnyes + // + this.btnyes.FlatStyle = ShiftUI.FlatStyle.Standard; + this.btnyes.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnyes.ForeColor = System.Drawing.Color.Black; + this.btnyes.Location = new System.Drawing.Point(29, 2); + this.btnyes.Name = "btnyes"; + this.btnyes.Size = new System.Drawing.Size(105, 30); + this.btnyes.TabIndex = 8; + this.btnyes.TabStop = false; + this.btnyes.Text = "Yes"; + this.btnyes.UseVisualStyleBackColor = true; + this.btnyes.Click += new System.EventHandler(this.btnyes_Click); + // + // infobox + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = ShiftUI.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(371, 154); + this.Widgets.Add(this.pgcontents); + this.DoubleBuffered = true; + this.FormBorderStyle = ShiftUI.FormBorderStyle.None; + this.KeyPreview = true; + this.Name = "infobox"; + this.Text = "infobox"; + this.TopMost = true; + this.Load += new System.EventHandler(this.infobox_Load); + this.pgcontents.ResumeLayout(false); + this.pgcontents.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pboximage)).EndInit(); + this.pnlyesno.ResumeLayout(false); + this.ResumeLayout(false); + + } + internal ShiftUI.Panel pgcontents; + internal ShiftUI.Button btnok; + internal ShiftUI.Label txtmessage; + internal ShiftUI.PictureBox pboximage; + internal ShiftUI.Label lblintructtext; + internal ShiftUI.TextBox txtuserinput; + internal ShiftUI.Panel pnlyesno; + internal ShiftUI.Button btnno; + internal ShiftUI.Button btnyes; + } +}
\ No newline at end of file |
