PIbd-23 Firsov Kirill LabWork 04 #23
@ -59,31 +59,6 @@ namespace ProjectTractor
|
||||
pictureBoxTractor.Image = bmp;
|
||||
}
|
||||
/// <summary>
|
||||
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü"
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void ButtonCreateBulldoserTractor_Click(object sender, EventArgs e)
|
||||
{
|
||||
Random random = new();
|
||||
Color color = Color.FromArgb(random.Next(0, 256),
|
||||
random.Next(0, 256), random.Next(0, 256));
|
||||
//TODO âûáîð îñíîâíîãî öâåòà
|
||||
Color dopColor = Color.FromArgb(random.Next(0, 256),
|
||||
random.Next(0, 256), random.Next(0, 256));
|
||||
//TODO âûáîð äîïîëíèòåëüíîãî öâåòà
|
||||
_drawningTractor = new DrawningBulldoser(random.Next(100, 300),
|
||||
random.Next(1000, 3000),
|
||||
color,
|
||||
dopColor,
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
pictureBoxTractor.Width,
|
||||
pictureBoxTractor.Height);
|
||||
_drawningTractor.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||
Draw();
|
||||
}
|
||||
/// <summary>
|
||||
/// Èçìåíåíèå ðàçìåðîâ ôîðìû
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
@ -336,19 +311,30 @@ namespace ProjectTractor
|
||||
private void buttonCreateBulldoserTractor_Click(object sender, EventArgs e)
|
||||
{
|
||||
Random random = new();
|
||||
Color color = Color.FromArgb(random.Next(0, 256),
|
||||
random.Next(0, 256), random.Next(0, 256));
|
||||
ColorDialog dialogColor = new();
|
||||
if (dialogColor.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
color = dialogColor.Color;
|
||||
}
|
||||
Color dopColor = Color.FromArgb(random.Next(0, 256),
|
||||
random.Next(0, 256), random.Next(0, 256));
|
||||
ColorDialog dialogDopColor = new();
|
||||
if (dialogDopColor.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
dopColor = dialogDopColor.Color;
|
||||
}
|
||||
_drawningTractor = new DrawningBulldoser(random.Next(100, 300),
|
||||
random.Next(1000, 3000),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256),
|
||||
random.Next(0, 256)),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256),
|
||||
random.Next(0, 256)),
|
||||
color,
|
||||
dopColor,
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
Convert.ToBoolean(random.Next(0, 2)),
|
||||
pictureBoxTractor.Width, pictureBoxTractor.Height);
|
||||
_drawningTractor.SetPosition(random.Next(10, 100), random.Next(10,
|
||||
100));
|
||||
pictureBoxTractor.Width,
|
||||
pictureBoxTractor.Height);
|
||||
_drawningTractor.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||
Draw();
|
||||
|
||||
}
|
||||
|
||||
private void buttonStep_Click(object sender, EventArgs e)
|
||||
@ -387,6 +373,5 @@ namespace ProjectTractor
|
||||
_strategy = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -158,7 +158,11 @@ namespace ProjectTractor
|
||||
this.ClientSize = new System.Drawing.Size(893, 437);
|
||||
this.Controls.Add(this.groupBox);
|
||||
this.Controls.Add(this.pictureBoxCollection);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FormTractorCollection";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Набор тракторов";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).EndInit();
|
||||
this.groupBox.ResumeLayout(false);
|
||||
this.groupBox.PerformLayout();
|
||||
|
@ -38,7 +38,7 @@ namespace ProjectTractor.Generics
|
||||
}
|
||||
else
|
||||
{
|
||||
Insert(tractor, 0);
|
||||
return Insert(tractor, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user