@@ -18,7 +18,8 @@ public partial class cours_de_grammaire : Form
18
18
binding binding2 = new binding ( ) ;
19
19
XmlDocument gram ;
20
20
21
- public bool cours , gram2 = false ; public static int [ ] scores = new int [ 10 ] ;
21
+ public bool cours , gram2 = false ;
22
+ public static int [ ] scores = new int [ 10 ] ;
22
23
public cours_de_grammaire ( )
23
24
{
24
25
InitializeComponent ( ) ;
@@ -27,8 +28,19 @@ public cours_de_grammaire()
27
28
28
29
private void Form1_Load ( object sender , EventArgs e )
29
30
{
30
- gram = new XmlDocument ( ) ; dr = Variables . XmlReader ( Application . StartupPath + "\\ users.xml" ) ;
31
- gram . Load ( Application . StartupPath + @"\Gramm.xml" ) ; if ( gram2 ) panel2 . Visible = true ; if ( ! cours ) { button11 . Click += lvl1_grams ; button3 . Click += lvl1_grams ; button4 . Click += lvl1_grams ; button7 . Click += lvl1_grams ; button6 . Click += lvl1_grams ; button9 . Click += lvl1_grams ; }
31
+ gram = new XmlDocument ( ) ;
32
+ dr = Variables . XmlReader ( Application . StartupPath + "\\ users.xml" ) ;
33
+ gram . Load ( Application . StartupPath + @"\Gramm.xml" ) ;
34
+ if ( gram2 ) panel2 . Visible = true ;
35
+ if ( ! cours )
36
+ {
37
+ button11 . Click += lvl1_grams
38
+ ; button3 . Click += lvl1_grams ;
39
+ button4 . Click += lvl1_grams ;
40
+ button7 . Click += lvl1_grams ;
41
+ button6 . Click += lvl1_grams ;
42
+ button9 . Click += lvl1_grams ;
43
+ }
32
44
CryptageEtHachage . DeCrypNode ( gram . DocumentElement ) ;
33
45
}
34
46
@@ -37,10 +49,7 @@ private void button1_Click(object sender, EventArgs e)
37
49
38
50
}
39
51
40
- //private void button2_Click(object sender, EventArgs e)
41
- //{
42
- // button3.Visible =button4.Visible = button5.Visible = true;button2.Visible = false;
43
- //}
52
+
44
53
private void button3_Click ( object sender , EventArgs e )
45
54
{
46
55
@@ -49,7 +58,7 @@ private void button3_Click(object sender, EventArgs e)
49
58
else
50
59
{
51
60
Cours cf = new Cours ( ) ;
52
- // this.Close(); cf.imageConv = pronomspersonnles; cf.Show();
61
+
53
62
cf . debut = 31 ; cf . fin = 33 ; cf . Show ( ) ;
54
63
}
55
64
@@ -60,35 +69,26 @@ private void button4_Click(object sender, EventArgs e)
60
69
else
61
70
{
62
71
Cours cf = new Cours ( ) ;
63
- // this.Close(); cf.imageConv = pronomspersonnles; cf.Show();
72
+
64
73
cf . debut = 27 ; cf . fin = 29 ; cf . Show ( ) ;
65
74
66
- // cf.imageConv = singulier; cf.Show();
67
75
}
68
- //button3.Visible = false; button4.Visible = false; button5.Visible = false; binding2.rand = ComMethodes.Generate(10, 16); binding2.dest = 2;
69
- //binding2.depart = 6;binding2.lecon = "SinPlu"; binding2.Location = new Point(200, 150); this.Controls.Add(binding2);
76
+
70
77
}
71
78
72
- //private void button5_Click(object sender, EventArgs e)
73
- //{
74
- // button5.Click += lvl1_grams;
75
- // button3.Visible = false; button4.Visible = false; button5.Visible = false; binding2.rand = ComMethodes.Generate(6, 10); binding2.dest = 6;
76
- // binding2.depart = 6; binding2.lecon = "Adjectifs"; binding2.Location = new Point(200, 150); this.Controls.Add(binding2);
77
- //}
79
+
78
80
79
81
private void button7_Click ( object sender , EventArgs e )
80
82
{
81
83
panconv = panel1 ; if ( ! cours ) pictureBox1 . Visible = true ;
82
84
else
83
85
{
84
86
Cours cf = new Cours ( ) ;
85
- // this.Close(); cf.imageConv = pronomspersonnles; cf.Show();
87
+
86
88
cf . debut = 17 ; cf . fin = 19 ; cf . Show ( ) ;
87
89
88
- // cf.imageConv = nompropre; cf.Show();
89
90
}
90
- //phraseoEx ep = new phraseoEx();this.Controls.Add(ep);ep.Dock = DockStyle.Fill;
91
- //ep.Show();ep.BringToFront();
91
+
92
92
}
93
93
94
94
private void button6_Click ( object sender , EventArgs e )
@@ -99,7 +99,7 @@ private void button6_Click(object sender, EventArgs e)
99
99
Cours cf = new Cours ( ) ;
100
100
cf . debut = 15 ; cf . fin = 17 ; cf . Show ( ) ;
101
101
102
- // cf.imageConv = femiMas; cf.Show();
102
+
103
103
}
104
104
}
105
105
@@ -111,29 +111,29 @@ private void panel1_Paint(object sender, PaintEventArgs e)
111
111
private void button8_Click ( object sender , EventArgs e )
112
112
{
113
113
114
- //button8.Click += lvl1_grams;
114
+
115
115
}
116
-
117
116
private void button9_Click ( object sender , EventArgs e )
118
117
{
119
118
panconv = panel1 ; if ( ! cours ) pictureBox1 . Visible = true ;
120
119
else
121
120
{
122
- // this.Close(); cf.imageConv = types; cf.Show();
121
+
123
122
Cours cf = new Cours ( ) ; cf . conjugaison = false ;
124
123
cf . debut = 22 ; cf . fin = 27 ; cf . Show ( ) ;
125
124
}
126
125
}
127
-
128
126
private void lvl1_grams ( object sender , EventArgs e )
129
127
{
130
- Button lb = ( Button ) sender ; binding2 . Dispose ( ) ; binding2 = new binding ( ) ; userconv = binding2 ;
131
-
132
- panel1 . Hide ( ) ; panel2 . Visible = false ;
133
- int a = int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 0 ] ) , b = int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 1 ] ) ;
134
- binding2 . rand = ComMethodes . Generate ( a , b ) ; binding2 . dest = int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 3 ] ) ;
135
- binding2 . depart = int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 2 ] ) ; binding2 . lecon = lb . Tag . ToString ( ) . Split ( ',' ) [ 5 ] ; binding2 . Location = new Point ( 200 , 150 ) ; binding2 . panl = panconv ; this . Controls . Add ( binding2 ) ;
136
- userconv . Visible = true ;
128
+ Button lb = ( Button ) sender ; binding2 . Dispose ( ) ;
129
+
130
+ panel1 . Hide ( ) ; panel2 . Visible = false ;
131
+ int a = int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 0 ] ) , b = int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 1 ] ) ;
132
+ binding2 = new binding ( lb . Tag . ToString ( ) . Split ( ',' ) [ 5 ] , int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 3 ] ) , int . Parse ( lb . Tag . ToString ( ) . Split ( ',' ) [ 2 ] ) , panconv , ComMethodes . Generate ( a , b ) ) ; userconv = binding2 ;
133
+ //binding2.rand = ComMethodes.Generate(a, b); binding2.dest = int.Parse(lb.Tag.ToString().Split(',')[3]);
134
+ //binding2.depart = int.Parse(lb.Tag.ToString().Split(',')[2]); binding2.lecon = lb.Tag.ToString().Split(',')[5]; binding2.Location = new Point(200, 150);binding2.panl = panconv;
135
+ binding2 . Location = new Point ( 200 , 150 ) ; this . Controls . Add ( binding2 ) ;
136
+ userconv . Visible = true ;
137
137
}
138
138
private void button13_Click ( object sender , EventArgs e )
139
139
{
@@ -147,8 +147,6 @@ private void button13_Click(object sender, EventArgs e)
147
147
{
148
148
Cours cf = new Cours ( ) ; cf . conjugaison = false ;
149
149
cf . debut = 20 ; cf . fin = 22 ; cf . Show ( ) ;
150
-
151
- // this.Close(); cf.imageConv = sujetVerbe; cf.Show();
152
150
}
153
151
}
154
152
Panel panconv ;
@@ -164,7 +162,6 @@ private void button10_Click(object sender, EventArgs e)
164
162
}
165
163
else
166
164
{
167
- // this.Close(); cf.imageConv = phrase; cf.Show();
168
165
Cours cf = new Cours ( ) ; cf . conjugaison = false ;
169
166
cf . debut = 1 ; cf . fin = 5 ; cf . Show ( ) ;
170
167
}
@@ -176,10 +173,8 @@ private void button11_Click(object sender, EventArgs e)
176
173
panconv = panel2 ; if ( ! cours ) pictureBox1 . Visible = true ;
177
174
else
178
175
{
179
- // this.Close(); cf.imageConv = demonstratifs; cf.Show();
180
176
Cours cf = new Cours ( ) ; cf . conjugaison = false ;
181
177
cf . debut = 5 ; cf . fin = 7 ; cf . Show ( ) ;
182
-
183
178
}
184
179
}
185
180
@@ -191,35 +186,59 @@ private void panel2_Paint(object sender, PaintEventArgs e)
191
186
private void button15_Click ( object sender , EventArgs e )
192
187
{
193
188
panconv = panel2 ;
194
- panel1 . Hide ( ) ; panel2 . Hide ( ) ; if ( ! cours )
189
+ panel1 . Hide ( ) ;
190
+ panel2 . Hide ( ) ;
191
+ if ( ! cours )
195
192
{
196
- pictureBox1 . Visible = true ; choixMultiple . len = 6 ; choixMultiple . max = 10 ; choixMultiple choiprn = new choixMultiple ( ) ; choiprn . pan = panconv ; userconv = choiprn ; userconv . Visible = true ; choiprn . rands = ComMethodes . Generate ( 6 , 10 ) ; choiprn . lecon = "Posses" ; choiprn . Show ( ) ; choiprn . BringToFront ( ) ;
197
-
198
- this . Controls . Add ( choiprn ) ; choiprn . Dock = DockStyle . Fill ; pictureBox1 . BringToFront ( ) ;
193
+ pictureBox1 . Visible = true ;
194
+ choixMultiple choiprn = new choixMultiple ( ComMethodes . Generate ( 6 , 10 ) , "Posses" , panconv , 6 , 10 , "Francais" ) ;
195
+
196
+
197
+ userconv = choiprn ;
198
+ userconv . Visible = true ;
199
+ choiprn . Show ( ) ;
200
+ choiprn . BringToFront ( ) ;
201
+ this . Controls . Add ( choiprn ) ;
202
+ choiprn . Dock = DockStyle . Fill ;
203
+ pictureBox1 . BringToFront ( ) ;
199
204
}
200
205
else
201
206
{
202
- Cours cf = new Cours ( ) ; cf . conjugaison = false ;
203
- cf . debut = 29 ; cf . fin = 31 ; cf . Show ( ) ;
207
+ Cours cf = new Cours ( ) ;
208
+ cf . conjugaison = false ;
209
+ cf . debut = 29 ;
210
+ cf . fin = 31 ;
211
+ cf . Show ( ) ;
204
212
205
- // this.Close(); cf.imageConv = possessifs; cf.Show();
206
213
}
207
214
}
208
215
UserControl userconv ;
209
216
private void button14_Click ( object sender , EventArgs e )
210
- { // gram = new XmlDocument();
211
- // gram.Load(Application.StartupPath + @"\ExempleDeXml.xml");
212
- panconv = panel1 ;
213
- if ( ! cours ) {
214
- panel1 . Hide ( ) ; panel2 . Hide ( ) ; choixMultiple . len = 7 ; choixMultiple . max = 10 ; choixMultiple choiADj = new choixMultiple ( ) ; userconv = choiADj ; choiADj . pan = panconv ; userconv . Visible = true ; choiADj . rands = ComMethodes . Generate ( 7 , 10 ) ; choiADj . lecon = "Adjectifs" ; choiADj . Show ( ) ; choiADj . BringToFront ( ) ;
215
- this . Controls . Add ( choiADj ) ; choiADj . Dock = DockStyle . Fill ;
216
- pictureBox1 . Visible = true ; pictureBox1 . BringToFront ( ) ;
217
+ {
218
+ panconv = panel1 ;
219
+ panel1 . Hide ( ) ;
220
+ panel2 . Hide ( ) ;
221
+ if ( ! cours )
222
+ {
223
+
224
+ choixMultiple choiADj = new choixMultiple ( ComMethodes . Generate ( 7 , 10 ) , "Adjectifs" , panconv , 7 , 10 , "Francais" ) ;
225
+
226
+ userconv = choiADj ;
227
+ userconv . Visible = true ;
228
+ choiADj . Show ( ) ;
229
+ choiADj . BringToFront ( ) ;
230
+ this . Controls . Add ( choiADj ) ;
231
+ choiADj . Dock = DockStyle . Fill ;
232
+ pictureBox1 . BringToFront ( ) ;
217
233
}
218
234
else
219
235
{
220
- // cf.imageConv = adjQualificatifs; cf.Show();
221
- Cours cf = new Cours ( ) ; cf . conjugaison = false ;
222
- cf . debut = 7 ; cf . fin = 15 ; cf . Show ( ) ;
236
+
237
+ Cours cf = new Cours ( ) ;
238
+ cf . conjugaison = false ;
239
+ cf . debut = 7 ;
240
+ cf . fin = 15 ;
241
+ cf . Show ( ) ;
223
242
224
243
}
225
244
}
@@ -261,7 +280,10 @@ private void button1_Click_1(object sender, EventArgs e)
261
280
}
262
281
263
282
private void pictureBox1_Click ( object sender , EventArgs e )
264
- { panconv . Visible = true ; userconv . Hide ( ) ; this . BackgroundImage = b ;
283
+ {
284
+ panconv . Visible = true ;
285
+ userconv . Hide ( ) ;
286
+ this . BackgroundImage = b ;
265
287
pictureBox1 . Visible = false ;
266
288
}
267
289
0 commit comments