From c4acd5e5bdc18c86c417880e01685d7cf28902aa Mon Sep 17 00:00:00 2001 From: AdmAlexus Date: Sat, 28 Oct 2017 16:00:30 +0500 Subject: Fix V3029 warnings from PVS-Studio Static Analyzer Hi! I'm a member of the Pinguem.ru competition on finding errors in open source projects. A bug, found using PVS-Studio. Warnings with low priority: --- Histacom2.Engine/Template/WinClassic.cs | 65 ++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 25cbfaa..39c7468 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -88,8 +88,11 @@ namespace Histacom2.Engine.Template { var toDraw = resizer.ToDraw; if (resizable) { - if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } } resizer.ToDraw = toDraw; } @@ -100,8 +103,11 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Y = this.Location.Y; - if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y; + if (resizable) + { + toDraw.Y = this.Location.Y; + toDraw.Height = MousePosition.Y - this.Location.Y; + } resizer.ToDraw = toDraw; } } @@ -111,8 +117,13 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; - if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y; + if (resizable) + { + if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) + toDraw.Width = MousePosition.X - this.Location.X; + toDraw.Height = MousePosition.Y - this.Location.Y; + } + resizer.ToDraw = toDraw; } } @@ -122,9 +133,15 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X); - if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; + if (resizable) + { + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } + toDraw.Height = Cursor.Position.Y - this.Location.Y; + } resizer.ToDraw = toDraw; } } @@ -134,10 +151,16 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; - if (resizable) toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } + toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } @@ -147,8 +170,11 @@ namespace Histacom2.Engine.Template if(e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } @@ -158,9 +184,12 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; - if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; + toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } -- cgit v1.2.3 From 956de4ff6b9c3bc413a8d136f126924a2695f54d Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Sun, 29 Oct 2017 09:20:58 -0400 Subject: Minimize --- Histacom2.Engine/Template/WinClassic.Designer.cs | 19 +++++----- Histacom2.Engine/Template/WinClassic.cs | 5 +++ Histacom2.Engine/Template/WinClassic.resx | 48 ++++++++++++------------ 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/Histacom2.Engine/Template/WinClassic.Designer.cs b/Histacom2.Engine/Template/WinClassic.Designer.cs index 8463041..fd1a02d 100644 --- a/Histacom2.Engine/Template/WinClassic.Designer.cs +++ b/Histacom2.Engine/Template/WinClassic.Designer.cs @@ -31,6 +31,7 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassic)); this.program = new System.Windows.Forms.Panel(); this.programContent = new System.Windows.Forms.Panel(); + this.panel1 = new System.Windows.Forms.Panel(); this.programtopbar = new System.Windows.Forms.Panel(); this.programIcon = new System.Windows.Forms.PictureBox(); this.maximizebutton = new System.Windows.Forms.PictureBox(); @@ -45,7 +46,6 @@ this.bottom = new System.Windows.Forms.Panel(); this.right = new System.Windows.Forms.Panel(); this.top = new System.Windows.Forms.Panel(); - this.panel1 = new System.Windows.Forms.Panel(); this.program.SuspendLayout(); this.programtopbar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit(); @@ -83,6 +83,14 @@ this.programContent.TabIndex = 9; this.programContent.ControlAdded += new System.Windows.Forms.ControlEventHandler(this.programContent_ControlAdded); // + // panel1 + // + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(4, 22); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(292, 1); + this.panel1.TabIndex = 0; + // // programtopbar // this.programtopbar.BackColor = System.Drawing.Color.Navy; @@ -130,6 +138,7 @@ this.minimizebutton.Size = new System.Drawing.Size(16, 14); this.minimizebutton.TabIndex = 5; this.minimizebutton.TabStop = false; + this.minimizebutton.Click += new System.EventHandler(this.minimizebutton_Click); // // Title // @@ -267,14 +276,6 @@ this.top.MouseMove += new System.Windows.Forms.MouseEventHandler(this.top_MouseMove); this.top.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); // - // panel1 - // - this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(4, 22); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(292, 1); - this.panel1.TabIndex = 0; - // // WinClassic // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 25cbfaa..79958d6 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -310,6 +310,11 @@ namespace Histacom2.Engine.Template gfx.DrawLine(new Pen(_darkBack), 0, 2, 2, 2); } + private void minimizebutton_Click(object sender, EventArgs e) + { + Hide(); + } + public Size prevSize; public Point prevPoint; private void maximizebutton_Click(object sender, EventArgs e) diff --git a/Histacom2.Engine/Template/WinClassic.resx b/Histacom2.Engine/Template/WinClassic.resx index a3848f8..ea30fa1 100644 --- a/Histacom2.Engine/Template/WinClassic.resx +++ b/Histacom2.Engine/Template/WinClassic.resx @@ -118,6 +118,30 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA+SURBVChTY/hP + CmAAAiB1nzjQ0NCA0HDgwAEQBwcAygIBNTRAJNDAqAY0DbgAdg0EAUIDkEUkAGkgDTAwAACYPGiagsMD + PwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA5SURBVChTY/hP + CmAAAiB1nzjQ0NCA0HCACDCqASqGF2DRAOKjAog4BFBDA36A0ABkEQlAGkgDDAwAKPmlWmNluNoAAAAA + SUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAABcSURBVChTrY/R + DcAgCERvdEbrJh2lPU+SYkINRt+PSN6J4FkBhMddw8y+wFUgCbQ70OtO7OQTJLgRa/L7JWmOt8RsB8mD + TQ5NkFbeQcLwauzMdkjZCLAq0gJrAC8niIXaIK89FAAAAABJRU5ErkJggg== + + iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO @@ -172,30 +196,6 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAIAAADAusJtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAVSURBVBhXYzh8 /DTD////wfTh46cBUSgJ/bC/izUAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA+SURBVChTY/hP - CmAAAiB1nzjQ0NCA0HDgwAEQBwcAygIBNTRAJNDAqAY0DbgAdg0EAUIDkEUkAGkgDTAwAACYPGiagsMD - PwAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA5SURBVChTY/hP - CmAAAiB1nzjQ0NCA0HCACDCqASqGF2DRAOKjAog4BFBDA36A0ABkEQlAGkgDDAwAKPmlWmNluNoAAAAA - SUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAABcSURBVChTrY/R - DcAgCERvdEbrJh2lPU+SYkINRt+PSN6J4FkBhMddw8y+wFUgCbQ70OtO7OQTJLgRa/L7JWmOt8RsB8mD - TQ5NkFbeQcLwauzMdkjZCLAq0gJrAC8niIXaIK89FAAAAABJRU5ErkJggg== \ No newline at end of file -- cgit v1.2.3 From 4c3477099a200dccf44948fbd8a4dfbe592f7510 Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Sun, 29 Oct 2017 12:01:04 -0400 Subject: About Page --- Histacom2.Engine/Template/AboutBox95.Designer.cs | 5 +++++ Histacom2.Engine/Template/AboutBox95.cs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Histacom2.Engine/Template/AboutBox95.Designer.cs b/Histacom2.Engine/Template/AboutBox95.Designer.cs index 8ad5dea..c6877f6 100644 --- a/Histacom2.Engine/Template/AboutBox95.Designer.cs +++ b/Histacom2.Engine/Template/AboutBox95.Designer.cs @@ -100,7 +100,12 @@ // // 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(251, 223); this.classicButton1.Name = "classicButton1"; diff --git a/Histacom2.Engine/Template/AboutBox95.cs b/Histacom2.Engine/Template/AboutBox95.cs index a97ab1c..188cf80 100644 --- a/Histacom2.Engine/Template/AboutBox95.cs +++ b/Histacom2.Engine/Template/AboutBox95.cs @@ -9,6 +9,10 @@ namespace Histacom2.Engine.Template { InitializeComponent(); this.textBox2.Text = "This product is licensed to:\r\n" + Environment.UserName + "\r\n"; + textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + textBox2.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + textBox3.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + textBox4.BackColor = SaveSystem.currentTheme.threeDObjectsColor; } private void classicButton1_Click(object sender, EventArgs e) -- cgit v1.2.3 From b17f7c1ceaa3edc32dc500bd029505bd3402cc14 Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Sun, 29 Oct 2017 12:09:28 -0400 Subject: Change timehack to histacom2 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index b8096ae..a5a3c81 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 TimeHACKDevs +Copyright (c) 2017 Histacom2-Devs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -- cgit v1.2.3 From 9c60128a833aac0e5321113e4ec20872b1366bc4 Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Sun, 29 Oct 2017 12:40:26 -0400 Subject: No more forum :( --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 4580f59..3e43d7e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ Histacom 2 is currently being developed in Microsoft Visual Studio 2017. Visual Load the ``.sln`` project file into Visual Studio and compile. No further steps are required. This list may grow in the future. ## Links -Histacom 2 has a forum at https://www.ashifter.ml/timehack/forum Histacom 2 has a Discord server at https://discord.gg/FZgQMDe (You can also click on the dark blue Discord Badge) -- cgit v1.2.3