diff --git a/historique_prototypes/Psychorientation_V1.rar b/historique_prototypes/Psychorientation_V1.rar new file mode 100644 index 0000000000000000000000000000000000000000..6d389ec2ddb92f84fcaba6049c26dce54d9c43d5 Binary files /dev/null and b/historique_prototypes/Psychorientation_V1.rar differ diff --git a/historique_prototypes/Psychorientation_V2.rar b/historique_prototypes/Psychorientation_V2.rar new file mode 100644 index 0000000000000000000000000000000000000000..0688c1e36b33ff0eb7a80245032fb9a03a666ddb Binary files /dev/null and b/historique_prototypes/Psychorientation_V2.rar differ diff --git a/Psychorientation_V3.rar b/historique_prototypes/Psychorientation_V3.rar similarity index 100% rename from Psychorientation_V3.rar rename to historique_prototypes/Psychorientation_V3.rar diff --git a/historique_prototypes/Psychorientation_V4.rar b/historique_prototypes/Psychorientation_V4.rar new file mode 100644 index 0000000000000000000000000000000000000000..928be6a78ddea7aa7c69fc1c250af7bf3aefd897 Binary files /dev/null and b/historique_prototypes/Psychorientation_V4.rar differ diff --git a/historique_prototypes/Psychorientation_V5.exe b/historique_prototypes/Psychorientation_V5.exe new file mode 100644 index 0000000000000000000000000000000000000000..9b1867fe40aacc8bc248e1be63f7fbcf5629380c Binary files /dev/null and b/historique_prototypes/Psychorientation_V5.exe differ diff --git a/historique_prototypes/Psychorientation_V6.exe b/historique_prototypes/Psychorientation_V6.exe new file mode 100644 index 0000000000000000000000000000000000000000..922e739af60527ac572c157e28170c649effdb4c Binary files /dev/null and b/historique_prototypes/Psychorientation_V6.exe differ diff --git a/historique_prototypes/Psychorientation_V7.exe b/historique_prototypes/Psychorientation_V7.exe new file mode 100644 index 0000000000000000000000000000000000000000..922e739af60527ac572c157e28170c649effdb4c Binary files /dev/null and b/historique_prototypes/Psychorientation_V7.exe differ diff --git a/psychorientation/psychorientation.sln b/psychorientation/psychorientation.sln index fb4184ec2f8be6344a2aeff5d8e144d225da7190..15cd0fdb2f86ffb1c73b8a8e00a97d8a2cd4c309 100644 --- a/psychorientation/psychorientation.sln +++ b/psychorientation/psychorientation.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.757 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28917.181 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "psychorientation", "psychorientation\psychorientation.csproj", "{73981980-53AE-4EC6-80AB-471E136663DF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Psychorientation", "psychorientation\Psychorientation.csproj", "{73981980-53AE-4EC6-80AB-471E136663DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/psychorientation/psychorientation/Config.cs b/psychorientation/psychorientation/Config.cs deleted file mode 100644 index 8a504f87b97d2f7d937c3508f20733f4c87f88e0..0000000000000000000000000000000000000000 --- a/psychorientation/psychorientation/Config.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Threading.Tasks; -using Newtonsoft.Json; - -namespace psychorientation -{ - class Config - { - private static Config instance; - - public double coeffEffortOral; - public double coeffCompetenceOral; - - public double coeffCompetenceEcrit; - public double coeffEffortEcrit; - - public static Config GetInstance() - { - if (Config.instance == null) - { - - Config.instance = JsonConvert.DeserializeObject<Config>(File.ReadAllText("config.json")); - Console.WriteLine(Config.instance.coeffEffortOral); - return Config.instance; - } - else - { - return Config.instance; - } - } - - public double GetCoeffEffortOral() - { - return this.coeffEffortOral; - } - - public double GetCoeffCompetenceOral() - { - return this.coeffCompetenceOral; - } - - public double GetCoeffCompetenceEcrit() - { - return this.coeffCompetenceEcrit; - } - - public double GetCoeffEffortEcrit() - { - return this.coeffEffortEcrit; - } - } -} diff --git a/psychorientation/psychorientation/InterfaceClasse.Designer.cs b/psychorientation/psychorientation/InterfaceClasse.Designer.cs index 3b8cfdc61cd4b0b06a03b8ff6fd0eeac54a0354c..ae4bea3a9771c51b0bf75cbab030ec3ccda3bc9f 100644 --- a/psychorientation/psychorientation/InterfaceClasse.Designer.cs +++ b/psychorientation/psychorientation/InterfaceClasse.Designer.cs @@ -40,11 +40,14 @@ this.lblListeEleve = new System.Windows.Forms.Label(); this.imgListPerso = new System.Windows.Forms.ImageList(this.components); this.pnlChoix = new System.Windows.Forms.Panel(); + this.lbl_barre_decisions = new System.Windows.Forms.Label(); this.lblCours = new System.Windows.Forms.Label(); this.lblNotation = new System.Windows.Forms.Label(); + this.pbProf = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).BeginInit(); this.pnlListeEleve.SuspendLayout(); this.pnlChoix.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbProf)).BeginInit(); this.SuspendLayout(); // // pb_action_suivante @@ -53,9 +56,9 @@ this.pb_action_suivante.BackgroundImage = global::psychorientation.Properties.Resources.passer; this.pb_action_suivante.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.pb_action_suivante.InitialImage = null; - this.pb_action_suivante.Location = new System.Drawing.Point(1225, 651); + this.pb_action_suivante.Location = new System.Drawing.Point(1156, 623); this.pb_action_suivante.Name = "pb_action_suivante"; - this.pb_action_suivante.Size = new System.Drawing.Size(120, 120); + this.pb_action_suivante.Size = new System.Drawing.Size(165, 148); this.pb_action_suivante.TabIndex = 0; this.pb_action_suivante.TabStop = false; this.pb_action_suivante.Click += new System.EventHandler(this.Pb_action_suivante_Click); @@ -64,11 +67,11 @@ // this.lblDate.AutoSize = true; this.lblDate.BackColor = System.Drawing.Color.Transparent; - this.lblDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblDate.Font = new System.Drawing.Font("Consolas", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblDate.ForeColor = System.Drawing.Color.White; - this.lblDate.Location = new System.Drawing.Point(269, 171); + this.lblDate.Location = new System.Drawing.Point(277, 171); this.lblDate.Name = "lblDate"; - this.lblDate.Size = new System.Drawing.Size(129, 24); + this.lblDate.Size = new System.Drawing.Size(140, 22); this.lblDate.TabIndex = 2; this.lblDate.Text = "Chargement..."; // @@ -76,11 +79,11 @@ // this.lblClasse.AutoSize = true; this.lblClasse.BackColor = System.Drawing.Color.Transparent; - this.lblClasse.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblClasse.Font = new System.Drawing.Font("Consolas", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblClasse.ForeColor = System.Drawing.Color.White; - this.lblClasse.Location = new System.Drawing.Point(943, 171); + this.lblClasse.Location = new System.Drawing.Point(951, 171); this.lblClasse.Name = "lblClasse"; - this.lblClasse.Size = new System.Drawing.Size(129, 24); + this.lblClasse.Size = new System.Drawing.Size(140, 22); this.lblClasse.TabIndex = 4; this.lblClasse.Text = "Chargement..."; // @@ -123,18 +126,21 @@ // pnlListeEleve // this.pnlListeEleve.AutoScroll = true; - this.pnlListeEleve.BackColor = System.Drawing.SystemColors.Control; + this.pnlListeEleve.BackColor = System.Drawing.Color.NavajoWhite; + this.pnlListeEleve.BackgroundImage = global::psychorientation.Properties.Resources.paternFeuille; this.pnlListeEleve.Controls.Add(this.lblListeEleve); this.pnlListeEleve.Location = new System.Drawing.Point(0, -1); this.pnlListeEleve.Name = "pnlListeEleve"; - this.pnlListeEleve.Size = new System.Drawing.Size(241, 783); + this.pnlListeEleve.Size = new System.Drawing.Size(245, 783); this.pnlListeEleve.TabIndex = 5; // // lblListeEleve // this.lblListeEleve.AutoSize = true; + this.lblListeEleve.BackColor = System.Drawing.Color.Transparent; this.lblListeEleve.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblListeEleve.Location = new System.Drawing.Point(3, 0); + this.lblListeEleve.ForeColor = System.Drawing.Color.Black; + this.lblListeEleve.Location = new System.Drawing.Point(10, 4); this.lblListeEleve.Name = "lblListeEleve"; this.lblListeEleve.Size = new System.Drawing.Size(217, 29); this.lblListeEleve.TabIndex = 0; @@ -153,30 +159,58 @@ // // pnlChoix // + this.pnlChoix.BackgroundImage = global::psychorientation.Properties.Resources.paternFeuille1; + this.pnlChoix.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.pnlChoix.Controls.Add(this.lbl_barre_decisions); this.pnlChoix.Controls.Add(this.lblCours); this.pnlChoix.Controls.Add(this.lblNotation); this.pnlChoix.Location = new System.Drawing.Point(1107, 99); this.pnlChoix.Name = "pnlChoix"; - this.pnlChoix.Size = new System.Drawing.Size(189, 528); + this.pnlChoix.Size = new System.Drawing.Size(189, 323); this.pnlChoix.TabIndex = 8; // + // lbl_barre_decisions + // + this.lbl_barre_decisions.BackColor = System.Drawing.Color.DimGray; + this.lbl_barre_decisions.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lbl_barre_decisions.Location = new System.Drawing.Point(-1, 185); + this.lbl_barre_decisions.Name = "lbl_barre_decisions"; + this.lbl_barre_decisions.Size = new System.Drawing.Size(189, 10); + this.lbl_barre_decisions.TabIndex = 2; + this.lbl_barre_decisions.Text = " "; + // // lblCours // + this.lblCours.BackColor = System.Drawing.Color.Transparent; this.lblCours.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.lblCours.Location = new System.Drawing.Point(13, 282); + this.lblCours.ForeColor = System.Drawing.Color.Black; + this.lblCours.Location = new System.Drawing.Point(13, 204); this.lblCours.Name = "lblCours"; this.lblCours.Size = new System.Drawing.Size(164, 59); this.lblCours.TabIndex = 1; - this.lblCours.Text = "Type de cours visant à aider les eleves de competence :"; + this.lblCours.Text = "Type de cours visant à aider les élèves de compétence :"; // // lblNotation // + this.lblNotation.BackColor = System.Drawing.Color.Transparent; this.lblNotation.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.lblNotation.Location = new System.Drawing.Point(13, 87); + this.lblNotation.ForeColor = System.Drawing.Color.Black; + this.lblNotation.Location = new System.Drawing.Point(13, 20); this.lblNotation.Name = "lblNotation"; - this.lblNotation.Size = new System.Drawing.Size(164, 59); + this.lblNotation.Size = new System.Drawing.Size(164, 74); this.lblNotation.TabIndex = 0; - this.lblNotation.Text = "Type de notation visant à aider les eleves de competence :"; + this.lblNotation.Text = "Coefficients de prise en compte de l\'effort et de la compétence pour noter :"; + // + // pbProf + // + this.pbProf.BackColor = System.Drawing.Color.Transparent; + this.pbProf.Image = global::psychorientation.Properties.Resources.prof2; + this.pbProf.Location = new System.Drawing.Point(642, 234); + this.pbProf.Name = "pbProf"; + this.pbProf.Size = new System.Drawing.Size(71, 93); + this.pbProf.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbProf.TabIndex = 9; + this.pbProf.TabStop = false; // // InterfaceClasse // @@ -186,6 +220,7 @@ this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1357, 783); + this.Controls.Add(this.pbProf); this.Controls.Add(this.pnlChoix); this.Controls.Add(this.lblEffort); this.Controls.Add(this.lblCompetence); @@ -203,10 +238,12 @@ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InterfaceClasse_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); this.SizeChanged += new System.EventHandler(this.InterfaceClasse_SizeChanged); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.InterfaceClasse_KeyDown); ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).EndInit(); this.pnlListeEleve.ResumeLayout(false); this.pnlListeEleve.PerformLayout(); this.pnlChoix.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbProf)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -228,6 +265,8 @@ private System.Windows.Forms.Panel pnlChoix; private System.Windows.Forms.Label lblNotation; private System.Windows.Forms.Label lblCours; + private System.Windows.Forms.Label lbl_barre_decisions; + private System.Windows.Forms.PictureBox pbProf; } } diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs index bb7f3e6a21d8eaf7c4f490a38d346191fce35bd3..970b29a3b92ed637c66337673645f0ac3da37055 100644 --- a/psychorientation/psychorientation/InterfaceClasse.cs +++ b/psychorientation/psychorientation/InterfaceClasse.cs @@ -12,6 +12,12 @@ namespace psychorientation { public partial class InterfaceClasse : Form { + + double effortInitial = 0.0; + double competenceInitial = 0.0; + double moyenneInitiale = 0.0; + + private Random r = new Random(); private Libelle libelle = Libelle.GetInstance(); private int moisActuel = 8; @@ -20,9 +26,10 @@ namespace psychorientation private int[] positionElevex = { 322, 571, 698, 951, 322, 571, 698, 951 }; private int[] positionElevey = { 398, 398, 398, 398, 505, 505, 505, 505 }; + private Image[] imageEleve; - private string notaText = "Notation suivant les coefficients : "; - private string coursText = "Type de cours visant à aider les eleves de competence : "; + private string notaText = "Coefficients de prise en compte de l'effort et de la compétence pour noter :"; + private string coursText = "Type de cours visant à aider les élèves de compétence : "; private double valCours = 5.0; private double valNotation = 10.0; @@ -41,7 +48,8 @@ namespace psychorientation { AjouterEleveImage(); GenererBase(); - + TransmitKeyDown(); + /* Message mAccueil = new Message("Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ", "Début", TypeMessage.INFORMATION); mAccueil.ShowDialog(); @@ -52,27 +60,35 @@ namespace psychorientation { lblDate.Text = libelle.Mois(moisActuel % 12); lblClasse.Text = libelle.Niveau(anneeActuelle); - lblEffort.Text = "Effort de la classe : " + Math.Round(gestEleve.GetEffortClasse(), 1).ToString(); - lblCompetence.Text = "Competence de la classe : " + Math.Round(gestEleve.GetCompetenceClasse(), 1).ToString(); - lblMoyenne.Text = "Moyenne de la classe : " + Math.Round(gestEleve.GetMoyenneClasse(), 1).ToString(); + effortInitial = Math.Round(gestEleve.GetEffortClasse(), 1); + competenceInitial = Math.Round(gestEleve.GetCompetenceClasse(), 1); + moyenneInitiale = Math.Round(gestEleve.GetMoyenneClasse(), 1); + lblEffort.Text = "Effort de la classe : " + effortInitial.ToString(); + lblCompetence.Text = "Competence de la classe : " + competenceInitial.ToString(); + lblMoyenne.Text = "Moyenne de la classe : " + moyenneInitiale.ToString(); Libelle lib = new Libelle(); - int y = 20; + int y = 40; foreach (Eleve eleve in gestEleve.GetListeEleves()) { InterfaceInfoEleve ii = new InterfaceInfoEleve(); ii.setParam(eleve); - ii.Location = new Point(0, y); + ii.Tag = eleve; + ii.Location = new Point(6, y); + ii.Click += new System.EventHandler(PbOuvrirInfo); pnlListeEleve.Controls.Add(ii); y += 220; } - TrackBar tbNota = new TrackBar(); tbNota.Location = new System.Drawing.Point(0, lblNotation.Location.Y + lblNotation.Size.Height); tbNota.Size = new System.Drawing.Size(184, 45); tbNota.Maximum = 20; + tbNota.BackColor = System.Drawing.Color.Tan; tbNota.Value = 10; + tbNota.SmallChange = 1; + tbNota.LargeChange = 1; + tbNota.TickStyle = TickStyle.TopLeft; tbNota.Scroll += new System.EventHandler(tbNota_Scroll); pnlChoix.Controls.Add(tbNota); lblNotation.Text = notaText; @@ -83,13 +99,18 @@ namespace psychorientation lblValCompetence.Location = new Point(1, 5 + tbNota.Location.Y + tbNota.Size.Height); lblValEffort.Text = lblValEffort.Tag + ((20 - tbNota.Value) / 10.0).ToString(); lblValCompetence.Text = lblValCompetence.Tag + (tbNota.Value / 10.0).ToString(); + lblValCompetence.BackColor= System.Drawing.Color.Transparent; + lblValEffort.BackColor= System.Drawing.Color.Transparent; pnlChoix.Controls.Add(lblValEffort); pnlChoix.Controls.Add(lblValCompetence); TrackBar tbCours = new TrackBar(); + tbCours.BackColor= System.Drawing.Color.Tan; tbCours.Location = new System.Drawing.Point(0, 10 + lblCours.Location.Y + lblCours.Size.Height); tbCours.Size = new System.Drawing.Size(184, 45); tbCours.Value = 5; + tbCours.SmallChange = 1; + tbCours.LargeChange = 1; tbCours.Scroll += new System.EventHandler(tbCours_Scroll); pnlChoix.Controls.Add(tbCours); lblCours.Text = coursText + tbCours.Value.ToString(); @@ -97,6 +118,7 @@ namespace psychorientation private void AjouterPictureboxEleve() { + imageEleve = new Image[gestEleve.GetListeEleves().Count]; for (int i = 0; i < gestEleve.GetListeEleves().Count; i++) { PictureBox pbEleve = new PictureBox(); @@ -110,7 +132,7 @@ namespace psychorientation pbEleve.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; pbEleve.Top = positionElevey[i]; pbEleve.Click += new System.EventHandler(PbOuvrirInfo); - + imageEleve[i] = pbEleve.Image; this.Controls.Add(pbEleve); } } @@ -119,7 +141,7 @@ namespace psychorientation { if (isRandom) { - for (int i = 1; i < r.Next(3,9); i++) + for (int i = 1; i < r.Next(6,9); i++) { gestEleve.AjouterEleve(new Eleve(i)); } @@ -131,19 +153,28 @@ namespace psychorientation gestEleve.AjouterEleve(new Eleve(3,0,9.0,1.0,0)); } AjouterPictureboxEleve(); + gestEleve.FaireControle("Controle " + lblClasse.Text + " " + lblDate.Text, valNotation / 10.0); } private void PbOuvrirInfo(object sender, EventArgs e) { - PictureBox pb = (PictureBox)sender; - Eleve tag = (Eleve)pb.Tag; + Eleve tag; + if (sender is PictureBox) + { + tag = (Eleve)(sender as PictureBox).Tag; + } + else + { + tag = (Eleve)(sender as InterfaceInfoEleve).Tag; + } + int id = tag.GetId(); InterfaceInfoCompletEleve iice = new InterfaceInfoCompletEleve(); - iice.setParam(tag); + iice.setParam(tag,imageEleve[id-1]); iice.Show(); } - private void Pb_action_suivante_Click(object sender, EventArgs e) + private void ActionSuivante() { // Traite les actions à effectuer avant de passer au mois suivant. @@ -153,15 +184,14 @@ namespace psychorientation } gestEleve.FaireControle("Controle " + lblClasse.Text + " " + lblDate.Text, valNotation / 10.0); - - lblEffort.Text = "Effort de la classe : " + Math.Round(gestEleve.GetEffortClasse(), 1).ToString(); - lblCompetence.Text = "Competence de la classe : " + Math.Round(gestEleve.GetCompetenceClasse(), 1).ToString(); - lblMoyenne.Text = "Moyenne de la classe : " + Math.Round(gestEleve.GetMoyenneClasse(), 1).ToString(); + lblEffort.Text = "Effort de la classe : " + Math.Round(gestEleve.GetEffortClasse(), 2).ToString(); + lblCompetence.Text = "Competence de la classe : " + Math.Round(gestEleve.GetCompetenceClasse(), 2).ToString(); + lblMoyenne.Text = "Moyenne de la classe : " + Math.Round(gestEleve.GetMoyenneClasse(), 2).ToString(); ActualiserEleveCoter(); // Passe au mois suivant. moisActuel++; - switch(moisActuel) + switch (moisActuel) { case 17: // Fin de la 1ère année : Début Juin. moisActuel = 20; @@ -173,15 +203,28 @@ namespace psychorientation break; case 42: // Fin de la 3ème année : Debut Juillet. // Fin de la partie. - Message m_fin = new Message( - "Vous avez fini la phase bêta de ce jeu !\n" + - "Bravo à vous et n'hésitez pas à essayer à nouveau pour " + - "améliorer votre compréhension du monde extérieur.", - "Félicitations", - TypeMessage.INFORMATION + double moyenneFinale = gestEleve.GetMoyenneClasse(); + double effortFinal = gestEleve.GetEffortClasse(); + double competenceFinal = gestEleve.GetCompetenceClasse(); + + Message m_fin = new Message( + "Vous avez fini la phase bêta de ce jeu !\n" + + "Bravo à vous et n'hésitez pas à essayer à nouveau pour " + + "améliorer votre compréhension du monde extérieur.\n", + "Félicitations", + TypeMessage.RESULTAT + ); + m_fin.setParamRes( + effortInitial, + competenceInitial, + moyenneInitiale, + effortFinal, + competenceFinal, + moyenneFinale ); m_fin.ShowDialog(); - Close(); + UntransmitKeyDown(); + pb_action_suivante.Click -= new System.EventHandler(Pb_action_suivante_Click); break; } @@ -190,7 +233,12 @@ namespace psychorientation // Cours particuliers. lblDate.Text = libelle.Mois(moisActuel % 12); - lblClasse.Text= libelle.Niveau(anneeActuelle); + lblClasse.Text = libelle.Niveau(anneeActuelle); + } + + private void Pb_action_suivante_Click(object sender, EventArgs e) + { + ActionSuivante(); } private void Pb_liste_eleves_Click(object sender, EventArgs e) @@ -217,13 +265,6 @@ namespace psychorientation PictureBox pb1 = pb_action_suivante; pb1.Location = new Point(Size.Width - pb1.Width - 32, Size.Height - pb1.Height - 32); } - /* - 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(); - } - */ private void tbNota_Scroll(object sender, EventArgs e) { @@ -245,10 +286,58 @@ namespace psychorientation { 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) == DialogResult.No) + "Confirmation de fermeture", + MessageBoxButtons.YesNo, + MessageBoxIcon.Warning, + MessageBoxDefaultButton.Button2 + ) + == DialogResult.No) { e.Cancel = true; } } + + private void TransmitKeyDown() + { + foreach (Control c in this.Controls) + { + if (c is Panel) + { + foreach (Control c2 in (c as Panel).Controls) + { + c2.KeyDown += new System.Windows.Forms.KeyEventHandler(InterfaceClasse_KeyDown); + } + } + c.KeyDown += new System.Windows.Forms.KeyEventHandler(InterfaceClasse_KeyDown); + } + } + + private void UntransmitKeyDown() + { + foreach (Control c in this.Controls) + { + if (c is Panel) + { + foreach (Control c2 in (c as Panel).Controls) + { + c2.KeyDown -= new System.Windows.Forms.KeyEventHandler(InterfaceClasse_KeyDown); + } + } + c.KeyDown -= new System.Windows.Forms.KeyEventHandler(InterfaceClasse_KeyDown); + } + } + + private void InterfaceClasse_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Escape) + { + Close(); + } + + if (e.KeyCode == Keys.Enter) + { + ActionSuivante(); + } + } } } diff --git a/psychorientation/psychorientation/InterfaceClasse.resx b/psychorientation/psychorientation/InterfaceClasse.resx index 67c43d952cd00794f386ac6b0c0306ea8569594e..02edc12fbfc6a0ab36b7246326a46f133a9739cc 100644 --- a/psychorientation/psychorientation/InterfaceClasse.resx +++ b/psychorientation/psychorientation/InterfaceClasse.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM - mgEAAk1TRnQBSQFMAgEBBgEAATABAAEwAQAByAEAAcgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + mgEAAk1TRnQBSQFMAgEBBgEAAYABAAGAAQAByAEAAcgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABIAEDAgABkAEBAgABAQEAAQgGAAHiAQQXAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEA AcAB3AHAAQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEA A0IBAAM5AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIA diff --git a/psychorientation/psychorientation/InterfaceInfoCompletEleve.Designer.cs b/psychorientation/psychorientation/InterfaceInfoCompletEleve.Designer.cs index 59b30e3a1b9a886a097db48ca95b67e8050b4983..2c9c1ff138873bfd7934d3c6dafcfce465e44b3c 100755 --- a/psychorientation/psychorientation/InterfaceInfoCompletEleve.Designer.cs +++ b/psychorientation/psychorientation/InterfaceInfoCompletEleve.Designer.cs @@ -50,7 +50,7 @@ // this.lblNomEleve.AutoSize = true; this.lblNomEleve.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F); - this.lblNomEleve.Location = new System.Drawing.Point(253, 14); + this.lblNomEleve.Location = new System.Drawing.Point(125, 17); this.lblNomEleve.Name = "lblNomEleve"; this.lblNomEleve.Size = new System.Drawing.Size(118, 24); this.lblNomEleve.TabIndex = 0; @@ -60,7 +60,7 @@ // this.lblClasse.AutoSize = true; this.lblClasse.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.lblClasse.Location = new System.Drawing.Point(254, 71); + this.lblClasse.Location = new System.Drawing.Point(126, 74); this.lblClasse.Name = "lblClasse"; this.lblClasse.Size = new System.Drawing.Size(70, 18); this.lblClasse.TabIndex = 2; @@ -70,7 +70,7 @@ // this.lblEffort.AutoSize = true; this.lblEffort.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.lblEffort.Location = new System.Drawing.Point(225, 126); + this.lblEffort.Location = new System.Drawing.Point(97, 129); this.lblEffort.Name = "lblEffort"; this.lblEffort.Size = new System.Drawing.Size(44, 15); this.lblEffort.TabIndex = 3; @@ -80,7 +80,7 @@ // this.lblCompetence.AutoSize = true; this.lblCompetence.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.lblCompetence.Location = new System.Drawing.Point(183, 160); + this.lblCompetence.Location = new System.Drawing.Point(55, 163); this.lblCompetence.Name = "lblCompetence"; this.lblCompetence.Size = new System.Drawing.Size(86, 15); this.lblCompetence.TabIndex = 4; @@ -90,17 +90,17 @@ // this.lblMoyenne.AutoSize = true; this.lblMoyenne.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.lblMoyenne.Location = new System.Drawing.Point(186, 195); + this.lblMoyenne.Location = new System.Drawing.Point(22, 198); this.lblMoyenne.Name = "lblMoyenne"; - this.lblMoyenne.Size = new System.Drawing.Size(112, 15); + this.lblMoyenne.Size = new System.Drawing.Size(119, 15); this.lblMoyenne.TabIndex = 10; - this.lblMoyenne.Text = "Moyenne général : "; + this.lblMoyenne.Text = "Moyenne générale : "; // // lblNiveau // this.lblNiveau.AutoSize = true; this.lblNiveau.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); - this.lblNiveau.Location = new System.Drawing.Point(330, 71); + this.lblNiveau.Location = new System.Drawing.Point(202, 74); this.lblNiveau.Name = "lblNiveau"; this.lblNiveau.Size = new System.Drawing.Size(67, 18); this.lblNiveau.TabIndex = 11; @@ -111,7 +111,7 @@ // this.panel1.BackColor = System.Drawing.Color.Silver; this.panel1.Controls.Add(this.pnlEffort); - this.panel1.Location = new System.Drawing.Point(320, 121); + this.panel1.Location = new System.Drawing.Point(192, 124); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(139, 26); this.panel1.TabIndex = 12; @@ -128,7 +128,7 @@ // this.panel2.BackColor = System.Drawing.Color.Silver; this.panel2.Controls.Add(this.pnlCompetence); - this.panel2.Location = new System.Drawing.Point(320, 156); + this.panel2.Location = new System.Drawing.Point(192, 159); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(139, 26); this.panel2.TabIndex = 13; @@ -145,7 +145,7 @@ // this.lblMoyenneNote.AutoSize = true; this.lblMoyenneNote.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.lblMoyenneNote.Location = new System.Drawing.Point(317, 195); + this.lblMoyenneNote.Location = new System.Drawing.Point(189, 198); this.lblMoyenneNote.Name = "lblMoyenneNote"; this.lblMoyenneNote.Size = new System.Drawing.Size(97, 15); this.lblMoyenneNote.TabIndex = 14; @@ -153,25 +153,26 @@ // // pcbEleve // - this.pcbEleve.Location = new System.Drawing.Point(32, 24); + this.pcbEleve.Location = new System.Drawing.Point(25, 12); this.pcbEleve.Name = "pcbEleve"; - this.pcbEleve.Size = new System.Drawing.Size(109, 97); + this.pcbEleve.Size = new System.Drawing.Size(78, 106); + this.pcbEleve.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pcbEleve.TabIndex = 15; this.pcbEleve.TabStop = false; // // pnlNote // this.pnlNote.AutoScroll = true; - this.pnlNote.Location = new System.Drawing.Point(85, 243); + this.pnlNote.Location = new System.Drawing.Point(12, 253); this.pnlNote.Name = "pnlNote"; - this.pnlNote.Size = new System.Drawing.Size(448, 134); + this.pnlNote.Size = new System.Drawing.Size(328, 143); this.pnlNote.TabIndex = 16; // // InterfaceInfoCompletEleve // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(579, 408); + this.ClientSize = new System.Drawing.Size(351, 408); this.Controls.Add(this.pnlNote); this.Controls.Add(this.pcbEleve); this.Controls.Add(this.lblMoyenneNote); @@ -183,10 +184,13 @@ this.Controls.Add(this.lblEffort); this.Controls.Add(this.lblClasse); this.Controls.Add(this.lblNomEleve); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; this.Name = "InterfaceInfoCompletEleve"; this.Text = "InterfaceInfoCompletEleve"; this.TopMost = true; this.Load += new System.EventHandler(this.InterfaceInfoCompletEleve_Load); + this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.InterfaceInfoCompletEleve_KeyPress); this.panel1.ResumeLayout(false); this.panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pcbEleve)).EndInit(); diff --git a/psychorientation/psychorientation/InterfaceInfoCompletEleve.cs b/psychorientation/psychorientation/InterfaceInfoCompletEleve.cs index 169d9b1d0ab67a689a285038c6694540b554cdc2..5073c251afcf2ca2c21cf1e4e88f3769d42c5b89 100755 --- a/psychorientation/psychorientation/InterfaceInfoCompletEleve.cs +++ b/psychorientation/psychorientation/InterfaceInfoCompletEleve.cs @@ -29,16 +29,20 @@ namespace psychorientation } - public void setParam(Eleve el) + public void setParam(Eleve el,Image pb) { this.eleve = el; + + pcbEleve.Image = pb; actualiser(); } private void actualiser() { + lblEffort.Text = "Effort : " + Math.Round(eleve.GetEffort(),1); + lblCompetence.Text = "Compétence : " + Math.Round(eleve.GetCompetence(),1); Libelle lib = new Libelle(); - string nom = "Eleve n°" + eleve.GetId(); + string nom = "Élève n°" + eleve.GetId(); this.Text = nom; lblNomEleve.Text = nom; lblNiveau.Text = lib.Niveau(eleve.GetClasse()); @@ -57,6 +61,8 @@ namespace psychorientation InitNote(); } + + private void MajPanel(Panel p, double valeur) { int val = (int)valeur; @@ -93,7 +99,7 @@ namespace psychorientation tlp.Controls.Add(CreerLabel(Math.Round(note.GetEffort(), 2).ToString()), 3, i); } - tlp.Size = new System.Drawing.Size(413, largeurLigne* tlp.RowCount); + tlp.Size = new System.Drawing.Size(320, largeurLigne * tlp.RowCount + 10); tlp.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; pnlNote.Controls.Add(tlp); } @@ -105,6 +111,12 @@ namespace psychorientation return lbl; } - + private void InterfaceInfoCompletEleve_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == 27) // Echap + { + Close(); + } + } } } diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs index 82289e78be0c24aecc1dbb9b8ee29c2a05465d3f..93352feb09f486fea1e89274c9293d0f85db7750 100644 --- a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs +++ b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs @@ -54,7 +54,7 @@ this.lblEleve.Size = new System.Drawing.Size(99, 33); this.lblEleve.TabIndex = 0; this.lblEleve.Text = "label1"; - this.lblEleve.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // label1 // @@ -64,7 +64,7 @@ this.label1.Size = new System.Drawing.Size(50, 13); this.label1.TabIndex = 1; this.label1.Text = "Classe : "; - this.label1.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // label2 // @@ -74,7 +74,7 @@ this.label2.Size = new System.Drawing.Size(41, 13); this.label2.TabIndex = 2; this.label2.Text = "Effort : "; - this.label2.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // label3 // @@ -84,7 +84,7 @@ this.label3.Size = new System.Drawing.Size(76, 13); this.label3.TabIndex = 3; this.label3.Text = "Compétence : "; - this.label3.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // lblClasse // @@ -94,18 +94,17 @@ this.lblClasse.Size = new System.Drawing.Size(35, 13); this.lblClasse.TabIndex = 4; this.lblClasse.Text = "label4"; - this.lblClasse.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // panel1 // this.panel1.BackColor = System.Drawing.Color.Silver; this.panel1.Controls.Add(this.pnlEffort); - this.panel1.Controls.Add(this.lblEffort); this.panel1.Location = new System.Drawing.Point(110, 95); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(92, 26); this.panel1.TabIndex = 5; - this.panel1.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // pnlEffort // @@ -114,7 +113,15 @@ this.pnlEffort.Name = "pnlEffort"; this.pnlEffort.Size = new System.Drawing.Size(84, 18); this.pnlEffort.TabIndex = 6; - this.pnlEffort.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + + // + // lblEffort + // + this.lblEffort.AutoSize = true; + this.lblEffort.Location = new System.Drawing.Point(53, 104); + this.lblEffort.Name = "lblEffort"; + this.lblEffort.Size = new System.Drawing.Size(0, 13); + this.lblEffort.TabIndex = 7; // // panel2 // @@ -124,7 +131,7 @@ this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(92, 26); this.panel2.TabIndex = 6; - this.panel2.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // pnlCompetence // @@ -133,15 +140,7 @@ this.pnlCompetence.Name = "pnlCompetence"; this.pnlCompetence.Size = new System.Drawing.Size(58, 18); this.pnlCompetence.TabIndex = 7; - this.pnlCompetence.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); - // - // lblEffort - // - this.lblEffort.AutoSize = true; - this.lblEffort.Location = new System.Drawing.Point(53, 104); - this.lblEffort.Name = "lblEffort"; - this.lblEffort.Size = new System.Drawing.Size(0, 13); - this.lblEffort.TabIndex = 7; + // // lblCompetence // @@ -159,7 +158,7 @@ this.label4.Size = new System.Drawing.Size(80, 13); this.label4.TabIndex = 9; this.label4.Text = "Dernière note : "; - this.label4.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // lblMoyenne // @@ -169,13 +168,14 @@ this.lblMoyenne.Size = new System.Drawing.Size(35, 13); this.lblMoyenne.TabIndex = 10; this.lblMoyenne.Text = "label5"; - this.lblMoyenne.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + // // InterfaceInfoEleve // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; + this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Controls.Add(this.lblMoyenne); this.Controls.Add(this.label4); this.Controls.Add(this.lblCompetence); @@ -188,10 +188,9 @@ this.Controls.Add(this.label1); this.Controls.Add(this.lblEleve); this.Name = "InterfaceInfoEleve"; - this.Size = new System.Drawing.Size(216, 216); - this.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); + this.Size = new System.Drawing.Size(214, 214); + this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); this.panel2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.cs b/psychorientation/psychorientation/InterfaceInfoEleve.cs index 5bbc6f0af03ad44a0e647a23ec4309465de1d27b..4c2c7c6554976030cc76e7539a6debbafddf3be5 100644 --- a/psychorientation/psychorientation/InterfaceInfoEleve.cs +++ b/psychorientation/psychorientation/InterfaceInfoEleve.cs @@ -27,7 +27,7 @@ namespace psychorientation public void actualiser() { Libelle lib = new Libelle(); - lblEleve.Text = "Eleve n°" + eleve.GetId(); + lblEleve.Text = "Élève n°" + eleve.GetId(); lblClasse.Text = lib.Niveau(eleve.GetClasse()); lblEffort.Text = Math.Round(eleve.GetEffort(), 2).ToString() ; lblCompetence.Text = Math.Round(eleve.GetCompetence(), 2).ToString(); @@ -42,12 +42,5 @@ namespace psychorientation int val = (int)valeur; p.Size = new Size(val * 84 / 10, p.Height); } - - private void InterfaceInfoEleve_Click(object sender, EventArgs e) - { - InterfaceInfoCompletEleve iice = new InterfaceInfoCompletEleve(); - iice.setParam(this.eleve); - iice.Show(); - } } } diff --git a/psychorientation/psychorientation/Menu.Designer.cs b/psychorientation/psychorientation/Menu.Designer.cs index 85007634e446ea9a08fec39240c4739a10c27ac4..f957dc7ad69e9c1b88030063334df548bbff3a45 100644 --- a/psychorientation/psychorientation/Menu.Designer.cs +++ b/psychorientation/psychorientation/Menu.Designer.cs @@ -30,40 +30,63 @@ { this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); + this.lbl_ou = new System.Windows.Forms.Label(); this.SuspendLayout(); // // button1 // - this.button1.Location = new System.Drawing.Point(102, 207); + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button1.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button1.Location = new System.Drawing.Point(77, 31); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(178, 84); + this.button1.Size = new System.Drawing.Size(242, 84); this.button1.TabIndex = 0; - this.button1.Text = "Partie scénarisé"; + this.button1.Text = "Partie scénarisée"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // - this.button2.Location = new System.Drawing.Point(478, 207); + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button2.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button2.Location = new System.Drawing.Point(453, 31); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(178, 84); + this.button2.Size = new System.Drawing.Size(242, 84); this.button2.TabIndex = 1; this.button2.Text = "Partie classique"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // + // lbl_ou + // + this.lbl_ou.AutoSize = true; + this.lbl_ou.BackColor = System.Drawing.Color.Transparent; + this.lbl_ou.Font = new System.Drawing.Font("Consolas", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_ou.ForeColor = System.Drawing.Color.White; + this.lbl_ou.Location = new System.Drawing.Point(358, 57); + this.lbl_ou.Name = "lbl_ou"; + this.lbl_ou.Size = new System.Drawing.Size(53, 37); + this.lbl_ou.TabIndex = 2; + this.lbl_ou.Text = "OU"; + // // Menu // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.BackgroundImage = global::psychorientation.Properties.Resources.paternFeuille; + this.ClientSize = new System.Drawing.Size(770, 157); + this.Controls.Add(this.lbl_ou); this.Controls.Add(this.button2); this.Controls.Add(this.button1); + this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.Name = "Menu"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Menu"; + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Menu_KeyDown); this.ResumeLayout(false); + this.PerformLayout(); } @@ -71,5 +94,6 @@ private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label lbl_ou; } } \ No newline at end of file diff --git a/psychorientation/psychorientation/Menu.cs b/psychorientation/psychorientation/Menu.cs index c73c2af96ca28f639bb75f61dcc517ed0634c090..00e62793d30f5daf18589699269c60e8fb0a68cf 100644 --- a/psychorientation/psychorientation/Menu.cs +++ b/psychorientation/psychorientation/Menu.cs @@ -15,27 +15,44 @@ namespace psychorientation public Menu() { InitializeComponent(); + + TransmitKeyDown(); } private void button1_Click(object sender, EventArgs e) { InterfaceClasse iC = new InterfaceClasse(false); - iC.FormClosing += new FormClosingEventHandler(f_FormClosing); - this.Hide(); iC.Show(); } - private void f_FormClosing(object sender, FormClosingEventArgs e) - { - this.Close(); - } private void button2_Click(object sender, EventArgs e) { InterfaceClasse iC = new InterfaceClasse(true); - iC.FormClosing += new FormClosingEventHandler(f_FormClosing); - this.Hide(); iC.Show(); } + + private void TransmitKeyDown() + { + foreach (Control c in this.Controls) + { + if (c is Panel) + { + foreach (Control c2 in (c as Panel).Controls) + { + c2.KeyDown += new System.Windows.Forms.KeyEventHandler(Menu_KeyDown); + } + } + c.KeyDown += new System.Windows.Forms.KeyEventHandler(Menu_KeyDown); + } + } + + private void Menu_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Escape) + { + Close(); + } + } } } diff --git a/psychorientation/psychorientation/Message.Designer.cs b/psychorientation/psychorientation/Message.Designer.cs index 624906096ad4633e7ca8096120275236b4192fa2..62ae444f0923a9a72e6f9da28cd8a036ae5ae611 100644 --- a/psychorientation/psychorientation/Message.Designer.cs +++ b/psychorientation/psychorientation/Message.Designer.cs @@ -31,20 +31,27 @@ this.lblMessage = new System.Windows.Forms.Label(); this.lblTitre = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); + this.lblScore = new System.Windows.Forms.Label(); + this.lblEffort = new System.Windows.Forms.Label(); + this.lblCompetence = new System.Windows.Forms.Label(); + this.lblMoyenen = new System.Windows.Forms.Label(); this.SuspendLayout(); // // lblMessage // + this.lblMessage.BackColor = System.Drawing.Color.Transparent; this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblMessage.Location = new System.Drawing.Point(12, 72); this.lblMessage.Name = "lblMessage"; this.lblMessage.Size = new System.Drawing.Size(962, 181); this.lblMessage.TabIndex = 0; this.lblMessage.Text = "label1"; + this.lblMessage.Visible = false; // // lblTitre // this.lblTitre.AutoSize = true; + this.lblTitre.BackColor = System.Drawing.Color.Transparent; this.lblTitre.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblTitre.Location = new System.Drawing.Point(116, 9); this.lblTitre.Name = "lblTitre"; @@ -60,11 +67,64 @@ this.label1.Size = new System.Drawing.Size(0, 13); this.label1.TabIndex = 4; // + // lblScore + // + this.lblScore.BackColor = System.Drawing.Color.Transparent; + this.lblScore.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblScore.Location = new System.Drawing.Point(12, 63); + this.lblScore.Name = "lblScore"; + this.lblScore.Size = new System.Drawing.Size(962, 116); + this.lblScore.TabIndex = 5; + this.lblScore.Text = "label1"; + this.lblScore.Visible = false; + // + // lblEffort + // + this.lblEffort.AutoSize = true; + this.lblEffort.BackColor = System.Drawing.Color.Transparent; + this.lblEffort.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblEffort.Location = new System.Drawing.Point(14, 179); + this.lblEffort.Name = "lblEffort"; + this.lblEffort.Size = new System.Drawing.Size(66, 24); + this.lblEffort.TabIndex = 6; + this.lblEffort.Text = "label2"; + this.lblEffort.Visible = false; + // + // lblCompetence + // + this.lblCompetence.AutoSize = true; + this.lblCompetence.BackColor = System.Drawing.Color.Transparent; + this.lblCompetence.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblCompetence.Location = new System.Drawing.Point(14, 207); + this.lblCompetence.Name = "lblCompetence"; + this.lblCompetence.Size = new System.Drawing.Size(66, 24); + this.lblCompetence.TabIndex = 7; + this.lblCompetence.Text = "label2"; + this.lblCompetence.Visible = false; + // + // lblMoyenen + // + this.lblMoyenen.AutoSize = true; + this.lblMoyenen.BackColor = System.Drawing.Color.Transparent; + this.lblMoyenen.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblMoyenen.Location = new System.Drawing.Point(14, 236); + this.lblMoyenen.Name = "lblMoyenen"; + this.lblMoyenen.Size = new System.Drawing.Size(66, 24); + this.lblMoyenen.TabIndex = 8; + this.lblMoyenen.Text = "label2"; + this.lblMoyenen.Visible = false; + this.lblMoyenen.Click += new System.EventHandler(this.lblMoyenen_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.lblMoyenen); + this.Controls.Add(this.lblCompetence); + this.Controls.Add(this.lblEffort); + this.Controls.Add(this.lblScore); this.Controls.Add(this.label1); this.Controls.Add(this.lblTitre); this.Controls.Add(this.lblMessage); @@ -84,5 +144,9 @@ private System.Windows.Forms.Label lblMessage; private System.Windows.Forms.Label lblTitre; private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lblScore; + private System.Windows.Forms.Label lblEffort; + private System.Windows.Forms.Label lblCompetence; + private System.Windows.Forms.Label lblMoyenen; } } \ No newline at end of file diff --git a/psychorientation/psychorientation/Message.cs b/psychorientation/psychorientation/Message.cs index efffe2d67266faf286e6f56a0c407467b616064b..d6d9b8426f168d711c589661f0310afdd7dda8dd 100644 --- a/psychorientation/psychorientation/Message.cs +++ b/psychorientation/psychorientation/Message.cs @@ -13,7 +13,7 @@ namespace psychorientation public enum TypeMessage { - INFORMATION,NOTATION + INFORMATION,NOTATION,RESULTAT } public partial class Message : Form @@ -27,6 +27,16 @@ namespace psychorientation int reponseInt = 0; double reponseDouble = 0; + bool effortScoreRouge = false; + bool moyenneScoreRouge = false; + bool competenceScoreRouge = false; + + double effortScore; + double competenceScore; + double moyenneScore; + double effortLimite; + double competenceLimite; + double moyenneLimite; public Message(string messageAffiche,string titreAffiche,TypeMessage typeMessage) { @@ -36,6 +46,19 @@ namespace psychorientation titre = titreAffiche; } + public void setParamRes(double effortInitial, double competenceInitial, double moyenneInitiale, double effortFinal, double competenceFinal, double moyenneFinale) + { + effortScore = Math.Round(100 * (effortFinal - effortInitial) / effortInitial, 1); + competenceScore = Math.Round(100 * (competenceFinal - competenceInitial) / competenceInitial, 1); + moyenneScore = Math.Round(100 * (moyenneFinale - moyenneInitiale) / moyenneInitiale, 1); + effortLimite = Math.Round(100 * ((10 - effortInitial) / 3) / effortInitial, 1); + competenceLimite = Math.Round(100 * ((10 - competenceInitial) / 4) / competenceInitial, 1); + moyenneLimite = 0; + effortScoreRouge = effortFinal > ((10 - effortInitial) / 3) + effortInitial; + competenceScoreRouge = competenceFinal > ((10 - competenceInitial) / 4) + competenceInitial; + moyenneScoreRouge = moyenneFinale > moyenneInitiale; + } + public bool getReponseBool { get { return reponseBool; } @@ -60,10 +83,12 @@ namespace psychorientation private void Message_Load(object sender, EventArgs e) { lblMessage.Text = message; + lblScore.Text = message; lblTitre.Text = titre; switch (typeMessage) { case TypeMessage.INFORMATION: + lblMessage.Visible = true; this.Size = new Size(986, 347); Button b = new Button(); b.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -75,7 +100,51 @@ namespace psychorientation b.Click += new System.EventHandler(this.b_Click); this.Controls.Add(b); break; + case TypeMessage.RESULTAT: + lblCompetence.Visible = true; + lblEffort.Visible = true; + lblMoyenen.Visible = true; + lblScore.Visible = true; + lblCompetence.Text = "L'évolution des compétences de vos élèves est de : " + competenceScore + " % pour " + competenceLimite + " % nécessaires."; + lblEffort.Text = "L'évolution des efforts de vos élèves est de : " + effortScore + " % pour " + effortLimite + " % nécessaires."; + lblMoyenen.Text = "L'évolution des moyennes de vos élèves est de : " + moyenneScore + " % pour " + moyenneLimite + " % nécessaires."; + if (!effortScoreRouge) + { + lblEffort.ForeColor = Color.Red; + } + else + { + lblEffort.ForeColor = Color.Green; + } + if (!competenceScoreRouge) + { + lblCompetence.ForeColor = Color.Red; + } + else + { + lblCompetence.ForeColor = Color.Green; + } + if (!moyenneScoreRouge) + { + lblMoyenen.ForeColor = Color.Red; + } + else + { + lblMoyenen.ForeColor = Color.Green; + } + this.Size = new Size(986, 347); + Button bh = new Button(); + bh.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + bh.Location = new System.Drawing.Point(784, 284); + bh.Size = new System.Drawing.Size(190, 51); + bh.TabIndex = 2; + bh.Text = "Valider"; + bh.UseVisualStyleBackColor = true; + bh.Click += new System.EventHandler(this.b_Click); + this.Controls.Add(bh); + break; case TypeMessage.NOTATION: + lblMessage.Visible = true; this.Size = new Size(986, 347); Button bu = new Button(); bu.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -122,5 +191,10 @@ namespace psychorientation this.reponseDouble = (double)tb.Value; tag.Text= "Type de cours visant à aider les élèves de compétence : " + this.reponseDouble; } + + private void lblMoyenen_Click(object sender, EventArgs e) + { + + } } } diff --git a/psychorientation/psychorientation/Properties/Resources.Designer.cs b/psychorientation/psychorientation/Properties/Resources.Designer.cs index c38eb90c849d7a3b77a8c40cca9efb7b1d2b8462..5a3341e908e534ad8b8561242d82412d32636dc4 100644 --- a/psychorientation/psychorientation/Properties/Resources.Designer.cs +++ b/psychorientation/psychorientation/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace psychorientation.Properties { // à l'aide d'un outil, tel que ResGen ou Visual Studio. // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen // avec l'option /str ou régénérez votre projet VS. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -80,6 +80,36 @@ namespace psychorientation.Properties { } } + /// <summary> + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap paternFeuille { + get { + object obj = ResourceManager.GetObject("paternFeuille", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap paternFeuille1 { + get { + object obj = ResourceManager.GetObject("paternFeuille1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap prof2 { + get { + object obj = ResourceManager.GetObject("prof2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// <summary> /// Recherche une ressource localisée de type System.Drawing.Bitmap. /// </summary> diff --git a/psychorientation/psychorientation/Properties/Resources.resx b/psychorientation/psychorientation/Properties/Resources.resx index 0501c1e65c76c521b5598ce2537ea70b025e6df1..4fc2ea8715c175173b895b4c96cb05b29ad3b9fd 100644 --- a/psychorientation/psychorientation/Properties/Resources.resx +++ b/psychorientation/psychorientation/Properties/Resources.resx @@ -124,13 +124,22 @@ <data name="grp" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\grp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="paternFeuille" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\bin\Debug\images\patern\paternFeuille.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> <data name="passer" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\passer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="prof2" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\prof2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="salleV11" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\salleV11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="paternFeuille1" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\paternFeuille.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/paternFeuille.png b/psychorientation/psychorientation/Resources/paternFeuille.png new file mode 100644 index 0000000000000000000000000000000000000000..002a14f0605484bd19172bb321b707b2bc00f56c Binary files /dev/null and b/psychorientation/psychorientation/Resources/paternFeuille.png differ diff --git a/psychorientation/psychorientation/Resources/prof2.png b/psychorientation/psychorientation/Resources/prof2.png new file mode 100644 index 0000000000000000000000000000000000000000..32cb8cfcda04e761981ec45a81328952794b0224 Binary files /dev/null and b/psychorientation/psychorientation/Resources/prof2.png differ diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index 8e1b5891e19132b6837be20f4b46e2931f8fe3d2..0e5dfb4b38d3d12d044ba7054983cb2bd7201c31 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -16,6 +16,7 @@ namespace psychorientation private List<Note> listeNotes = new List<Note>(); private double appreciation; private static Random r = new Random(); + public Eleve(int id) { @@ -24,7 +25,7 @@ namespace psychorientation this.competence = Eleve.r.NextDouble()*10; this.effort = Eleve.r.NextDouble()*10; this.orientation = 0; - this.appreciation=CalculerAppreciation(); + this.appreciation=CalculerAppreciation(1); } public Eleve(int id,int classe, double competence, double effort, int orientation) @@ -34,7 +35,7 @@ namespace psychorientation this.competence = competence; this.effort = effort; this.orientation = orientation; - this.appreciation = CalculerAppreciation(); + this.appreciation = CalculerAppreciation(1); } public void SetClasse(int classe) { @@ -124,7 +125,7 @@ namespace psychorientation { double note = CalculerNote(coeff); - double note_convenable = 10 + (competence - 5); + double note_convenable = 10 + (competence - 5);//((competence + effort) / 2 - 5); if (effort > 5) { if (note >= note_convenable) @@ -144,10 +145,10 @@ namespace psychorientation } else { - effort += 0.25; + effort -= 0.25; } } - + if (effort < 0) { effort = 0; } else if (effort > 10) { effort = 10; } @@ -160,9 +161,9 @@ namespace psychorientation return (this.effort * (2 - coeff) + this.competence * coeff); } - private double CalculerAppreciation() + private double CalculerAppreciation(double coeff) { - return (this.effort * Config.GetInstance().GetCoeffEffortOral() + this.competence * Config.GetInstance().GetCoeffCompetenceOral()); + return (this.effort * (2 - coeff) + this.competence * coeff); } } } diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj index 535e29a359d2c221f7d200612224ea6925727dfe..55432bbe4a2b6da818421e88d7fd9960b5c40c45 100644 --- a/psychorientation/psychorientation/psychorientation.csproj +++ b/psychorientation/psychorientation/psychorientation.csproj @@ -50,7 +50,6 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Config.cs" /> <Compile Include="Eleve.cs" /> <Compile Include="InterfaceClasse.cs"> <SubType>Form</SubType> @@ -150,5 +149,14 @@ <ItemGroup> <None Include="Resources\salleV11.png" /> </ItemGroup> + <ItemGroup> + <None Include="bin\Debug\images\patern\paternFeuille.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\prof2.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\paternFeuille.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file