From c7e1563f1e897ded0ed6b15e28c551e6e47bca4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20F=C3=A9lix?= <felixantoine67@yahoo.fr>
Date: Wed, 1 Apr 2020 16:06:34 +0200
Subject: [PATCH] Ajout d'un bouton de fermeture pour quitter une partie.

---
 psychorientation/images/icones/sortir.png       | Bin 0 -> 699 bytes
 .../InterfaceClasse.Designer.cs                 |  16 ++++++++++++++++
 .../psychorientation/InterfaceClasse.cs         |  16 ++++++++++++++--
 .../psychorientation/InterfaceInfoEleve.cs      |  16 ++++++++--------
 .../Properties/Resources.Designer.cs            |  10 ++++++++++
 .../psychorientation/Properties/Resources.resx  |   3 +++
 .../psychorientation/Resources/sortir.png       | Bin 0 -> 699 bytes
 .../psychorientation/psychorientation.csproj    |   3 +++
 8 files changed, 54 insertions(+), 10 deletions(-)
 create mode 100644 psychorientation/images/icones/sortir.png
 create mode 100644 psychorientation/psychorientation/Resources/sortir.png

diff --git a/psychorientation/images/icones/sortir.png b/psychorientation/images/icones/sortir.png
new file mode 100644
index 0000000000000000000000000000000000000000..3b2233b63eb4c58ee1dc4b4ca05ff8483f694b47
GIT binary patch
literal 699
zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl
z_H+M9WCij$3p^r=85sBuf-vKbiP>)%7?=V)T^vIy;@;lc?-gAraqQ#uZA&y)@JbwU
zHJBWHFy+(*SAjcL9eGW<l2Pjq-qc=k$)~kxG1uPKZ%lseaSjeIN?4|6iEi{g|J(P)
zd-2JWzsw2d+W(#Tla129ZX10U(PW<s%T6q`>x>B!Hl97(e?{l7kA<&}Yh0?HIRDC#
z)q8Dc&AN48{^wU)h2~U#2FW$|e;1g2ihN>i`Z4Cn%{^DLL`1K?Ho0nHtNTTbCuiQ9
z=!gXit}a^f&bOfMg&Ct!L>cpmeTR2irYG-y{@ld$179zjtE;!S$<(iEOY-cFvTu66
z^t<j2mJ<m#c@^5N)`ZOA-M4SYf|czl_istLx^CWVGPO*&>)xL8Y7T6t^B63*HNVVE
zU%b})`E}NyeY+PYW_K@AdjB@w&o5)ui?hFTm{K;pVVh9@Hh1TnJ1ui>N6(t|G48z9
z>u0r4m)wz=;`Oe$eYW(hDwjU(_i!CMPyVX8_r0`w_Of}hvNw58Otxi6*<kcu^Zi-=
z8#flLIQPfK_v)>;KKGk_8+fMOWhlytG{3(tEc1J{@bN8*Vd0vqHt+EXo_vpGHiM+j
zZpJ48mHBn%eeQMV%CD~a{4*&3&?zq0(pkQ<ymoWKf~0=$PZQz$EbsqISigR4^7KAb
z>)q*_!oC(3e(ai6QCQ}-JO18mf8&?F9WHeN!n_l?OcRBHkzn5NC%Dt6B>#}9>BqOH
zECpNh?Rx8lXBEE5*{Anu%B{zLHeP~;)~V!8$9Ho6SA5=9y7T{n2OBvj9OU}LDDaat
Y^F>S1)ZEoRzy!zO>FVdQ&MBb@0Nr;)^8f$<

literal 0
HcmV?d00001

diff --git a/psychorientation/psychorientation/InterfaceClasse.Designer.cs b/psychorientation/psychorientation/InterfaceClasse.Designer.cs
index 32b648a..6631532 100644
--- a/psychorientation/psychorientation/InterfaceClasse.Designer.cs
+++ b/psychorientation/psychorientation/InterfaceClasse.Designer.cs
@@ -31,8 +31,10 @@
             this.pb_action_suivante = new System.Windows.Forms.PictureBox();
             this.pb_liste_eleves = new System.Windows.Forms.PictureBox();
             this.lbl_date = new System.Windows.Forms.Label();
+            this.pb_sortir = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pb_liste_eleves)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pb_sortir)).BeginInit();
             this.SuspendLayout();
             // 
             // pb_action_suivante
@@ -68,6 +70,17 @@
             this.lbl_date.TabIndex = 2;
             this.lbl_date.Text = "Chargement...";
             // 
+            // pb_sortir
+            // 
+            this.pb_sortir.BackgroundImage = global::psychorientation.Properties.Resources.sortir;
+            this.pb_sortir.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.pb_sortir.Location = new System.Drawing.Point(1283, -1);
+            this.pb_sortir.Name = "pb_sortir";
+            this.pb_sortir.Size = new System.Drawing.Size(75, 75);
+            this.pb_sortir.TabIndex = 3;
+            this.pb_sortir.TabStop = false;
+            this.pb_sortir.Click += new System.EventHandler(this.Pb_sortir_Click);
+            // 
             // InterfaceClasse
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -76,6 +89,7 @@
             this.BackgroundImage = global::psychorientation.Properties.Resources.salleV1;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.ClientSize = new System.Drawing.Size(1357, 783);
+            this.Controls.Add(this.pb_sortir);
             this.Controls.Add(this.lbl_date);
             this.Controls.Add(this.pb_liste_eleves);
             this.Controls.Add(this.pb_action_suivante);
@@ -90,6 +104,7 @@
             this.SizeChanged += new System.EventHandler(this.InterfaceClasse_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pb_liste_eleves)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pb_sortir)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -100,6 +115,7 @@
         private System.Windows.Forms.PictureBox pb_action_suivante;
         private System.Windows.Forms.PictureBox pb_liste_eleves;
         private System.Windows.Forms.Label lbl_date;
+        private System.Windows.Forms.PictureBox pb_sortir;
     }
 }
 
diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs
index 245588f..d28b2e6 100644
--- a/psychorientation/psychorientation/InterfaceClasse.cs
+++ b/psychorientation/psychorientation/InterfaceClasse.cs
@@ -74,8 +74,20 @@ namespace psychorientation
 
         private void InterfaceClasse_SizeChanged(object sender, EventArgs e)
         {
-            PictureBox pb = pb_action_suivante;
-            pb.Location = new Point(Size.Width - pb.Width - 32, Size.Height - pb.Height - 32);
+            PictureBox pb1 = pb_action_suivante;
+            pb1.Location = new Point(Size.Width - pb1.Width - 32, Size.Height - pb1.Height - 32);
+
+            PictureBox pb2 = pb_sortir;
+            pb2.Location = new Point(Size.Width - pb2.Width, 0);
+        }
+
+        private void Pb_sortir_Click(object sender, EventArgs e)
+        {
+            if (MessageBox.Show("Souhaitez-vous quitter le jeu ?\nVous perdrez alors votre progression dans la partie en cours.",
+                                "Confirmation de fermeture", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
+            {
+                Close();
+            }
         }
     }
 }
diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.cs b/psychorientation/psychorientation/InterfaceInfoEleve.cs
index c8c93df..c36ff67 100644
--- a/psychorientation/psychorientation/InterfaceInfoEleve.cs
+++ b/psychorientation/psychorientation/InterfaceInfoEleve.cs
@@ -33,22 +33,22 @@ namespace psychorientation
 
         private void actualiser()
         {
-            lblEleve.Text = "Eleve n°"+eleve.getId();
-            lblClasse.Text = listClasse[eleve.getClasse()];
-            lblEffort.Text = eleve.getEffort().ToString();
-            lblCompetence.Text = eleve.getCompetence().ToString();
-            double moyenne = eleve.getMoyenne();
+            lblEleve.Text = "Eleve n°" + eleve.GetId();
+            lblClasse.Text = listClasse[eleve.GetClasse()];
+            lblEffort.Text = eleve.GetEffort().ToString();
+            lblCompetence.Text = eleve.GetCompetence().ToString();
+            double moyenne = eleve.GetMoyenne();
             if (moyenne == -1)
             {
                 lblMoyenne.Text="Pas encore d'évaluation";
             }
             else
             {
-                lblMoyenne.Text = eleve.getMoyenne().ToString()+"/20";
+                lblMoyenne.Text = eleve.GetMoyenne().ToString()+"/20";
             }
             
-            MajPanel(pnlCompetence,eleve.getCompetence());
-            MajPanel(pnlEffort, eleve.getEffort());
+            MajPanel(pnlCompetence,eleve.GetCompetence());
+            MajPanel(pnlEffort, eleve.GetEffort());
         }
         private void MajPanel(Panel p, double valeur)
         {
diff --git a/psychorientation/psychorientation/Properties/Resources.Designer.cs b/psychorientation/psychorientation/Properties/Resources.Designer.cs
index c94656d..3d8b1ed 100644
--- a/psychorientation/psychorientation/Properties/Resources.Designer.cs
+++ b/psychorientation/psychorientation/Properties/Resources.Designer.cs
@@ -79,5 +79,15 @@ namespace psychorientation.Properties {
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
+        
+        /// <summary>
+        ///   Recherche une ressource localisée de type System.Drawing.Bitmap.
+        /// </summary>
+        internal static System.Drawing.Bitmap sortir {
+            get {
+                object obj = ResourceManager.GetObject("sortir", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
     }
 }
diff --git a/psychorientation/psychorientation/Properties/Resources.resx b/psychorientation/psychorientation/Properties/Resources.resx
index 883a180..0fa817a 100644
--- a/psychorientation/psychorientation/Properties/Resources.resx
+++ b/psychorientation/psychorientation/Properties/Resources.resx
@@ -124,4 +124,7 @@
   <data name="salleV1" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\salleV1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="sortir" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\sortir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/psychorientation/psychorientation/Resources/sortir.png b/psychorientation/psychorientation/Resources/sortir.png
new file mode 100644
index 0000000000000000000000000000000000000000..3b2233b63eb4c58ee1dc4b4ca05ff8483f694b47
GIT binary patch
literal 699
zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl
z_H+M9WCij$3p^r=85sBuf-vKbiP>)%7?=V)T^vIy;@;lc?-gAraqQ#uZA&y)@JbwU
zHJBWHFy+(*SAjcL9eGW<l2Pjq-qc=k$)~kxG1uPKZ%lseaSjeIN?4|6iEi{g|J(P)
zd-2JWzsw2d+W(#Tla129ZX10U(PW<s%T6q`>x>B!Hl97(e?{l7kA<&}Yh0?HIRDC#
z)q8Dc&AN48{^wU)h2~U#2FW$|e;1g2ihN>i`Z4Cn%{^DLL`1K?Ho0nHtNTTbCuiQ9
z=!gXit}a^f&bOfMg&Ct!L>cpmeTR2irYG-y{@ld$179zjtE;!S$<(iEOY-cFvTu66
z^t<j2mJ<m#c@^5N)`ZOA-M4SYf|czl_istLx^CWVGPO*&>)xL8Y7T6t^B63*HNVVE
zU%b})`E}NyeY+PYW_K@AdjB@w&o5)ui?hFTm{K;pVVh9@Hh1TnJ1ui>N6(t|G48z9
z>u0r4m)wz=;`Oe$eYW(hDwjU(_i!CMPyVX8_r0`w_Of}hvNw58Otxi6*<kcu^Zi-=
z8#flLIQPfK_v)>;KKGk_8+fMOWhlytG{3(tEc1J{@bN8*Vd0vqHt+EXo_vpGHiM+j
zZpJ48mHBn%eeQMV%CD~a{4*&3&?zq0(pkQ<ymoWKf~0=$PZQz$EbsqISigR4^7KAb
z>)q*_!oC(3e(ai6QCQ}-JO18mf8&?F9WHeN!n_l?OcRBHkzn5NC%Dt6B>#}9>BqOH
zECpNh?Rx8lXBEE5*{Anu%B{zLHeP~;)~V!8$9Ho6SA5=9y7T{n2OBvj9OU}LDDaat
Y^F>S1)ZEoRzy!zO>FVdQ&MBb@0Nr;)^8f$<

literal 0
HcmV?d00001

diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj
index 8d3f5a0..3373fc1 100644
--- a/psychorientation/psychorientation/psychorientation.csproj
+++ b/psychorientation/psychorientation/psychorientation.csproj
@@ -113,5 +113,8 @@
   <ItemGroup>
     <None Include="Resources\salleV1.png" />
   </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\sortir.png" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>
\ No newline at end of file
-- 
GitLab