From 311d896ca59155f4a1cd80921cd76c548937367a Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 1 Jul 2017 22:36:17 -0400 Subject: paint it black (on the bottom and right) --- TimeHACK.Engine/Paintbrush.cs | 22 ++++++++++++++++++++++ TimeHACK.Engine/TimeHACK.Engine.csproj | 1 + 2 files changed, 23 insertions(+) create mode 100644 TimeHACK.Engine/Paintbrush.cs (limited to 'TimeHACK.Engine') diff --git a/TimeHACK.Engine/Paintbrush.cs b/TimeHACK.Engine/Paintbrush.cs new file mode 100644 index 0000000..2b640cf --- /dev/null +++ b/TimeHACK.Engine/Paintbrush.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TimeHACK.Engine +{ + public class Paintbrush + { + public static void paintClassicBorders(object sender, PaintEventArgs e, int borderwidth) + { + ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset); + } + } +} diff --git a/TimeHACK.Engine/TimeHACK.Engine.csproj b/TimeHACK.Engine/TimeHACK.Engine.csproj index 7ee8e6e..6a2dba4 100644 --- a/TimeHACK.Engine/TimeHACK.Engine.csproj +++ b/TimeHACK.Engine/TimeHACK.Engine.csproj @@ -49,6 +49,7 @@ + -- cgit v1.2.3 From c75aea5a35405b81de4f9ee679ed415cdc0fdeef Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 1 Jul 2017 22:49:31 -0400 Subject: a few improved things --- TimeHACK.Engine/Paintbrush.cs | 10 +++++++++- TimeHACK.Main/OS/Win95/Win95.Designer.cs | 2 +- TimeHACK.Main/OS/Win95/Win95.cs | 13 +------------ TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs | 1 + TimeHACK.Main/OS/Win98/Win98.Designer.cs | 2 +- TimeHACK.Main/Program.cs | 6 +++--- TimeHACK.Main/TitleScreen.Designer.cs | 2 +- 7 files changed, 17 insertions(+), 19 deletions(-) (limited to 'TimeHACK.Engine') diff --git a/TimeHACK.Engine/Paintbrush.cs b/TimeHACK.Engine/Paintbrush.cs index 2b640cf..9b94ad8 100644 --- a/TimeHACK.Engine/Paintbrush.cs +++ b/TimeHACK.Engine/Paintbrush.cs @@ -10,8 +10,16 @@ namespace TimeHACK.Engine { public class Paintbrush { - public static void paintClassicBorders(object sender, PaintEventArgs e, int borderwidth) + public enum BGStyle { + NoChange, + Silver, + XP + } + + public static void paintClassicBorders(object sender, PaintEventArgs e, int borderwidth, BGStyle bg) + { + ((Control)sender).BackColor = Color.Silver; ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle, SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index f963251..2a39d34 100644 --- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs @@ -223,7 +223,7 @@ namespace TimeHACK.OS.Win95 this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(174, 300); this.startmenu.TabIndex = 3; - this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2, Engine.Paintbrush.BGStyle.NoChange); // // startmenuitems // diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index bd706cb..a991a00 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -16,7 +16,6 @@ namespace TimeHACK.OS.Win95 public partial class Windows95 : Form { private SoundPlayer startsound; - private SoundPlayer stopsound; public WindowManager wm = new WindowManager(); public List nonimportantapps = new List(); @@ -88,22 +87,12 @@ namespace TimeHACK.OS.Win95 #region StartMenu - // Paint StartMenu - private void startmenu_Paint(object sender, PaintEventArgs e) - { - // Paint the StartMenu - ControlPaint.DrawBorder(e.Graphics, startmenu.ClientRectangle, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset); - } - // StartButton Click private void startbutton_Click(object sender, EventArgs e) { startmenu.Show(); startmenu.BringToFront(); + if (taskbar.Visible) taskbar.BringToFront(); } // Shutdown button diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs index cd94306..ec87a18 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs @@ -200,6 +200,7 @@ this.button1.Text = "Login"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.Button1_Click); + this.button1.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 1, Engine.Paintbrush.BGStyle.Silver); // // txtscreenname // diff --git a/TimeHACK.Main/OS/Win98/Win98.Designer.cs b/TimeHACK.Main/OS/Win98/Win98.Designer.cs index d1f66dd..97ff7bf 100644 --- a/TimeHACK.Main/OS/Win98/Win98.Designer.cs +++ b/TimeHACK.Main/OS/Win98/Win98.Designer.cs @@ -177,7 +177,7 @@ this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(174, 300); this.startmenu.TabIndex = 4; - this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2, Engine.Paintbrush.BGStyle.NoChange); // // startmenuitems // diff --git a/TimeHACK.Main/Program.cs b/TimeHACK.Main/Program.cs index 72a7291..8411ae8 100644 --- a/TimeHACK.Main/Program.cs +++ b/TimeHACK.Main/Program.cs @@ -80,12 +80,12 @@ namespace TimeHACK public static void ShutdownApplication(System.IO.UnmanagedMemoryStream audio) { - + System.Threading.Thread.Sleep(500); System.IO.Stream audioPlay = audio; stopsound = new System.Media.SoundPlayer(audioPlay); - stopsound.Play(); + stopsound.PlaySync(); - System.Threading.Thread.Sleep(1500); + System.Threading.Thread.Sleep(500); Application.Exit(); } diff --git a/TimeHACK.Main/TitleScreen.Designer.cs b/TimeHACK.Main/TitleScreen.Designer.cs index b71f6f3..a51a0dd 100644 --- a/TimeHACK.Main/TitleScreen.Designer.cs +++ b/TimeHACK.Main/TitleScreen.Designer.cs @@ -213,7 +213,7 @@ this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(165, 187); this.startmenu.TabIndex = 11; - this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2, Engine.Paintbrush.BGStyle.NoChange); // // startmenuitems // -- cgit v1.2.3 From 82af186d5140e878f6b49bc101112550d36bc78a Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 1 Jul 2017 23:02:34 -0400 Subject: classic buttons are here --- TimeHACK.Engine/Paintbrush.cs | 9 +-------- TimeHACK.Main/OS/Win95/Win95.Designer.cs | 2 +- TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs | 5 ++++- TimeHACK.Main/OS/Win98/Win98.Designer.cs | 2 +- TimeHACK.Main/TitleScreen.Designer.cs | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) (limited to 'TimeHACK.Engine') diff --git a/TimeHACK.Engine/Paintbrush.cs b/TimeHACK.Engine/Paintbrush.cs index 9b94ad8..b343100 100644 --- a/TimeHACK.Engine/Paintbrush.cs +++ b/TimeHACK.Engine/Paintbrush.cs @@ -10,16 +10,9 @@ namespace TimeHACK.Engine { public class Paintbrush { - public enum BGStyle - { - NoChange, - Silver, - XP - } - public static void paintClassicBorders(object sender, PaintEventArgs e, int borderwidth, BGStyle bg) + public static void paintClassicBorders(object sender, PaintEventArgs e, int borderwidth) { - ((Control)sender).BackColor = Color.Silver; ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle, SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index 2a39d34..f963251 100644 --- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs @@ -223,7 +223,7 @@ namespace TimeHACK.OS.Win95 this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(174, 300); this.startmenu.TabIndex = 3; - this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2, Engine.Paintbrush.BGStyle.NoChange); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs index ec87a18..050e1e3 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs @@ -193,6 +193,8 @@ // // button1 // + this.button1.BackColor = System.Drawing.Color.Silver; + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.Location = new System.Drawing.Point(331, 208); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(151, 23); @@ -200,7 +202,7 @@ this.button1.Text = "Login"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.Button1_Click); - this.button1.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 1, Engine.Paintbrush.BGStyle.Silver); + this.button1.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // txtscreenname // @@ -237,6 +239,7 @@ this.button2.Text = "Speak"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.Button2_Click); + this.button2.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // button3 // diff --git a/TimeHACK.Main/OS/Win98/Win98.Designer.cs b/TimeHACK.Main/OS/Win98/Win98.Designer.cs index 97ff7bf..d1f66dd 100644 --- a/TimeHACK.Main/OS/Win98/Win98.Designer.cs +++ b/TimeHACK.Main/OS/Win98/Win98.Designer.cs @@ -177,7 +177,7 @@ this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(174, 300); this.startmenu.TabIndex = 4; - this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2, Engine.Paintbrush.BGStyle.NoChange); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/TitleScreen.Designer.cs b/TimeHACK.Main/TitleScreen.Designer.cs index a51a0dd..950dfb8 100644 --- a/TimeHACK.Main/TitleScreen.Designer.cs +++ b/TimeHACK.Main/TitleScreen.Designer.cs @@ -184,7 +184,7 @@ this.gameversion.AutoSize = true; this.gameversion.BackColor = System.Drawing.Color.Transparent; this.gameversion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.gameversion.Location = new System.Drawing.Point(25, 8); + this.gameversion.Location = new System.Drawing.Point(25, 6); this.gameversion.Name = "gameversion"; this.gameversion.Size = new System.Drawing.Size(78, 13); this.gameversion.TabIndex = 0; @@ -213,7 +213,7 @@ this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(165, 187); this.startmenu.TabIndex = 11; - this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2, Engine.Paintbrush.BGStyle.NoChange); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // -- cgit v1.2.3