From d0ccad358ee589bbb94371f052e31fda803497ab Mon Sep 17 00:00:00 2001 From: Antoine Tritschberger <antoine.tritschberger@etu.unistra.fr> Date: Thu, 2 Apr 2020 10:53:52 +0200 Subject: [PATCH] Suite du bouton suivant qui fait faire un ctonrole au eleves et les fait progresser --- .../InterfaceClasse.Designer.cs | 41 +++++++++---- .../psychorientation/InterfaceClasse.cs | 28 +++++++-- .../psychorientation/Message.Designer.cs | 21 +++---- psychorientation/psychorientation/Message.cs | 59 ++++++++++++++++--- .../psychorientation/psychorientation.csproj | 1 + 5 files changed, 112 insertions(+), 38 deletions(-) diff --git a/psychorientation/psychorientation/InterfaceClasse.Designer.cs b/psychorientation/psychorientation/InterfaceClasse.Designer.cs index be6e2db..ec6e084 100644 --- a/psychorientation/psychorientation/InterfaceClasse.Designer.cs +++ b/psychorientation/psychorientation/InterfaceClasse.Designer.cs @@ -30,8 +30,9 @@ { 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.lblDate = new System.Windows.Forms.Label(); this.pb_sortir = new System.Windows.Forms.PictureBox(); + this.lblClasse = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_liste_eleves)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_sortir)).BeginInit(); @@ -62,16 +63,17 @@ this.pb_liste_eleves.TabStop = false; this.pb_liste_eleves.Click += new System.EventHandler(this.Pb_liste_eleves_Click); // - // lbl_date + // lblDate // - this.lbl_date.AutoSize = true; - this.lbl_date.BackColor = System.Drawing.Color.Transparent; - this.lbl_date.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_date.Location = new System.Drawing.Point(118, 12); - this.lbl_date.Name = "lbl_date"; - this.lbl_date.Size = new System.Drawing.Size(163, 29); - this.lbl_date.TabIndex = 2; - this.lbl_date.Text = "Chargement..."; + 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.ForeColor = System.Drawing.Color.White; + this.lblDate.Location = new System.Drawing.Point(269, 171); + this.lblDate.Name = "lblDate"; + this.lblDate.Size = new System.Drawing.Size(129, 24); + this.lblDate.TabIndex = 2; + this.lblDate.Text = "Chargement..."; // // pb_sortir // @@ -85,6 +87,18 @@ this.pb_sortir.TabStop = false; this.pb_sortir.Click += new System.EventHandler(this.Pb_sortir_Click); // + // lblClasse + // + 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.ForeColor = System.Drawing.Color.White; + this.lblClasse.Location = new System.Drawing.Point(943, 171); + this.lblClasse.Name = "lblClasse"; + this.lblClasse.Size = new System.Drawing.Size(129, 24); + this.lblClasse.TabIndex = 4; + this.lblClasse.Text = "Chargement..."; + // // InterfaceClasse // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -93,8 +107,9 @@ this.BackgroundImage = global::psychorientation.Properties.Resources.salleV11; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1357, 783); + this.Controls.Add(this.lblClasse); this.Controls.Add(this.pb_sortir); - this.Controls.Add(this.lbl_date); + this.Controls.Add(this.lblDate); this.Controls.Add(this.pb_liste_eleves); this.Controls.Add(this.pb_action_suivante); this.DoubleBuffered = true; @@ -103,7 +118,6 @@ this.Name = "InterfaceClasse"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Psychorientation"; - this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.Form1_Load); this.SizeChanged += new System.EventHandler(this.InterfaceClasse_SizeChanged); ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).EndInit(); @@ -118,8 +132,9 @@ 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.Label lblDate; private System.Windows.Forms.PictureBox pb_sortir; + private System.Windows.Forms.Label lblClasse; } } diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs index 204a355..468b510 100644 --- a/psychorientation/psychorientation/InterfaceClasse.cs +++ b/psychorientation/psychorientation/InterfaceClasse.cs @@ -15,6 +15,7 @@ namespace psychorientation private Libelle libelle = Libelle.GetInstance(); private int moisActuel = 8; private int anneeActuelle = 0; + private GestionnaireEleve gestEleve = new GestionnaireEleve(); public InterfaceClasse() { @@ -23,20 +24,35 @@ namespace psychorientation private void Form1_Load(object sender, EventArgs e) { - lbl_date.Text = libelle.Mois(moisActuel % 12) + " " + libelle.Niveau(anneeActuelle); + lblDate.Text = libelle.Mois(moisActuel % 12); + lblClasse.Text=libelle.Niveau(anneeActuelle); - Message m_accueil = new Message(-1, "Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ", "Début", TypeMessage.INFORMATION); - m_accueil.ShowDialog(); + for(int i = 1; i < 5; i++) + { + gestEleve.AjouterEleve(new Eleve(i)); + } + + Message mAccueil = new Message("Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ", "Début", TypeMessage.INFORMATION); + mAccueil.ShowDialog(); } private void Pb_action_suivante_Click(object sender, EventArgs e) { // Traite les actions à effectuer avant de passer au mois suivant. + if (false) { // Lance l'interface appropriee. return; } + Message mControle = new Message("C'est la fin du mois, comme chaque mois, les eleves vont passer un contrôle, à vous de choisir le niveau de compétence de votre enseignement.", "Début", TypeMessage.NOTATION); + mControle.ShowDialog(); + + foreach(Eleve el in gestEleve.GetListeEleves()) + { + el.Progression(mControle.getReponseDouble); + } + // Passe au mois suivant. moisActuel++; @@ -52,8 +68,7 @@ namespace psychorientation break; case 42: // Fin de la 3ème année : Debut Juillet. // Fin de la partie. - Message m_fin = new Message( - -1, + 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.", @@ -69,7 +84,8 @@ namespace psychorientation // Notation. // Cours particuliers. - lbl_date.Text = libelle.Mois(moisActuel % 12) + " " + libelle.Niveau(anneeActuelle); + lblDate.Text = libelle.Mois(moisActuel % 12); + lblClasse.Text= libelle.Niveau(anneeActuelle); } private void Pb_liste_eleves_Click(object sender, EventArgs e) diff --git a/psychorientation/psychorientation/Message.Designer.cs b/psychorientation/psychorientation/Message.Designer.cs index 3e6a162..6249060 100644 --- a/psychorientation/psychorientation/Message.Designer.cs +++ b/psychorientation/psychorientation/Message.Designer.cs @@ -30,7 +30,7 @@ { this.lblMessage = new System.Windows.Forms.Label(); this.lblTitre = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // lblMessage @@ -52,23 +52,20 @@ this.lblTitre.TabIndex = 1; this.lblTitre.Text = "label1"; // - // button1 + // label1 // - this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button1.Location = new System.Drawing.Point(398, 271); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(190, 51); - this.button1.TabIndex = 2; - this.button1.Text = "Valider"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(136, 284); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(0, 13); + this.label1.TabIndex = 4; // // Message // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(986, 347); - this.Controls.Add(this.button1); + this.Controls.Add(this.label1); this.Controls.Add(this.lblTitre); this.Controls.Add(this.lblMessage); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; @@ -86,6 +83,6 @@ private System.Windows.Forms.Label lblMessage; private System.Windows.Forms.Label lblTitre; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/psychorientation/psychorientation/Message.cs b/psychorientation/psychorientation/Message.cs index 7efdfc2..670dfd3 100644 --- a/psychorientation/psychorientation/Message.cs +++ b/psychorientation/psychorientation/Message.cs @@ -13,12 +13,11 @@ namespace psychorientation public enum TypeMessage { - INFORMATION + INFORMATION,NOTATION } public partial class Message : Form { - int affichage = -1; string message = ""; string titre = ""; TypeMessage typeMessage; @@ -29,11 +28,10 @@ namespace psychorientation double reponseDouble = 0; - public Message(int affichageChoisi,string messageAffiche,string titreAffiche,TypeMessage typeMessage) + public Message(string messageAffiche,string titreAffiche,TypeMessage typeMessage) { InitializeComponent(); this.typeMessage = typeMessage; - affichage = affichageChoisi; message = messageAffiche; titre = titreAffiche; } @@ -65,15 +63,62 @@ namespace psychorientation lblTitre.Text = titre; switch (typeMessage) { - case TypeMessage.INFORMATION:; - break; + case TypeMessage.INFORMATION: + 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))); + b.Location = new System.Drawing.Point(784, 284); + b.Size = new System.Drawing.Size(190, 51); + b.TabIndex = 2; + b.Text = "Valider"; + b.UseVisualStyleBackColor = true; + b.Click += new System.EventHandler(this.b_Click); + this.Controls.Add(b); + break; + case TypeMessage.NOTATION: + 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))); + bu.Location = new System.Drawing.Point(784, 284); + bu.Size = new System.Drawing.Size(190, 51); + bu.TabIndex = 2; + bu.Text = "Valider"; + bu.UseVisualStyleBackColor = true; + bu.Click += new System.EventHandler(this.b_Click); + this.Controls.Add(bu); + + + Label l = new Label(); + l.AutoSize = true; + l.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + l.Location = new System.Drawing.Point(10, 279); + l.Size = new System.Drawing.Size(477, 20); + l.TabIndex = 5; + l.Text = "Type de notation visant à aider les eleves de competence :"; + this.Controls.Add(l); + TrackBar tb = new TrackBar(); + tb.Location = new System.Drawing.Point(533, 279); + tb.Size = new System.Drawing.Size(184, 45); + tb.Tag = l; + tb.Scroll += new System.EventHandler(tb_Scroll); + tb.TabIndex = 3; + this.Controls.Add(tb); + break; } } - private void button1_Click(object sender, EventArgs e) + private void b_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; } + + private void tb_Scroll(object sender, EventArgs e) + { + TrackBar tb = (TrackBar)sender; + Label tag = (Label)tb.Tag; + this.reponseDouble = (double)tb.Value; + tag.Text= "Type de notation visant à aider les eleves de competence : "+this.reponseDouble; + } } } diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj index 932049b..c7d50c3 100644 --- a/psychorientation/psychorientation/psychorientation.csproj +++ b/psychorientation/psychorientation/psychorientation.csproj @@ -38,6 +38,7 @@ </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> + <Reference Include="System.DirectoryServices" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> -- GitLab