diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-10-24 11:18:12 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-10-24 11:18:12 +0100 |
| commit | e5f29e7b53322e11578acd0deb3b1d454998bb77 (patch) | |
| tree | 7cca33ae9ec7e8ea09fdd20a23a69a52d734d1c4 | |
| parent | 350e749bb9eab16efe753f9b8fd703b52a97f808 (diff) | |
| download | histacom2-e5f29e7b53322e11578acd0deb3b1d454998bb77.tar.gz histacom2-e5f29e7b53322e11578acd0deb3b1d454998bb77.tar.bz2 histacom2-e5f29e7b53322e11578acd0deb3b1d454998bb77.zip | |
All new ClassicTextBox
18 files changed, 869 insertions, 137 deletions
diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj index 889c071..57d6bbb 100644 --- a/Histacom2.Engine/Histacom2.Engine.csproj +++ b/Histacom2.Engine/Histacom2.Engine.csproj @@ -94,15 +94,25 @@ <Compile Include="UI\ClassicButton.cs"> <SubType>Component</SubType> </Compile> + <Compile Include="UI\ClassicDropDown.cs"> + <SubType>Component</SubType> + </Compile> + <Compile Include="UI\ClassicDropDown.Designer.cs"> + <DependentUpon>ClassicDropDown.cs</DependentUpon> + </Compile> <Compile Include="UI\ClassicLabel.cs"> <SubType>Component</SubType> </Compile> <Compile Include="UI\ClassicStartMenuItem.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="UI\ClassicTextbox.cs"> - <SubType>Component</SubType> + <Compile Include="UI\ClassicTextBox.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="UI\ClassicTextBox.Designer.cs"> + <DependentUpon>ClassicTextBox.cs</DependentUpon> </Compile> + <Compile Include="UI\OldClassicTextbox.cs" /> <Compile Include="UI\IProgressBar.cs"> <SubType>Component</SubType> </Compile> @@ -138,9 +148,13 @@ <EmbeddedResource Include="Template\WinXP.resx"> <DependentUpon>WinXP.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="UI\ClassicTextBox.resx"> + <DependentUpon>ClassicTextBox.cs</DependentUpon> + </EmbeddedResource> </ItemGroup> <ItemGroup> <Content Include="Resources\chord.wav" /> + <None Include="Resources\ClassicDropDownButton.png" /> <Content Include="Resources\Icon128x.ico" /> <Content Include="Resources\WinXP\Window\WinXP_Bottom.png" /> <Content Include="Resources\WinXP\Window\WinXP_Close.png" /> diff --git a/Histacom2.Engine/Properties/Resources.Designer.cs b/Histacom2.Engine/Properties/Resources.Designer.cs index 949a91c..a65020b 100644 --- a/Histacom2.Engine/Properties/Resources.Designer.cs +++ b/Histacom2.Engine/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Histacom2.Engine.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -70,6 +70,16 @@ namespace Histacom2.Engine.Properties { } /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap ClassicDropDownButton { + get { + object obj = ResourceManager.GetObject("ClassicDropDownButton", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> /// Looks up a localized resource of type System.Byte[]. /// </summary> public static byte[] LeviWindows { diff --git a/Histacom2.Engine/Properties/Resources.resx b/Histacom2.Engine/Properties/Resources.resx index a6faf66..122ea03 100644 --- a/Histacom2.Engine/Properties/Resources.resx +++ b/Histacom2.Engine/Properties/Resources.resx @@ -265,4 +265,7 @@ <data name="WinXP_TopRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\resources\winxp\window\winxp_trcorner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="ClassicDropDownButton" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\ClassicDropDownButton.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root>
\ No newline at end of file diff --git a/Histacom2.Engine/Resources/ClassicDropDownButton.png b/Histacom2.Engine/Resources/ClassicDropDownButton.png Binary files differnew file mode 100644 index 0000000..4cdc12f --- /dev/null +++ b/Histacom2.Engine/Resources/ClassicDropDownButton.png diff --git a/Histacom2.Engine/Template/WinClassic.Designer.cs b/Histacom2.Engine/Template/WinClassic.Designer.cs index 8463041..f788517 100644 --- a/Histacom2.Engine/Template/WinClassic.Designer.cs +++ b/Histacom2.Engine/Template/WinClassic.Designer.cs @@ -287,7 +287,6 @@ this.Text = "WinClassic"; this.Activated += new System.EventHandler(this.WinClassic_Activated); this.Deactivate += new System.EventHandler(this.WinClassic_Deactivate); - this.Paint += new System.Windows.Forms.PaintEventHandler(this.WinClassic_Paint); this.program.ResumeLayout(false); this.programtopbar.ResumeLayout(false); this.programtopbar.PerformLayout(); diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 25cbfaa..988f268 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -165,15 +165,6 @@ namespace Histacom2.Engine.Template } } - private void WinClassic_Paint(object sender, PaintEventArgs e) - { - if (Resizing) - { - MessageBox.Show("HIT IT"); - e.Graphics.DrawImage(ResizingBmp, 0, 0, this.Width, this.Height); - } - } - private void border_MouseUp(object sender, MouseEventArgs e) { this.Bounds = resizer.ToDraw; diff --git a/Histacom2.Engine/UI/ClassicDropDown.Designer.cs b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs new file mode 100644 index 0000000..2925f72 --- /dev/null +++ b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs @@ -0,0 +1,36 @@ +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() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs new file mode 100644 index 0000000..85c509a --- /dev/null +++ b/Histacom2.Engine/UI/ClassicDropDown.cs @@ -0,0 +1,306 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.UI +{ + //public class CustomTextBox : NativeWindow + //{ + // private TextBox parentTextBox; + // private Bitmap bitmap; + // private Graphics textBoxGraphics; + // private Graphics bufferGraphics; + // // this is where we intercept the Paint event for the TextBox at the OS level + // protected override void WndProc(ref Message m) + // { + // switch (m.Msg) + // { + // case 15: // this is the WM_PAINT message + // // invalidate the TextBox so that it gets refreshed properly + // parentTextBox.Invalidate(); + // // call the default win32 Paint method for the TextBox first + // base.WndProc(ref m); + // // now use our code to draw extra stuff over the TextBox + // this.CustomPaint(); + // break; + // default: + // base.WndProc(ref m); + // break; + // } + // } + // public CustomTextBox(TextBox textBox) + // { + // this.parentTextBox = textBox; + // this.bitmap = new Bitmap(textBox.Width, textBox.Height); + // this.bufferGraphics = Graphics.FromImage(this.bitmap); + // this.bufferGraphics.Clip = new Region(textBox.ClientRectangle); + // this.textBoxGraphics = Graphics.FromHwnd(textBox.Handle); + // // Start receiving messages (make sure you call ReleaseHandle on Dispose): + // this.AssignHandle(textBox.Handle); + // } + // private void CustomPaint() + // { + // // code goes here, see below + // } + //} + + public partial class ClassicDropDown : Control + { + public TextBox tb = new TextBox(); + public bool UseSystemPasswordChar { get; set; } + public int CursorPosition { get; set; } + private Timer CursorBlink { get; set; } + private bool _cursorVisible { get; set; } + + public ClassicDropDown() : base() + { + if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont; + else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); + + DoubleBuffered = true; + + CursorBlink = new Timer(); + CursorBlink.Interval = 1000; + + // The stuff that make the textbox "work" + + MouseDown += new MouseEventHandler(PerformMouseDown); + MouseUp += new MouseEventHandler(PerformMouseUp); + + PreviewKeyDown += (s, e) => + { + e.IsInputKey = true; + }; + + //KeyDown += new KeyEventHandler(PerformKeyDown); + + // Remove the default textbox paint event so that we can have our own! ACTUALLY, NO! + + //FieldInfo f1 = typeof(Control).GetField("EventPaint", + // BindingFlags.Static | BindingFlags.NonPublic); + //object obj = f1.GetValue(this); + //PropertyInfo pi = GetType().GetProperty("Events", + // BindingFlags.NonPublic | BindingFlags.Instance); + //EventHandlerList list = (EventHandlerList)pi.GetValue(this, null); + //list.RemoveHandler(obj, list[obj]); + + //tb.Paint += new PaintEventHandler(PerformPaint); + //TextChanged += new EventHandler(PerformTextChanged); + //CursorBlink.Tick += new EventHandler(PerformCursorBlink); + + //CursorBlink.Start(); + + // I know it's a bit of a hack but it's all we can really do... + tb.Size = new Size(this.Size.Width - 6, this.Size.Height - 6); + tb.Location = new Point(3, 3); + tb.BorderStyle = BorderStyle.None; + Controls.Add(tb); + + + } + + protected override void OnPaint(PaintEventArgs e) + { + var textboxcolor = Color.Silver; + if (SaveSystem.currentTheme != null) textboxcolor = SaveSystem.currentTheme.windowColor; + + if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor; + else BackColor = Color.White; + + 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); + + var g = e.Graphics; + g.Clear(BackColor); + + //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); + + 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); + + Size textSize = MeasureText(Text.Substring(0, CursorPosition), Font); // Get the width of the text from the begining to the cursor's position so it can draw the cursor. + + if (_cursorVisible) g.DrawLine(new Pen(Color.Gray), textSize.Width + 3, 4, textSize.Width + 3, Height - 4); // This is the caret! + g.DrawImage(Properties.Resources.ClassicDropDownButton, Width - 17, 2); + + base.OnPaint(e); + + } + + private void PerformMouseDown(object sender, MouseEventArgs e) + { + // TextBox: + + base.Focus(); + + // First check if it is in the bounds of the actual box + if (e.X < Width - 18 && e.X > 3 && e.Y > 3 && e.Y < Width - 2) + { + // Now to get where on text you are clicking... this is very tricky because different characters are different widths... + int Sum = 0; + int i = 0; + + foreach (char character in Text) + { + + Sum += MeasureText(character.ToString(), Font).Width; + + if (e.X - 3 <= Sum) break; + + //LastSum = Sum; + i++; + } + + //setCurPos = (Sum == 0) ? Text.Length : Sum; + //if (setCurPos > Text.Length) setCurPos = Text.Length; + CursorPosition = i; // This sets the cursor position! + } + _cursorVisible = true; + + // DropDown: + + + Invalidate(); + } + + private void PerformMouseUp(object sender, MouseEventArgs e) + { + // DropDown: + + + } + + private void PerformKeyDown(object sender, KeyEventArgs e) + { + // TextBox: + + switch (e.KeyCode) + { + case Keys.Back: + Text = Text.Remove(CursorPosition - 1, 1); + break; + case Keys.Delete: + if (!(CursorPosition > Text.Length + 1)) Text = Text.Remove(CursorPosition, 1); + break; + case Keys.Home: + CursorPosition = 0; + break; + case Keys.End: + CursorPosition = Text.Length; + break; + case Keys.Left: + if (CursorPosition > 0) CursorPosition -= 1; + break; + case Keys.Right: + if (CursorPosition < Text.Length) CursorPosition += 1; + break; + case Keys.Return: + break; + case Keys.Space: + Text = Text.Insert(CursorPosition, " "); + CursorPosition = CursorPosition + 1; + break; + default: + bool caps = false; + + if (e.Shift) caps = true; + if (Control.IsKeyLocked(Keys.CapsLock)) caps = true; + + if (char.IsLetterOrDigit((char)e.KeyCode)) + { + // Now the numbers 1, 2, 3 etc. are "d1", "d2" etc. - STUPID, RIGHT? So now we have to check if it has a number and contains "d". + + bool handled = false; + + if (StrContainsNumber(e.KeyCode.ToString().ToLower())) + { + if (e.KeyCode.ToString().ToLower().Contains("d")) + { + handled = true; + Text = Text.Insert(CursorPosition, e.KeyCode.ToString().Replace("d", "")); + } + } + + if (handled == false) + { + if (caps == false) Text = Text.Insert(CursorPosition, e.KeyCode.ToString().ToLower()); else Text = Text.Insert(CursorPosition, e.KeyCode.ToString().ToUpper()); + } + CursorPosition = CursorPosition + 1; + } + break; + } + + _cursorVisible = true; + Invalidate(); + } + + private void PerformCursorBlink(object sender, EventArgs e) + { + if (_cursorVisible) _cursorVisible = false; + else _cursorVisible = true; + Invalidate(); + } + + private void PerformTextChanged(object sender, EventArgs e) + { + _cursorVisible = true; + if (CursorPosition >= Text.Length) CursorPosition = Text.Length; + Invalidate(); + } + + public static Size MeasureText(string Text, Font Font) + { + TextFormatFlags flags + = TextFormatFlags.Left + | TextFormatFlags.Top + | TextFormatFlags.NoPadding + | TextFormatFlags.NoPrefix; + Size szProposed = new Size(int.MaxValue, int.MaxValue); + Size sz1 = TextRenderer.MeasureText(".", Font, szProposed, flags); + Size sz2 = TextRenderer.MeasureText(Text + ".", Font, szProposed, flags); + return new Size(sz2.Width - sz1.Width, sz2.Height); + } + + public bool StrContainsNumber(string str) + { + foreach (char ch in str) + { + double unused; + if (double.TryParse(ch.ToString(), out unused)) return true; + } + return false; + } + + [DllImport("gdi32.dll")] + private static extern bool BitBlt( +IntPtr hdcDest, // handle to destination DC +int nXDest, // x-coord of destination upper-left corner +int nYDest, // y-coord of destination upper-left corner +int nWidth, // width of destination rectangle +int nHeight, // height of destination rectangle +IntPtr hdcSrc, // handle to source DC +int nXSrc, // x-coordinate of source upper-left corner +int nYSrc, // y-coordinate of source upper-left corner +System.Int32 dwRop // raster operation code +); + } +} diff --git a/Histacom2.Engine/UI/ClassicTextBox.Designer.cs b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs new file mode 100644 index 0000000..0e7148f --- /dev/null +++ b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs @@ -0,0 +1,117 @@ +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, 15); + 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, 17); + 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, 17); + 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.MaximumSize = new System.Drawing.Size(0, 17); + this.MinimumSize = new System.Drawing.Size(100, 17); + this.Name = "ClassicTextBox"; + this.Size = new System.Drawing.Size(100, 17); + ((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..8c1d8d8 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,72 @@ using System.Windows.Forms; namespace Histacom2.Engine.UI { - public class ClassicTextbox : Control + public partial class ClassicTextBox : UserControl { public bool UseSystemPasswordChar { get; set; } - public ClassicTextbox() : base() - { - if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont; - else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); - } + public static Color textboxcolor = Color.Black; - protected override void OnPaint(PaintEventArgs e) + public static Color _lightBack = Color.Silver; + public static Color _darkBack = Color.Silver; + + public ClassicTextBox() { - base.OnPaint(e); + InitializeComponent(); + + try + { + // Draw the border + + this.Paint += new PaintEventHandler((object sender, PaintEventArgs e) => + { + // Update a bunch of variables! + if (SaveSystem.currentTheme != null) textBox1.Font = SaveSystem.currentTheme.buttonFont; + else textBox1.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); + + if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor; + else 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 { } } } } diff --git a/Histacom2.Engine/UI/OldClassicTextbox.cs b/Histacom2.Engine/UI/OldClassicTextbox.cs new file mode 100644 index 0000000..f7db87d --- /dev/null +++ b/Histacom2.Engine/UI/OldClassicTextbox.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.UI +{ + //public class OldClassicTextbox : Control + //{ + // private System.ComponentModel.IContainer components = null; + // public TextBox tb = new TextBox(); + // public bool UseSystemPasswordChar { get; set; } + + // public ClassicTextbox() : base() + // { + // // A bunch of designer stuff! + // this.components = new System.ComponentModel.Container(); + // this.SuspendLayout(); + + // if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont; + // else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); + + // tb.Name = "mainText"; + // tb.Location = new Point(3, 3); + // tb.Size = new Size(Size.Width - 6, Size.Height - 6); + // tb.BorderStyle = BorderStyle.None; + // Controls.Add(tb); + + // this.ResumeLayout(false); + // } + + // protected override void Dispose(bool disposing) + // { + // if (disposing && (components != null)) + // { + // components.Dispose(); + // } + // base.Dispose(disposing); + // } + + // protected override void OnPaint(PaintEventArgs e) + // { + + // var textboxcolor = Color.Silver; + // if (SaveSystem.currentTheme != null) textboxcolor = SaveSystem.currentTheme.windowColor; + + // if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor; + // else BackColor = Color.White; + + // 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); + + // var g = e.Graphics; + // g.Clear(BackColor); + + // 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); + + // 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); + + // base.OnPaint(e); + // } +} diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index 8939b84..153018a 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -30,10 +30,6 @@ { this.components = new System.ComponentModel.Container(); this.program = new System.Windows.Forms.Panel(); - this.pnlSave = new System.Windows.Forms.Panel(); - this.Button1 = new System.Windows.Forms.Button(); - this.Label1 = new System.Windows.Forms.Label(); - this.txtSave = new System.Windows.Forms.TextBox(); this.mainView = new System.Windows.Forms.ListView(); this.diskView = new System.Windows.Forms.TreeView(); this.MenuStrip1 = new System.Windows.Forms.MenuStrip(); @@ -58,10 +54,16 @@ this.bottomrightcorner = new System.Windows.Forms.Panel(); this.bottomleftcorner = new System.Windows.Forms.Panel(); this.topleftcorner = new System.Windows.Forms.Panel(); + this.pnlSave = new System.Windows.Forms.Panel(); this.refresh = new System.Windows.Forms.Timer(this.components); + this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicButton1 = new Histacom2.Engine.UI.ClassicButton(); + this.btnSave = new Histacom2.Engine.UI.ClassicButton(); + this.txtSave = new Histacom2.Engine.UI.ClassicTextBox(); this.program.SuspendLayout(); - this.pnlSave.SuspendLayout(); this.MenuStrip1.SuspendLayout(); + this.pnlSave.SuspendLayout(); this.SuspendLayout(); // // program @@ -81,54 +83,12 @@ this.program.Size = new System.Drawing.Size(704, 517); this.program.TabIndex = 13; // - // pnlSave - // - this.pnlSave.Controls.Add(this.Button1); - this.pnlSave.Controls.Add(this.Label1); - this.pnlSave.Controls.Add(this.txtSave); - this.pnlSave.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlSave.Location = new System.Drawing.Point(0, 482); - this.pnlSave.Name = "pnlSave"; - this.pnlSave.Size = new System.Drawing.Size(704, 35); - this.pnlSave.TabIndex = 18; - this.pnlSave.Visible = false; - // - // Button1 - // - this.Button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.Button1.Location = new System.Drawing.Point(629, 1); - this.Button1.Name = "Button1"; - this.Button1.Size = new System.Drawing.Size(75, 23); - this.Button1.TabIndex = 17; - this.Button1.Text = "Save"; - this.Button1.UseVisualStyleBackColor = true; - this.Button1.Click += new System.EventHandler(this.Button1_Click); - // - // Label1 - // - this.Label1.AutoSize = true; - this.Label1.Location = new System.Drawing.Point(3, 6); - this.Label1.Name = "Label1"; - this.Label1.Size = new System.Drawing.Size(57, 13); - this.Label1.TabIndex = 16; - this.Label1.Text = "File Name:"; - // - // txtSave - // - this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSave.Location = new System.Drawing.Point(60, 3); - this.txtSave.Name = "txtSave"; - this.txtSave.Size = new System.Drawing.Size(563, 20); - this.txtSave.TabIndex = 15; - // // mainView // this.mainView.Dock = System.Windows.Forms.DockStyle.Fill; this.mainView.Location = new System.Drawing.Point(213, 24); this.mainView.Name = "mainView"; - this.mainView.Size = new System.Drawing.Size(491, 458); + this.mainView.Size = new System.Drawing.Size(491, 439); this.mainView.TabIndex = 10; this.mainView.UseCompatibleStateImageBehavior = false; this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit); @@ -139,7 +99,7 @@ this.diskView.Dock = System.Windows.Forms.DockStyle.Left; this.diskView.Location = new System.Drawing.Point(0, 24); this.diskView.Name = "diskView"; - this.diskView.Size = new System.Drawing.Size(213, 458); + this.diskView.Size = new System.Drawing.Size(213, 439); this.diskView.TabIndex = 13; this.diskView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.diskView_AfterSelect); // @@ -321,11 +281,84 @@ this.topleftcorner.Size = new System.Drawing.Size(4, 4); this.topleftcorner.TabIndex = 1; // + // pnlSave + // + this.pnlSave.Controls.Add(this.txtSave); + this.pnlSave.Controls.Add(this.classicLabel2); + this.pnlSave.Controls.Add(this.classicLabel1); + this.pnlSave.Controls.Add(this.classicButton1); + this.pnlSave.Controls.Add(this.btnSave); + this.pnlSave.Dock = System.Windows.Forms.DockStyle.Bottom; + this.pnlSave.Location = new System.Drawing.Point(0, 463); + this.pnlSave.Name = "pnlSave"; + this.pnlSave.Size = new System.Drawing.Size(704, 54); + this.pnlSave.TabIndex = 18; + this.pnlSave.Visible = false; + // // refresh // this.refresh.Interval = 15000; this.refresh.Tick += new System.EventHandler(this.refresh_Tick); // + // classicLabel2 + // + 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:"; + // + // classicLabel1 + // + this.classicLabel1.Location = new System.Drawing.Point(3, 6); + this.classicLabel1.Name = "classicLabel1"; + this.classicLabel1.Size = new System.Drawing.Size(64, 13); + this.classicLabel1.TabIndex = 19; + this.classicLabel1.Text = "File name:"; + // + // classicButton1 + // + this.classicButton1.AdaptBackColorWithTheme = true; + this.classicButton1.AdaptFontWithTheme = true; + this.classicButton1.AdaptForeColorWithTheme = true; + this.classicButton1.BackColor = System.Drawing.Color.Silver; + this.classicButton1.DialogResult = System.Windows.Forms.DialogResult.None; + this.classicButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.classicButton1.ForeColor = System.Drawing.Color.Black; + this.classicButton1.Location = new System.Drawing.Point(611, 29); + this.classicButton1.Name = "classicButton1"; + this.classicButton1.Size = new System.Drawing.Size(75, 23); + this.classicButton1.TabIndex = 17; + this.classicButton1.Text = "Cancel"; + this.classicButton1.Click += new System.EventHandler(this.btnSave_Click); + // + // btnSave + // + this.btnSave.AdaptBackColorWithTheme = true; + this.btnSave.AdaptFontWithTheme = true; + this.btnSave.AdaptForeColorWithTheme = true; + this.btnSave.BackColor = System.Drawing.Color.Silver; + this.btnSave.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnSave.ForeColor = System.Drawing.Color.Black; + this.btnSave.Location = new System.Drawing.Point(611, 1); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(75, 25); + this.btnSave.TabIndex = 17; + this.btnSave.Text = "Save"; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // txtSave + // + this.txtSave.BackColor = System.Drawing.Color.White; + this.txtSave.Location = new System.Drawing.Point(56, 6); + this.txtSave.MaximumSize = new System.Drawing.Size(0, 17); + this.txtSave.MinimumSize = new System.Drawing.Size(100, 17); + this.txtSave.Name = "txtSave"; + this.txtSave.Size = new System.Drawing.Size(549, 17); + this.txtSave.TabIndex = 22; + this.txtSave.UseSystemPasswordChar = false; + // // Win95WindowsExplorer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -336,10 +369,9 @@ this.Load += new System.EventHandler(this.WinClassicWindowsExplorer_Load); this.program.ResumeLayout(false); this.program.PerformLayout(); - this.pnlSave.ResumeLayout(false); - this.pnlSave.PerformLayout(); this.MenuStrip1.ResumeLayout(false); this.MenuStrip1.PerformLayout(); + this.pnlSave.ResumeLayout(false); this.ResumeLayout(false); } @@ -372,9 +404,11 @@ internal System.Windows.Forms.Panel topleftcorner; internal System.Windows.Forms.ListView mainView; internal System.Windows.Forms.Panel pnlSave; - internal System.Windows.Forms.Button Button1; - internal System.Windows.Forms.Label Label1; - internal System.Windows.Forms.TextBox txtSave; private System.Windows.Forms.Timer refresh; + private Engine.UI.ClassicButton btnSave; + private Engine.UI.ClassicButton classicButton1; + private Engine.UI.ClassicLabel classicLabel2; + private Engine.UI.ClassicLabel classicLabel1; + private Engine.UI.ClassicTextBox txtSave; } } diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index fa1e0ce..9038a96 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -36,6 +36,16 @@ namespace Histacom2.OS.Win95.Win95Apps public Win95WindowsExplorer() { InitializeComponent(); + + + // Fonts! yoy! + + foreach (Control ctrl in this.Controls) + { + ctrl.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + } + + //Histacom2.Engine.UI.CustomTextBox ctb = new Histacom2.Engine.UI.CustomTextBox(textBox1); } void WinClassicWindowsExplorer_Load(object sender, EventArgs e) @@ -100,14 +110,14 @@ namespace Histacom2.OS.Win95.Win95Apps if (IsFileOpenDialog == true) { pnlSave.Show(); - Button1.Text = "Open"; + btnSave.Text = "Open"; } else { if (IsFileSaveDialog == true) { pnlSave.Show(); - Button1.Text = "Save"; + btnSave.Text = "Save"; } } @@ -701,7 +711,7 @@ namespace Histacom2.OS.Win95.Win95Apps RefreshTreeNode(); } - private void Button1_Click(object sender, EventArgs e) + private void btnSave_Click(object sender, EventArgs e) { try { @@ -728,9 +738,8 @@ namespace Histacom2.OS.Win95.Win95Apps ((Form)this.TopLevelControl).Close(); } } - } catch { - } + catch { } } private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/Histacom2/SaveDialogs/SaveFileTroubleShooter.Designer.cs b/Histacom2/SaveDialogs/SaveFileTroubleShooter.Designer.cs index 85c04fb..ff7b5c0 100644 --- a/Histacom2/SaveDialogs/SaveFileTroubleShooter.Designer.cs +++ b/Histacom2/SaveDialogs/SaveFileTroubleShooter.Designer.cs @@ -59,7 +59,7 @@ this.pnlResolved.Controls.Add(this.label2); this.pnlResolved.Location = new System.Drawing.Point(12, 38); this.pnlResolved.Name = "pnlResolved"; - this.pnlResolved.Size = new System.Drawing.Size(589, 275); + this.pnlResolved.Size = new System.Drawing.Size(518, 243); this.pnlResolved.TabIndex = 1; this.pnlResolved.Visible = false; // @@ -73,7 +73,7 @@ this.textBox1.Name = "textBox1"; this.textBox1.ReadOnly = true; this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBox1.Size = new System.Drawing.Size(567, 208); + this.textBox1.Size = new System.Drawing.Size(496, 176); this.textBox1.TabIndex = 3; // // label3 @@ -100,15 +100,15 @@ this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.panel2.Controls.Add(this.btnClose); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel2.Location = new System.Drawing.Point(0, 315); + this.panel2.Location = new System.Drawing.Point(0, 283); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(612, 30); + this.panel2.Size = new System.Drawing.Size(541, 30); this.panel2.TabIndex = 2; // // btnClose // this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnClose.Location = new System.Drawing.Point(526, 4); + this.btnClose.Location = new System.Drawing.Point(455, 4); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(75, 23); this.btnClose.TabIndex = 0; @@ -120,12 +120,11 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(612, 345); + this.ClientSize = new System.Drawing.Size(541, 313); this.Controls.Add(this.panel2); this.Controls.Add(this.pnlResolved); this.Controls.Add(this.label1); this.Name = "SaveFileTroubleShooter"; - this.Text = "Save File Troubleshooter"; this.Load += new System.EventHandler(this.SaveFileTroubleShooter_Load); this.pnlResolved.ResumeLayout(false); this.pnlResolved.PerformLayout(); diff --git a/Histacom2/TitleScreen.Designer.cs b/Histacom2/TitleScreen.Designer.cs index 3d3ef0c..d73f29f 100644 --- a/Histacom2/TitleScreen.Designer.cs +++ b/Histacom2/TitleScreen.Designer.cs @@ -30,7 +30,6 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TitleScreen)); - this.vmModeTimer = new System.Windows.Forms.Timer(this.components); this.program = new System.Windows.Forms.Panel(); this.programContent = new System.Windows.Forms.Panel(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); @@ -72,10 +71,6 @@ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.SuspendLayout(); // - // vmModeTimer - // - this.vmModeTimer.Tick += new System.EventHandler(this.vmModeTimer_Tick); - // // program // this.program.BackColor = System.Drawing.Color.Silver; @@ -148,6 +143,7 @@ 0, 0, 0}); + this.VM_Height.Visible = false; // // VM_Width // @@ -170,6 +166,7 @@ 0, 0, 0}); + this.VM_Width.Visible = false; // // vm_mode // @@ -182,6 +179,7 @@ this.vm_mode.TabIndex = 4; this.vm_mode.Text = "VM Mode"; this.vm_mode.UseVisualStyleBackColor = false; + this.vm_mode.CheckStateChanged += new System.EventHandler(this.vm_mode_CheckStateChanged); // // pictureBox1 // @@ -427,7 +425,6 @@ } #endregion - private System.Windows.Forms.Timer vmModeTimer; internal System.Windows.Forms.Panel program; internal System.Windows.Forms.Panel toprightcorner; internal System.Windows.Forms.Panel bottomrightcorner; diff --git a/Histacom2/TitleScreen.cs b/Histacom2/TitleScreen.cs index 37539d9..ea06ce2 100644 --- a/Histacom2/TitleScreen.cs +++ b/Histacom2/TitleScreen.cs @@ -137,9 +137,6 @@ namespace Histacom2 SettingsToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); HelpToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); ShutdownToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); - - // Start the VM Mode timer - vmModeTimer.Start(); } private static void leet() @@ -155,23 +152,6 @@ namespace Histacom2 wm.Init(leet, "Thank You", null, true, true); } - // The VM Mode timer / checker. Updates every 100ms - private void vmModeTimer_Tick(object sender, EventArgs e) - { - // Check for VM mode - if (vm_mode.Checked == true) - { - VM_Width.Visible = true; - VM_Height.Visible = true; - } - // If VM Mode is disabled - else - { - VM_Width.Visible = false; - VM_Height.Visible = false; - } - } - #region Menu Buttons #region NewGame @@ -296,5 +276,21 @@ namespace Histacom2 AchievementScreen achievelist = new AchievementScreen(); achievelist.ShowDialog(); } + + private void vm_mode_CheckStateChanged(object sender, EventArgs e) + { + // Check for VM mode + if (vm_mode.Checked == true) + { + VM_Width.Visible = true; + VM_Height.Visible = true; + } + // If VM Mode is disabled + else + { + VM_Width.Visible = false; + VM_Height.Visible = false; + } + } } } diff --git a/Histacom2/TitleScreen.resx b/Histacom2/TitleScreen.resx index 435fff8..ba800cd 100644 --- a/Histacom2/TitleScreen.resx +++ b/Histacom2/TitleScreen.resx @@ -117,9 +117,6 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="vmModeTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="panel2.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> |
