правки

This commit is contained in:
Geo7312 2024-04-29 10:35:26 +04:00
parent 0c7bc6aa68
commit 4ae6b34ca3
2 changed files with 83 additions and 61 deletions

View File

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

View File

@ -98,6 +98,7 @@ public partial class FormTrolleyBConfig : Form
Color.Black, checkBoxBatteryCompartment.Checked, checkBoxHorns.Checked);
break;
}
DrawObject();
}
@ -123,7 +124,7 @@ public partial class FormTrolleyBConfig : Form
}
}
private void labelColor_DragDrop(object sender, DragEventArgs e)
private void LabelColor_DragDrop(object sender, DragEventArgs e)
{
if (_trolleyB == null)
{