diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs index 970b29a3b92ed637c66337673645f0ac3da37055..65a9beea3b30680f42361235b66f9686013b0d40 100644 --- a/psychorientation/psychorientation/InterfaceClasse.cs +++ b/psychorientation/psychorientation/InterfaceClasse.cs @@ -45,7 +45,7 @@ namespace psychorientation } private void Form1_Load(object sender, EventArgs e) - { + { AjouterEleveImage(); GenererBase(); TransmitKeyDown(); @@ -220,11 +220,14 @@ namespace psychorientation moyenneInitiale, effortFinal, competenceFinal, - moyenneFinale + moyenneFinale, + isRandom ); m_fin.ShowDialog(); UntransmitKeyDown(); pb_action_suivante.Click -= new System.EventHandler(Pb_action_suivante_Click); + this.FormClosing -= new System.Windows.Forms.FormClosingEventHandler(InterfaceClasse_FormClosing); + Close(); break; } diff --git a/psychorientation/psychorientation/Message.Designer.cs b/psychorientation/psychorientation/Message.Designer.cs index 62ae444f0923a9a72e6f9da28cd8a036ae5ae611..20be13dce15d0aebf7a120ffea3750d9ea62f93d 100644 --- a/psychorientation/psychorientation/Message.Designer.cs +++ b/psychorientation/psychorientation/Message.Designer.cs @@ -35,6 +35,7 @@ this.lblEffort = new System.Windows.Forms.Label(); this.lblCompetence = new System.Windows.Forms.Label(); this.lblMoyenen = new System.Windows.Forms.Label(); + this.btnRejouer = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lblMessage @@ -115,12 +116,25 @@ this.lblMoyenen.Visible = false; this.lblMoyenen.Click += new System.EventHandler(this.lblMoyenen_Click); // + // btnRejouer + // + this.btnRejouer.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnRejouer.Location = new System.Drawing.Point(548, 284); + this.btnRejouer.Name = "btnRejouer"; + this.btnRejouer.Size = new System.Drawing.Size(172, 51); + this.btnRejouer.TabIndex = 9; + this.btnRejouer.Text = "Rejouer"; + this.btnRejouer.UseVisualStyleBackColor = true; + this.btnRejouer.Visible = false; + this.btnRejouer.Click += new System.EventHandler(this.btnRejouer_Click); + // // Message // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImage = global::psychorientation.Properties.Resources.paternFeuille; this.ClientSize = new System.Drawing.Size(986, 347); + this.Controls.Add(this.btnRejouer); this.Controls.Add(this.lblMoyenen); this.Controls.Add(this.lblCompetence); this.Controls.Add(this.lblEffort); @@ -148,5 +162,6 @@ private System.Windows.Forms.Label lblEffort; private System.Windows.Forms.Label lblCompetence; private System.Windows.Forms.Label lblMoyenen; + private System.Windows.Forms.Button btnRejouer; } } \ No newline at end of file diff --git a/psychorientation/psychorientation/Message.cs b/psychorientation/psychorientation/Message.cs index d6d9b8426f168d711c589661f0310afdd7dda8dd..c3507428d2ee41bcba658716d39930d4c2bb13e8 100644 --- a/psychorientation/psychorientation/Message.cs +++ b/psychorientation/psychorientation/Message.cs @@ -38,6 +38,8 @@ namespace psychorientation double competenceLimite; double moyenneLimite; + bool isRandom; + public Message(string messageAffiche,string titreAffiche,TypeMessage typeMessage) { InitializeComponent(); @@ -46,7 +48,7 @@ namespace psychorientation titre = titreAffiche; } - public void setParamRes(double effortInitial, double competenceInitial, double moyenneInitiale, double effortFinal, double competenceFinal, double moyenneFinale) + public void setParamRes(double effortInitial, double competenceInitial, double moyenneInitiale, double effortFinal, double competenceFinal, double moyenneFinale,bool isRandom) { effortScore = Math.Round(100 * (effortFinal - effortInitial) / effortInitial, 1); competenceScore = Math.Round(100 * (competenceFinal - competenceInitial) / competenceInitial, 1); @@ -57,6 +59,7 @@ namespace psychorientation effortScoreRouge = effortFinal > ((10 - effortInitial) / 3) + effortInitial; competenceScoreRouge = competenceFinal > ((10 - competenceInitial) / 4) + competenceInitial; moyenneScoreRouge = moyenneFinale > moyenneInitiale; + this.isRandom = isRandom; } public bool getReponseBool @@ -82,6 +85,8 @@ namespace psychorientation private void Message_Load(object sender, EventArgs e) { + btnRejouer.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + lblMessage.Text = message; lblScore.Text = message; lblTitre.Text = titre; @@ -101,6 +106,7 @@ namespace psychorientation this.Controls.Add(b); break; case TypeMessage.RESULTAT: + btnRejouer.Visible = true; lblCompetence.Visible = true; lblEffort.Visible = true; lblMoyenen.Visible = true; @@ -196,5 +202,12 @@ namespace psychorientation { } + + private void btnRejouer_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + InterfaceClasse iC = new InterfaceClasse(isRandom); + iC.Show(); + } } }