From 4af9777601e85fa948bf2e246798f60f6eae2f49 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 1 Jul 2017 15:49:09 -0400 Subject: improved launcher --- TimeHACK.Main/TitleScreen.cs | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'TimeHACK.Main/TitleScreen.cs') diff --git a/TimeHACK.Main/TitleScreen.cs b/TimeHACK.Main/TitleScreen.cs index 0e01d4c..d23c1d3 100644 --- a/TimeHACK.Main/TitleScreen.cs +++ b/TimeHACK.Main/TitleScreen.cs @@ -18,8 +18,6 @@ namespace TimeHACK { public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection(); - TimeHACK.Engine.Template.WinClassic borders = new TimeHACK.Engine.Template.WinClassic(); - public static Windows95 frm95; public static Windows98 frm98; public static string username; @@ -48,28 +46,16 @@ namespace TimeHACK public TitleScreen() { InitializeComponent(); + } - // Add the WINDOWS BORDERS from the Window Manager - - FieldInfo f1 = typeof(Control).GetField("EventMouseDown", - BindingFlags.Static | BindingFlags.NonPublic); - object obj = f1.GetValue(borders.programtopbar); - PropertyInfo pi = borders.programtopbar.GetType().GetProperty("Events", - BindingFlags.NonPublic | BindingFlags.Instance); - EventHandlerList list = (EventHandlerList)pi.GetValue(borders.programtopbar, null); - list.RemoveHandler(obj, list[obj]); - - borders.programtopbar.MouseDown += new MouseEventHandler(TitleBarDrag); - borders.programtopbar.Controls.Find("closebutton", false)[0].MouseClick += new MouseEventHandler(closeButton); - borders.programtopbar.Controls.Find("maximizebutton", false)[0].MouseClick += new MouseEventHandler(MaximiseButton); - - this.Controls.Add(borders.programtopbar); - this.Controls.Add(borders.top); - this.Controls.Add(borders.right); - this.Controls.Add(borders.left); - this.Controls.Add(borders.bottom); - - + 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); } public void StartGame() @@ -199,6 +185,11 @@ namespace TimeHACK pfc.AddFontFile(Data + "\\LeviWindows.ttf"); pfc.AddFontFile(Data + "\\windows_command_prompt.ttf"); gameversion.Font = new Font(pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, (0)); + ProgramsToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + DocumentsToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + SettingsToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + HelpToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + ShutdownToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); // Start the VM Mode timer vmModeTimer.Start(); -- cgit v1.2.3 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 + TimeHACK.Main/OS/Win95/Win95.Designer.cs | 2 +- TimeHACK.Main/OS/Win98/Win98.Designer.cs | 1 + TimeHACK.Main/TitleScreen.Designer.cs | 2 +- TimeHACK.Main/TitleScreen.cs | 10 ---------- 6 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 TimeHACK.Engine/Paintbrush.cs (limited to 'TimeHACK.Main/TitleScreen.cs') 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 @@ + diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index 5a35e3d..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 += new System.Windows.Forms.PaintEventHandler(this.startmenu_Paint); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/OS/Win98/Win98.Designer.cs b/TimeHACK.Main/OS/Win98/Win98.Designer.cs index 72f6e10..d1f66dd 100644 --- a/TimeHACK.Main/OS/Win98/Win98.Designer.cs +++ b/TimeHACK.Main/OS/Win98/Win98.Designer.cs @@ -177,6 +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); // // startmenuitems // diff --git a/TimeHACK.Main/TitleScreen.Designer.cs b/TimeHACK.Main/TitleScreen.Designer.cs index 774f7aa..b71f6f3 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 += new System.Windows.Forms.PaintEventHandler(this.startmenu_Paint); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/TitleScreen.cs b/TimeHACK.Main/TitleScreen.cs index d23c1d3..54b680f 100644 --- a/TimeHACK.Main/TitleScreen.cs +++ b/TimeHACK.Main/TitleScreen.cs @@ -48,16 +48,6 @@ namespace TimeHACK InitializeComponent(); } - 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); - } - public void StartGame() { //TODO: You may want to handle story stuff to decide what OS to boot here. -- cgit v1.2.3