diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorCollection.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorCollection.cs
index e8c12e9..cd9a7e9 100644
--- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorCollection.cs
+++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorCollection.cs
@@ -73,7 +73,7 @@ namespace ProjectTractor
///
///
///
- private void ListBoxObjects_SelectedIndexChanged(object sender,
+ private void listBoxStorages_SelectedIndexChanged(object sender,
EventArgs e)
{
pictureBoxCollection.Image =
@@ -253,6 +253,7 @@ namespace ProjectTractor
this.listBoxStorages.Name = "listBoxStorages";
this.listBoxStorages.Size = new System.Drawing.Size(203, 84);
this.listBoxStorages.TabIndex = 2;
+ this.listBoxStorages.SelectedIndexChanged += new System.EventHandler(this.listBoxStorages_SelectedIndexChanged);
//
// ButtonAddObject
//
@@ -338,7 +339,5 @@ namespace ProjectTractor
private Button ButtonAddObject;
private MaskedTextBox textBoxStorageName;
private PictureBox pictureBoxCollection;
-
-
}
}
diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.Designer.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.Designer.cs
index bc527eb..786aa34 100644
--- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.Designer.cs
+++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.Designer.cs
@@ -28,177 +28,177 @@
///
private void InitializeComponent()
{
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.panel18 = new System.Windows.Forms.Panel();
- this.panel19 = new System.Windows.Forms.Panel();
- this.panel20 = new System.Windows.Forms.Panel();
- this.panel21 = new System.Windows.Forms.Panel();
- this.panel14 = new System.Windows.Forms.Panel();
- this.panel22 = new System.Windows.Forms.Panel();
- this.panel10 = new System.Windows.Forms.Panel();
- this.panel26 = new System.Windows.Forms.Panel();
- this.panel6 = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.panel1 = new System.Windows.Forms.Panel();
+ this.groupBoxConfig = new System.Windows.Forms.GroupBox();
+ this.labelModifiedObject = new System.Windows.Forms.Label();
+ this.labelSimleObject = new System.Windows.Forms.Label();
+ this.groupBoxColors = new System.Windows.Forms.GroupBox();
+ this.panelPurpule = new System.Windows.Forms.Panel();
+ this.panelBlack = new System.Windows.Forms.Panel();
+ this.panelGrey = new System.Windows.Forms.Panel();
+ this.panelYellow = new System.Windows.Forms.Panel();
+ this.panelBlue = new System.Windows.Forms.Panel();
+ this.panelWhite = new System.Windows.Forms.Panel();
+ this.panelGreen = new System.Windows.Forms.Panel();
+ this.panelRed = new System.Windows.Forms.Panel();
this.checkBoxBlade = new System.Windows.Forms.CheckBox();
this.checkBoxWheelsOrnament = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.numericUpDownWeight = new System.Windows.Forms.NumericUpDown();
this.numericUpDownSpeed = new System.Windows.Forms.NumericUpDown();
- this.panel16 = new System.Windows.Forms.Panel();
- this.panel17 = new System.Windows.Forms.Panel();
- this.panel24 = new System.Windows.Forms.Panel();
- this.panel25 = new System.Windows.Forms.Panel();
- this.panel12 = new System.Windows.Forms.Panel();
- this.panel13 = new System.Windows.Forms.Panel();
- this.panel28 = new System.Windows.Forms.Panel();
- this.panel29 = new System.Windows.Forms.Panel();
- this.panel5 = new System.Windows.Forms.Panel();
- this.panel4 = new System.Windows.Forms.Panel();
- this.panel8 = new System.Windows.Forms.Panel();
- this.panel9 = new System.Windows.Forms.Panel();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.pictureBoxObject = new System.Windows.Forms.PictureBox();
- this.button5 = new System.Windows.Forms.Button();
+ this.buttonAddCar = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
- this.label3 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
+ this.pictureBoxObject = new System.Windows.Forms.PictureBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.panel18.SuspendLayout();
- this.panel19.SuspendLayout();
+ this.panelObject = new System.Windows.Forms.Panel();
+ this.groupBoxConfig.SuspendLayout();
+ this.groupBoxColors.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWeight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpeed)).BeginInit();
- this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxObject)).BeginInit();
+ this.panelObject.SuspendLayout();
this.SuspendLayout();
//
- // groupBox1
+ // groupBoxConfig
//
- this.groupBox1.Controls.Add(this.label4);
- this.groupBox1.Controls.Add(this.label3);
- this.groupBox1.Controls.Add(this.groupBox2);
- this.groupBox1.Controls.Add(this.checkBoxBlade);
- this.groupBox1.Controls.Add(this.checkBoxWheelsOrnament);
- this.groupBox1.Controls.Add(this.label2);
- this.groupBox1.Controls.Add(this.label1);
- this.groupBox1.Controls.Add(this.numericUpDownWeight);
- this.groupBox1.Controls.Add(this.numericUpDownSpeed);
- this.groupBox1.Location = new System.Drawing.Point(12, 0);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(585, 341);
- this.groupBox1.TabIndex = 0;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "groupBox1";
+ this.groupBoxConfig.Controls.Add(this.labelModifiedObject);
+ this.groupBoxConfig.Controls.Add(this.labelSimleObject);
+ this.groupBoxConfig.Controls.Add(this.groupBoxColors);
+ this.groupBoxConfig.Controls.Add(this.checkBoxBlade);
+ this.groupBoxConfig.Controls.Add(this.checkBoxWheelsOrnament);
+ this.groupBoxConfig.Controls.Add(this.label2);
+ this.groupBoxConfig.Controls.Add(this.label1);
+ this.groupBoxConfig.Controls.Add(this.numericUpDownWeight);
+ this.groupBoxConfig.Controls.Add(this.numericUpDownSpeed);
+ this.groupBoxConfig.Location = new System.Drawing.Point(12, 0);
+ this.groupBoxConfig.Name = "groupBoxConfig";
+ this.groupBoxConfig.Size = new System.Drawing.Size(585, 341);
+ this.groupBoxConfig.TabIndex = 0;
+ this.groupBoxConfig.TabStop = false;
+ this.groupBoxConfig.Text = "Параметры";
//
- // groupBox2
+ // labelModifiedObject
//
- this.groupBox2.Controls.Add(this.panel18);
- this.groupBox2.Controls.Add(this.panel14);
- this.groupBox2.Controls.Add(this.panel22);
- this.groupBox2.Controls.Add(this.panel10);
- this.groupBox2.Controls.Add(this.panel26);
- this.groupBox2.Controls.Add(this.panel6);
- this.groupBox2.Controls.Add(this.panel2);
- this.groupBox2.Controls.Add(this.panel1);
- this.groupBox2.Location = new System.Drawing.Point(369, 28);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(194, 120);
- this.groupBox2.TabIndex = 6;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "groupBox2";
+ this.labelModifiedObject.BackColor = System.Drawing.SystemColors.ButtonHighlight;
+ this.labelModifiedObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.labelModifiedObject.Enabled = false;
+ this.labelModifiedObject.Location = new System.Drawing.Point(449, 171);
+ this.labelModifiedObject.Name = "labelModifiedObject";
+ this.labelModifiedObject.Size = new System.Drawing.Size(114, 42);
+ this.labelModifiedObject.TabIndex = 8;
+ this.labelModifiedObject.Text = "Продвинутый";
+ this.labelModifiedObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ this.labelModifiedObject.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LabelObject_MouseDown);
//
- // panel18
+ // labelSimleObject
//
- this.panel18.BackColor = System.Drawing.Color.Purple;
- this.panel18.Controls.Add(this.panel19);
- this.panel18.Location = new System.Drawing.Point(144, 69);
- this.panel18.Name = "panel18";
- this.panel18.Size = new System.Drawing.Size(40, 40);
- this.panel18.TabIndex = 1;
+ this.labelSimleObject.BackColor = System.Drawing.SystemColors.ButtonHighlight;
+ this.labelSimleObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.labelSimleObject.Location = new System.Drawing.Point(369, 171);
+ this.labelSimleObject.Name = "labelSimleObject";
+ this.labelSimleObject.Size = new System.Drawing.Size(74, 42);
+ this.labelSimleObject.TabIndex = 7;
+ this.labelSimleObject.Text = "Простой";
+ this.labelSimleObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ this.labelSimleObject.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LabelObject_MouseDown);
//
- // panel19
+ // groupBoxColors
//
- this.panel19.Controls.Add(this.panel20);
- this.panel19.Controls.Add(this.panel21);
- this.panel19.Location = new System.Drawing.Point(96, 0);
- this.panel19.Name = "panel19";
- this.panel19.Size = new System.Drawing.Size(40, 40);
- this.panel19.TabIndex = 0;
+ this.groupBoxColors.Controls.Add(this.panelPurpule);
+ this.groupBoxColors.Controls.Add(this.panelBlack);
+ this.groupBoxColors.Controls.Add(this.panelGrey);
+ this.groupBoxColors.Controls.Add(this.panelYellow);
+ this.groupBoxColors.Controls.Add(this.panelBlue);
+ this.groupBoxColors.Controls.Add(this.panelWhite);
+ this.groupBoxColors.Controls.Add(this.panelGreen);
+ this.groupBoxColors.Controls.Add(this.panelRed);
+ this.groupBoxColors.Location = new System.Drawing.Point(369, 28);
+ this.groupBoxColors.Name = "groupBoxColors";
+ this.groupBoxColors.Size = new System.Drawing.Size(194, 120);
+ this.groupBoxColors.TabIndex = 6;
+ this.groupBoxColors.TabStop = false;
+ this.groupBoxColors.Text = "Цвета";
//
- // panel20
+ // panelPurpule
//
- this.panel20.Location = new System.Drawing.Point(46, 0);
- this.panel20.Name = "panel20";
- this.panel20.Size = new System.Drawing.Size(40, 40);
- this.panel20.TabIndex = 0;
+ this.panelPurpule.AllowDrop = true;
+ this.panelPurpule.BackColor = System.Drawing.Color.Purple;
+ this.panelPurpule.Location = new System.Drawing.Point(144, 69);
+ this.panelPurpule.Name = "panelPurpule";
+ this.panelPurpule.Size = new System.Drawing.Size(40, 40);
+ this.panelPurpule.TabIndex = 1;
+ this.panelPurpule.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel21
+ // panelBlack
//
- this.panel21.Location = new System.Drawing.Point(0, 0);
- this.panel21.Name = "panel21";
- this.panel21.Size = new System.Drawing.Size(40, 40);
- this.panel21.TabIndex = 0;
+ this.panelBlack.AllowDrop = true;
+ this.panelBlack.BackColor = System.Drawing.Color.Black;
+ this.panelBlack.Location = new System.Drawing.Point(98, 69);
+ this.panelBlack.Name = "panelBlack";
+ this.panelBlack.Size = new System.Drawing.Size(40, 40);
+ this.panelBlack.TabIndex = 1;
+ this.panelBlack.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel14
+ // panelGrey
//
- this.panel14.BackColor = System.Drawing.Color.Black;
- this.panel14.Location = new System.Drawing.Point(98, 69);
- this.panel14.Name = "panel14";
- this.panel14.Size = new System.Drawing.Size(40, 40);
- this.panel14.TabIndex = 1;
+ this.panelGrey.AllowDrop = true;
+ this.panelGrey.BackColor = System.Drawing.Color.Silver;
+ this.panelGrey.Location = new System.Drawing.Point(52, 69);
+ this.panelGrey.Name = "panelGrey";
+ this.panelGrey.Size = new System.Drawing.Size(40, 40);
+ this.panelGrey.TabIndex = 1;
+ this.panelGrey.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel22
+ // panelYellow
//
- this.panel22.BackColor = System.Drawing.Color.Silver;
- this.panel22.Location = new System.Drawing.Point(52, 69);
- this.panel22.Name = "panel22";
- this.panel22.Size = new System.Drawing.Size(40, 40);
- this.panel22.TabIndex = 1;
+ this.panelYellow.AllowDrop = true;
+ this.panelYellow.BackColor = System.Drawing.Color.Yellow;
+ this.panelYellow.Location = new System.Drawing.Point(145, 23);
+ this.panelYellow.Name = "panelYellow";
+ this.panelYellow.Size = new System.Drawing.Size(40, 40);
+ this.panelYellow.TabIndex = 1;
+ this.panelYellow.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel10
+ // panelBlue
//
- this.panel10.BackColor = System.Drawing.Color.Yellow;
- this.panel10.Location = new System.Drawing.Point(145, 23);
- this.panel10.Name = "panel10";
- this.panel10.Size = new System.Drawing.Size(40, 40);
- this.panel10.TabIndex = 1;
+ this.panelBlue.AllowDrop = true;
+ this.panelBlue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
+ this.panelBlue.Location = new System.Drawing.Point(98, 23);
+ this.panelBlue.Name = "panelBlue";
+ this.panelBlue.Size = new System.Drawing.Size(40, 40);
+ this.panelBlue.TabIndex = 1;
+ this.panelBlue.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel26
+ // panelWhite
//
- this.panel26.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
- this.panel26.Location = new System.Drawing.Point(98, 23);
- this.panel26.Name = "panel26";
- this.panel26.Size = new System.Drawing.Size(40, 40);
- this.panel26.TabIndex = 1;
+ this.panelWhite.AllowDrop = true;
+ this.panelWhite.BackColor = System.Drawing.Color.White;
+ this.panelWhite.Location = new System.Drawing.Point(6, 69);
+ this.panelWhite.Name = "panelWhite";
+ this.panelWhite.Size = new System.Drawing.Size(40, 40);
+ this.panelWhite.TabIndex = 1;
+ this.panelWhite.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel6
+ // panelGreen
//
- this.panel6.BackColor = System.Drawing.Color.White;
- this.panel6.Location = new System.Drawing.Point(6, 69);
- this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(40, 40);
- this.panel6.TabIndex = 1;
+ this.panelGreen.AllowDrop = true;
+ this.panelGreen.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+ this.panelGreen.Location = new System.Drawing.Point(52, 23);
+ this.panelGreen.Name = "panelGreen";
+ this.panelGreen.Size = new System.Drawing.Size(40, 40);
+ this.panelGreen.TabIndex = 0;
+ this.panelGreen.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
- // panel2
+ // panelRed
//
- this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
- this.panel2.Location = new System.Drawing.Point(52, 23);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(40, 40);
- this.panel2.TabIndex = 0;
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Red;
- this.panel1.Location = new System.Drawing.Point(6, 23);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(40, 40);
- this.panel1.TabIndex = 0;
+ this.panelRed.AllowDrop = true;
+ this.panelRed.BackColor = System.Drawing.Color.Red;
+ this.panelRed.Location = new System.Drawing.Point(6, 23);
+ this.panelRed.Name = "panelRed";
+ this.panelRed.Size = new System.Drawing.Size(40, 40);
+ this.panelRed.TabIndex = 0;
+ this.panelRed.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelColor_MouseDown);
//
// checkBoxBlade
//
@@ -282,118 +282,15 @@
0,
0});
//
- // panel16
+ // buttonAddCar
//
- this.panel16.Location = new System.Drawing.Point(0, 0);
- this.panel16.Name = "panel16";
- this.panel16.Size = new System.Drawing.Size(200, 100);
- this.panel16.TabIndex = 0;
- //
- // panel17
- //
- this.panel17.Location = new System.Drawing.Point(0, 0);
- this.panel17.Name = "panel17";
- this.panel17.Size = new System.Drawing.Size(200, 100);
- this.panel17.TabIndex = 0;
- //
- // panel24
- //
- this.panel24.Location = new System.Drawing.Point(0, 0);
- this.panel24.Name = "panel24";
- this.panel24.Size = new System.Drawing.Size(200, 100);
- this.panel24.TabIndex = 0;
- //
- // panel25
- //
- this.panel25.Location = new System.Drawing.Point(0, 0);
- this.panel25.Name = "panel25";
- this.panel25.Size = new System.Drawing.Size(200, 100);
- this.panel25.TabIndex = 0;
- //
- // panel12
- //
- this.panel12.Location = new System.Drawing.Point(0, 0);
- this.panel12.Name = "panel12";
- this.panel12.Size = new System.Drawing.Size(200, 100);
- this.panel12.TabIndex = 0;
- //
- // panel13
- //
- this.panel13.Location = new System.Drawing.Point(0, 0);
- this.panel13.Name = "panel13";
- this.panel13.Size = new System.Drawing.Size(200, 100);
- this.panel13.TabIndex = 0;
- //
- // panel28
- //
- this.panel28.Location = new System.Drawing.Point(0, 0);
- this.panel28.Name = "panel28";
- this.panel28.Size = new System.Drawing.Size(200, 100);
- this.panel28.TabIndex = 0;
- //
- // panel29
- //
- this.panel29.Location = new System.Drawing.Point(0, 0);
- this.panel29.Name = "panel29";
- this.panel29.Size = new System.Drawing.Size(200, 100);
- this.panel29.TabIndex = 0;
- //
- // panel5
- //
- this.panel5.Location = new System.Drawing.Point(0, 0);
- this.panel5.Name = "panel5";
- this.panel5.Size = new System.Drawing.Size(200, 100);
- this.panel5.TabIndex = 0;
- //
- // panel4
- //
- this.panel4.Location = new System.Drawing.Point(0, 0);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(200, 100);
- this.panel4.TabIndex = 0;
- //
- // panel8
- //
- this.panel8.Location = new System.Drawing.Point(0, 0);
- this.panel8.Name = "panel8";
- this.panel8.Size = new System.Drawing.Size(200, 100);
- this.panel8.TabIndex = 0;
- //
- // panel9
- //
- this.panel9.Location = new System.Drawing.Point(0, 0);
- this.panel9.Name = "panel9";
- this.panel9.Size = new System.Drawing.Size(200, 100);
- this.panel9.TabIndex = 0;
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.label6);
- this.groupBox3.Controls.Add(this.label5);
- this.groupBox3.Controls.Add(this.pictureBoxObject);
- this.groupBox3.Location = new System.Drawing.Point(603, 12);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(267, 287);
- this.groupBox3.TabIndex = 1;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "groupBox3";
- //
- // pictureBoxObject
- //
- this.pictureBoxObject.Location = new System.Drawing.Point(6, 63);
- this.pictureBoxObject.Name = "pictureBoxObject";
- this.pictureBoxObject.Size = new System.Drawing.Size(255, 218);
- this.pictureBoxObject.TabIndex = 2;
- this.pictureBoxObject.TabStop = false;
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(631, 305);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(94, 29);
- this.button5.TabIndex = 2;
- this.button5.Text = "Добавить";
- this.button5.UseVisualStyleBackColor = true;
+ this.buttonAddCar.Location = new System.Drawing.Point(631, 305);
+ this.buttonAddCar.Name = "buttonAddCar";
+ this.buttonAddCar.Size = new System.Drawing.Size(94, 29);
+ this.buttonAddCar.TabIndex = 2;
+ this.buttonAddCar.Text = "Добавить";
+ this.buttonAddCar.UseVisualStyleBackColor = true;
+ this.buttonAddCar.Click += new System.EventHandler(this.buttonAddCar_Click);
//
// button6
//
@@ -404,115 +301,99 @@
this.button6.Text = "Отмена";
this.button6.UseVisualStyleBackColor = true;
//
- // label3
+ // pictureBoxObject
//
- this.label3.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.label3.Location = new System.Drawing.Point(369, 171);
- this.label3.Name = "label3";
- this.label3.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
- this.label3.Size = new System.Drawing.Size(74, 42);
- this.label3.TabIndex = 7;
- this.label3.Text = "Простой";
- //
- // label4
- //
- this.label4.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.label4.Enabled = false;
- this.label4.Location = new System.Drawing.Point(449, 171);
- this.label4.Name = "label4";
- this.label4.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
- this.label4.Size = new System.Drawing.Size(114, 42);
- this.label4.TabIndex = 8;
- this.label4.Text = "Продвинутый";
+ this.pictureBoxObject.Location = new System.Drawing.Point(3, 50);
+ this.pictureBoxObject.Name = "pictureBoxObject";
+ this.pictureBoxObject.Size = new System.Drawing.Size(259, 232);
+ this.pictureBoxObject.TabIndex = 2;
+ this.pictureBoxObject.TabStop = false;
//
// label5
//
+ this.label5.AllowDrop = true;
this.label5.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.label5.Location = new System.Drawing.Point(6, 23);
+ this.label5.Location = new System.Drawing.Point(2, 15);
this.label5.Name = "label5";
- this.label5.Padding = new System.Windows.Forms.Padding(35, 5, 25, 5);
this.label5.Size = new System.Drawing.Size(119, 32);
this.label5.TabIndex = 3;
this.label5.Text = "Цвет";
+ this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label6
//
+ this.label6.AllowDrop = true;
this.label6.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.label6.Location = new System.Drawing.Point(141, 23);
+ this.label6.Location = new System.Drawing.Point(142, 15);
this.label6.Name = "label6";
- this.label6.Padding = new System.Windows.Forms.Padding(10, 5, 10, 5);
this.label6.Size = new System.Drawing.Size(120, 32);
this.label6.TabIndex = 4;
this.label6.Text = "Доп. цвет";
+ this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // panelObject
+ //
+ this.panelObject.AllowDrop = true;
+ this.panelObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.panelObject.Controls.Add(this.label6);
+ this.panelObject.Controls.Add(this.label5);
+ this.panelObject.Controls.Add(this.pictureBoxObject);
+ this.panelObject.Location = new System.Drawing.Point(603, 12);
+ this.panelObject.Name = "panelObject";
+ this.panelObject.Size = new System.Drawing.Size(267, 287);
+ this.panelObject.TabIndex = 4;
+ this.panelObject.DragDrop += new System.Windows.Forms.DragEventHandler(this.panelObject_DragDrop);
+ this.panelObject.DragEnter += new System.Windows.Forms.DragEventHandler(this.panelObject_DragEnter);
//
// FormTractorConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(882, 353);
+ this.Controls.Add(this.panelObject);
this.Controls.Add(this.button6);
- this.Controls.Add(this.button5);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this.buttonAddCar);
+ this.Controls.Add(this.groupBoxConfig);
this.Name = "FormTractorConfig";
this.Text = "FormTractorConfig";
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.panel18.ResumeLayout(false);
- this.panel19.ResumeLayout(false);
+ this.groupBoxConfig.ResumeLayout(false);
+ this.groupBoxConfig.PerformLayout();
+ this.groupBoxColors.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWeight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpeed)).EndInit();
- this.groupBox3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxObject)).EndInit();
+ this.panelObject.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
- private GroupBox groupBox1;
- private GroupBox groupBox2;
- private Panel panel1;
- private Panel panel2;
- private Panel panel5;
- private Panel panel4;
+ private GroupBox groupBoxConfig;
+ private GroupBox groupBoxColors;
+ private Panel panelRed;
+ private Panel panelGreen;
private CheckBox checkBoxBlade;
private CheckBox checkBoxWheelsOrnament;
private Label label2;
private Label label1;
private NumericUpDown numericUpDownWeight;
private NumericUpDown numericUpDownSpeed;
- private Panel panel18;
- private Panel panel19;
- private Panel panel20;
- private Panel panel21;
- private Panel panel14;
- private Panel panel16;
- private Panel panel17;
- private Panel panel22;
- private Panel panel24;
- private Panel panel25;
- private Panel panel10;
- private Panel panel12;
- private Panel panel13;
- private Panel panel26;
- private Panel panel28;
- private Panel panel29;
- private Panel panel6;
- private Panel panel8;
- private Panel panel9;
- private Label label4;
- private Label label3;
- private GroupBox groupBox3;
- private Label label6;
- private Label label5;
- private PictureBox pictureBoxObject;
- private Button button5;
+ private Panel panelPurpule;
+ private Panel panelBlack;
+ private Panel panelGrey;
+ private Panel panelYellow;
+ private Panel panelBlue;
+ private Panel panelWhite;
+ private Label labelModifiedObject;
+ private Label labelSimleObject;
+ private Button buttonAddCar;
private Button button6;
+ private PictureBox pictureBoxObject;
+ private Label label5;
+ private Label label6;
+ private Panel panelObject;
}
}
\ No newline at end of file
diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.cs
index efaa928..4c11d33 100644
--- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.cs
+++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractorConfig.cs
@@ -11,6 +11,9 @@ using ProjectTractor.DrawningObjects;
namespace ProjectTractor;
+
+
+
public partial class FormTractorConfig : Form
{
///
@@ -18,16 +21,59 @@ public partial class FormTractorConfig : Form
///
DrawningTractor? _tractor = null;
///
+ /// Делегат для передачи объекта-автомобиля
+ ///
+ ///
+ public delegate void TractorDelegate(DrawningTractor tractor);
+ ///
/// Событие
///
private event TractorDelegate? EventAddTractor;
+
///
/// Конструктор
///
+ //
public FormTractorConfig()
{
InitializeComponent();
+ panelBlack.MouseDown += panelColor_MouseDown;
+ panelPurpule.MouseDown += panelColor_MouseDown;
+ panelGrey.MouseDown += panelColor_MouseDown;
+ panelGreen.MouseDown += panelColor_MouseDown;
+ panelRed.MouseDown += panelColor_MouseDown;
+ panelWhite.MouseDown += panelColor_MouseDown;
+ panelYellow.MouseDown += panelColor_MouseDown;
+ panelBlue.MouseDown += panelColor_MouseDown;
+
+ // TODO buttonCancel.Click with lambda
}
+ ///
+ /// Добавление события
+ ///
+ /// Привязанный метод
+ public void AddEvent(TractorDelegate ev)
+ {
+ if (EventAddTractor == null)
+ {
+ EventAddTractor = ev;
+ }
+ else
+ {
+ EventAddTractor += ev;
+ }
+ }
+ ///
+ /// Добавление машины
+ ///
+ ///
+ ///
+ private void ButtonOk_Click(object sender, EventArgs e)
+ {
+ EventAddTractor?.Invoke(_tractor);
+ Close();
+ }
+
///
/// Отрисовать машину
///
@@ -49,12 +95,8 @@ public partial class FormTractorConfig : Form
(sender as Label)?.DoDragDrop((sender as Label)?.Name,
DragDropEffects.Move | DragDropEffects.Copy);
}
- ///
- /// Проверка получаемой информации (ее типа на соответствие требуемому)
- ///
- ///
- ///
- private void PanelObject_DragEnter(object sender, DragEventArgs e)
+
+ private void panelObject_DragEnter(object sender, DragEventArgs e)
{
if (e.Data?.GetDataPresent(DataFormats.Text) ?? false)
{
@@ -65,12 +107,8 @@ public partial class FormTractorConfig : Form
e.Effect = DragDropEffects.None;
}
}
- ///
- /// Действия при приеме перетаскиваемой информации
- ///
- ///
- ///
- private void PanelObject_DragDrop(object sender, DragEventArgs e)
+
+ private void panelObject_DragDrop(object sender, DragEventArgs e)
{
switch (e.Data?.GetData(DataFormats.Text).ToString())
{
@@ -89,4 +127,23 @@ public partial class FormTractorConfig : Form
DrawTractor();
}
+ private void panelColor_MouseDown(object sender, MouseEventArgs e)
+ {
+
+ }
+ ///
+ /// Добавление объекта
+ ///
+ ///
+ ///
+ private void buttonAddCar_Click(object sender, EventArgs e)
+ {
+ var formTractorConfig = new FormTractorConfig();
+ // TODO Call method AddEvent from formCarConfig
+ formTractorConfig.Show();
+
+ }
+
+
+ // TODO Реализовать логику смены цветов: основного и дополнительного (для продвинутого объекта)
}