Started on ClassicDropDown

This commit is contained in:
Alex-TIMEHACK 2017-10-24 13:55:39 +01:00
parent 72a2b98a29
commit 81cde79fcc
5 changed files with 297 additions and 3 deletions

View file

@ -95,7 +95,7 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="UI\ClassicDropDown.cs">
<SubType>Component</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\ClassicDropDown.Designer.cs">
<DependentUpon>ClassicDropDown.cs</DependentUpon>
@ -148,6 +148,9 @@
<EmbeddedResource Include="Template\WinXP.resx">
<DependentUpon>WinXP.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ClassicDropDown.resx">
<DependentUpon>ClassicDropDown.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ClassicTextBox.resx">
<DependentUpon>ClassicTextBox.cs</DependentUpon>
</EmbeddedResource>

View file

@ -28,10 +28,104 @@ protected override void Dispose(bool disposing)
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.textBox1 = new System.Windows.Forms.TextBox();
this.pictureBox1 = 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.pictureBox1)).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;
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Right;
this.pictureBox1.Image = global::Histacom2.Engine.Properties.Resources.ClassicDropDownButton;
this.pictureBox1.Location = new System.Drawing.Point(82, 2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(16, 16);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 10;
this.pictureBox1.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 = 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.pictureBox1);
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);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).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 pictureBox1;
}
}

View file

@ -12,9 +12,70 @@ namespace Histacom2.Engine.UI
{
public partial class ClassicDropDown : UserControl
{
public bool UseSystemPasswordChar { get; set; }
public static Color textboxcolor = Color.Black;
public static Color _lightBack = Color.Silver;
public static Color _darkBack = Color.Silver;
public ClassicDropDown()
{
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;
else textBox1.BackColor = Color.White;
if (SaveSystem.currentTheme != null)
{
textboxcolor = SaveSystem.currentTheme.windowColor;
_lightBack = Paintbrush.GetLightFromColor(textboxcolor);
_darkBack = Paintbrush.GetDarkFromColor(textboxcolor);
}
});
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 { }
}
}
}

View file

@ -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>

View file

@ -55,6 +55,7 @@ private void InitializeComponent()
this.bottomleftcorner = new System.Windows.Forms.Panel();
this.topleftcorner = new System.Windows.Forms.Panel();
this.pnlSave = new System.Windows.Forms.Panel();
this.classicDropDown1 = new Histacom2.Engine.UI.ClassicDropDown();
this.txtSave = new Histacom2.Engine.UI.ClassicTextBox();
this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel();
this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel();
@ -283,6 +284,7 @@ private void InitializeComponent()
//
// pnlSave
//
this.pnlSave.Controls.Add(this.classicDropDown1);
this.pnlSave.Controls.Add(this.txtSave);
this.pnlSave.Controls.Add(this.classicLabel2);
this.pnlSave.Controls.Add(this.classicLabel1);
@ -295,6 +297,17 @@ private void InitializeComponent()
this.pnlSave.TabIndex = 18;
this.pnlSave.Visible = false;
//
// classicDropDown1
//
this.classicDropDown1.BackColor = System.Drawing.Color.White;
this.classicDropDown1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.classicDropDown1.Location = new System.Drawing.Point(56, 31);
this.classicDropDown1.Name = "classicDropDown1";
this.classicDropDown1.Size = new System.Drawing.Size(549, 20);
this.classicDropDown1.TabIndex = 23;
this.classicDropDown1.Text = "classicDropDown1";
this.classicDropDown1.UseSystemPasswordChar = false;
//
// txtSave
//
this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -309,14 +322,16 @@ private void InitializeComponent()
//
// classicLabel2
//
this.classicLabel2.DropShadow = false;
this.classicLabel2.Location = new System.Drawing.Point(3, 32);
this.classicLabel2.Name = "classicLabel2";
this.classicLabel2.Size = new System.Drawing.Size(64, 13);
this.classicLabel2.TabIndex = 19;
this.classicLabel2.Text = "File name:";
this.classicLabel2.Text = "File type:";
//
// classicLabel1
//
this.classicLabel1.DropShadow = false;
this.classicLabel1.Location = new System.Drawing.Point(3, 6);
this.classicLabel1.Name = "classicLabel1";
this.classicLabel1.Size = new System.Drawing.Size(64, 13);
@ -411,5 +426,6 @@ private void InitializeComponent()
private Engine.UI.ClassicLabel classicLabel2;
private Engine.UI.ClassicLabel classicLabel1;
private Engine.UI.ClassicTextBox txtSave;
private Engine.UI.ClassicDropDown classicDropDown1;
}
}