Browse Source

Made branch ready for pull request

Martin Edlund 5 years ago
parent
commit
a621346c6f

+ 3 - 3
userstory1.md → Finished Userstories/userstory1.md

@@ -7,7 +7,7 @@
 |**Akzeptanzkriterium**|Das Fenster wird geöffnet, wenn das Program gestartet wird und ist in zwei gleich große Bereiche aufgeteilt, einer auf der linken und einer auf der rechten Seite. Es wird eine Toolbar über den zwei Bereichen angezeigt. Die Bereiche sollen sich deutlich vom Rest der UI abheben, z.B. dadurch dass die Bereiche ein Grauton haben und die restliche UI weiß ist.|
 |Geschätzter Aufwand (Story Points)|2|
 |Entwickler|Martin|
-|Umgesetzt in Iteration|keine|
-|Tatsächlicher Aufwand (Std.)|keine|
-|Velocity (Std./Story Point)|keine|
+|Umgesetzt in Iteration|1|
+|Tatsächlicher Aufwand (Std.)|1|
+|Velocity (Std./Story Point)|0.5|
 |Bemerkungen|Keine|

+ 2 - 0
SketchAssistant/SketchAssistant/Form1.Designer.cs

@@ -91,12 +91,14 @@ namespace SketchAssistant
             this.pictureBoxLeft.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBoxLeft.TabIndex = 5;
             this.pictureBoxLeft.TabStop = false;
+            this.pictureBoxLeft.Click += new System.EventHandler(this.pictureBoxLeft_Click);
             // 
             // menuStrip1
             // 
             this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.fileToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+            this.menuStrip1.MaximumSize = new System.Drawing.Size(1000, 0);
             this.menuStrip1.Name = "menuStrip1";
             this.menuStrip1.Size = new System.Drawing.Size(696, 24);
             this.menuStrip1.TabIndex = 2;

+ 16 - 14
SketchAssistant/SketchAssistant/Form1.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+//using SvgNet;
 
 // This is the code for your desktop app.
 // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
@@ -21,7 +22,7 @@ namespace SketchAssistant
         }
 
         //Dialog to select a file.
-        OpenFileDialog ofd = new OpenFileDialog();
+        OpenFileDialog openFileDialogLeft = new OpenFileDialog();
         //Image loaded on the left
         Image leftImage = null;
 
@@ -34,10 +35,7 @@ namespace SketchAssistant
 
         private void pictureBoxLeft_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
         {
-            //Create a local version of the graphics object
-            //Graphics g = e.Graphics;
-
-            //Draw something
+            //Draw the left image
             if(leftImage != null)
             {
                 pictureBoxLeft.Image = leftImage;
@@ -45,7 +43,7 @@ namespace SketchAssistant
 
         }
 
-        //TODO: Remove this placeholde when real buttons are in place
+        //TODO: Remove this placeholder when real buttons are in place
         private void toolStripLabel1_Click(object sender, EventArgs e)
         {
 
@@ -54,7 +52,7 @@ namespace SketchAssistant
         // A Table Layout with one row and two columns. 
         // Columns are 50% so that the window is evenly split.
         // The size is manually set relative to the window size. 
-        // Maybe change this to automatically be the size of a parent container...
+        // TODO: Maybe change this to automatically be the size of a parent container...
         private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
         {
 
@@ -68,13 +66,11 @@ namespace SketchAssistant
         //Load button, will open an OpenFileDialog
         private void loadToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            ofd.Filter = "SVG|*.svg;*.jpg";
-            if(ofd.ShowDialog() == DialogResult.OK)
+            openFileDialogLeft.Filter = "Image|*.jpg;*.png;*.jpeg";
+            if(openFileDialogLeft.ShowDialog() == DialogResult.OK)
             {
-                toolStripLoadStatus.Text = ofd.SafeFileName;
-                Svg.SvgDocument svgDoc = Svg.SvgDocument.Open(ofd.FileName);
-                leftImage = new Bitmap(svgDoc.Draw());
-                //leftImage = Image.FromFile(ofd.FileName);
+                toolStripLoadStatus.Text = openFileDialogLeft.SafeFileName;
+                leftImage = Image.FromFile(openFileDialogLeft.FileName);
                 //The following line is needed, as else on first image load
                 //the image will only be shown after resizing the window.
                 this.Refresh();
@@ -90,10 +86,16 @@ namespace SketchAssistant
         {
 
         }
-
+        
+        //Timer that refreshes the picture box, so that it will always show the right contents in the right size
         private void timer1_Tick(object sender, EventArgs e)
         {
             pictureBoxLeft.Update();
         }
+
+        private void pictureBoxLeft_Click(object sender, EventArgs e)
+        {
+
+        }
     }
 }

+ 0 - 13
userstory2.md

@@ -1,13 +0,0 @@
-# Userstory 2  
-
-|**ID**|2|
-|-|-|
-|**Name**|Lademodul|
-|**Beschreibung**|Man kann einen Knopf in der Toolbar drücken, um einen Dateimanager zu öffnen, welcher einem erlaubt Vektorgrafiken auszuwählen, welche im linken Bereich des Hauptfensters angezeigt werden.|
-|**Akzeptanzkriterium**|Der Knopf wird korrekt in der Toolbar angezeigt und es wird ein Dateimanager angezeigt, wenn er gedrückt wird. Im Dateimanager können nur Vektorgrafiken ausgewählt werden. Drückt man im Dateimanager auf 'Abbrechen' so wird der Ladevorgang abgebrochen und der Nutzer kehrt zum Hauptfenster zurück ohne eine Grafik zu laden. Kann die Datei nicht geladen werden, wird ein Fenster angezeigt welches den Nutzer informiert, dass die Datei nicht geladen werden konnte, sowie den Fehler. Falls die Datei geladen werden kann, wird sie im linken Bereich des Hauptfensters angezeigt. Ist die Grafik nicht gleich groß wie der Bereich wird sie trotzdem korrekt angezeigt. Die Größe des Bereichs wird bei kleineren Grafiken verkleinert, jedoch bei größeren nicht vergrößert (Der Bereich muss immer die Hälfte des Hauptfensters einnehmen). Die Grafik wird bei entsprechend skaliert, sodass sie in ihrer Gesamtheit im linken Bereich zu sehen ist.|
-|Geschätzter Aufwand (Story Points)|8|
-|Entwickler|Martin|
-|Umgesetzt in Iteration|keine|
-|Tatsächlicher Aufwand (Std.)|keine|
-|Velocity (Std./Story Point)|keine|
-|Bemerkungen|Keine|