Compare commits

..

2 Commits

Author SHA1 Message Date
c6fad42dae правки 2024-05-10 20:32:11 +04:00
4ae6b34ca3 правки 2024-04-29 10:35:26 +04:00
2 changed files with 86 additions and 64 deletions

View File

@ -44,7 +44,7 @@
labelWeight = new Label(); labelWeight = new Label();
numericUpDownSpeed = new NumericUpDown(); numericUpDownSpeed = new NumericUpDown();
labelSpeed = new Label(); labelSpeed = new Label();
labelModifiedObkect = new Label(); labelModifiedObject = new Label();
labelSimpleObject = new Label(); labelSimpleObject = new Label();
pictureBoxObject = new PictureBox(); pictureBoxObject = new PictureBox();
buttonAdd = new Button(); buttonAdd = new Button();
@ -69,12 +69,14 @@
groupBoxConfig.Controls.Add(labelWeight); groupBoxConfig.Controls.Add(labelWeight);
groupBoxConfig.Controls.Add(numericUpDownSpeed); groupBoxConfig.Controls.Add(numericUpDownSpeed);
groupBoxConfig.Controls.Add(labelSpeed); groupBoxConfig.Controls.Add(labelSpeed);
groupBoxConfig.Controls.Add(labelModifiedObkect); groupBoxConfig.Controls.Add(labelModifiedObject);
groupBoxConfig.Controls.Add(labelSimpleObject); groupBoxConfig.Controls.Add(labelSimpleObject);
groupBoxConfig.Dock = DockStyle.Left; groupBoxConfig.Dock = DockStyle.Left;
groupBoxConfig.Location = new Point(0, 0); groupBoxConfig.Location = new Point(0, 0);
groupBoxConfig.Margin = new Padding(3, 4, 3, 4);
groupBoxConfig.Name = "groupBoxConfig"; groupBoxConfig.Name = "groupBoxConfig";
groupBoxConfig.Size = new Size(427, 263); groupBoxConfig.Padding = new Padding(3, 4, 3, 4);
groupBoxConfig.Size = new Size(488, 351);
groupBoxConfig.TabIndex = 0; groupBoxConfig.TabIndex = 0;
groupBoxConfig.TabStop = false; groupBoxConfig.TabStop = false;
groupBoxConfig.Text = "Параметры"; groupBoxConfig.Text = "Параметры";
@ -89,9 +91,11 @@
groupBoxColors.Controls.Add(panelGreen); groupBoxColors.Controls.Add(panelGreen);
groupBoxColors.Controls.Add(panelWhite); groupBoxColors.Controls.Add(panelWhite);
groupBoxColors.Controls.Add(panelRed); groupBoxColors.Controls.Add(panelRed);
groupBoxColors.Location = new Point(12, 139); groupBoxColors.Location = new Point(14, 185);
groupBoxColors.Margin = new Padding(3, 4, 3, 4);
groupBoxColors.Name = "groupBoxColors"; groupBoxColors.Name = "groupBoxColors";
groupBoxColors.Size = new Size(209, 118); groupBoxColors.Padding = new Padding(3, 4, 3, 4);
groupBoxColors.Size = new Size(239, 157);
groupBoxColors.TabIndex = 8; groupBoxColors.TabIndex = 8;
groupBoxColors.TabStop = false; groupBoxColors.TabStop = false;
groupBoxColors.Text = "Цвета"; groupBoxColors.Text = "Цвета";
@ -99,73 +103,82 @@
// panelPurple // panelPurple
// //
panelPurple.BackColor = Color.Purple; panelPurple.BackColor = Color.Purple;
panelPurple.Location = new Point(154, 71); panelPurple.Location = new Point(176, 95);
panelPurple.Margin = new Padding(3, 4, 3, 4);
panelPurple.Name = "panelPurple"; panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(29, 26); panelPurple.Size = new Size(33, 35);
panelPurple.TabIndex = 3; panelPurple.TabIndex = 3;
// //
// panelYellow // panelYellow
// //
panelYellow.BackColor = Color.Yellow; panelYellow.BackColor = Color.Yellow;
panelYellow.Location = new Point(154, 22); panelYellow.Location = new Point(176, 29);
panelYellow.Margin = new Padding(3, 4, 3, 4);
panelYellow.Name = "panelYellow"; panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(29, 26); panelYellow.Size = new Size(33, 35);
panelYellow.TabIndex = 1; panelYellow.TabIndex = 1;
// //
// panelBlack // panelBlack
// //
panelBlack.BackColor = Color.Black; panelBlack.BackColor = Color.Black;
panelBlack.Location = new Point(105, 71); panelBlack.Location = new Point(120, 95);
panelBlack.Margin = new Padding(3, 4, 3, 4);
panelBlack.Name = "panelBlack"; panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(29, 26); panelBlack.Size = new Size(33, 35);
panelBlack.TabIndex = 4; panelBlack.TabIndex = 4;
// //
// panelBlue // panelBlue
// //
panelBlue.BackColor = Color.Blue; panelBlue.BackColor = Color.Blue;
panelBlue.Location = new Point(105, 22); panelBlue.Location = new Point(120, 29);
panelBlue.Margin = new Padding(3, 4, 3, 4);
panelBlue.Name = "panelBlue"; panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(29, 26); panelBlue.Size = new Size(33, 35);
panelBlue.TabIndex = 1; panelBlue.TabIndex = 1;
// //
// panelGray // panelGray
// //
panelGray.BackColor = Color.Gray; panelGray.BackColor = Color.Gray;
panelGray.Location = new Point(56, 71); panelGray.Location = new Point(64, 95);
panelGray.Margin = new Padding(3, 4, 3, 4);
panelGray.Name = "panelGray"; panelGray.Name = "panelGray";
panelGray.Size = new Size(29, 26); panelGray.Size = new Size(33, 35);
panelGray.TabIndex = 5; panelGray.TabIndex = 5;
// //
// panelGreen // panelGreen
// //
panelGreen.BackColor = Color.Green; panelGreen.BackColor = Color.Green;
panelGreen.Location = new Point(56, 22); panelGreen.Location = new Point(64, 29);
panelGreen.Margin = new Padding(3, 4, 3, 4);
panelGreen.Name = "panelGreen"; panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(29, 26); panelGreen.Size = new Size(33, 35);
panelGreen.TabIndex = 1; panelGreen.TabIndex = 1;
// //
// panelWhite // panelWhite
// //
panelWhite.BackColor = Color.White; panelWhite.BackColor = Color.White;
panelWhite.Location = new Point(6, 71); panelWhite.Location = new Point(7, 95);
panelWhite.Margin = new Padding(3, 4, 3, 4);
panelWhite.Name = "panelWhite"; panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(29, 26); panelWhite.Size = new Size(33, 35);
panelWhite.TabIndex = 2; panelWhite.TabIndex = 2;
// //
// panelRed // panelRed
// //
panelRed.BackColor = Color.Red; panelRed.BackColor = Color.Red;
panelRed.Location = new Point(6, 22); panelRed.Location = new Point(7, 29);
panelRed.Margin = new Padding(3, 4, 3, 4);
panelRed.Name = "panelRed"; panelRed.Name = "panelRed";
panelRed.Size = new Size(29, 26); panelRed.Size = new Size(33, 35);
panelRed.TabIndex = 0; panelRed.TabIndex = 0;
// //
// checkBoxHorns // checkBoxHorns
// //
checkBoxHorns.AutoSize = true; checkBoxHorns.AutoSize = true;
checkBoxHorns.Location = new Point(12, 114); checkBoxHorns.Location = new Point(14, 152);
checkBoxHorns.Margin = new Padding(3, 4, 3, 4);
checkBoxHorns.Name = "checkBoxHorns"; checkBoxHorns.Name = "checkBoxHorns";
checkBoxHorns.Size = new Size(325, 19); checkBoxHorns.Size = new Size(410, 24);
checkBoxHorns.TabIndex = 7; checkBoxHorns.TabIndex = 7;
checkBoxHorns.Text = "Признак наличия \"Рогов\" для подключения проводов"; checkBoxHorns.Text = "Признак наличия \"Рогов\" для подключения проводов";
checkBoxHorns.UseVisualStyleBackColor = true; checkBoxHorns.UseVisualStyleBackColor = true;
@ -173,68 +186,71 @@
// checkBoxBatteryCompartment // checkBoxBatteryCompartment
// //
checkBoxBatteryCompartment.AutoSize = true; checkBoxBatteryCompartment.AutoSize = true;
checkBoxBatteryCompartment.Location = new Point(12, 89); checkBoxBatteryCompartment.Location = new Point(14, 119);
checkBoxBatteryCompartment.Margin = new Padding(3, 4, 3, 4);
checkBoxBatteryCompartment.Name = "checkBoxBatteryCompartment"; checkBoxBatteryCompartment.Name = "checkBoxBatteryCompartment";
checkBoxBatteryCompartment.Size = new Size(232, 19); checkBoxBatteryCompartment.Size = new Size(294, 24);
checkBoxBatteryCompartment.TabIndex = 6; checkBoxBatteryCompartment.TabIndex = 6;
checkBoxBatteryCompartment.Text = "Признак наличия отсека под батареи"; checkBoxBatteryCompartment.Text = "Признак наличия отсека под батареи";
checkBoxBatteryCompartment.UseVisualStyleBackColor = true; checkBoxBatteryCompartment.UseVisualStyleBackColor = true;
// //
// numericUpDownWeight // numericUpDownWeight
// //
numericUpDownWeight.Location = new Point(80, 60); numericUpDownWeight.Location = new Point(91, 80);
numericUpDownWeight.Margin = new Padding(3, 4, 3, 4);
numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownWeight.Name = "numericUpDownWeight"; numericUpDownWeight.Name = "numericUpDownWeight";
numericUpDownWeight.Size = new Size(115, 23); numericUpDownWeight.Size = new Size(131, 27);
numericUpDownWeight.TabIndex = 5; numericUpDownWeight.TabIndex = 5;
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
// //
// labelWeight // labelWeight
// //
labelWeight.AutoSize = true; labelWeight.AutoSize = true;
labelWeight.Location = new Point(45, 62); labelWeight.Location = new Point(51, 83);
labelWeight.Name = "labelWeight"; labelWeight.Name = "labelWeight";
labelWeight.Size = new Size(29, 15); labelWeight.Size = new Size(36, 20);
labelWeight.TabIndex = 4; labelWeight.TabIndex = 4;
labelWeight.Text = "Вес:"; labelWeight.Text = "Вес:";
// //
// numericUpDownSpeed // numericUpDownSpeed
// //
numericUpDownSpeed.Location = new Point(80, 17); numericUpDownSpeed.Location = new Point(91, 23);
numericUpDownSpeed.Margin = new Padding(3, 4, 3, 4);
numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownSpeed.Name = "numericUpDownSpeed"; numericUpDownSpeed.Name = "numericUpDownSpeed";
numericUpDownSpeed.Size = new Size(115, 23); numericUpDownSpeed.Size = new Size(131, 27);
numericUpDownSpeed.TabIndex = 3; numericUpDownSpeed.TabIndex = 3;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
// //
// labelSpeed // labelSpeed
// //
labelSpeed.AutoSize = true; labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(12, 19); labelSpeed.Location = new Point(14, 25);
labelSpeed.Name = "labelSpeed"; labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(62, 15); labelSpeed.Size = new Size(76, 20);
labelSpeed.TabIndex = 2; labelSpeed.TabIndex = 2;
labelSpeed.Text = "Скорость:"; labelSpeed.Text = "Скорость:";
// //
// labelModifiedObkect // labelModifiedObject
// //
labelModifiedObkect.BorderStyle = BorderStyle.FixedSingle; labelModifiedObject.BorderStyle = BorderStyle.FixedSingle;
labelModifiedObkect.Location = new Point(336, 210); labelModifiedObject.Location = new Point(384, 280);
labelModifiedObkect.Name = "labelModifiedObkect"; labelModifiedObject.Name = "labelModifiedObject";
labelModifiedObkect.Size = new Size(85, 39); labelModifiedObject.Size = new Size(97, 51);
labelModifiedObkect.TabIndex = 1; labelModifiedObject.TabIndex = 1;
labelModifiedObkect.Text = "Продвинутый"; labelModifiedObject.Text = "Продвинутый";
labelModifiedObkect.TextAlign = ContentAlignment.MiddleCenter; labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter;
labelModifiedObkect.MouseDown += labelObject_MouseDown; labelModifiedObject.MouseDown += labelObject_MouseDown;
// //
// labelSimpleObject // labelSimpleObject
// //
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle; labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
labelSimpleObject.Location = new Point(242, 210); labelSimpleObject.Location = new Point(277, 280);
labelSimpleObject.Name = "labelSimpleObject"; labelSimpleObject.Name = "labelSimpleObject";
labelSimpleObject.Size = new Size(88, 39); labelSimpleObject.Size = new Size(100, 51);
labelSimpleObject.TabIndex = 0; labelSimpleObject.TabIndex = 0;
labelSimpleObject.Text = "Простой"; labelSimpleObject.Text = "Простой";
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter; labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
@ -242,17 +258,19 @@
// //
// pictureBoxObject // pictureBoxObject
// //
pictureBoxObject.Location = new Point(15, 89); pictureBoxObject.Location = new Point(17, 119);
pictureBoxObject.Margin = new Padding(3, 4, 3, 4);
pictureBoxObject.Name = "pictureBoxObject"; pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(186, 106); pictureBoxObject.Size = new Size(213, 141);
pictureBoxObject.TabIndex = 1; pictureBoxObject.TabIndex = 1;
pictureBoxObject.TabStop = false; pictureBoxObject.TabStop = false;
// //
// buttonAdd // buttonAdd
// //
buttonAdd.Location = new Point(443, 210); buttonAdd.Location = new Point(506, 280);
buttonAdd.Margin = new Padding(3, 4, 3, 4);
buttonAdd.Name = "buttonAdd"; buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(75, 23); buttonAdd.Size = new Size(86, 31);
buttonAdd.TabIndex = 2; buttonAdd.TabIndex = 2;
buttonAdd.Text = "Добавить"; buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true; buttonAdd.UseVisualStyleBackColor = true;
@ -260,9 +278,10 @@
// //
// buttonCancel // buttonCancel
// //
buttonCancel.Location = new Point(554, 210); buttonCancel.Location = new Point(633, 280);
buttonCancel.Margin = new Padding(3, 4, 3, 4);
buttonCancel.Name = "buttonCancel"; buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(75, 23); buttonCancel.Size = new Size(86, 31);
buttonCancel.TabIndex = 3; buttonCancel.TabIndex = 3;
buttonCancel.Text = "Отмена"; buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true; buttonCancel.UseVisualStyleBackColor = true;
@ -270,12 +289,13 @@
// panelObject // panelObject
// //
panelObject.AllowDrop = true; panelObject.AllowDrop = true;
panelObject.Controls.Add(pictureBoxObject);
panelObject.Controls.Add(labelAdditionalColor); panelObject.Controls.Add(labelAdditionalColor);
panelObject.Controls.Add(labelBodyColor); panelObject.Controls.Add(labelBodyColor);
panelObject.Controls.Add(pictureBoxObject); panelObject.Location = new Point(489, 0);
panelObject.Location = new Point(428, 0); panelObject.Margin = new Padding(3, 4, 3, 4);
panelObject.Name = "panelObject"; panelObject.Name = "panelObject";
panelObject.Size = new Size(213, 204); panelObject.Size = new Size(243, 272);
panelObject.TabIndex = 4; panelObject.TabIndex = 4;
panelObject.DragDrop += PanelObject_DragDrop; panelObject.DragDrop += PanelObject_DragDrop;
panelObject.DragEnter += PanelObject_DragEnter; panelObject.DragEnter += PanelObject_DragEnter;
@ -283,9 +303,9 @@
// labelAdditionalColor // labelAdditionalColor
// //
labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle;
labelAdditionalColor.Location = new Point(126, 17); labelAdditionalColor.Location = new Point(144, 23);
labelAdditionalColor.Name = "labelAdditionalColor"; labelAdditionalColor.Name = "labelAdditionalColor";
labelAdditionalColor.Size = new Size(75, 39); labelAdditionalColor.Size = new Size(85, 51);
labelAdditionalColor.TabIndex = 10; labelAdditionalColor.TabIndex = 10;
labelAdditionalColor.Text = "Доп. цвет"; labelAdditionalColor.Text = "Доп. цвет";
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter; labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
@ -293,22 +313,23 @@
// labelBodyColor // labelBodyColor
// //
labelBodyColor.BorderStyle = BorderStyle.FixedSingle; labelBodyColor.BorderStyle = BorderStyle.FixedSingle;
labelBodyColor.Location = new Point(15, 17); labelBodyColor.Location = new Point(17, 23);
labelBodyColor.Name = "labelBodyColor"; labelBodyColor.Name = "labelBodyColor";
labelBodyColor.Size = new Size(75, 39); labelBodyColor.Size = new Size(85, 51);
labelBodyColor.TabIndex = 9; labelBodyColor.TabIndex = 9;
labelBodyColor.Text = "Цвет"; labelBodyColor.Text = "Цвет";
labelBodyColor.TextAlign = ContentAlignment.MiddleCenter; labelBodyColor.TextAlign = ContentAlignment.MiddleCenter;
// //
// FormTrolleyBConfig // FormTrolleyBConfig
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(641, 263); ClientSize = new Size(733, 351);
Controls.Add(panelObject); Controls.Add(panelObject);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(buttonAdd); Controls.Add(buttonAdd);
Controls.Add(groupBoxConfig); Controls.Add(groupBoxConfig);
Margin = new Padding(3, 4, 3, 4);
Name = "FormTrolleyBConfig"; Name = "FormTrolleyBConfig";
Text = "Создание объекта"; Text = "Создание объекта";
groupBoxConfig.ResumeLayout(false); groupBoxConfig.ResumeLayout(false);
@ -324,7 +345,7 @@
#endregion #endregion
private GroupBox groupBoxConfig; private GroupBox groupBoxConfig;
private Label labelModifiedObkect; private Label labelModifiedObject;
private Label labelSimpleObject; private Label labelSimpleObject;
private NumericUpDown numericUpDownSpeed; private NumericUpDown numericUpDownSpeed;
private Label labelSpeed; private Label labelSpeed;

View File

@ -17,7 +17,7 @@ public partial class FormTrolleyBConfig : Form
/// <summary> /// <summary>
/// Событие для передачи объекта /// Событие для передачи объекта
/// </summary> /// </summary>
private event TrolleyBDelegate? TrolleyBDelegate; private event Action<DrawningTrolleyB> TrolleyBDelegate;
/// <summary> /// <summary>
/// Конструктор /// Конструктор
@ -36,16 +36,16 @@ public partial class FormTrolleyBConfig : Form
buttonCancel.Click += (s, e) => Close(); buttonCancel.Click += (s, e) => Close();
} }
/// <summary> /// <summary>
/// Привязка внешнего метода к событию /// Привязка внешнего метода к событию
/// </summary> /// </summary>
/// <param name="trolleyBDelegate"></param> /// <param name="trolleyBDelegate"></param>
public void AddEvent(TrolleyBDelegate trolleyBDelegate) public void AddEvent(Action<DrawningTrolleyB> excavatorDelegate)
{ {
TrolleyBDelegate = trolleyBDelegate; TrolleyBDelegate += excavatorDelegate;
} }
/// <summary> /// <summary>
@ -98,6 +98,7 @@ public partial class FormTrolleyBConfig : Form
Color.Black, checkBoxBatteryCompartment.Checked, checkBoxHorns.Checked); Color.Black, checkBoxBatteryCompartment.Checked, checkBoxHorns.Checked);
break; break;
} }
DrawObject(); DrawObject();
} }