From e5f29e7b53322e11578acd0deb3b1d454998bb77 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Tue, 24 Oct 2017 11:18:12 +0100 Subject: All new ClassicTextBox --- Histacom2.Engine/UI/ClassicTextbox.cs | 85 +++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 29 deletions(-) (limited to 'Histacom2.Engine/UI/ClassicTextbox.cs') 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 { } } } } -- cgit v1.2.3 From 72a2b98a29ac1d3b67a4158b6a1823a39ecb5e00 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Tue, 24 Oct 2017 13:50:38 +0100 Subject: Finished ClassicTextBox ClassicDropDown next! --- Histacom2.Engine/UI/ClassicDropDown.Designer.cs | 7 +- Histacom2.Engine/UI/ClassicDropDown.cs | 294 +-------------------- Histacom2.Engine/UI/ClassicTextBox.Designer.cs | 2 - Histacom2.Engine/UI/ClassicTextbox.cs | 7 +- .../Win95Apps/Win95WindowsExplorer.Designer.cs | 29 +- 5 files changed, 26 insertions(+), 313 deletions(-) (limited to 'Histacom2.Engine/UI/ClassicTextbox.cs') diff --git a/Histacom2.Engine/UI/ClassicDropDown.Designer.cs b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs index 2925f72..424ff69 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.Designer.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs @@ -2,7 +2,7 @@ { partial class ClassicDropDown { - /// + /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; @@ -22,13 +22,14 @@ #region Component Designer generated code - /// - /// Required method for Designer support - do not modify + /// + /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; } #endregion diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs index 85c509a..43e1a65 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.cs @@ -1,306 +1,20 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Diagnostics; using System.Drawing; +using System.Data; 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 partial class ClassicDropDown : UserControl { - 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) + public ClassicDropDown() { - // DropDown: - - + InitializeComponent(); } - - 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 index 0e7148f..af6b199 100644 --- a/Histacom2.Engine/UI/ClassicTextBox.Designer.cs +++ b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs @@ -93,8 +93,6 @@ 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(); diff --git a/Histacom2.Engine/UI/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs index 8c1d8d8..a42c2b1 100644 --- a/Histacom2.Engine/UI/ClassicTextbox.cs +++ b/Histacom2.Engine/UI/ClassicTextbox.cs @@ -30,11 +30,10 @@ namespace Histacom2.Engine.UI 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); + 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) textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + else textBox1.BackColor = Color.White; if (SaveSystem.currentTheme != null) { diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index 153018a..0f3eee8 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -55,12 +55,12 @@ 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.txtSave = new Histacom2.Engine.UI.ClassicTextBox(); 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.refresh = new System.Windows.Forms.Timer(this.components); this.program.SuspendLayout(); this.MenuStrip1.SuspendLayout(); this.pnlSave.SuspendLayout(); @@ -295,10 +295,17 @@ this.pnlSave.TabIndex = 18; this.pnlSave.Visible = false; // - // refresh + // txtSave // - this.refresh.Interval = 15000; - this.refresh.Tick += new System.EventHandler(this.refresh_Tick); + this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSave.BackColor = System.Drawing.Color.White; + this.txtSave.Location = new System.Drawing.Point(56, 6); + this.txtSave.Name = "txtSave"; + this.txtSave.Size = new System.Drawing.Size(549, 17); + this.txtSave.TabIndex = 22; + this.txtSave.UseSystemPasswordChar = false; // // classicLabel2 // @@ -348,16 +355,10 @@ this.btnSave.Text = "Save"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // txtSave + // refresh // - 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; + this.refresh.Interval = 15000; + this.refresh.Tick += new System.EventHandler(this.refresh_Tick); // // Win95WindowsExplorer // -- cgit v1.2.3 From 2a473d05a34afe51cf0f5340cbdd48ad4e771657 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 4 Nov 2017 08:51:38 +0000 Subject: ClassicDropDown + ClassicTextBox! Finally! It only took 2 months... --- Histacom2.Engine/Histacom2.Engine.csproj | 19 +++- Histacom2.Engine/Template/DropDownItem.Designer.cs | 63 +++++++++++ Histacom2.Engine/Template/DropDownItem.cs | 42 ++++++++ Histacom2.Engine/Template/DropDownItem.resx | 120 +++++++++++++++++++++ .../Template/DropDownOverlay.Designer.cs | 64 +++++++++++ Histacom2.Engine/Template/DropDownOverlay.cs | 26 +++++ Histacom2.Engine/Template/DropDownOverlay.resx | 120 +++++++++++++++++++++ Histacom2.Engine/UI/ClassicDropDown.Designer.cs | 30 +++--- Histacom2.Engine/UI/ClassicDropDown.cs | 82 +++++++++++++- Histacom2.Engine/UI/ClassicTextbox.cs | 12 ++- Histacom2.Engine/UI/OldClassicTextbox.cs | 77 ------------- .../Win95Apps/Win95WindowsExplorer.Designer.cs | 86 ++++++--------- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 2 + 13 files changed, 590 insertions(+), 153 deletions(-) create mode 100644 Histacom2.Engine/Template/DropDownItem.Designer.cs create mode 100644 Histacom2.Engine/Template/DropDownItem.cs create mode 100644 Histacom2.Engine/Template/DropDownItem.resx create mode 100644 Histacom2.Engine/Template/DropDownOverlay.Designer.cs create mode 100644 Histacom2.Engine/Template/DropDownOverlay.cs create mode 100644 Histacom2.Engine/Template/DropDownOverlay.resx delete mode 100644 Histacom2.Engine/UI/OldClassicTextbox.cs (limited to 'Histacom2.Engine/UI/ClassicTextbox.cs') diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj index bb10572..46d7427 100644 --- a/Histacom2.Engine/Histacom2.Engine.csproj +++ b/Histacom2.Engine/Histacom2.Engine.csproj @@ -54,6 +54,18 @@ + + UserControl + + + DropDownItem.cs + + + Form + + + DropDownOverlay.cs + Form @@ -112,7 +124,6 @@ ClassicTextBox.cs - Component @@ -130,6 +141,12 @@ PublicResXFileCodeGenerator Resources.Designer.cs + + DropDownItem.cs + + + DropDownOverlay.cs + ResizeOverlay.cs diff --git a/Histacom2.Engine/Template/DropDownItem.Designer.cs b/Histacom2.Engine/Template/DropDownItem.Designer.cs new file mode 100644 index 0000000..1318726 --- /dev/null +++ b/Histacom2.Engine/Template/DropDownItem.Designer.cs @@ -0,0 +1,63 @@ +namespace Histacom2.Engine.Template +{ + partial class DropDownItem + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(315, 20); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.label1.Click += new System.EventHandler(this.label1_Click); + this.label1.MouseEnter += new System.EventHandler(this.label1_MouseEnter); + this.label1.MouseLeave += new System.EventHandler(this.label1_MouseLeave); + // + // DropDownItem + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Transparent; + this.Controls.Add(this.label1); + this.Name = "DropDownItem"; + this.Size = new System.Drawing.Size(315, 20); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} diff --git a/Histacom2.Engine/Template/DropDownItem.cs b/Histacom2.Engine/Template/DropDownItem.cs new file mode 100644 index 0000000..8b2c654 --- /dev/null +++ b/Histacom2.Engine/Template/DropDownItem.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.Template +{ + public partial class DropDownItem : UserControl + { + public UI.ClassicDropDown dpdw; + public DropDownItem() + { + InitializeComponent(); + } + + public void ChangeText(string newText, Font fnt) + { + label1.Font = fnt; + label1.Text = newText; + } + + private void label1_MouseLeave(object sender, EventArgs e) + { + label1.BackColor = Color.Transparent; + } + + private void label1_Click(object sender, EventArgs e) + { + dpdw.ChooseItem(label1.Text); + } + + private void label1_MouseEnter(object sender, EventArgs e) + { + label1.BackColor = Color.Blue; + } + } +} diff --git a/Histacom2.Engine/Template/DropDownItem.resx b/Histacom2.Engine/Template/DropDownItem.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Histacom2.Engine/Template/DropDownItem.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Histacom2.Engine/Template/DropDownOverlay.Designer.cs b/Histacom2.Engine/Template/DropDownOverlay.Designer.cs new file mode 100644 index 0000000..6894433 --- /dev/null +++ b/Histacom2.Engine/Template/DropDownOverlay.Designer.cs @@ -0,0 +1,64 @@ +namespace Histacom2.Engine.Template +{ + partial class DropDownOverlay + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.outline = new System.Windows.Forms.Panel(); + this.SuspendLayout(); + // + // outline + // + this.outline.BackColor = System.Drawing.Color.White; + this.outline.Location = new System.Drawing.Point(230, 56); + this.outline.Name = "outline"; + this.outline.Size = new System.Drawing.Size(200, 100); + this.outline.TabIndex = 0; + this.outline.Paint += new System.Windows.Forms.PaintEventHandler(this.outline_Paint); + // + // DropDownOverlay + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(0)))), ((int)(((byte)(1))))); + this.ClientSize = new System.Drawing.Size(628, 210); + this.Controls.Add(this.outline); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "DropDownOverlay"; + this.Text = "DropDownOverlay"; + this.TopMost = true; + this.TransparencyKey = System.Drawing.Color.FromArgb(((int)(((byte)(1)))), ((int)(((byte)(0)))), ((int)(((byte)(1))))); + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.ResumeLayout(false); + + } + + #endregion + + public System.Windows.Forms.Panel outline; + } +} \ No newline at end of file diff --git a/Histacom2.Engine/Template/DropDownOverlay.cs b/Histacom2.Engine/Template/DropDownOverlay.cs new file mode 100644 index 0000000..4d364d6 --- /dev/null +++ b/Histacom2.Engine/Template/DropDownOverlay.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.Template +{ + public partial class DropDownOverlay : Form + { + public DropDownOverlay() + { + InitializeComponent(); + } + + private void outline_Paint(object sender, PaintEventArgs e) + { + e.Graphics.DrawRectangle(Pens.Black, 0, 0, outline.Width - 1, outline.Height - 1); // Draws a 1 pixel border around the dropdown's drop area! + if (SaveSystem.currentTheme != null) outline.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + } + } +} diff --git a/Histacom2.Engine/Template/DropDownOverlay.resx b/Histacom2.Engine/Template/DropDownOverlay.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Histacom2.Engine/Template/DropDownOverlay.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Histacom2.Engine/UI/ClassicDropDown.Designer.cs b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs index da54d6e..509c04d 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.Designer.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.Designer.cs @@ -29,12 +29,12 @@ private void InitializeComponent() { this.textBox1 = new System.Windows.Forms.TextBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); + 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.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dropDownSwitch)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tborder)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bborder)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.rborder)).BeginInit(); @@ -50,16 +50,17 @@ this.textBox1.Size = new System.Drawing.Size(96, 13); this.textBox1.TabIndex = 9; // - // pictureBox1 + // dropDownSwitch // - 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; + 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 // @@ -101,7 +102,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.dropDownSwitch); this.Controls.Add(this.textBox1); this.Controls.Add(this.tborder); this.Controls.Add(this.bborder); @@ -109,7 +110,8 @@ this.Controls.Add(this.lborder); this.Name = "ClassicDropDown"; this.Size = new System.Drawing.Size(100, 20); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + 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(); @@ -126,6 +128,6 @@ private System.Windows.Forms.PictureBox bborder; private System.Windows.Forms.PictureBox rborder; private System.Windows.Forms.PictureBox lborder; - private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.PictureBox dropDownSwitch; } } diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs index b26862e..0b56cb9 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.cs @@ -7,22 +7,28 @@ 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 UseSystemPasswordChar { get; set; } + public bool dropDownShown; public static Color textboxcolor = Color.Black; public static Color _lightBack = Color.Silver; public static Color _darkBack = Color.Silver; + public List items = new List { "TestItem" }; + public ClassicDropDown() { InitializeComponent(); + try { // Draw the border @@ -30,20 +36,26 @@ namespace Histacom2.Engine.UI 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; + 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) => { @@ -77,5 +89,67 @@ namespace Histacom2.Engine.UI } 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/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs index a42c2b1..8f1f9c3 100644 --- a/Histacom2.Engine/UI/ClassicTextbox.cs +++ b/Histacom2.Engine/UI/ClassicTextbox.cs @@ -32,8 +32,16 @@ namespace Histacom2.Engine.UI // 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) + { + textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + BackColor = SaveSystem.currentTheme.threeDObjectsColor; + } + else + { + textBox1.BackColor = Color.White; + BackColor = Color.White; + } if (SaveSystem.currentTheme != null) { diff --git a/Histacom2.Engine/UI/OldClassicTextbox.cs b/Histacom2.Engine/UI/OldClassicTextbox.cs deleted file mode 100644 index f7db87d..0000000 --- a/Histacom2.Engine/UI/OldClassicTextbox.cs +++ /dev/null @@ -1,77 +0,0 @@ -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 8da51f7..2a96033 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -51,17 +51,15 @@ this.HelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.AboutWindows95ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toprightcorner = new System.Windows.Forms.Panel(); - 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.classicDropDown1 = new Histacom2.Engine.UI.ClassicDropDown(); + this.cmbType = 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(); - this.classicButton1 = new Histacom2.Engine.UI.ClassicButton(); this.btnSave = new Histacom2.Engine.UI.ClassicButton(); this.refresh = new System.Windows.Forms.Timer(this.components); + this.btnCanc = new Histacom2.Engine.UI.ClassicButton(); this.program.SuspendLayout(); this.MenuStrip1.SuspendLayout(); this.pnlSave.SuspendLayout(); @@ -74,8 +72,6 @@ this.program.Controls.Add(this.diskView); this.program.Controls.Add(this.MenuStrip1); this.program.Controls.Add(this.toprightcorner); - this.program.Controls.Add(this.bottomrightcorner); - this.program.Controls.Add(this.bottomleftcorner); this.program.Controls.Add(this.topleftcorner); this.program.Controls.Add(this.pnlSave); this.program.Dock = System.Windows.Forms.DockStyle.Fill; @@ -258,23 +254,6 @@ this.toprightcorner.Size = new System.Drawing.Size(4, 4); this.toprightcorner.TabIndex = 6; // - // bottomrightcorner - // - this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE; - this.bottomrightcorner.Location = new System.Drawing.Point(700, 513); - this.bottomrightcorner.Name = "bottomrightcorner"; - this.bottomrightcorner.Size = new System.Drawing.Size(4, 4); - this.bottomrightcorner.TabIndex = 4; - // - // bottomleftcorner - // - this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.bottomleftcorner.Location = new System.Drawing.Point(0, 513); - this.bottomleftcorner.Name = "bottomleftcorner"; - this.bottomleftcorner.Size = new System.Drawing.Size(4, 4); - this.bottomleftcorner.TabIndex = 2; - // // topleftcorner // this.topleftcorner.Location = new System.Drawing.Point(0, 0); @@ -284,11 +263,11 @@ // // pnlSave // - this.pnlSave.Controls.Add(this.classicDropDown1); + this.pnlSave.Controls.Add(this.btnCanc); + this.pnlSave.Controls.Add(this.cmbType); 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); @@ -297,16 +276,15 @@ this.pnlSave.TabIndex = 18; this.pnlSave.Visible = false; // - // classicDropDown1 + // cmbType // - 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; + this.cmbType.BackColor = System.Drawing.Color.White; + this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.cmbType.Location = new System.Drawing.Point(56, 31); + this.cmbType.Name = "cmbType"; + this.cmbType.Size = new System.Drawing.Size(549, 20); + this.cmbType.TabIndex = 23; + this.cmbType.UseSystemPasswordChar = false; // // txtSave // @@ -316,7 +294,7 @@ this.txtSave.BackColor = System.Drawing.Color.White; this.txtSave.Location = new System.Drawing.Point(56, 6); this.txtSave.Name = "txtSave"; - this.txtSave.Size = new System.Drawing.Size(549, 17); + this.txtSave.Size = new System.Drawing.Size(549, 20); this.txtSave.TabIndex = 22; this.txtSave.UseSystemPasswordChar = false; // @@ -338,27 +316,12 @@ 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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 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); @@ -375,6 +338,21 @@ this.refresh.Interval = 15000; this.refresh.Tick += new System.EventHandler(this.refresh_Tick); // + // btnCanc + // + this.btnCanc.AdaptBackColorWithTheme = true; + this.btnCanc.AdaptFontWithTheme = true; + this.btnCanc.AdaptForeColorWithTheme = true; + this.btnCanc.BackColor = System.Drawing.Color.Silver; + this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnCanc.ForeColor = System.Drawing.Color.Black; + this.btnCanc.Location = new System.Drawing.Point(611, 27); + this.btnCanc.Name = "btnCanc"; + this.btnCanc.Size = new System.Drawing.Size(75, 25); + this.btnCanc.TabIndex = 24; + this.btnCanc.Text = "Cancel"; + // // Win95WindowsExplorer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -415,17 +393,15 @@ internal System.Windows.Forms.ToolStripMenuItem HelpToolStripMenuItem1; internal System.Windows.Forms.ToolStripMenuItem AboutWindows95ToolStripMenuItem; internal System.Windows.Forms.Panel toprightcorner; - internal System.Windows.Forms.Panel bottomrightcorner; - internal System.Windows.Forms.Panel bottomleftcorner; internal System.Windows.Forms.Panel topleftcorner; internal System.Windows.Forms.ListView mainView; internal System.Windows.Forms.Panel pnlSave; 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; - private Engine.UI.ClassicDropDown classicDropDown1; + private Engine.UI.ClassicDropDown cmbType; + private Engine.UI.ClassicButton btnCanc; } } diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 9038a96..f118542 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -45,6 +45,8 @@ namespace Histacom2.OS.Win95.Win95Apps ctrl.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); } + txtSave.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + cmbType.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); } -- cgit v1.2.3 From 6ab1468786f1e865e9ff408d32149f9c9620d844 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 4 Nov 2017 09:43:02 +0000 Subject: Fix bugs ...and get rid of all == false and == true --- Histacom2.Engine/DesktopController.cs | 4 +- Histacom2.Engine/FileDialogBoxManager.cs | 7 ++ Histacom2.Engine/SaveSystem.cs | 4 +- Histacom2.Engine/Template/WinClassic.cs | 4 +- Histacom2.Engine/Template/WinXP.cs | 2 +- Histacom2.Engine/UI/ClassicDropDown.cs | 12 ++ Histacom2.Engine/UI/ClassicTextbox.cs | 12 ++ Histacom2.Engine/WindowManager.cs | 12 +- Histacom2/GlobalPrograms/WinClassicNotepad.cs | 20 +-- Histacom2/OS/Win95/Win95.cs | 2 +- Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs | 2 +- .../Win95Apps/MineSweeper/WinClassicMinesweeper.cs | 2 +- Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs | 2 +- .../Win95Apps/Win95WindowsExplorer.Designer.cs | 49 ++++---- .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 32 ++--- .../OS/Win95/Win95Apps/WinClassicFTPClient.cs | 113 ++++++++--------- Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs | 1 + Histacom2/OS/Win98/Win98.cs | 2 +- .../WinClassicWindowsExplorer.Designer.cs | 135 +++++++++++++++------ .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 82 ++++++++----- Histacom2/SaveDialogs/LoadGameProfileItem.cs | 6 +- Histacom2/SaveDialogs/NewGameDialog.cs | 4 +- Histacom2/SaveDialogs/SaveFileTroubleShooter.cs | 2 +- Histacom2/TitleScreen.cs | 14 +-- 24 files changed, 321 insertions(+), 204 deletions(-) (limited to 'Histacom2.Engine/UI/ClassicTextbox.cs') diff --git a/Histacom2.Engine/DesktopController.cs b/Histacom2.Engine/DesktopController.cs index 8ea9775..cb09333 100644 --- a/Histacom2.Engine/DesktopController.cs +++ b/Histacom2.Engine/DesktopController.cs @@ -17,9 +17,9 @@ namespace Histacom2.Engine string directoryFileInfo = File.ReadAllText(Path.Combine(reqDirectory, "_data.info")); FileSystemFolderInfo toRead = JsonConvert.DeserializeObject(directoryFileInfo); - if (returnYesIfProtected == true) + if (returnYesIfProtected) { - if (toRead.IsProtected == true) + if (toRead.IsProtected) { return "yes"; } diff --git a/Histacom2.Engine/FileDialogBoxManager.cs b/Histacom2.Engine/FileDialogBoxManager.cs index 161c393..9f0b2ce 100644 --- a/Histacom2.Engine/FileDialogBoxManager.cs +++ b/Histacom2.Engine/FileDialogBoxManager.cs @@ -28,6 +28,13 @@ namespace Histacom2.Engine OnlyViewExtension = ExtensionToView; } + public static void DeactivateFileDialog() + { + IsInOpenDialog = false; + IsInSaveDialog = false; + OnlyViewExtension = ""; + } + public static string ReadTextFile(string path) { try diff --git a/Histacom2.Engine/SaveSystem.cs b/Histacom2.Engine/SaveSystem.cs index 70609a2..fcc6606 100644 --- a/Histacom2.Engine/SaveSystem.cs +++ b/Histacom2.Engine/SaveSystem.cs @@ -127,7 +127,7 @@ namespace Histacom2.Engine { var save = new Save(); save.ExperiencedStories = new List(); - if (DevMode == true) + if (DevMode) { if (ProfileName == "xpbad") { @@ -373,7 +373,7 @@ namespace Histacom2.Engine info.SubDirs = new List(256); info.ByteSize = 0; - if (updateParent == true) + if (updateParent) { if ((parent != ProfileDirectory)) { diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 988f268..68cba3d 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -45,7 +45,7 @@ namespace Histacom2.Engine.Template private void Programtopbar_drag(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left && max == false) + if (e.Button == MouseButtons.Left && !max) { ReleaseCapture(); SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); @@ -306,7 +306,7 @@ namespace Histacom2.Engine.Template private void maximizebutton_Click(object sender, EventArgs e) { - if (max == false) + if (!max) { this.right.Hide(); this.left.Hide(); diff --git a/Histacom2.Engine/Template/WinXP.cs b/Histacom2.Engine/Template/WinXP.cs index fa26611..2f51c1c 100644 --- a/Histacom2.Engine/Template/WinXP.cs +++ b/Histacom2.Engine/Template/WinXP.cs @@ -51,7 +51,7 @@ namespace Histacom2.Engine.Template private void top_MouseDown(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left && max == false) + if (e.Button == MouseButtons.Left && !max) { ReleaseCapture(); SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs index 0b56cb9..93b4a62 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.cs @@ -17,6 +17,18 @@ namespace Histacom2.Engine.UI public bool UseSystemPasswordChar { get; set; } public bool dropDownShown; + public override string Text + { + get + { + return textBox1.Text; + } + set + { + textBox1.Text = value; + } + } + public static Color textboxcolor = Color.Black; public static Color _lightBack = Color.Silver; diff --git a/Histacom2.Engine/UI/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs index 8f1f9c3..f89df03 100644 --- a/Histacom2.Engine/UI/ClassicTextbox.cs +++ b/Histacom2.Engine/UI/ClassicTextbox.cs @@ -19,6 +19,18 @@ namespace Histacom2.Engine.UI public static Color _lightBack = Color.Silver; public static Color _darkBack = Color.Silver; + public override string Text + { + get + { + return textBox1.Text; + } + set + { + textBox1.Text = value; + } + } + public ClassicTextBox() { InitializeComponent(); diff --git a/Histacom2.Engine/WindowManager.cs b/Histacom2.Engine/WindowManager.cs index 12f7954..04de392 100644 --- a/Histacom2.Engine/WindowManager.cs +++ b/Histacom2.Engine/WindowManager.cs @@ -67,14 +67,14 @@ namespace Histacom2.Engine else app.programIcon.Image = icon; // Check if Max button is enabled and set proper X for Min button - if (MaxButton == false) + if (!MaxButton) { app.maximizebutton.Visible = false; app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y); } // Check if Min button is enabled - if (MinButton == false) + if (!MinButton) { app.minimizebutton.Visible = false; app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y); @@ -102,7 +102,7 @@ namespace Histacom2.Engine // Show the app app.TopMost = true; - if (ShowApplicationAsDialog == false) { app.Show(); } else { app.ShowDialog(); } + if (!ShowApplicationAsDialog) { app.Show(); } else { app.ShowDialog(); } return app; } @@ -134,14 +134,14 @@ namespace Histacom2.Engine else app.programIcon.Image = icon; // Check if Max button is enabled and set proper X for Min button - if (MaxButton == false) + if (!MaxButton) { app.maximizebutton.Visible = false; app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y); } // Check if Min button is enabled - if (MinButton == false) + if (!MinButton) { app.minimizebutton.Visible = false; app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y); @@ -165,7 +165,7 @@ namespace Histacom2.Engine // Show the app app.TopMost = true; - if (ShowApplicationAsDialog == false) { app.Show(); } else { app.ShowDialog(); } + if (!ShowApplicationAsDialog) { app.Show(); } else { app.ShowDialog(); } return app; } diff --git a/Histacom2/GlobalPrograms/WinClassicNotepad.cs b/Histacom2/GlobalPrograms/WinClassicNotepad.cs index 1a58d8e..de838e0 100644 --- a/Histacom2/GlobalPrograms/WinClassicNotepad.cs +++ b/Histacom2/GlobalPrograms/WinClassicNotepad.cs @@ -100,16 +100,21 @@ namespace Histacom2.GlobalPrograms private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - if (CurrentFilePath == "") + try { - // We aren't in a file right now + if (CurrentFilePath == "") + { + // We aren't in a file right now - SaveAs(); - } else { + SaveAs(); + } + else + { - File.Delete(CurrentFilePath); - SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); - } + File.Delete(CurrentFilePath); + SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); + } + } catch { } // This try catch loop was added due the game crashing if the desktop is updating the same time the notepad is saving... which I got! } void SaveAs() @@ -118,6 +123,7 @@ namespace Histacom2.GlobalPrograms { ActivateSaveFileDialog(".txt"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); if (selectedPath != "") { diff --git a/Histacom2/OS/Win95/Win95.cs b/Histacom2/OS/Win95/Win95.cs index e330ea0..2a26b91 100644 --- a/Histacom2/OS/Win95/Win95.cs +++ b/Histacom2/OS/Win95/Win95.cs @@ -114,7 +114,7 @@ namespace Histacom2.OS.Win95 this.BringToFront(); //Check if it is the first time - if (CurrentSave.FTime95 == false) + if (!CurrentSave.FTime95) { CurrentSave.FTime95 = true; SaveGame(); diff --git a/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs b/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs index 4f80240..2ebb319 100644 --- a/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs +++ b/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs @@ -108,7 +108,7 @@ namespace Histacom2.OS.Win95.Win95Apps.MineSweeper this.Open(); } } - if (_game.ftime == true && !Minded) + if (_game.ftime && !Minded) { _game.ftime = false; _game._timer = new Timer(); diff --git a/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs b/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs index 2a03c7e..958e8a0 100644 --- a/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs +++ b/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs @@ -129,7 +129,7 @@ namespace Histacom2.OS.Win95.Win95Apps private void timer1_Tick(object sender, EventArgs e) { - if (_game.win == true) + if (_game.win) { button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperWin; switch (level) diff --git a/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs b/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs index 41f7c35..7cf9dd4 100644 --- a/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs +++ b/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs @@ -74,7 +74,7 @@ namespace Histacom2.OS.Win95.Win95Apps.Story public static void CheckIfSoundFinished(Object sender, EventArgs e) { - if (soundThread.IsAlive == false) + if (!soundThread.IsAlive) { // Continue from where we were System.Windows.Forms.Timer trm = sender as System.Windows.Forms.Timer; diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index 2a96033..a4bd611 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -53,13 +53,13 @@ this.toprightcorner = 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.btnCanc = new Histacom2.Engine.UI.ClassicButton(); this.cmbType = 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(); this.btnSave = new Histacom2.Engine.UI.ClassicButton(); - this.refresh = new System.Windows.Forms.Timer(this.components); - this.btnCanc = new Histacom2.Engine.UI.ClassicButton(); this.program.SuspendLayout(); this.MenuStrip1.SuspendLayout(); this.pnlSave.SuspendLayout(); @@ -276,8 +276,33 @@ this.pnlSave.TabIndex = 18; this.pnlSave.Visible = false; // + // refresh + // + this.refresh.Interval = 15000; + this.refresh.Tick += new System.EventHandler(this.refresh_Tick); + // + // btnCanc + // + this.btnCanc.AdaptBackColorWithTheme = true; + this.btnCanc.AdaptFontWithTheme = true; + this.btnCanc.AdaptForeColorWithTheme = true; + this.btnCanc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCanc.BackColor = System.Drawing.Color.Silver; + this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnCanc.ForeColor = System.Drawing.Color.Black; + this.btnCanc.Location = new System.Drawing.Point(611, 27); + this.btnCanc.Name = "btnCanc"; + this.btnCanc.Size = new System.Drawing.Size(75, 25); + this.btnCanc.TabIndex = 24; + this.btnCanc.Text = "Cancel"; + this.btnCanc.Click += new System.EventHandler(this.btnCanc_Click); + // // cmbType // + this.cmbType.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.cmbType.BackColor = System.Drawing.Color.White; this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.cmbType.Location = new System.Drawing.Point(56, 31); @@ -333,26 +358,6 @@ this.btnSave.Text = "Save"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // refresh - // - this.refresh.Interval = 15000; - this.refresh.Tick += new System.EventHandler(this.refresh_Tick); - // - // btnCanc - // - this.btnCanc.AdaptBackColorWithTheme = true; - this.btnCanc.AdaptFontWithTheme = true; - this.btnCanc.AdaptForeColorWithTheme = true; - this.btnCanc.BackColor = System.Drawing.Color.Silver; - this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; - this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.btnCanc.ForeColor = System.Drawing.Color.Black; - this.btnCanc.Location = new System.Drawing.Point(611, 27); - this.btnCanc.Name = "btnCanc"; - this.btnCanc.Size = new System.Drawing.Size(75, 25); - this.btnCanc.TabIndex = 24; - this.btnCanc.Text = "Cancel"; - // // Win95WindowsExplorer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index f118542..0f221af 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -109,14 +109,14 @@ namespace Histacom2.OS.Win95.Win95Apps IsFileSaveDialog = true; } - if (IsFileOpenDialog == true) + if (IsFileOpenDialog) { pnlSave.Show(); btnSave.Text = "Open"; } else { - if (IsFileSaveDialog == true) + if (IsFileSaveDialog) { pnlSave.Show(); btnSave.Text = "Save"; @@ -133,9 +133,9 @@ namespace Histacom2.OS.Win95.Win95Apps FileSystemFolderInfo toRead = new FileSystemFolderInfo(); toRead = JsonConvert.DeserializeObject(directoryFileInfo); - if (returnYesIfProtected == true) + if (returnYesIfProtected) { - if (toRead.IsProtected == true) return "yes"; + if (toRead.IsProtected) return "yes"; } else return toRead.Label; return Val; @@ -717,28 +717,23 @@ namespace Histacom2.OS.Win95.Win95Apps { try { - bool OpenFile = false; if (mainView.FocusedItem != null) { if (mainView.FocusedItem.Tag.ToString() == "") { // If it isn't a file GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); } - else OpenFile = true; // If it is a file + else txtSave.Text = mainView.FocusedItem.Tag.ToString(); } - else OpenFile = true; - if (OpenFile == true) + if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); + else { - if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); - else - { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - ((Form)this.TopLevelControl).Close(); - } + ((Form)this.TopLevelControl).Close(); } } catch { } @@ -1041,5 +1036,10 @@ namespace Histacom2.OS.Win95.Win95Apps RefreshTreeNode(); } + + private void btnCanc_Click(object sender, EventArgs e) + { + ((Form)this.TopLevelControl).Close(); + } } } diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs index 1a0836b..55a4ee2 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs @@ -58,64 +58,67 @@ namespace Histacom2.OS.Win95.Win95Apps private void ftpItems_Click(object sender, EventArgs e) { - Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position); - ListViewItem objListViewItem = new ListViewItem(); - if (objDrawingPoint != null) + try { - objListViewItem = ftpFiles.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y); - if (objListViewItem.Text == "/software/") + Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position); + ListViewItem objListViewItem = new ListViewItem(); + if (objDrawingPoint != null) { - ftpFiles.Clear(); - ListViewItem listViewItem1 = new ListViewItem(new string[] { "/downloads/" }, 0, Color.Black, Color.Empty, null); - ListViewItem listViewItem2 = new ListViewItem(new string[] { "skindows.html" }, 1, Color.Black, Color.Empty, null); - ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2 }); - } - else if (objListViewItem.Text == "/downloads/") - { - ftpFiles.Clear(); - ListViewItem listViewItem1 = new ListViewItem(new string[] { "/totallynotthetimedistorter/" }, 0, Color.Black, Color.Empty, null); - ListViewItem listViewItem2 = new ListViewItem(new string[] { "FTP Client Setup.exe" }, 2, Color.Black, Color.Empty, null); - ListViewItem listViewItem3 = new ListViewItem(new string[] { "Web Chat Setup.exe" }, 2, Color.Black, Color.Empty, null); - ListViewItem listViewItem4 = new ListViewItem(new string[] { "Guess The Number V1 Setup.exe" }, 2, Color.Black, Color.Empty, null); - ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4 }); - } - else if (objListViewItem.Text == "/totallynotthetimedistorter/") - { - ftpFiles.Clear(); - ListViewItem listViewItem1 = new ListViewItem(new string[] { "Time Distorter Setup.exe" }, 2, Color.Black, Color.Empty, null); - ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1 }); - } - else if (objListViewItem.Text == "FTP Client Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: FTP Client"; - } - else if (objListViewItem.Text == "Web Chat Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: Web Chat 1998"; - opendownload.amountToDL = 35; - } - else if (objListViewItem.Text == "Time Distorter Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: Time Distorter 0.1"; - } - else if (objListViewItem.Text == "Guess The Number V1 Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: Guess The Number V1"; - opendownload.amountToDL = 16; + objListViewItem = ftpFiles.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y); + if (objListViewItem.Text == "/software/") + { + ftpFiles.Clear(); + ListViewItem listViewItem1 = new ListViewItem(new string[] { "/downloads/" }, 0, Color.Black, Color.Empty, null); + ListViewItem listViewItem2 = new ListViewItem(new string[] { "skindows.html" }, 1, Color.Black, Color.Empty, null); + ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2 }); + } + else if (objListViewItem.Text == "/downloads/") + { + ftpFiles.Clear(); + ListViewItem listViewItem1 = new ListViewItem(new string[] { "/totallynotthetimedistorter/" }, 0, Color.Black, Color.Empty, null); + ListViewItem listViewItem2 = new ListViewItem(new string[] { "FTP Client Setup.exe" }, 2, Color.Black, Color.Empty, null); + ListViewItem listViewItem3 = new ListViewItem(new string[] { "Web Chat Setup.exe" }, 2, Color.Black, Color.Empty, null); + ListViewItem listViewItem4 = new ListViewItem(new string[] { "Guess The Number V1 Setup.exe" }, 2, Color.Black, Color.Empty, null); + ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4 }); + } + else if (objListViewItem.Text == "/totallynotthetimedistorter/") + { + ftpFiles.Clear(); + ListViewItem listViewItem1 = new ListViewItem(new string[] { "Time Distorter Setup.exe" }, 2, Color.Black, Color.Empty, null); + ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1 }); + } + else if (objListViewItem.Text == "FTP Client Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: FTP Client"; + } + else if (objListViewItem.Text == "Web Chat Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: Web Chat 1998"; + opendownload.amountToDL = 35; + } + else if (objListViewItem.Text == "Time Distorter Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: Time Distorter 0.1"; + } + else if (objListViewItem.Text == "Guess The Number V1 Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: Guess The Number V1"; + opendownload.amountToDL = 16; + } } - } + } catch { } // Try catch due to if you have more then one item selected the game crashing. } private void btnCancel_Click(object sender, EventArgs e) diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs index 91d9368..381f5ee 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs @@ -225,6 +225,7 @@ namespace Histacom2.OS.Win95.Win95Apps { ActivateSaveFileDialog(".rtf"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); if (selectedPath != "") { diff --git a/Histacom2/OS/Win98/Win98.cs b/Histacom2/OS/Win98/Win98.cs index e10904e..efaa31b 100644 --- a/Histacom2/OS/Win98/Win98.cs +++ b/Histacom2/OS/Win98/Win98.cs @@ -116,7 +116,7 @@ namespace Histacom2.OS.Win98 this.BringToFront(); //Check if it is the first time - if (CurrentSave.FTime98 == false) + if (!CurrentSave.FTime98) { CurrentSave.FTime98 = true; SaveGame(); diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index af2570c..f88d451 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -52,9 +52,12 @@ this.bottomleftcorner = new System.Windows.Forms.Panel(); this.topleftcorner = 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.btnCanc = new Histacom2.Engine.UI.ClassicButton(); + this.cmbType = 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(); + this.btnSave = new Histacom2.Engine.UI.ClassicButton(); this.MenuStrip1 = new System.Windows.Forms.MenuStrip(); this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -112,7 +115,7 @@ this.mainView.Dock = System.Windows.Forms.DockStyle.Fill; this.mainView.Location = new System.Drawing.Point(396, 24); this.mainView.Name = "mainView"; - this.mainView.Size = new System.Drawing.Size(308, 458); + this.mainView.Size = new System.Drawing.Size(308, 439); this.mainView.TabIndex = 10; this.mainView.UseCompatibleStateImageBehavior = false; this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit); @@ -130,7 +133,7 @@ this.pnlInfo.Dock = System.Windows.Forms.DockStyle.Left; this.pnlInfo.Location = new System.Drawing.Point(196, 24); this.pnlInfo.Name = "pnlInfo"; - this.pnlInfo.Size = new System.Drawing.Size(200, 458); + this.pnlInfo.Size = new System.Drawing.Size(200, 439); this.pnlInfo.TabIndex = 19; // // pictureBox1 @@ -165,7 +168,7 @@ this.pnlInfoContent.Controls.Add(this.txtInfoTip); this.pnlInfoContent.Location = new System.Drawing.Point(0, 95); this.pnlInfoContent.Name = "pnlInfoContent"; - this.pnlInfoContent.Size = new System.Drawing.Size(199, 362); + this.pnlInfoContent.Size = new System.Drawing.Size(199, 343); this.pnlInfoContent.TabIndex = 22; // // InfoDesc @@ -245,7 +248,7 @@ this.pnlFolders.Dock = System.Windows.Forms.DockStyle.Left; this.pnlFolders.Location = new System.Drawing.Point(0, 24); this.pnlFolders.Name = "pnlFolders"; - this.pnlFolders.Size = new System.Drawing.Size(196, 458); + this.pnlFolders.Size = new System.Drawing.Size(196, 439); this.pnlFolders.TabIndex = 0; // // diskView @@ -253,7 +256,7 @@ this.diskView.Dock = System.Windows.Forms.DockStyle.Fill; this.diskView.Location = new System.Drawing.Point(0, 22); this.diskView.Name = "diskView"; - this.diskView.Size = new System.Drawing.Size(196, 436); + this.diskView.Size = new System.Drawing.Size(196, 417); this.diskView.TabIndex = 13; this.diskView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.diskView_AfterSelect); // @@ -325,45 +328,95 @@ // // pnlSave // - this.pnlSave.Controls.Add(this.Button1); - this.pnlSave.Controls.Add(this.Label1); + this.pnlSave.Controls.Add(this.btnCanc); + this.pnlSave.Controls.Add(this.cmbType); this.pnlSave.Controls.Add(this.txtSave); + this.pnlSave.Controls.Add(this.classicLabel2); + this.pnlSave.Controls.Add(this.classicLabel1); + this.pnlSave.Controls.Add(this.btnSave); this.pnlSave.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlSave.Location = new System.Drawing.Point(0, 482); + this.pnlSave.Location = new System.Drawing.Point(0, 463); this.pnlSave.Name = "pnlSave"; - this.pnlSave.Size = new System.Drawing.Size(704, 35); + this.pnlSave.Size = new System.Drawing.Size(704, 54); 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(626, 3); - 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:"; + // btnCanc + // + this.btnCanc.AdaptBackColorWithTheme = true; + this.btnCanc.AdaptFontWithTheme = true; + this.btnCanc.AdaptForeColorWithTheme = true; + this.btnCanc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCanc.BackColor = System.Drawing.Color.Silver; + this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnCanc.ForeColor = System.Drawing.Color.Black; + this.btnCanc.Location = new System.Drawing.Point(619, 28); + this.btnCanc.Name = "btnCanc"; + this.btnCanc.Size = new System.Drawing.Size(75, 25); + this.btnCanc.TabIndex = 30; + this.btnCanc.Text = "Cancel"; + this.btnCanc.Click += new System.EventHandler(this.btnCanc_Click); + // + // cmbType + // + this.cmbType.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.cmbType.BackColor = System.Drawing.Color.White; + this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.cmbType.Location = new System.Drawing.Point(64, 32); + this.cmbType.Name = "cmbType"; + this.cmbType.Size = new System.Drawing.Size(549, 20); + this.cmbType.TabIndex = 29; + this.cmbType.UseSystemPasswordChar = false; // // txtSave // - this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtSave.Location = new System.Drawing.Point(60, 3); + this.txtSave.BackColor = System.Drawing.Color.White; + this.txtSave.Location = new System.Drawing.Point(64, 7); this.txtSave.Name = "txtSave"; - this.txtSave.Size = new System.Drawing.Size(560, 20); - this.txtSave.TabIndex = 15; + this.txtSave.Size = new System.Drawing.Size(549, 20); + this.txtSave.TabIndex = 28; + this.txtSave.UseSystemPasswordChar = false; + // + // classicLabel2 + // + this.classicLabel2.DropShadow = false; + this.classicLabel2.Location = new System.Drawing.Point(11, 33); + this.classicLabel2.Name = "classicLabel2"; + this.classicLabel2.Size = new System.Drawing.Size(64, 13); + this.classicLabel2.TabIndex = 26; + this.classicLabel2.Text = "File type:"; + // + // classicLabel1 + // + this.classicLabel1.DropShadow = false; + this.classicLabel1.Location = new System.Drawing.Point(11, 7); + this.classicLabel1.Name = "classicLabel1"; + this.classicLabel1.Size = new System.Drawing.Size(64, 13); + this.classicLabel1.TabIndex = 27; + this.classicLabel1.Text = "File name:"; + // + // btnSave + // + this.btnSave.AdaptBackColorWithTheme = true; + this.btnSave.AdaptFontWithTheme = true; + this.btnSave.AdaptForeColorWithTheme = true; + this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + 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(619, 2); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(75, 25); + this.btnSave.TabIndex = 25; + this.btnSave.Text = "Save"; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // MenuStrip1 // @@ -553,7 +606,6 @@ this.pnlFoldersTop.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.btnFolderClose)).EndInit(); this.pnlSave.ResumeLayout(false); - this.pnlSave.PerformLayout(); this.MenuStrip1.ResumeLayout(false); this.MenuStrip1.PerformLayout(); this.ResumeLayout(false); @@ -590,9 +642,6 @@ 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.Panel pnlInfo; private System.Windows.Forms.Panel pnlFolders; private System.Windows.Forms.Panel pnlFoldersTop; @@ -609,5 +658,11 @@ private System.Windows.Forms.Label txtInfoDescName; private System.Windows.Forms.Label txtInfoDescSize; private System.Windows.Forms.Timer refresh; + private Engine.UI.ClassicButton btnCanc; + private Engine.UI.ClassicDropDown cmbType; + private Engine.UI.ClassicTextBox txtSave; + private Engine.UI.ClassicLabel classicLabel2; + private Engine.UI.ClassicLabel classicLabel1; + private Engine.UI.ClassicButton btnSave; } } diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index f261cb2..5cc075e 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -102,17 +102,17 @@ namespace Histacom2.OS.Win95.Win95Apps IsFileSaveDialog = true; } - if (IsFileOpenDialog == true) + if (IsFileOpenDialog) { pnlSave.Show(); - Button1.Text = "Open"; + btnSave.Text = "Open"; } else { - if (IsFileSaveDialog == true) + if (IsFileSaveDialog) { pnlSave.Show(); - Button1.Text = "Save"; + btnSave.Text = "Save"; } } @@ -139,9 +139,9 @@ namespace Histacom2.OS.Win95.Win95Apps FileSystemFolderInfo toRead = new FileSystemFolderInfo(); toRead = JsonConvert.DeserializeObject(directoryFileInfo); - if (returnYesIfProtected == true) + if (returnYesIfProtected) { - if (toRead.IsProtected == true) + if (toRead.IsProtected) { return "yes"; } @@ -655,7 +655,7 @@ namespace Histacom2.OS.Win95.Win95Apps } else { // If it is a file - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (IsFileOpenDialog || IsFileSaveDialog) { if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) { @@ -734,41 +734,26 @@ namespace Histacom2.OS.Win95.Win95Apps { try { - bool OpenFile = false; if (mainView.FocusedItem != null) { - if ((string)mainView.FocusedItem.Tag == "") + if (mainView.FocusedItem.Tag.ToString() == "") { // If it isn't a file GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); } - else OpenFile = true; // If it is a file + else txtSave.Text = mainView.FocusedItem.Tag.ToString(); } - else OpenFile = true; - if (OpenFile == true) + if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); + else { - if (txtSave.Text == "") - { - wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); - } - else - { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) - { - - Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); - - } + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; - - ((Form)this.TopLevelControl).Close(); - } + ((Form)this.TopLevelControl).Close(); } - } catch { - } + catch { } } private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) @@ -929,7 +914,7 @@ namespace Histacom2.OS.Win95.Win95Apps private void FoldersToolStripMenuItem_Click(object sender, EventArgs e) { - if (FoldersToolStripMenuItem.Checked == true) + if (FoldersToolStripMenuItem.Checked) { FoldersToolStripMenuItem.Checked = false; pnlFolders.Hide(); @@ -973,7 +958,7 @@ namespace Histacom2.OS.Win95.Win95Apps } } - if (recognized == true) + if (recognized) { // TODO: } else { @@ -1137,5 +1122,36 @@ namespace Histacom2.OS.Win95.Win95Apps item.Selected = true; } } + + private void btnCanc_Click(object sender, EventArgs e) + { + ((Form)this.TopLevelControl).Close(); + } + + private void btnSave_Click(object sender, EventArgs e) + { + try + { + if (mainView.FocusedItem != null) + { + if (mainView.FocusedItem.Tag.ToString() == "") + { // If it isn't a file + GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); + } + else txtSave.Text = mainView.FocusedItem.Tag.ToString(); + } + if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); + else + { + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; + + ((Form)this.TopLevelControl).Close(); + } + } + catch { } + } } } diff --git a/Histacom2/SaveDialogs/LoadGameProfileItem.cs b/Histacom2/SaveDialogs/LoadGameProfileItem.cs index bdc0b7c..646601b 100644 --- a/Histacom2/SaveDialogs/LoadGameProfileItem.cs +++ b/Histacom2/SaveDialogs/LoadGameProfileItem.cs @@ -37,7 +37,7 @@ namespace Histacom2 if (!ClientRectangle.Contains(PointToClient(Control.MousePosition))) { sidebar.Hide(); - if (OnceRemoveHeight == false) + if (!OnceRemoveHeight) { this.Height -= 28; OnceRemoveHeight = true; @@ -49,7 +49,7 @@ namespace Histacom2 } else { sidebar.Show(); - if (OnceAddHeight == false) + if (!OnceAddHeight) { this.Height += 28; OnceAddHeight = true; @@ -95,7 +95,7 @@ namespace Histacom2 { try { - if (!RequestingNewName == false) + if (!RequestingNewName) { if (textBox1.Text == "") { diff --git a/Histacom2/SaveDialogs/NewGameDialog.cs b/Histacom2/SaveDialogs/NewGameDialog.cs index eb8d44f..e3ecd00 100644 --- a/Histacom2/SaveDialogs/NewGameDialog.cs +++ b/Histacom2/SaveDialogs/NewGameDialog.cs @@ -46,7 +46,7 @@ namespace Histacom2 if (!(txtProfName.Text.Length > 20)) { ProfileName = txtProfName.Text; - if (DevMode == true) + if (DevMode) { if (Directory.Exists(ProfileDirectory)) { @@ -84,7 +84,7 @@ namespace Histacom2 private void NewGameDialog_Load(object sender, EventArgs e) { - if (DevMode == true) + if (DevMode) { btnDevMode.Show(); } diff --git a/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs b/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs index eceff04..3283ca1 100644 --- a/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs +++ b/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs @@ -193,7 +193,7 @@ namespace Histacom2.SaveDialogs { pnlResolved.Visible = true; label1.Hide(); - if (successful == true) + if (successful) { label2.Text = "The issue has been resolved."; diff --git a/Histacom2/TitleScreen.cs b/Histacom2/TitleScreen.cs index 4e3ab01..d39ba45 100644 --- a/Histacom2/TitleScreen.cs +++ b/Histacom2/TitleScreen.cs @@ -69,7 +69,7 @@ namespace Histacom2 frm95.TopMost = true; frm95.FormBorderStyle = FormBorderStyle.None; frm95.WindowState = FormWindowState.Maximized; - //if (vm_mode.Checked == true) + //if (vm_mode.Checked) //{ // frm95.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text)); // frm95.FormBorderStyle = FormBorderStyle.Fixed3D; @@ -83,7 +83,7 @@ namespace Histacom2 frm98.TopMost = true; frm98.FormBorderStyle = FormBorderStyle.None; frm98.WindowState = FormWindowState.Maximized; - //if (vm_mode.Checked == true) + //if (vm_mode.Checked) //{ // frm98.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text)); // frm98.FormBorderStyle = FormBorderStyle.Fixed3D; @@ -97,7 +97,7 @@ namespace Histacom2 frmBadXP.TopMost = true; frmBadXP.FormBorderStyle = FormBorderStyle.None; frmBadXP.WindowState = FormWindowState.Maximized; - //if (vm_mode.Checked == true) + //if (vm_mode.Checked) //{ // frm98.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text)); // frm98.FormBorderStyle = FormBorderStyle.Fixed3D; @@ -178,7 +178,7 @@ namespace Histacom2 newGameBox = new NewGameDialog(); newGameBox.ShowDialog(); - if (newGameBox.Successful == true) + if (newGameBox.Successful) { NewGame(); StartGame(); @@ -232,7 +232,7 @@ namespace Histacom2 loadGameBox = new LoadGameDialog(); loadGameBox.ShowDialog(); - if (loadGameBox.successful == true) + if (loadGameBox.successful) { LoadSave(); SetTheme(); @@ -262,7 +262,7 @@ namespace Histacom2 private void startbutton_Click(object sender, EventArgs e) { - if (DevMode == true) + if (DevMode) { DevMode = false; gameversion.Text = "Developer Mode Deactivated"; @@ -296,7 +296,7 @@ namespace Histacom2 private void vm_mode_CheckStateChanged(object sender, EventArgs e) { // Check for VM mode - if (vm_mode.Checked == true) + if (vm_mode.Checked) { VM_Width.Visible = true; VM_Height.Visible = true; -- cgit v1.2.3 From 1cdbf9659b0153285bb56bd35ab58e0a70f4d632 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 4 Nov 2017 22:00:05 +0000 Subject: Final commit! --- Histacom2.Engine/UI/ClassicDropDown.cs | 13 +- Histacom2.Engine/UI/ClassicTextBox.Designer.cs | 8 +- Histacom2.Engine/UI/ClassicTextbox.cs | 14 +- Histacom2/Histacom2.csproj | 3 + .../OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 2 +- .../Win95Apps/WinClassicFTPClient.Designer.cs | 217 +++++++++++---------- .../OS/Win95/Win95Apps/WinClassicFTPClient.cs | 6 +- .../OS/Win95/Win95Apps/WinClassicFTPClient.resx | 2 +- .../AddressBook/WinClassicAddressBook.Designer.cs | 2 +- .../Win98Apps/AddressBook/WinClassicAddressBook.cs | 7 +- .../WinClassicWindowsExplorer.Designer.cs | 150 +++++++------- .../Win98/Win98Apps/WinClassicWindowsExplorer.cs | 32 ++- .../Win98/Win98Apps/WinClassicWindowsExplorer.resx | 9 + Histacom2/Properties/Resources.resx | 6 + Histacom2/Properties/Resources1.Designer.cs | 26 ++- Histacom2/Resources/WinClassicAddressBookBig.png | Bin 0 -> 2146 bytes Histacom2/Resources/WinClassicDrive.png | Bin 0 -> 238 bytes Histacom2/Resources/addrbook.ico_32x32[1].png | Bin 0 -> 2146 bytes 18 files changed, 294 insertions(+), 203 deletions(-) create mode 100644 Histacom2/Resources/WinClassicAddressBookBig.png create mode 100644 Histacom2/Resources/WinClassicDrive.png create mode 100644 Histacom2/Resources/addrbook.ico_32x32[1].png (limited to 'Histacom2.Engine/UI/ClassicTextbox.cs') diff --git a/Histacom2.Engine/UI/ClassicDropDown.cs b/Histacom2.Engine/UI/ClassicDropDown.cs index edf2268..e01ca2a 100644 --- a/Histacom2.Engine/UI/ClassicDropDown.cs +++ b/Histacom2.Engine/UI/ClassicDropDown.cs @@ -14,7 +14,6 @@ namespace Histacom2.Engine.UI public partial class ClassicDropDown : UserControl { public DropDownOverlay thisOverlay = new DropDownOverlay(); - public bool UseSystemPasswordChar { get; set; } public bool dropDownShown; public override string Text @@ -29,6 +28,18 @@ namespace Histacom2.Engine.UI } } + public bool UseSystemPasswordChar + { + get + { + return textBox1.UseSystemPasswordChar; + } + set + { + textBox1.UseSystemPasswordChar = value; + } + } + public static Color textboxcolor = Color.Black; public static Color _lightBack = Color.Silver; diff --git a/Histacom2.Engine/UI/ClassicTextBox.Designer.cs b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs index af6b199..06df3fb 100644 --- a/Histacom2.Engine/UI/ClassicTextBox.Designer.cs +++ b/Histacom2.Engine/UI/ClassicTextBox.Designer.cs @@ -42,7 +42,7 @@ // bborder // this.bborder.Dock = System.Windows.Forms.DockStyle.Bottom; - this.bborder.Location = new System.Drawing.Point(2, 15); + 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; @@ -53,7 +53,7 @@ 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.Size = new System.Drawing.Size(2, 20); this.lborder.TabIndex = 1; this.lborder.TabStop = false; // @@ -62,7 +62,7 @@ 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.Size = new System.Drawing.Size(2, 20); this.rborder.TabIndex = 2; this.rborder.TabStop = false; // @@ -94,7 +94,7 @@ this.Controls.Add(this.rborder); this.Controls.Add(this.lborder); this.Name = "ClassicTextBox"; - this.Size = new System.Drawing.Size(100, 17); + 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(); diff --git a/Histacom2.Engine/UI/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs index f89df03..4847ed5 100644 --- a/Histacom2.Engine/UI/ClassicTextbox.cs +++ b/Histacom2.Engine/UI/ClassicTextbox.cs @@ -12,8 +12,6 @@ namespace Histacom2.Engine.UI { public partial class ClassicTextBox : UserControl { - public bool UseSystemPasswordChar { get; set; } - public static Color textboxcolor = Color.Black; public static Color _lightBack = Color.Silver; @@ -31,6 +29,18 @@ namespace Histacom2.Engine.UI } } + public bool UseSystemPasswordChar + { + get + { + return textBox1.UseSystemPasswordChar; + } + set + { + textBox1.UseSystemPasswordChar = value; + } + } + public ClassicTextBox() { InitializeComponent(); diff --git a/Histacom2/Histacom2.csproj b/Histacom2/Histacom2.csproj index 1c34422..19cf5dc 100644 --- a/Histacom2/Histacom2.csproj +++ b/Histacom2/Histacom2.csproj @@ -759,6 +759,7 @@ + @@ -878,6 +879,8 @@ + + diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 1ac4512..e743b30 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -88,7 +88,7 @@ namespace Histacom2.OS.Win95.Win95Apps Properties.Resources.WinClassicGTN, Properties.Resources.WinClassicFTP, Properties.Resources.WinClassicRtfFile, // 20 - Properties.Resources.WinClassicAddressBook}); + Properties.Resources.WinClassicAddressBookBig}); program.BringToFront(); diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.Designer.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.Designer.cs index c112e61..ead2483 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.Designer.cs @@ -38,21 +38,21 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassicFTPClient)); this.topBar = new System.Windows.Forms.Panel(); this.btnLogin = new Histacom2.Engine.UI.ClassicButton(); - this.infoLabel = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.textBox4 = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.passBox = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.usernameBox = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.hostnameBox = new System.Windows.Forms.TextBox(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.btnCancel = new Histacom2.Engine.UI.ClassicButton(); this.welcomeLabel = new System.Windows.Forms.Label(); this.ftpFiles = new System.Windows.Forms.ListView(); this.fileIcons = new System.Windows.Forms.ImageList(this.components); + this.hostnameBox = new Histacom2.Engine.UI.ClassicTextBox(); + this.usernameBox = new Histacom2.Engine.UI.ClassicTextBox(); + this.passBox = new Histacom2.Engine.UI.ClassicTextBox(); + this.infoLabel = new Histacom2.Engine.UI.ClassicLabel(); + this.textBox4 = new Histacom2.Engine.UI.ClassicTextBox(); + this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel3 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel4 = new Histacom2.Engine.UI.ClassicLabel(); this.topBar.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); @@ -60,16 +60,16 @@ // topBar // this.topBar.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.topBar.Controls.Add(this.btnLogin); this.topBar.Controls.Add(this.infoLabel); - this.topBar.Controls.Add(this.label4); this.topBar.Controls.Add(this.textBox4); - this.topBar.Controls.Add(this.label3); this.topBar.Controls.Add(this.passBox); - this.topBar.Controls.Add(this.label2); this.topBar.Controls.Add(this.usernameBox); - this.topBar.Controls.Add(this.label1); this.topBar.Controls.Add(this.hostnameBox); + this.topBar.Controls.Add(this.btnLogin); + this.topBar.Controls.Add(this.classicLabel4); + this.topBar.Controls.Add(this.classicLabel3); + this.topBar.Controls.Add(this.classicLabel2); + this.topBar.Controls.Add(this.classicLabel1); this.topBar.Dock = System.Windows.Forms.DockStyle.Top; this.topBar.Location = new System.Drawing.Point(0, 0); this.topBar.Name = "topBar"; @@ -85,91 +85,13 @@ this.btnLogin.DialogResult = System.Windows.Forms.DialogResult.None; this.btnLogin.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.btnLogin.ForeColor = System.Drawing.Color.Black; - this.btnLogin.Location = new System.Drawing.Point(585, 4); + this.btnLogin.Location = new System.Drawing.Point(571, 4); this.btnLogin.Name = "btnLogin"; this.btnLogin.Size = new System.Drawing.Size(44, 20); this.btnLogin.TabIndex = 9; this.btnLogin.Text = "Login"; this.btnLogin.Click += new System.EventHandler(this.button1_Click); // - // infoLabel - // - this.infoLabel.AutoSize = true; - this.infoLabel.ForeColor = System.Drawing.Color.Red; - this.infoLabel.Location = new System.Drawing.Point(635, 7); - this.infoLabel.Name = "infoLabel"; - this.infoLabel.Size = new System.Drawing.Size(35, 13); - this.infoLabel.TabIndex = 8; - this.infoLabel.Text = "label5"; - this.infoLabel.Visible = false; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(503, 7); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(29, 13); - this.label4.TabIndex = 6; - this.label4.Text = "&Port:"; - // - // textBox4 - // - this.textBox4.Enabled = false; - this.textBox4.Location = new System.Drawing.Point(538, 4); - this.textBox4.Name = "textBox4"; - this.textBox4.Size = new System.Drawing.Size(41, 20); - this.textBox4.TabIndex = 7; - this.textBox4.Text = "21"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(335, 7); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(56, 13); - this.label3.TabIndex = 4; - this.label3.Text = "Pass&word:"; - // - // passBox - // - this.passBox.Location = new System.Drawing.Point(397, 4); - this.passBox.Name = "passBox"; - this.passBox.PasswordChar = '*'; - this.passBox.Size = new System.Drawing.Size(100, 20); - this.passBox.TabIndex = 5; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(156, 7); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(58, 13); - this.label2.TabIndex = 2; - this.label2.Text = "&Username:"; - // - // usernameBox - // - this.usernameBox.Location = new System.Drawing.Point(214, 4); - this.usernameBox.Name = "usernameBox"; - this.usernameBox.Size = new System.Drawing.Size(100, 20); - this.usernameBox.TabIndex = 3; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(8, 7); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(32, 13); - this.label1.TabIndex = 1; - this.label1.Text = "&Host:"; - // - // hostnameBox - // - this.hostnameBox.Location = new System.Drawing.Point(41, 4); - this.hostnameBox.Name = "hostnameBox"; - this.hostnameBox.Size = new System.Drawing.Size(100, 20); - this.hostnameBox.TabIndex = 1; - // // contextMenuStrip1 // this.contextMenuStrip1.Name = "contextMenuStrip1"; @@ -246,6 +168,96 @@ this.fileIcons.Images.SetKeyName(1, "WinClassicNotepad.png"); this.fileIcons.Images.SetKeyName(2, "WinClassicSetup.png"); // + // hostnameBox + // + this.hostnameBox.BackColor = System.Drawing.Color.White; + this.hostnameBox.Location = new System.Drawing.Point(37, 4); + this.hostnameBox.Name = "hostnameBox"; + this.hostnameBox.Size = new System.Drawing.Size(113, 20); + this.hostnameBox.TabIndex = 10; + this.hostnameBox.UseSystemPasswordChar = false; + // + // usernameBox + // + this.usernameBox.BackColor = System.Drawing.Color.White; + this.usernameBox.Location = new System.Drawing.Point(220, 4); + this.usernameBox.Name = "usernameBox"; + this.usernameBox.Size = new System.Drawing.Size(109, 20); + this.usernameBox.TabIndex = 10; + this.usernameBox.UseSystemPasswordChar = false; + // + // passBox + // + this.passBox.BackColor = System.Drawing.Color.White; + this.passBox.Location = new System.Drawing.Point(392, 4); + this.passBox.Name = "passBox"; + this.passBox.Size = new System.Drawing.Size(105, 20); + this.passBox.TabIndex = 10; + this.passBox.UseSystemPasswordChar = true; + // + // infoLabel + // + this.infoLabel.DropShadow = false; + this.infoLabel.ForeColor = System.Drawing.Color.Red; + this.infoLabel.Location = new System.Drawing.Point(621, 7); + this.infoLabel.Name = "infoLabel"; + this.infoLabel.Size = new System.Drawing.Size(75, 13); + this.infoLabel.TabIndex = 11; + this.infoLabel.Text = "classicLabel1"; + // + // textBox4 + // + this.textBox4.BackColor = System.Drawing.Color.White; + this.textBox4.Location = new System.Drawing.Point(530, 4); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(36, 20); + this.textBox4.TabIndex = 10; + this.textBox4.UseSystemPasswordChar = false; + // + // classicLabel1 + // + this.classicLabel1.BackColor = System.Drawing.Color.Transparent; + this.classicLabel1.DropShadow = false; + this.classicLabel1.ForeColor = System.Drawing.Color.Black; + this.classicLabel1.Location = new System.Drawing.Point(3, 7); + this.classicLabel1.Name = "classicLabel1"; + this.classicLabel1.Size = new System.Drawing.Size(75, 13); + this.classicLabel1.TabIndex = 11; + this.classicLabel1.Text = "Host:"; + // + // classicLabel2 + // + this.classicLabel2.BackColor = System.Drawing.Color.Transparent; + this.classicLabel2.DropShadow = false; + this.classicLabel2.ForeColor = System.Drawing.Color.Black; + this.classicLabel2.Location = new System.Drawing.Point(156, 7); + this.classicLabel2.Name = "classicLabel2"; + this.classicLabel2.Size = new System.Drawing.Size(75, 13); + this.classicLabel2.TabIndex = 11; + this.classicLabel2.Text = "Username:"; + // + // classicLabel3 + // + this.classicLabel3.BackColor = System.Drawing.Color.Transparent; + this.classicLabel3.DropShadow = false; + this.classicLabel3.ForeColor = System.Drawing.Color.Black; + this.classicLabel3.Location = new System.Drawing.Point(335, 7); + this.classicLabel3.Name = "classicLabel3"; + this.classicLabel3.Size = new System.Drawing.Size(75, 13); + this.classicLabel3.TabIndex = 11; + this.classicLabel3.Text = "Password:"; + // + // classicLabel4 + // + this.classicLabel4.BackColor = System.Drawing.Color.Transparent; + this.classicLabel4.DropShadow = false; + this.classicLabel4.ForeColor = System.Drawing.Color.Black; + this.classicLabel4.Location = new System.Drawing.Point(503, 7); + this.classicLabel4.Name = "classicLabel4"; + this.classicLabel4.Size = new System.Drawing.Size(75, 13); + this.classicLabel4.TabIndex = 11; + this.classicLabel4.Text = "Port:"; + // // WinClassicFTPClient // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -257,7 +269,6 @@ this.Size = new System.Drawing.Size(762, 499); this.Load += new System.EventHandler(this.WinClassicFTPClient_Load); this.topBar.ResumeLayout(false); - this.topBar.PerformLayout(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); @@ -266,21 +277,21 @@ #endregion private System.Windows.Forms.Panel topBar; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox textBox4; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox passBox; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox usernameBox; - private System.Windows.Forms.Label label1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - public System.Windows.Forms.TextBox hostnameBox; - private System.Windows.Forms.Label infoLabel; private System.Windows.Forms.Panel panel1; private Engine.UI.ClassicButton btnCancel; private System.Windows.Forms.Label welcomeLabel; internal System.Windows.Forms.ListView ftpFiles; private System.Windows.Forms.ImageList fileIcons; private Engine.UI.ClassicButton btnLogin; + private Engine.UI.ClassicTextBox hostnameBox; + private Engine.UI.ClassicTextBox passBox; + private Engine.UI.ClassicTextBox usernameBox; + private Engine.UI.ClassicLabel infoLabel; + private Engine.UI.ClassicTextBox textBox4; + private Engine.UI.ClassicLabel classicLabel1; + private Engine.UI.ClassicLabel classicLabel3; + private Engine.UI.ClassicLabel classicLabel2; + private Engine.UI.ClassicLabel classicLabel4; } } diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs index df531c3..d20563e 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs @@ -17,6 +17,10 @@ namespace Histacom2.OS.Win95.Win95Apps public WinClassicFTPClient() { InitializeComponent(); + + hostnameBox.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0))); + usernameBox.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0))); + passBox.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0))); } @@ -64,7 +68,7 @@ namespace Histacom2.OS.Win95.Win95Apps private void WinClassicFTPClient_Load(object sender, EventArgs e) { - + textBox4.Text = "21"; } private void topBar_Paint(object sender, PaintEventArgs e) diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.resx b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.resx index e03fcd1..067a121 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.resx +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.resx @@ -128,7 +128,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABe - EgAAAk1TRnQBSQFMAgEBAwEAAUABAAFAAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + EgAAAk1TRnQBSQFMAgEBAwEAAUgBAAFIAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs index 5452184..f76bb99 100644 --- a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.Designer.cs @@ -383,7 +383,7 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.ListView contactsView; - private System.Windows.Forms.TreeView treeView1; + public System.Windows.Forms.TreeView treeView1; private System.Windows.Forms.ToolStripMenuItem toolbarToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem foldersToolStripMenuItem; private System.Windows.Forms.Panel toolbar; diff --git a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs index bf4f648..fd2bf0f 100644 --- a/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs +++ b/Histacom2/OS/Win98/Win98Apps/AddressBook/WinClassicAddressBook.cs @@ -388,8 +388,11 @@ namespace Histacom2.OS.Win95.Win95Apps public void UpdateTreeView(AddressBookContactList lst, int count = 0) { try - { - string[] parts = lst.NodePath.Split('\\'); + { + string[] parts = new string[] { "Shared Contacts" }; + if (lst.NodePath != null) + parts = lst.NodePath.Split('\\'); + if (count == 0) UpdatePrevParent = treeView1.Nodes[0]; if (lst.NodePath != FindNodePath(treeView1.Nodes[0])) { diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index f88d451..586c6c2 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -29,24 +29,25 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassicWindowsExplorer)); this.program = new System.Windows.Forms.Panel(); this.mainView = new System.Windows.Forms.ListView(); this.pnlInfo = new System.Windows.Forms.Panel(); + this.txtInfoTitle = new Histacom2.Engine.UI.ClassicLabel(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.txtInfoTitle = new System.Windows.Forms.Label(); this.pnlInfoContent = new System.Windows.Forms.Panel(); this.InfoDesc = new System.Windows.Forms.Panel(); - this.txtInfoDescSize = new System.Windows.Forms.Label(); - this.txtInfoDescModified = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.txtInfoDescType = new System.Windows.Forms.Label(); - this.txtInfoDescName = new System.Windows.Forms.Label(); - this.txtInfoTip = new System.Windows.Forms.Label(); + this.classicLabel3 = new Histacom2.Engine.UI.ClassicLabel(); + this.txtInfoDescSize = new Histacom2.Engine.UI.ClassicLabel(); + this.txtInfoDescModified = new Histacom2.Engine.UI.ClassicLabel(); + this.txtInfoDescType = new Histacom2.Engine.UI.ClassicLabel(); + this.txtInfoDescName = new Histacom2.Engine.UI.ClassicLabel(); + this.txtInfoTip = new Histacom2.Engine.UI.ClassicLabel(); this.pnlFolders = new System.Windows.Forms.Panel(); this.diskView = new System.Windows.Forms.TreeView(); this.pnlFoldersTop = new System.Windows.Forms.Panel(); - this.label2 = new System.Windows.Forms.Label(); this.btnFolderClose = new System.Windows.Forms.PictureBox(); + this.classicLabel4 = new Histacom2.Engine.UI.ClassicLabel(); this.toprightcorner = new System.Windows.Forms.Panel(); this.bottomrightcorner = new System.Windows.Forms.Panel(); this.bottomleftcorner = new System.Windows.Forms.Panel(); @@ -127,8 +128,8 @@ this.pnlInfo.BackColor = System.Drawing.Color.White; this.pnlInfo.BackgroundImage = global::Histacom2.Properties.Resources.Win98WebBackground; this.pnlInfo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.pnlInfo.Controls.Add(this.pictureBox1); this.pnlInfo.Controls.Add(this.txtInfoTitle); + this.pnlInfo.Controls.Add(this.pictureBox1); this.pnlInfo.Controls.Add(this.pnlInfoContent); this.pnlInfo.Dock = System.Windows.Forms.DockStyle.Left; this.pnlInfo.Location = new System.Drawing.Point(196, 24); @@ -136,28 +137,28 @@ this.pnlInfo.Size = new System.Drawing.Size(200, 439); this.pnlInfo.TabIndex = 19; // + // txtInfoTitle + // + this.txtInfoTitle.BackColor = System.Drawing.Color.Transparent; + this.txtInfoTitle.DropShadow = false; + this.txtInfoTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F); + this.txtInfoTitle.Location = new System.Drawing.Point(13, 56); + this.txtInfoTitle.Name = "txtInfoTitle"; + this.txtInfoTitle.Size = new System.Drawing.Size(194, 30); + this.txtInfoTitle.TabIndex = 23; + this.txtInfoTitle.Text = "FOLDER_NAME"; + // // pictureBox1 // this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.Image = global::Histacom2.Properties.Resources.WinClassicFolderSmall; + this.pictureBox1.Image = global::Histacom2.Properties.Resources.WinClassicFolder; this.pictureBox1.Location = new System.Drawing.Point(15, 18); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(30, 30); + this.pictureBox1.Size = new System.Drawing.Size(32, 32); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 20; this.pictureBox1.TabStop = false; // - // txtInfoTitle - // - this.txtInfoTitle.AutoSize = true; - this.txtInfoTitle.BackColor = System.Drawing.Color.Transparent; - this.txtInfoTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtInfoTitle.Location = new System.Drawing.Point(3, 51); - this.txtInfoTitle.Name = "txtInfoTitle"; - this.txtInfoTitle.Size = new System.Drawing.Size(192, 29); - this.txtInfoTitle.TabIndex = 0; - this.txtInfoTitle.Text = "FOLDER_NAME"; - // // pnlInfoContent // this.pnlInfoContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -173,73 +174,72 @@ // // InfoDesc // + this.InfoDesc.Controls.Add(this.classicLabel3); this.InfoDesc.Controls.Add(this.txtInfoDescSize); this.InfoDesc.Controls.Add(this.txtInfoDescModified); - this.InfoDesc.Controls.Add(this.label5); this.InfoDesc.Controls.Add(this.txtInfoDescType); this.InfoDesc.Controls.Add(this.txtInfoDescName); this.InfoDesc.Dock = System.Windows.Forms.DockStyle.Top; - this.InfoDesc.Location = new System.Drawing.Point(0, 25); + this.InfoDesc.Location = new System.Drawing.Point(0, 26); this.InfoDesc.Name = "InfoDesc"; this.InfoDesc.Size = new System.Drawing.Size(199, 94); this.InfoDesc.TabIndex = 22; this.InfoDesc.Visible = false; // + // classicLabel3 + // + this.classicLabel3.DropShadow = false; + this.classicLabel3.Location = new System.Drawing.Point(13, 38); + this.classicLabel3.Name = "classicLabel3"; + this.classicLabel3.Size = new System.Drawing.Size(179, 13); + this.classicLabel3.TabIndex = 1; + this.classicLabel3.Text = "Last modified:"; + // // txtInfoDescSize // - this.txtInfoDescSize.AutoSize = true; - this.txtInfoDescSize.Location = new System.Drawing.Point(12, 81); + this.txtInfoDescSize.DropShadow = false; + this.txtInfoDescSize.Location = new System.Drawing.Point(15, 76); this.txtInfoDescSize.Name = "txtInfoDescSize"; - this.txtInfoDescSize.Size = new System.Drawing.Size(59, 13); - this.txtInfoDescSize.TabIndex = 0; + this.txtInfoDescSize.Size = new System.Drawing.Size(179, 13); + this.txtInfoDescSize.TabIndex = 1; this.txtInfoDescSize.Text = "FILE_SIZE"; // // txtInfoDescModified // - this.txtInfoDescModified.AutoSize = true; - this.txtInfoDescModified.Location = new System.Drawing.Point(12, 54); + this.txtInfoDescModified.DropShadow = false; + this.txtInfoDescModified.Location = new System.Drawing.Point(13, 57); this.txtInfoDescModified.Name = "txtInfoDescModified"; - this.txtInfoDescModified.Size = new System.Drawing.Size(92, 13); - this.txtInfoDescModified.TabIndex = 0; - this.txtInfoDescModified.Text = "LAST_MODIFIED"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(12, 41); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(73, 13); - this.label5.TabIndex = 0; - this.label5.Text = "Last Modified:"; + this.txtInfoDescModified.Size = new System.Drawing.Size(179, 13); + this.txtInfoDescModified.TabIndex = 1; + this.txtInfoDescModified.Text = "DATE_MODIFIED"; // // txtInfoDescType // - this.txtInfoDescType.AutoSize = true; - this.txtInfoDescType.Location = new System.Drawing.Point(12, 18); + this.txtInfoDescType.DropShadow = false; + this.txtInfoDescType.Location = new System.Drawing.Point(13, 19); this.txtInfoDescType.Name = "txtInfoDescType"; - this.txtInfoDescType.Size = new System.Drawing.Size(63, 13); - this.txtInfoDescType.TabIndex = 0; + this.txtInfoDescType.Size = new System.Drawing.Size(183, 13); + this.txtInfoDescType.TabIndex = 1; this.txtInfoDescType.Text = "FILE_TYPE"; // // txtInfoDescName // - this.txtInfoDescName.AutoSize = true; - this.txtInfoDescName.Location = new System.Drawing.Point(12, 5); + this.txtInfoDescName.DropShadow = false; + this.txtInfoDescName.Location = new System.Drawing.Point(13, 2); this.txtInfoDescName.Name = "txtInfoDescName"; - this.txtInfoDescName.Size = new System.Drawing.Size(66, 13); - this.txtInfoDescName.TabIndex = 0; + this.txtInfoDescName.Size = new System.Drawing.Size(179, 13); + this.txtInfoDescName.TabIndex = 1; this.txtInfoDescName.Text = "FILE_NAME"; // // txtInfoTip // - this.txtInfoTip.BackColor = System.Drawing.Color.Transparent; this.txtInfoTip.Dock = System.Windows.Forms.DockStyle.Top; + this.txtInfoTip.DropShadow = false; this.txtInfoTip.Location = new System.Drawing.Point(0, 0); this.txtInfoTip.Name = "txtInfoTip"; - this.txtInfoTip.Size = new System.Drawing.Size(199, 25); - this.txtInfoTip.TabIndex = 21; - this.txtInfoTip.Text = "Select an item to view its description."; - this.txtInfoTip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.txtInfoTip.Size = new System.Drawing.Size(199, 26); + this.txtInfoTip.TabIndex = 23; + this.txtInfoTip.Text = "Please choose an item to view it\'s description."; // // pnlFolders // @@ -263,23 +263,14 @@ // pnlFoldersTop // this.pnlFoldersTop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); - this.pnlFoldersTop.Controls.Add(this.label2); this.pnlFoldersTop.Controls.Add(this.btnFolderClose); + this.pnlFoldersTop.Controls.Add(this.classicLabel4); this.pnlFoldersTop.Dock = System.Windows.Forms.DockStyle.Top; this.pnlFoldersTop.Location = new System.Drawing.Point(0, 0); this.pnlFoldersTop.Name = "pnlFoldersTop"; this.pnlFoldersTop.Size = new System.Drawing.Size(196, 22); this.pnlFoldersTop.TabIndex = 20; // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(3, 3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(41, 13); - this.label2.TabIndex = 1; - this.label2.Text = "Folders"; - // // btnFolderClose // this.btnFolderClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200))))); @@ -294,6 +285,15 @@ this.btnFolderClose.MouseEnter += new System.EventHandler(this.pictureBox1_MouseEnter); this.btnFolderClose.MouseLeave += new System.EventHandler(this.btnFolderClose_MouseLeave); // + // classicLabel4 + // + this.classicLabel4.DropShadow = false; + this.classicLabel4.Location = new System.Drawing.Point(3, 5); + this.classicLabel4.Name = "classicLabel4"; + this.classicLabel4.Size = new System.Drawing.Size(179, 13); + this.classicLabel4.TabIndex = 1; + this.classicLabel4.Text = "Folders"; + // // toprightcorner // this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -365,6 +365,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.cmbType.BackColor = System.Drawing.Color.White; this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.cmbType.Items = ((System.Collections.Generic.List)(resources.GetObject("cmbType.Items"))); this.cmbType.Location = new System.Drawing.Point(64, 32); this.cmbType.Name = "cmbType"; this.cmbType.Size = new System.Drawing.Size(549, 20); @@ -596,14 +597,11 @@ this.program.ResumeLayout(false); this.program.PerformLayout(); this.pnlInfo.ResumeLayout(false); - this.pnlInfo.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.pnlInfoContent.ResumeLayout(false); this.InfoDesc.ResumeLayout(false); - this.InfoDesc.PerformLayout(); this.pnlFolders.ResumeLayout(false); this.pnlFoldersTop.ResumeLayout(false); - this.pnlFoldersTop.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.btnFolderClose)).EndInit(); this.pnlSave.ResumeLayout(false); this.MenuStrip1.ResumeLayout(false); @@ -646,17 +644,9 @@ private System.Windows.Forms.Panel pnlFolders; private System.Windows.Forms.Panel pnlFoldersTop; private System.Windows.Forms.PictureBox btnFolderClose; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label txtInfoTitle; private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label txtInfoTip; private System.Windows.Forms.Panel pnlInfoContent; private System.Windows.Forms.Panel InfoDesc; - private System.Windows.Forms.Label txtInfoDescModified; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label txtInfoDescType; - private System.Windows.Forms.Label txtInfoDescName; - private System.Windows.Forms.Label txtInfoDescSize; private System.Windows.Forms.Timer refresh; private Engine.UI.ClassicButton btnCanc; private Engine.UI.ClassicDropDown cmbType; @@ -664,5 +654,13 @@ private Engine.UI.ClassicLabel classicLabel2; private Engine.UI.ClassicLabel classicLabel1; private Engine.UI.ClassicButton btnSave; + private Engine.UI.ClassicLabel txtInfoTitle; + private Engine.UI.ClassicLabel txtInfoTip; + private Engine.UI.ClassicLabel txtInfoDescName; + private Engine.UI.ClassicLabel txtInfoDescType; + private Engine.UI.ClassicLabel classicLabel3; + private Engine.UI.ClassicLabel txtInfoDescModified; + private Engine.UI.ClassicLabel txtInfoDescSize; + private Engine.UI.ClassicLabel classicLabel4; } } diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index 947f9ba..bc121e6 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -38,11 +38,6 @@ namespace Histacom2.OS.Win95.Win95Apps void WinClassicWindowsExplorer_Load(object sender, EventArgs e) { - if (SaveSystem.CurrentSave.CurrentOS == "2000") - { - pnlInfo.Width = 200; - txtInfoTitle.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0))); - } diskView.ImageList = new ImageList(); @@ -82,7 +77,7 @@ namespace Histacom2.OS.Win95.Win95Apps Properties.Resources.WinClassicGTN, Properties.Resources.WinClassicFTP, Properties.Resources.WinClassicRtfFile, // 20 - Properties.Resources.WinClassicAddressBook}); + Properties.Resources.WinClassicAddressBookBig}); program.BringToFront(); @@ -122,6 +117,9 @@ namespace Histacom2.OS.Win95.Win95Apps cmbType.Items.Add(str); cmbType.Text = onlyViewExtension.FirstOrDefault(); + + txtSave.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + cmbType.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); } //'Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) @@ -168,10 +166,10 @@ namespace Histacom2.OS.Win95.Win95Apps pictureBox1.Image = Properties.Resources.Win95ComputerIcon; } else if (CurrentDirectory == ProfileMyComputerDirectory) { txtInfoTitle.Text = "C:"; - pictureBox1.Image = Properties.Resources.WinClassicFolderSmall; // TODO: ADD DRIVE ICON + pictureBox1.Image = Properties.Resources.WinClassicDrive; } else { txtInfoTitle.Text = Path.GetFileName(CurrentDirectory); - pictureBox1.Image = Properties.Resources.WinClassicFolderSmall; + pictureBox1.Image = Properties.Resources.WinClassicFolder; } @@ -283,6 +281,19 @@ namespace Histacom2.OS.Win95.Win95Apps case 12: OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir), fileDir); break; + case 13: + WinClassicAddressBook wcab = new WinClassicAddressBook(); + wcab.AddressBookObjects = JsonConvert.DeserializeObject>(File.ReadAllText(fileDir)); + + wcab.treeView1.Nodes.Clear(); + wcab.treeView1.Nodes.Add("Shared Contacts"); + foreach (AddressBookContactList lst in wcab.AddressBookObjects) + wcab.UpdateTreeView(lst); + + WinClassic app3 = wm.Init(wcab, "Address Book", Properties.Resources.WinClassicAddressBook, true, true); + + Program.AddTaskbarItem(app3, app3.Tag.ToString(), "Address Book", Properties.Resources.WinClassicAddressBook); + break; } } catch @@ -407,9 +418,10 @@ namespace Histacom2.OS.Win95.Win95Apps case ".bmp": case ".zip": return 11; - case ".exe": return 12; + case ".wab": + return 13; case ".avi": case ".m4v": case ".mp4": @@ -820,6 +832,8 @@ namespace Histacom2.OS.Win95.Win95Apps return "Image File"; case 12: return "Executable File"; + case 13: + return "Address Book File"; case 21: return "Video File"; case 16: diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx index e1edd06..3b47ace 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.resx @@ -120,6 +120,15 @@ 17, 17 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u + ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u + PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB + AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0 + ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAAAAAAAAAAAABEDAAAAAAAAAAs= + + 132, 17 diff --git a/Histacom2/Properties/Resources.resx b/Histacom2/Properties/Resources.resx index c34dd0c..605ba09 100644 --- a/Histacom2/Properties/Resources.resx +++ b/Histacom2/Properties/Resources.resx @@ -2123,4 +2123,10 @@ ..\Resources\distort fail.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\WinClassicAddressBookBig.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\WinClassicDrive.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Histacom2/Properties/Resources1.Designer.cs b/Histacom2/Properties/Resources1.Designer.cs index a053ed4..69aefb6 100644 --- a/Histacom2/Properties/Resources1.Designer.cs +++ b/Histacom2/Properties/Resources1.Designer.cs @@ -19,7 +19,7 @@ namespace Histacom2.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 { @@ -976,7 +976,9 @@ namespace Histacom2.Properties { /// "btn4txt": "", /// "btn4tag": "", /// "btn5txt": "", - /// "btn5tag": " [rest of string was truncated]";. + /// "btn5tag": "" + /// }, + /// "inthe [rest of string was truncated]";. /// public static string std_story { get { @@ -1613,6 +1615,16 @@ namespace Histacom2.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap WinClassicAddressBookBig { + get { + object obj = ResourceManager.GetObject("WinClassicAddressBookBig", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1703,6 +1715,16 @@ namespace Histacom2.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap WinClassicDrive { + get { + object obj = ResourceManager.GetObject("WinClassicDrive", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Histacom2/Resources/WinClassicAddressBookBig.png b/Histacom2/Resources/WinClassicAddressBookBig.png new file mode 100644 index 0000000..ceee626 Binary files /dev/null and b/Histacom2/Resources/WinClassicAddressBookBig.png differ diff --git a/Histacom2/Resources/WinClassicDrive.png b/Histacom2/Resources/WinClassicDrive.png new file mode 100644 index 0000000..5ac1517 Binary files /dev/null and b/Histacom2/Resources/WinClassicDrive.png differ diff --git a/Histacom2/Resources/addrbook.ico_32x32[1].png b/Histacom2/Resources/addrbook.ico_32x32[1].png new file mode 100644 index 0000000..ceee626 Binary files /dev/null and b/Histacom2/Resources/addrbook.ico_32x32[1].png differ -- cgit v1.2.3