From 1ee3e00f8f0ee879fce4edf7d1ba9889335bc826 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 23 Sep 2017 12:23:10 -0400 Subject: [PATCH] EULA Pane & Disabled buttons --- Histacom2.Engine/UI/ClassicButton.cs | 8 +- .../InstallerPanes/DirectoryPane.Designer.cs | 8 +- .../InstallerPanes/DirectoryPane.cs | 3 + .../InstallerPanes/EULAPane.Designer.cs | 159 ++++++++++++++++++ .../GlobalPrograms/InstallerPanes/EULAPane.cs | 28 +++ .../InstallerPanes/EULAPane.resx | 137 +++++++++++++++ .../WinClassicInstaller.Designer.cs | 1 + .../GlobalPrograms/WinClassicInstaller.cs | 6 +- Histacom2/Histacom2.csproj | 9 + 9 files changed, 350 insertions(+), 9 deletions(-) create mode 100644 Histacom2/GlobalPrograms/InstallerPanes/EULAPane.Designer.cs create mode 100644 Histacom2/GlobalPrograms/InstallerPanes/EULAPane.cs create mode 100644 Histacom2/GlobalPrograms/InstallerPanes/EULAPane.resx diff --git a/Histacom2.Engine/UI/ClassicButton.cs b/Histacom2.Engine/UI/ClassicButton.cs index 29b3a3b..4ccdbe6 100644 --- a/Histacom2.Engine/UI/ClassicButton.cs +++ b/Histacom2.Engine/UI/ClassicButton.cs @@ -63,16 +63,17 @@ protected override void OnPaint(PaintEventArgs e) g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; + sf.LineAlignment = StringAlignment.Center; sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; - if (_pressing) + if (_pressing && Enabled) { g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width, Height)); g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width - 1, Height - 1)); g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); g.FillRectangle(new SolidBrush(BackColor), new Rectangle(2, 2, Width - 3, Height - 3)); - g.DrawString(Text, Font, new SolidBrush(ForeColor), ((Width / 2) + 1) + Padding.Left, (Height / 2) - (g.MeasureString(Text, Font).Height / 2) + 2, sf); + g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(2, 2, Width - 3, Height - 3), sf); } else { @@ -81,7 +82,8 @@ protected override void OnPaint(PaintEventArgs e) g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3)); - g.DrawString(Text, Font, new SolidBrush(ForeColor), (Width / 2) + Padding.Left, (Height / 2) - (g.MeasureString(Text, Font).Height / 2) + 1, sf); + if (Enabled) g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(1, 1, Width - 3, Height - 3), sf); + else g.DrawString(Text, Font, new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 3, Height - 3), sf); } } diff --git a/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.Designer.cs b/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.Designer.cs index 6759dd9..6946002 100644 --- a/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.Designer.cs +++ b/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.Designer.cs @@ -101,16 +101,16 @@ private void InitializeComponent() // this.groupBox1.Controls.Add(this.classicButton1); this.groupBox1.Controls.Add(this.classicLabel5); - this.groupBox1.Location = new System.Drawing.Point(24, 231); + this.groupBox1.Location = new System.Drawing.Point(24, 225); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(447, 50); + this.groupBox1.Size = new System.Drawing.Size(447, 56); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "Destination Folder"; // // classicLabel5 // - this.classicLabel5.Location = new System.Drawing.Point(12, 22); + this.classicLabel5.Location = new System.Drawing.Point(12, 27); this.classicLabel5.Name = "classicLabel5"; this.classicLabel5.Size = new System.Drawing.Size(311, 13); this.classicLabel5.TabIndex = 0; @@ -125,7 +125,7 @@ private void InitializeComponent() 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(365, 16); + this.classicButton1.Location = new System.Drawing.Point(365, 22); this.classicButton1.Name = "classicButton1"; this.classicButton1.Size = new System.Drawing.Size(75, 23); this.classicButton1.TabIndex = 1; diff --git a/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.cs b/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.cs index 7e415dd..ae30ae0 100644 --- a/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.cs +++ b/Histacom2/GlobalPrograms/InstallerPanes/DirectoryPane.cs @@ -7,6 +7,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Histacom2.Engine; namespace Histacom2.GlobalPrograms.InstallerPanes { @@ -21,6 +22,8 @@ private void DirectoryPane_Load(object sender, EventArgs e) { classicLabel3.Text = $"Setup will install {((WinClassicInstaller)Parent.Parent).progName} to the destination folder."; classicLabel5.Text = $"C:\\Program Files\\12padams\\{((WinClassicInstaller)Parent.Parent).progName}\\"; + + groupBox1.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular); } } } diff --git a/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.Designer.cs b/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.Designer.cs new file mode 100644 index 0000000..90dbbb1 --- /dev/null +++ b/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.Designer.cs @@ -0,0 +1,159 @@ +namespace Histacom2.GlobalPrograms.InstallerPanes +{ + partial class EULAPane + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EULAPane)); + this.panel1 = new System.Windows.Forms.Panel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel3 = new Histacom2.Engine.UI.ClassicLabel(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Controls.Add(this.pictureBox1); + this.panel1.Controls.Add(this.classicLabel2); + this.panel1.Controls.Add(this.classicLabel1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(495, 58); + this.panel1.TabIndex = 0; + // + // pictureBox1 + // + this.pictureBox1.BackgroundImage = global::Histacom2.Properties.Resources.WinClassicInstallIcon; + this.pictureBox1.Location = new System.Drawing.Point(440, 2); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(53, 53); + this.pictureBox1.TabIndex = 2; + this.pictureBox1.TabStop = false; + // + // classicLabel2 + // + this.classicLabel2.Location = new System.Drawing.Point(40, 28); + this.classicLabel2.Name = "classicLabel2"; + this.classicLabel2.Size = new System.Drawing.Size(394, 13); + this.classicLabel2.TabIndex = 1; + this.classicLabel2.Text = "Please read the following important information before continuing."; + // + // classicLabel1 + // + this.classicLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.classicLabel1.Location = new System.Drawing.Point(25, 12); + this.classicLabel1.Name = "classicLabel1"; + this.classicLabel1.Size = new System.Drawing.Size(274, 13); + this.classicLabel1.TabIndex = 0; + this.classicLabel1.Text = "License  Agree m e n t"; + // + // classicLabel3 + // + this.classicLabel3.Location = new System.Drawing.Point(25, 73); + this.classicLabel3.Name = "classicLabel3"; + this.classicLabel3.Size = new System.Drawing.Size(457, 26); + this.classicLabel3.TabIndex = 1; + this.classicLabel3.Text = "Please read the following license agreement. You must accept the terms of this ag" + + "reement before continuing with the installation."; + // + // textBox1 + // + this.textBox1.BackColor = System.Drawing.Color.White; + this.textBox1.Location = new System.Drawing.Point(25, 105); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.textBox1.Size = new System.Drawing.Size(446, 147); + this.textBox1.TabIndex = 2; + this.textBox1.Text = resources.GetString("textBox1.Text"); + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.BackColor = System.Drawing.Color.Silver; + this.radioButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.radioButton1.Location = new System.Drawing.Point(25, 259); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(134, 17); + this.radioButton1.TabIndex = 3; + this.radioButton1.Text = "I &accept the agreement"; + this.radioButton1.UseVisualStyleBackColor = false; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Checked = true; + this.radioButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.radioButton2.Location = new System.Drawing.Point(25, 280); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(167, 17); + this.radioButton2.TabIndex = 4; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "I &do not accept the agreement"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // EULAPane + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Silver; + this.Controls.Add(this.radioButton2); + this.Controls.Add(this.radioButton1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.classicLabel3); + this.Controls.Add(this.panel1); + this.Name = "EULAPane"; + this.Size = new System.Drawing.Size(495, 314); + this.Load += new System.EventHandler(this.DirectoryPane_Load); + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private Engine.UI.ClassicLabel classicLabel1; + private Engine.UI.ClassicLabel classicLabel2; + private System.Windows.Forms.PictureBox pictureBox1; + private Engine.UI.ClassicLabel classicLabel3; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.RadioButton radioButton2; + } +} diff --git a/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.cs b/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.cs new file mode 100644 index 0000000..c477836 --- /dev/null +++ b/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.cs @@ -0,0 +1,28 @@ +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; +using Histacom2.Engine; + +namespace Histacom2.GlobalPrograms.InstallerPanes +{ + public partial class EULAPane : UserControl + { + public EULAPane() + { + InitializeComponent(); + } + + private void DirectoryPane_Load(object sender, EventArgs e) + { + textBox1.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular); + radioButton1.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular); + radioButton2.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular); + } + } +} diff --git a/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.resx b/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.resx new file mode 100644 index 0000000..fec481c --- /dev/null +++ b/Histacom2/GlobalPrograms/InstallerPanes/EULAPane.resx @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + By installing this software you agree that you will not try to reverse engineer it in anyway or claim it as your own work. + +You agree that you will not try to spread this software or any of its components to other companies without rightful permission from the owner. + +You agree that if you bought this program, you own it and that nobody else is allowed to use it on your computer or on their computer. + +You understand that trying to upload this software online or any other forms of spreading this software will result in the FBI coming into your home and killing you with knives. + +You agree that taking a picture of this software and sending it to someone will cause you to get 15 years in jail for software exposing. + +You agree that if you tell someone else about this software's features that you will wake up dead in the morning because the owner would have killed you in your sleep. + +You know that using this software will alert the maker of it and then cause him to monitor every moment of your life after you install this software. + +You agree to all of the above and will not commit any of the crimes otherwise you will go to Hell. + + \ No newline at end of file diff --git a/Histacom2/GlobalPrograms/WinClassicInstaller.Designer.cs b/Histacom2/GlobalPrograms/WinClassicInstaller.Designer.cs index 246f7aa..20688b5 100644 --- a/Histacom2/GlobalPrograms/WinClassicInstaller.Designer.cs +++ b/Histacom2/GlobalPrograms/WinClassicInstaller.Designer.cs @@ -90,6 +90,7 @@ private void InitializeComponent() this.classicButton3.AdaptForeColorWithTheme = true; this.classicButton3.BackColor = System.Drawing.Color.Silver; this.classicButton3.DialogResult = System.Windows.Forms.DialogResult.None; + this.classicButton3.Enabled = false; this.classicButton3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.classicButton3.ForeColor = System.Drawing.Color.Black; this.classicButton3.Location = new System.Drawing.Point(248, 326); diff --git a/Histacom2/GlobalPrograms/WinClassicInstaller.cs b/Histacom2/GlobalPrograms/WinClassicInstaller.cs index ff1b7c4..4e0098c 100644 --- a/Histacom2/GlobalPrograms/WinClassicInstaller.cs +++ b/Histacom2/GlobalPrograms/WinClassicInstaller.cs @@ -35,8 +35,10 @@ private void classicButton2_Click(object sender, EventArgs e) if (state == 0) { - var dir = new InstallerPanes.DirectoryPane(); - dir.Parent = panel1; + var eula = new InstallerPanes.EULAPane(); + eula.Parent = panel1; + state = 1; + classicButton2.Enabled = false; } } } diff --git a/Histacom2/Histacom2.csproj b/Histacom2/Histacom2.csproj index 2411b68..1edcc08 100644 --- a/Histacom2/Histacom2.csproj +++ b/Histacom2/Histacom2.csproj @@ -132,6 +132,12 @@ AchievementBox.cs + + UserControl + + + EULAPane.cs + UserControl @@ -419,6 +425,9 @@ AchievementBox.cs + + EULAPane.cs + DirectoryPane.cs