EULA Pane & Disabled buttons

This commit is contained in:
lempamo 2017-09-23 12:23:10 -04:00
parent 245a7c360b
commit 1ee3e00f8f
9 changed files with 350 additions and 9 deletions

View file

@ -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);
}
}

View file

@ -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;

View file

@ -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);
}
}
}

View file

@ -0,0 +1,159 @@
namespace Histacom2.GlobalPrograms.InstallerPanes
{
partial class EULAPane
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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 Agreement";
//
// 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;
}
}

View file

@ -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);
}
}
}

View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="textBox1.Text" xml:space="preserve">
<value>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.</value>
</data>
</root>

View file

@ -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);

View file

@ -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;
}
}
}

View file

@ -132,6 +132,12 @@
<Compile Include="AchievementBox.Designer.cs">
<DependentUpon>AchievementBox.cs</DependentUpon>
</Compile>
<Compile Include="GlobalPrograms\InstallerPanes\EULAPane.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GlobalPrograms\InstallerPanes\EULAPane.Designer.cs">
<DependentUpon>EULAPane.cs</DependentUpon>
</Compile>
<Compile Include="GlobalPrograms\InstallerPanes\DirectoryPane.cs">
<SubType>UserControl</SubType>
</Compile>
@ -419,6 +425,9 @@
<EmbeddedResource Include="AchievementBox.resx">
<DependentUpon>AchievementBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GlobalPrograms\InstallerPanes\EULAPane.resx">
<DependentUpon>EULAPane.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GlobalPrograms\InstallerPanes\DirectoryPane.resx">
<DependentUpon>DirectoryPane.cs</DependentUpon>
</EmbeddedResource>