From 530c14ac7863cc5ab0ecdb57b19e0db1a8e5652f Mon Sep 17 00:00:00 2001 From: Antoine Tritschberger <antoine.tritschberger@etu.unistra.fr> Date: Tue, 31 Mar 2020 21:15:52 +0200 Subject: [PATCH] Correction string en int pour la classe eleve et ajout d'une fenetre d'information --- psychorientation/psychorientation/Form1.cs | 3 +- .../psychorientation/Message.Designer.cs | 33 ++++++++----------- psychorientation/psychorientation/Message.cs | 5 +++ psychorientation/psychorientation/eleve.cs | 18 +++++----- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/psychorientation/psychorientation/Form1.cs b/psychorientation/psychorientation/Form1.cs index fe7de15..e202b6b 100644 --- a/psychorientation/psychorientation/Form1.cs +++ b/psychorientation/psychorientation/Form1.cs @@ -19,7 +19,8 @@ namespace psychorientation private void Form1_Load(object sender, EventArgs e) { - + Message m = new Message(-1,"Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ","Début"); + m.ShowDialog(); } } } diff --git a/psychorientation/psychorientation/Message.Designer.cs b/psychorientation/psychorientation/Message.Designer.cs index 3f6c0e6..3e6a162 100644 --- a/psychorientation/psychorientation/Message.Designer.cs +++ b/psychorientation/psychorientation/Message.Designer.cs @@ -31,57 +31,51 @@ this.lblMessage = new System.Windows.Forms.Label(); this.lblTitre = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lblMessage // - this.lblMessage.Location = new System.Drawing.Point(99, 93); + 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(547, 160); + this.lblMessage.Size = new System.Drawing.Size(962, 181); this.lblMessage.TabIndex = 0; this.lblMessage.Text = "label1"; // // lblTitre // this.lblTitre.AutoSize = true; - this.lblTitre.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitre.Location = new System.Drawing.Point(133, 24); + 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"; - this.lblTitre.Size = new System.Drawing.Size(66, 24); + this.lblTitre.Size = new System.Drawing.Size(124, 42); this.lblTitre.TabIndex = 1; this.lblTitre.Text = "label1"; // // button1 // - this.button1.Location = new System.Drawing.Point(12, 275); + 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 = "Accepter"; + this.button1.Text = "Valider"; this.button1.UseVisualStyleBackColor = true; - // - // button2 - // - this.button2.Location = new System.Drawing.Point(456, 275); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(190, 51); - this.button2.TabIndex = 3; - this.button2.Text = "Refuser"; - this.button2.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); // // Message // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(658, 338); - this.Controls.Add(this.button2); + this.ClientSize = new System.Drawing.Size(986, 347); this.Controls.Add(this.button1); this.Controls.Add(this.lblTitre); this.Controls.Add(this.lblMessage); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "Message"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Message"; + this.TopMost = true; this.Load += new System.EventHandler(this.Message_Load); this.ResumeLayout(false); this.PerformLayout(); @@ -93,6 +87,5 @@ private System.Windows.Forms.Label lblMessage; private System.Windows.Forms.Label lblTitre; private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; } } \ No newline at end of file diff --git a/psychorientation/psychorientation/Message.cs b/psychorientation/psychorientation/Message.cs index 66fbc0c..8fb84cb 100644 --- a/psychorientation/psychorientation/Message.cs +++ b/psychorientation/psychorientation/Message.cs @@ -62,5 +62,10 @@ namespace psychorientation break; } } + + private void button1_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + } } } diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index 69a454d..02bc5cd 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -8,21 +8,21 @@ namespace psychorientation { class eleve { - private string classe = ""; + private int classe = 0; private double competence = 0; private double effort = 0; - private string orientation = ""; + private int orientation = 0; public eleve() { - this.classe = "seconde"; + this.classe = 0; this.competence = 10; this.effort = 10; - this.orientation = "Inconnu"; + this.orientation = 0; } - public eleve(string classe, double competence, double effort, string orientation) + public eleve(int classe, double competence, double effort, int orientation) { this.classe = classe; this.competence = competence; @@ -30,12 +30,12 @@ namespace psychorientation this.orientation = orientation; } - public void setClasse(string classe) + public void setClasse(int classe) { this.classe = classe; } - public void setOrientation(string orientation) + public void setOrientation(int orientation) { this.orientation = orientation; } @@ -55,11 +55,11 @@ namespace psychorientation { return this.competence; } - public string getClasse() + public int getClasse() { return this.classe; } - public string getOrientation() + public int getOrientation() { return this.orientation; } -- GitLab