Skip to content
Snippets Groups Projects
Commit c7e1563f authored by Antoine Félix's avatar Antoine Félix
Browse files

Ajout d'un bouton de fermeture pour quitter une partie.

parent d13f33ae
No related merge requests found
psychorientation/images/icones/sortir.png

699 B

......@@ -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;
}
}
......@@ -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();
}
}
}
}
......@@ -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)
{
......
......@@ -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));
}
}
}
}
......@@ -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
psychorientation/psychorientation/Resources/sortir.png

699 B

......@@ -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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment