From 666c8fc9240ee525284c9e39b37ec3c09f952bc7 Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Tue, 6 Oct 2020 18:34:51 +0100 Subject: [PATCH] Implemented basic preview design --- .../Advanced Software Engineering.csproj | 9 ++ .../DrawPreview.Designer.cs | 48 +++++++ .../DrawPreview.cs | 36 ++++++ .../DrawPreview.resx | 120 ++++++++++++++++++ .../Menu.Designer.cs | 2 +- .../Advanced Software Engineering/Menu.cs | 1 + 6 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 Advanced Software Engineering/Advanced Software Engineering/DrawPreview.Designer.cs create mode 100644 Advanced Software Engineering/Advanced Software Engineering/DrawPreview.cs create mode 100644 Advanced Software Engineering/Advanced Software Engineering/DrawPreview.resx diff --git a/Advanced Software Engineering/Advanced Software Engineering/Advanced Software Engineering.csproj b/Advanced Software Engineering/Advanced Software Engineering/Advanced Software Engineering.csproj index 967af6c..37042f1 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Advanced Software Engineering.csproj +++ b/Advanced Software Engineering/Advanced Software Engineering/Advanced Software Engineering.csproj @@ -65,6 +65,12 @@ + + Form + + + DrawPreview.cs + Form @@ -80,6 +86,9 @@ + + DrawPreview.cs + Text Editor.cs diff --git a/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.Designer.cs b/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.Designer.cs new file mode 100644 index 0000000..ca7de09 --- /dev/null +++ b/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.Designer.cs @@ -0,0 +1,48 @@ +namespace Advanced_Software_Engineering +{ + partial class DrawPreview + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // DrawPreview + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(438, 501); + this.Name = "DrawPreview"; + this.Text = "Draw Preview"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.DrawPreview_FormClosed); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.DrawPreview_Paint); + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.cs b/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.cs new file mode 100644 index 0000000..65cbb76 --- /dev/null +++ b/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Advanced_Software_Engineering +{ + public partial class DrawPreview : Form + { + public DrawPreview() + { + InitializeComponent(); + SettingsAndHelperFunctions.NumberOfWindows++; + } + + private void DrawPreview_Paint(object sender, System.Windows.Forms.PaintEventArgs e) + { + Point pt1 = new Point(0, 0); + Point pt2 = new Point(200, 200); + Graphics g = e.Graphics; + Pen myBlackPen = new Pen(Color.Black, 5); + + g.DrawLine(myBlackPen, pt1, pt2); + } + + private void DrawPreview_FormClosed(object sender, FormClosedEventArgs e) + { + SettingsAndHelperFunctions.WindowClosed(); + } + } +} diff --git a/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.resx b/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Advanced Software Engineering/Advanced Software Engineering/DrawPreview.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/Advanced Software Engineering/Advanced Software Engineering/Menu.Designer.cs b/Advanced Software Engineering/Advanced Software Engineering/Menu.Designer.cs index a44bf48..e66c6de 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Menu.Designer.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Menu.Designer.cs @@ -42,7 +42,7 @@ this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(195, 23); this.button1.TabIndex = 0; - this.button1.Text = "Console"; + this.button1.Text = "Interactive Preview"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // diff --git a/Advanced Software Engineering/Advanced Software Engineering/Menu.cs b/Advanced Software Engineering/Advanced Software Engineering/Menu.cs index 2433496..78c4163 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Menu.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Menu.cs @@ -19,6 +19,7 @@ namespace Advanced_Software_Engineering private void button1_Click(object sender, EventArgs e) { + new DrawPreview().Show(); this.Hide(); }