aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine/UI
diff options
context:
space:
mode:
Diffstat (limited to 'Histacom2.Engine/UI')
-rw-r--r--Histacom2.Engine/UI/ClassicDropDown.Designer.cs133
-rw-r--r--Histacom2.Engine/UI/ClassicDropDown.cs178
-rw-r--r--Histacom2.Engine/UI/ClassicDropDown.resx120
-rw-r--r--Histacom2.Engine/UI/ClassicTextBox.Designer.cs115
-rw-r--r--Histacom2.Engine/UI/ClassicTextBox.resx120
-rw-r--r--Histacom2.Engine/UI/ClassicTextbox.cs112
6 files changed, 750 insertions, 28 deletions
diff --git a/Histacom2.Engine/UI/ClassicDropDown.Designer.cs b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs
new file mode 100644
index 0000000..509c04d
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs
@@ -0,0 +1,133 @@
+namespace Histacom2.Engine.UI
+{
+ partial class ClassicDropDown
+ {
+ /// <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.textBox1 = new System.Windows.Forms.TextBox();
+ this.dropDownSwitch = new System.Windows.Forms.PictureBox();
+ this.tborder = new System.Windows.Forms.PictureBox();
+ this.bborder = new System.Windows.Forms.PictureBox();
+ this.rborder = new System.Windows.Forms.PictureBox();
+ this.lborder = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.dropDownSwitch)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.tborder)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.bborder)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.rborder)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.lborder)).BeginInit();
+ this.SuspendLayout();
+ //
+ // textBox1
+ //
+ this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.textBox1.Location = new System.Drawing.Point(2, 2);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(96, 13);
+ this.textBox1.TabIndex = 9;
+ //
+ // dropDownSwitch
+ //
+ this.dropDownSwitch.Dock = System.Windows.Forms.DockStyle.Right;
+ this.dropDownSwitch.Image = global::Histacom2.Engine.Properties.Resources.ClassicDropDownButton;
+ this.dropDownSwitch.Location = new System.Drawing.Point(82, 2);
+ this.dropDownSwitch.Name = "dropDownSwitch";
+ this.dropDownSwitch.Size = new System.Drawing.Size(16, 16);
+ this.dropDownSwitch.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+ this.dropDownSwitch.TabIndex = 10;
+ this.dropDownSwitch.TabStop = false;
+ this.dropDownSwitch.Click += new System.EventHandler(this.dropDownSwitch_Click);
+ //
+ // tborder
+ //
+ this.tborder.Dock = System.Windows.Forms.DockStyle.Top;
+ this.tborder.Location = new System.Drawing.Point(2, 0);
+ this.tborder.Name = "tborder";
+ this.tborder.Size = new System.Drawing.Size(96, 2);
+ this.tborder.TabIndex = 8;
+ this.tborder.TabStop = false;
+ //
+ // bborder
+ //
+ this.bborder.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.bborder.Location = new System.Drawing.Point(2, 18);
+ this.bborder.Name = "bborder";
+ this.bborder.Size = new System.Drawing.Size(96, 2);
+ this.bborder.TabIndex = 5;
+ this.bborder.TabStop = false;
+ //
+ // rborder
+ //
+ this.rborder.Dock = System.Windows.Forms.DockStyle.Right;
+ this.rborder.Location = new System.Drawing.Point(98, 0);
+ this.rborder.Name = "rborder";
+ this.rborder.Size = new System.Drawing.Size(2, 20);
+ this.rborder.TabIndex = 7;
+ this.rborder.TabStop = false;
+ //
+ // lborder
+ //
+ this.lborder.Dock = System.Windows.Forms.DockStyle.Left;
+ this.lborder.Location = new System.Drawing.Point(0, 0);
+ this.lborder.Name = "lborder";
+ this.lborder.Size = new System.Drawing.Size(2, 20);
+ this.lborder.TabIndex = 6;
+ this.lborder.TabStop = false;
+ //
+ // ClassicDropDown
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.dropDownSwitch);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.tborder);
+ this.Controls.Add(this.bborder);
+ this.Controls.Add(this.rborder);
+ this.Controls.Add(this.lborder);
+ this.Name = "ClassicDropDown";
+ this.Size = new System.Drawing.Size(100, 20);
+ this.Load += new System.EventHandler(this.ClassicDropDown_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dropDownSwitch)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.tborder)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.bborder)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.rborder)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.lborder)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.PictureBox tborder;
+ private System.Windows.Forms.PictureBox bborder;
+ private System.Windows.Forms.PictureBox rborder;
+ private System.Windows.Forms.PictureBox lborder;
+ private System.Windows.Forms.PictureBox dropDownSwitch;
+ }
+}
diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs
new file mode 100644
index 0000000..e01ca2a
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicDropDown.cs
@@ -0,0 +1,178 @@
+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 Histacom2.Engine.Template;
+
+namespace Histacom2.Engine.UI
+{
+ public partial class ClassicDropDown : UserControl
+ {
+ public DropDownOverlay thisOverlay = new DropDownOverlay();
+ public bool dropDownShown;
+
+ public override string Text
+ {
+ get
+ {
+ return textBox1.Text;
+ }
+ set
+ {
+ textBox1.Text = value;
+ }
+ }
+
+ public bool UseSystemPasswordChar
+ {
+ get
+ {
+ return textBox1.UseSystemPasswordChar;
+ }
+ set
+ {
+ textBox1.UseSystemPasswordChar = value;
+ }
+ }
+
+ public static Color textboxcolor = Color.Black;
+
+ public static Color _lightBack = Color.Silver;
+ public static Color _darkBack = Color.Silver;
+
+ public List<string> Items { get; set; } = new List<string>();
+
+ public ClassicDropDown()
+ {
+ InitializeComponent();
+
+
+ try
+ {
+ // Draw the border
+
+ this.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ // Update a bunch of variables!
+ textBox1.Font = Font;
+
+ if (SaveSystem.currentTheme != null)
+ {
+ textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+
+ textboxcolor = SaveSystem.currentTheme.windowColor;
+
+ _lightBack = Paintbrush.GetLightFromColor(textboxcolor);
+ _darkBack = Paintbrush.GetDarkFromColor(textboxcolor);
+ }
+ else
+ {
+ textBox1.BackColor = Color.White;
+ BackColor = Color.White;
+ }
+ });
+
+
+
+ tborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, tborder.Width, 0);
+ e.Graphics.DrawLine(Pens.Black, 0, 1, tborder.Width, 1);
+
+ });
+
+ lborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, 0, Height);
+ e.Graphics.DrawLine(Pens.Black, 1, 0, 1, Height);
+ });
+
+ rborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, 0, Height - 1);
+ e.Graphics.DrawLine(new Pen(textboxcolor), 1, 0, 1, Height - 1);
+ });
+
+ bborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, Width - 1, 0);
+ e.Graphics.DrawLine(new Pen(textboxcolor), 0, 1, Width - 2, 1);
+ });
+
+ tborder.Invalidate();
+ lborder.Invalidate();
+ rborder.Invalidate();
+ bborder.Invalidate();
+ }
+ catch { }
+ }
+
+ public void ChooseItem(string str)
+ {
+ textBox1.Text = str;
+ ShowHideDropDown();
+ }
+
+ public void ShowHideDropDown()
+ {
+ if (dropDownShown)
+ {
+ thisOverlay.Close();
+ dropDownShown = false;
+ } else {
+ thisOverlay = new DropDownOverlay();
+ int applyHeight = 0;
+ foreach (string str in Items)
+ {
+ DropDownItem itm = new DropDownItem();
+ itm.ChangeText(str, Font);
+ itm.dpdw = this;
+ itm.Dock = DockStyle.Top;
+ applyHeight += itm.Height;
+ thisOverlay.outline.Controls.Add(itm);
+ }
+ thisOverlay.outline.Location = this.PointToScreen(Point.Empty);
+ thisOverlay.outline.Top += this.Height;
+ thisOverlay.outline.Size = new Size(this.Width, applyHeight);
+
+ thisOverlay.Deactivate += (sender2, e2) => { thisOverlay.Close(); dropDownShown = false; };
+
+ thisOverlay.Show();
+ dropDownShown = true;
+ }
+ }
+
+ private void dropDownSwitch_Click(object sender, EventArgs e)
+ {
+ ShowHideDropDown();
+ }
+
+ private void ClassicDropDown_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ ((Form)this.TopLevelControl).FormClosed += (sender2, e2) => { thisOverlay.Close(); };
+ ((Form)this.TopLevelControl).Resize += (sender2, e2) =>
+ {
+ thisOverlay.outline.Location = this.PointToScreen(Point.Empty);
+ thisOverlay.outline.Top += this.Height;
+ thisOverlay.BringToFront();
+ };
+
+ ((Form)this.TopLevelControl).Move += (sender2, e2) =>
+ {
+ thisOverlay.outline.Location = this.PointToScreen(Point.Empty);
+ thisOverlay.outline.Top += this.Height;
+ thisOverlay.BringToFront();
+ };
+ } catch { }
+
+ }
+ }
+}
diff --git a/Histacom2.Engine/UI/ClassicDropDown.resx b/Histacom2.Engine/UI/ClassicDropDown.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicDropDown.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/Histacom2.Engine/UI/ClassicTextBox.Designer.cs b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs
new file mode 100644
index 0000000..06df3fb
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs
@@ -0,0 +1,115 @@
+namespace Histacom2.Engine.UI
+{
+ partial class ClassicTextBox
+ {
+ /// <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.bborder = new System.Windows.Forms.PictureBox();
+ this.lborder = new System.Windows.Forms.PictureBox();
+ this.rborder = new System.Windows.Forms.PictureBox();
+ this.tborder = new System.Windows.Forms.PictureBox();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ ((System.ComponentModel.ISupportInitialize)(this.bborder)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.lborder)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.rborder)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.tborder)).BeginInit();
+ this.SuspendLayout();
+ //
+ // bborder
+ //
+ this.bborder.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.bborder.Location = new System.Drawing.Point(2, 18);
+ this.bborder.Name = "bborder";
+ this.bborder.Size = new System.Drawing.Size(96, 2);
+ this.bborder.TabIndex = 0;
+ this.bborder.TabStop = false;
+ //
+ // lborder
+ //
+ this.lborder.Dock = System.Windows.Forms.DockStyle.Left;
+ this.lborder.Location = new System.Drawing.Point(0, 0);
+ this.lborder.Name = "lborder";
+ this.lborder.Size = new System.Drawing.Size(2, 20);
+ this.lborder.TabIndex = 1;
+ this.lborder.TabStop = false;
+ //
+ // rborder
+ //
+ this.rborder.Dock = System.Windows.Forms.DockStyle.Right;
+ this.rborder.Location = new System.Drawing.Point(98, 0);
+ this.rborder.Name = "rborder";
+ this.rborder.Size = new System.Drawing.Size(2, 20);
+ this.rborder.TabIndex = 2;
+ this.rborder.TabStop = false;
+ //
+ // tborder
+ //
+ this.tborder.Dock = System.Windows.Forms.DockStyle.Top;
+ this.tborder.Location = new System.Drawing.Point(2, 0);
+ this.tborder.Name = "tborder";
+ this.tborder.Size = new System.Drawing.Size(96, 2);
+ this.tborder.TabIndex = 3;
+ this.tborder.TabStop = false;
+ //
+ // textBox1
+ //
+ this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.textBox1.Location = new System.Drawing.Point(2, 2);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(96, 13);
+ this.textBox1.TabIndex = 4;
+ //
+ // ClassicTextBox
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.tborder);
+ this.Controls.Add(this.bborder);
+ this.Controls.Add(this.rborder);
+ this.Controls.Add(this.lborder);
+ this.Name = "ClassicTextBox";
+ this.Size = new System.Drawing.Size(100, 20);
+ ((System.ComponentModel.ISupportInitialize)(this.bborder)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.lborder)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.rborder)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.tborder)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.PictureBox bborder;
+ private System.Windows.Forms.PictureBox lborder;
+ private System.Windows.Forms.PictureBox rborder;
+ private System.Windows.Forms.PictureBox tborder;
+ private System.Windows.Forms.TextBox textBox1;
+ }
+}
diff --git a/Histacom2.Engine/UI/ClassicTextBox.resx b/Histacom2.Engine/UI/ClassicTextBox.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicTextBox.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/Histacom2.Engine/UI/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs
index e38af16..4847ed5 100644
--- a/Histacom2.Engine/UI/ClassicTextbox.cs
+++ b/Histacom2.Engine/UI/ClassicTextbox.cs
@@ -1,6 +1,8 @@
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;
@@ -8,47 +10,101 @@ using System.Windows.Forms;
namespace Histacom2.Engine.UI
{
- public class ClassicTextbox : Control
+ public partial class ClassicTextBox : UserControl
{
- public bool UseSystemPasswordChar { get; set; }
+ public static Color textboxcolor = Color.Black;
- public ClassicTextbox() : base()
+ public static Color _lightBack = Color.Silver;
+ public static Color _darkBack = Color.Silver;
+
+ public override string Text
{
- if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
- else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+ get
+ {
+ return textBox1.Text;
+ }
+ set
+ {
+ textBox1.Text = value;
+ }
}
- protected override void OnPaint(PaintEventArgs e)
+ public bool UseSystemPasswordChar
{
- base.OnPaint(e);
+ get
+ {
+ return textBox1.UseSystemPasswordChar;
+ }
+ set
+ {
+ textBox1.UseSystemPasswordChar = value;
+ }
+ }
+
+ public ClassicTextBox()
+ {
+ InitializeComponent();
+
+ try
+ {
+ // Draw the border
+
+ this.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ // Update a bunch of variables!
+ textBox1.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+
+ if (SaveSystem.currentTheme != null)
+ {
+ textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ }
+ else
+ {
+ textBox1.BackColor = Color.White;
+ BackColor = Color.White;
+ }
+
+ if (SaveSystem.currentTheme != null)
+ {
+ textboxcolor = SaveSystem.currentTheme.windowColor;
+
+ _lightBack = Paintbrush.GetLightFromColor(textboxcolor);
+ _darkBack = Paintbrush.GetDarkFromColor(textboxcolor);
+ }
+ });
- var textboxcolor = Color.Silver;
- if (SaveSystem.currentTheme != null) textboxcolor = SaveSystem.currentTheme.windowColor;
- if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor;
- else BackColor = Color.White;
+ tborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, tborder.Width, 0);
+ e.Graphics.DrawLine(Pens.Black, 0, 1, tborder.Width, 1);
- var _lightBack = Paintbrush.GetLightFromColor(textboxcolor);
- var _darkBack = Paintbrush.GetDarkFromColor(textboxcolor);
+ });
- if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
- else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+ lborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, 0, Height);
+ e.Graphics.DrawLine(Pens.Black, 1, 0, 1, Height);
+ });
- var g = e.Graphics;
- g.Clear(BackColor);
+ rborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, 0, Height - 1);
+ e.Graphics.DrawLine(new Pen(textboxcolor), 1, 0, 1, Height - 1);
+ });
- g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
- if (UseSystemPasswordChar) g.DrawString(new string('●', Text.Length), Font, Brushes.Black, 3, 3);
- else g.DrawString(Text, Font, Brushes.Black, 3, 3);
+ bborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
+ {
+ e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, Width - 1, 0);
+ e.Graphics.DrawLine(new Pen(textboxcolor), 0, 1, Width - 2, 1);
+ });
- g.DrawLine(new Pen(_darkBack), 0, 0, Width - 2, 0);
- g.DrawLine(new Pen(_lightBack), Width - 1, 0, Width - 1, Height - 1);
- g.DrawLine(new Pen(_lightBack), 0, Height - 1, Width - 1, Height - 1);
- g.DrawLine(new Pen(_darkBack), 0, 0, 0, Height - 2);
- g.DrawLine(Pens.Black, 1, 1, Width - 3, 1);
- g.DrawLine(Pens.Black, 1, 1, 1, Height - 3);
- g.DrawLine(new Pen(textboxcolor), 1, Height - 2, Width - 2, Height - 2);
- g.DrawLine(new Pen(textboxcolor), Width - 2, Height - 2, Width - 2, 1);
+ tborder.Invalidate();
+ lborder.Invalidate();
+ rborder.Invalidate();
+ bborder.Invalidate();
+ } catch { }
}
}
}