Added some code for the Error Windows

This commit is contained in:
Lukasz Baldyga committed 2020-10-19 01:32:46 +01:00
1 parent ef9b2ec9c5
commit aeea08f021
3 files changed
+74 -32

No files matched your search

@@ -80,6 +80,12 @@
<Compile Include="DrawPreview.Designer.cs"> <Compile Include="DrawPreview.Designer.cs">
<DependentUpon>DrawPreview.cs</DependentUpon> <DependentUpon>DrawPreview.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="ErrorDetailWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ErrorDetailWindow.Designer.cs">
<DependentUpon>ErrorDetailWindow.cs</DependentUpon>
</Compile>
<Compile Include="ErrorWindow.cs"> <Compile Include="ErrorWindow.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -107,6 +113,9 @@
<EmbeddedResource Include="DrawPreview.resx"> <EmbeddedResource Include="DrawPreview.resx">
<DependentUpon>DrawPreview.cs</DependentUpon> <DependentUpon>DrawPreview.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="ErrorDetailWindow.resx">
<DependentUpon>ErrorDetailWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ErrorWindow.resx"> <EmbeddedResource Include="ErrorWindow.resx">
<DependentUpon>ErrorWindow.cs</DependentUpon> <DependentUpon>ErrorWindow.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -25,42 +25,14 @@
private void InitializeComponent() { private void InitializeComponent() {
System.Windows.Forms.GroupBox groupBox1; System.Windows.Forms.GroupBox groupBox1;
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
groupBox1 = new System.Windows.Forms.GroupBox(); groupBox1 = new System.Windows.Forms.GroupBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
groupBox1.SuspendLayout(); groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(6, 19);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(56, 60);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.button1.Location = new System.Drawing.Point(0, 127);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(336, 23);
this.button1.TabIndex = 1;
this.button1.Text = "Exit";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(68, 19);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Error Name";
//
// groupBox1 // groupBox1
// //
groupBox1.AutoSize = true; groupBox1.AutoSize = true;
@@ -74,6 +46,34 @@
groupBox1.TabStop = false; groupBox1.TabStop = false;
groupBox1.Text = "Error"; groupBox1.Text = "Error";
// //
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(6, 19);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(56, 60);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(68, 19);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Error Name";
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.button1.Location = new System.Drawing.Point(0, 127);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(336, 23);
this.button1.TabIndex = 1;
this.button1.Text = "Exit";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2 // button2
// //
this.button2.Dock = System.Windows.Forms.DockStyle.Bottom; this.button2.Dock = System.Windows.Forms.DockStyle.Bottom;
@@ -83,6 +83,7 @@
this.button2.TabIndex = 5; this.button2.TabIndex = 5;
this.button2.Text = "Show Details"; this.button2.Text = "Show Details";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
// //
// ErrorWindow // ErrorWindow
// //
@@ -97,10 +98,9 @@
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "ErrorWindow"; this.Name = "ErrorWindow";
this.Text = "Error"; this.Text = "Error";
this.TopMost = true;
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
groupBox1.ResumeLayout(false); groupBox1.ResumeLayout(false);
groupBox1.PerformLayout(); groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@@ -10,12 +10,45 @@ using System.Windows.Forms;
namespace Advanced_Software_Engineering { namespace Advanced_Software_Engineering {
public partial class ErrorWindow : Form { public partial class ErrorWindow : Form {
string desc;
public const int ERROR_MESSAGE = 0;
public const int WARNING_MESSAGE = 1;
public const int INFO_MESSAGE = 2;
public ErrorWindow() { public ErrorWindow() {
InitializeComponent(); InitializeComponent();
this.Text = "Error";
label1.Text = "An error has occured";
desc = "None";
}
public ErrorWindow(string title, string brief, string desc, int type) {
InitializeComponent();
this.Text = title;
label1.Text = brief;
this.desc = desc;
switch(type) {
case INFO_MESSAGE:
break;
case WARNING_MESSAGE:
break;
case ERROR_MESSAGE:
default:
break;
}
} }
private void button1_Click(object sender, EventArgs e) { private void button1_Click(object sender, EventArgs e) {
Close(); Close();
} }
private void button2_Click(object sender, EventArgs e) {
new ErrorDetailWindow(desc).Show();
}
} }
} }