From efe390737d5d0c5ff824b4203a67617325057546 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Sun, 7 Apr 2024 01:44:18 +0400 Subject: [PATCH 1/9] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormTruckConfig.Designer.cs | 352 ++++++++++++++++++ .../ProjectDumpTruck/FormTruckConfig.cs | 20 + .../ProjectDumpTruck/FormTruckConfig.resx | 120 ++++++ 3 files changed, 492 insertions(+) create mode 100644 ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs create mode 100644 ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs create mode 100644 ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.resx diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs new file mode 100644 index 0000000..a1ec706 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs @@ -0,0 +1,352 @@ +namespace ProjectDumpTruck +{ + partial class FormTruckConfig + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + groupBoxConfig = new GroupBox(); + checkBoxAwning = new CheckBox(); + numericUpDownWeight = new NumericUpDown(); + labelWeight = new Label(); + numericUpDownSpeed = new NumericUpDown(); + labelSpeed = new Label(); + labelModifiedObject = new Label(); + labelSimpleObject = new Label(); + checkBoxTent = new CheckBox(); + groupBoxColours = new GroupBox(); + panelRed = new Panel(); + panelOrange = new Panel(); + panelGreen = new Panel(); + panelYellow = new Panel(); + panelWhite = new Panel(); + panelGray = new Panel(); + panelBlack = new Panel(); + panelPink = new Panel(); + panelPurple = new Panel(); + panelBlue = new Panel(); + pictureBoxObject = new PictureBox(); + buttonAdd = new Button(); + buttonCancel = new Button(); + panel1 = new Panel(); + panelObject = new Panel(); + groupBoxConfig.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit(); + groupBoxColours.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit(); + panelObject.SuspendLayout(); + SuspendLayout(); + // + // groupBoxConfig + // + groupBoxConfig.Controls.Add(panel1); + groupBoxConfig.Controls.Add(groupBoxColours); + groupBoxConfig.Controls.Add(checkBoxTent); + groupBoxConfig.Controls.Add(checkBoxAwning); + groupBoxConfig.Controls.Add(numericUpDownWeight); + groupBoxConfig.Controls.Add(labelWeight); + groupBoxConfig.Controls.Add(numericUpDownSpeed); + groupBoxConfig.Controls.Add(labelSpeed); + groupBoxConfig.Controls.Add(labelModifiedObject); + groupBoxConfig.Controls.Add(labelSimpleObject); + groupBoxConfig.Dock = DockStyle.Left; + groupBoxConfig.Location = new Point(0, 0); + groupBoxConfig.Name = "groupBoxConfig"; + groupBoxConfig.Size = new Size(615, 266); + groupBoxConfig.TabIndex = 0; + groupBoxConfig.TabStop = false; + groupBoxConfig.Text = "Параметры"; + // + // checkBoxAwning + // + checkBoxAwning.AutoSize = true; + checkBoxAwning.Location = new Point(24, 153); + checkBoxAwning.Name = "checkBoxAwning"; + checkBoxAwning.Size = new Size(204, 24); + checkBoxAwning.TabIndex = 6; + checkBoxAwning.Text = "Признак наличия кузова"; + checkBoxAwning.UseVisualStyleBackColor = true; + // + // numericUpDownWeight + // + numericUpDownWeight.Location = new Point(94, 86); + 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(120, 27); + numericUpDownWeight.TabIndex = 5; + numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 }); + // + // labelWeight + // + labelWeight.AutoSize = true; + labelWeight.Location = new Point(52, 88); + labelWeight.Name = "labelWeight"; + labelWeight.Size = new Size(36, 20); + labelWeight.TabIndex = 4; + labelWeight.Text = "Вес:"; + // + // numericUpDownSpeed + // + numericUpDownSpeed.Location = new Point(94, 33); + 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(120, 27); + numericUpDownSpeed.TabIndex = 3; + numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 }); + // + // labelSpeed + // + labelSpeed.AutoSize = true; + labelSpeed.Location = new Point(12, 33); + labelSpeed.Name = "labelSpeed"; + labelSpeed.Size = new Size(76, 20); + labelSpeed.TabIndex = 2; + labelSpeed.Text = "Скорость:"; + // + // labelModifiedObject + // + labelModifiedObject.BorderStyle = BorderStyle.FixedSingle; + labelModifiedObject.Location = new Point(432, 184); + labelModifiedObject.Name = "labelModifiedObject"; + labelModifiedObject.Size = new Size(148, 44); + labelModifiedObject.TabIndex = 1; + labelModifiedObject.Text = "Продвинутый"; + labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter; + // + // labelSimpleObject + // + labelSimpleObject.BorderStyle = BorderStyle.FixedSingle; + labelSimpleObject.Location = new Point(260, 184); + labelSimpleObject.Name = "labelSimpleObject"; + labelSimpleObject.Size = new Size(148, 44); + labelSimpleObject.TabIndex = 0; + labelSimpleObject.Text = "Простой"; + labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter; + // + // checkBoxTent + // + checkBoxTent.AutoSize = true; + checkBoxTent.Location = new Point(24, 204); + checkBoxTent.Name = "checkBoxTent"; + checkBoxTent.Size = new Size(195, 24); + checkBoxTent.TabIndex = 7; + checkBoxTent.Text = "Признак наличия тента"; + checkBoxTent.UseVisualStyleBackColor = true; + // + // groupBoxColours + // + groupBoxColours.Controls.Add(panelPurple); + groupBoxColours.Controls.Add(panelWhite); + groupBoxColours.Controls.Add(panelBlue); + groupBoxColours.Controls.Add(panelGreen); + groupBoxColours.Controls.Add(panelGray); + groupBoxColours.Controls.Add(panelOrange); + groupBoxColours.Controls.Add(panelBlack); + groupBoxColours.Controls.Add(panelYellow); + groupBoxColours.Controls.Add(panelPink); + groupBoxColours.Controls.Add(panelRed); + groupBoxColours.Location = new Point(260, 26); + groupBoxColours.Name = "groupBoxColours"; + groupBoxColours.Size = new Size(320, 135); + groupBoxColours.TabIndex = 8; + groupBoxColours.TabStop = false; + groupBoxColours.Text = "Цвета"; + // + // panelRed + // + panelRed.BackColor = Color.Red; + panelRed.Location = new Point(15, 26); + panelRed.Name = "panelRed"; + panelRed.Size = new Size(45, 45); + panelRed.TabIndex = 0; + // + // panelOrange + // + panelOrange.BackColor = Color.Orange; + panelOrange.Location = new Point(15, 77); + panelOrange.Name = "panelOrange"; + panelOrange.Size = new Size(45, 45); + panelOrange.TabIndex = 1; + // + // panelGreen + // + panelGreen.BackColor = Color.Green; + panelGreen.Location = new Point(75, 77); + panelGreen.Name = "panelGreen"; + panelGreen.Size = new Size(45, 45); + panelGreen.TabIndex = 3; + // + // panelYellow + // + panelYellow.BackColor = Color.Yellow; + panelYellow.Location = new Point(75, 26); + panelYellow.Name = "panelYellow"; + panelYellow.Size = new Size(45, 45); + panelYellow.TabIndex = 2; + // + // panelWhite + // + panelWhite.BackColor = Color.White; + panelWhite.Location = new Point(262, 77); + panelWhite.Name = "panelWhite"; + panelWhite.Size = new Size(45, 45); + panelWhite.TabIndex = 7; + // + // panelGray + // + panelGray.BackColor = Color.Gray; + panelGray.Location = new Point(200, 77); + panelGray.Name = "panelGray"; + panelGray.Size = new Size(45, 45); + panelGray.TabIndex = 5; + // + // panelBlack + // + panelBlack.BackColor = Color.Black; + panelBlack.Location = new Point(262, 26); + panelBlack.Name = "panelBlack"; + panelBlack.Size = new Size(45, 45); + panelBlack.TabIndex = 6; + // + // panelPink + // + panelPink.BackColor = Color.Pink; + panelPink.Location = new Point(200, 26); + panelPink.Name = "panelPink"; + panelPink.Size = new Size(45, 45); + panelPink.TabIndex = 4; + // + // panelPurple + // + panelPurple.BackColor = Color.Purple; + panelPurple.Location = new Point(135, 77); + panelPurple.Name = "panelPurple"; + panelPurple.Size = new Size(45, 45); + panelPurple.TabIndex = 5; + // + // panelBlue + // + panelBlue.BackColor = Color.Blue; + panelBlue.Location = new Point(135, 26); + panelBlue.Name = "panelBlue"; + panelBlue.Size = new Size(45, 45); + panelBlue.TabIndex = 4; + // + // pictureBoxObject + // + pictureBoxObject.Location = new Point(3, 21); + pictureBoxObject.Name = "pictureBoxObject"; + pictureBoxObject.Size = new Size(226, 159); + pictureBoxObject.TabIndex = 1; + pictureBoxObject.TabStop = false; + // + // buttonAdd + // + buttonAdd.Location = new Point(637, 204); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(94, 29); + buttonAdd.TabIndex = 2; + buttonAdd.Text = "Добавить"; + buttonAdd.UseVisualStyleBackColor = true; + // + // buttonCancel + // + buttonCancel.Location = new Point(742, 204); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(94, 29); + buttonCancel.TabIndex = 3; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + // + // panel1 + // + panel1.Location = new Point(621, 33); + panel1.Name = "panel1"; + panel1.Size = new Size(224, 125); + panel1.TabIndex = 4; + // + // panelObject + // + panelObject.AllowDrop = true; + panelObject.Controls.Add(pictureBoxObject); + panelObject.Location = new Point(624, 12); + panelObject.Name = "panelObject"; + panelObject.Size = new Size(232, 186); + panelObject.TabIndex = 4; + // + // FormTruckConfig + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(857, 266); + Controls.Add(panelObject); + Controls.Add(buttonCancel); + Controls.Add(buttonAdd); + Controls.Add(groupBoxConfig); + Name = "FormTruckConfig"; + Text = "Создание объекта"; + groupBoxConfig.ResumeLayout(false); + groupBoxConfig.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)numericUpDownWeight).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit(); + groupBoxColours.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit(); + panelObject.ResumeLayout(false); + ResumeLayout(false); + } + + #endregion + + private GroupBox groupBoxConfig; + private Label labelSimpleObject; + private NumericUpDown numericUpDownWeight; + private Label labelWeight; + private NumericUpDown numericUpDownSpeed; + private Label labelSpeed; + private Label labelModifiedObject; + private CheckBox checkBoxAwning; + private CheckBox checkBoxTent; + private GroupBox groupBoxColours; + private Panel panelPurple; + private Panel panelWhite; + private Panel panelBlue; + private Panel panelGreen; + private Panel panelGray; + private Panel panelOrange; + private Panel panelBlack; + private Panel panelYellow; + private Panel panelPink; + private Panel panelRed; + private PictureBox pictureBoxObject; + private Button buttonAdd; + private Button buttonCancel; + private Panel panel1; + private Panel panelObject; + } +} \ No newline at end of file diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs new file mode 100644 index 0000000..2ed08cc --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ProjectDumpTruck +{ + public partial class FormTruckConfig : Form + { + public FormTruckConfig() + { + InitializeComponent(); + } + } +} diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.resx b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file -- 2.25.1 From 7b4eb0a55806060ac0b52a22d9170e68d5ca9871 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Sun, 7 Apr 2024 14:54:18 +0400 Subject: [PATCH 2/9] =?UTF-8?q?=D1=87=D1=83=D1=82=D1=8C=20=D1=87=D1=83?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/EntityDumpTruck.cs | 10 + .../ProjectDumpTruck/Entities/EntityTruck.cs | 12 + .../FormTruckConfig.Designer.cs | 314 ++++++++++-------- .../ProjectDumpTruck/FormTruckConfig.cs | 98 +++++- 4 files changed, 293 insertions(+), 141 deletions(-) diff --git a/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityDumpTruck.cs b/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityDumpTruck.cs index 8d754d1..daabf15 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityDumpTruck.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityDumpTruck.cs @@ -7,6 +7,16 @@ public class EntityDumpTruck : EntityTruck /// Дополнительный цвет (для опциональных элементов) /// public Color AdditionalColor { get; private set; } + + /// + /// Метод передачи дополнительного цвета + /// + /// + public void SetAdditionalColor(Color additionalColor) + { + AdditionalColor = additionalColor; + } + /// /// Признак (опция) наличие кузова /// diff --git a/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityTruck.cs b/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityTruck.cs index 3570da6..e9f41a2 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityTruck.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/Entities/EntityTruck.cs @@ -15,14 +15,26 @@ public class EntityTruck /// Скорость /// public int Speed { get; private set; } + /// /// Вес /// public double Weight { get; private set; } + /// /// Основной цвет /// public Color BodyColor { get; private set; } + + /// + /// Метод передачи базового цвета + /// + /// + public void SetBodyColor(Color bodyColor) + { + BodyColor = bodyColor; + } + /// /// Шаг перемещения автомобиля /// diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs index a1ec706..98d6bc5 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs @@ -29,6 +29,19 @@ private void InitializeComponent() { groupBoxConfig = new GroupBox(); + panel1 = new Panel(); + groupBoxColours = new GroupBox(); + panelPurple = new Panel(); + panelWhite = new Panel(); + panelBlue = new Panel(); + panelGreen = new Panel(); + panelGray = new Panel(); + panelOrange = new Panel(); + panelBlack = new Panel(); + panelYellow = new Panel(); + panelPink = new Panel(); + panelRed = new Panel(); + checkBoxTent = new CheckBox(); checkBoxAwning = new CheckBox(); numericUpDownWeight = new NumericUpDown(); labelWeight = new Label(); @@ -36,27 +49,16 @@ labelSpeed = new Label(); labelModifiedObject = new Label(); labelSimpleObject = new Label(); - checkBoxTent = new CheckBox(); - groupBoxColours = new GroupBox(); - panelRed = new Panel(); - panelOrange = new Panel(); - panelGreen = new Panel(); - panelYellow = new Panel(); - panelWhite = new Panel(); - panelGray = new Panel(); - panelBlack = new Panel(); - panelPink = new Panel(); - panelPurple = new Panel(); - panelBlue = new Panel(); pictureBoxObject = new PictureBox(); buttonAdd = new Button(); buttonCancel = new Button(); - panel1 = new Panel(); panelObject = new Panel(); + labelAdditionalColor = new Label(); + labelBaseColor = new Label(); groupBoxConfig.SuspendLayout(); + groupBoxColours.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit(); - groupBoxColours.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit(); panelObject.SuspendLayout(); SuspendLayout(); @@ -81,6 +83,132 @@ groupBoxConfig.TabStop = false; groupBoxConfig.Text = "Параметры"; // + // panel1 + // + panel1.Location = new Point(621, 33); + panel1.Name = "panel1"; + panel1.Size = new Size(224, 125); + panel1.TabIndex = 4; + // + // groupBoxColours + // + groupBoxColours.Controls.Add(panelPurple); + groupBoxColours.Controls.Add(panelWhite); + groupBoxColours.Controls.Add(panelBlue); + groupBoxColours.Controls.Add(panelGreen); + groupBoxColours.Controls.Add(panelGray); + groupBoxColours.Controls.Add(panelOrange); + groupBoxColours.Controls.Add(panelBlack); + groupBoxColours.Controls.Add(panelYellow); + groupBoxColours.Controls.Add(panelPink); + groupBoxColours.Controls.Add(panelRed); + groupBoxColours.Location = new Point(260, 26); + groupBoxColours.Name = "groupBoxColours"; + groupBoxColours.Size = new Size(320, 135); + groupBoxColours.TabIndex = 8; + groupBoxColours.TabStop = false; + groupBoxColours.Text = "Цвета"; + // + // panelPurple + // + panelPurple.BackColor = Color.Purple; + panelPurple.Location = new Point(135, 77); + panelPurple.Name = "panelPurple"; + panelPurple.Size = new Size(45, 45); + panelPurple.TabIndex = 5; + panelPurple.MouseDown += Panel_MouseDown; + // + // panelWhite + // + panelWhite.BackColor = Color.White; + panelWhite.Location = new Point(262, 77); + panelWhite.Name = "panelWhite"; + panelWhite.Size = new Size(45, 45); + panelWhite.TabIndex = 7; + panelWhite.MouseDown += Panel_MouseDown; + // + // panelBlue + // + panelBlue.BackColor = Color.Blue; + panelBlue.Location = new Point(135, 26); + panelBlue.Name = "panelBlue"; + panelBlue.Size = new Size(45, 45); + panelBlue.TabIndex = 4; + panelBlue.MouseDown += Panel_MouseDown; + // + // panelGreen + // + panelGreen.BackColor = Color.Green; + panelGreen.Location = new Point(75, 77); + panelGreen.Name = "panelGreen"; + panelGreen.Size = new Size(45, 45); + panelGreen.TabIndex = 3; + panelGreen.MouseDown += Panel_MouseDown; + // + // panelGray + // + panelGray.BackColor = Color.Gray; + panelGray.Location = new Point(200, 77); + panelGray.Name = "panelGray"; + panelGray.Size = new Size(45, 45); + panelGray.TabIndex = 5; + panelGray.MouseDown += Panel_MouseDown; + // + // panelOrange + // + panelOrange.BackColor = Color.Orange; + panelOrange.Location = new Point(15, 77); + panelOrange.Name = "panelOrange"; + panelOrange.Size = new Size(45, 45); + panelOrange.TabIndex = 1; + panelOrange.MouseDown += Panel_MouseDown; + // + // panelBlack + // + panelBlack.BackColor = Color.Black; + panelBlack.Location = new Point(262, 26); + panelBlack.Name = "panelBlack"; + panelBlack.Size = new Size(45, 45); + panelBlack.TabIndex = 6; + panelBlack.MouseDown += Panel_MouseDown; + // + // panelYellow + // + panelYellow.BackColor = Color.Yellow; + panelYellow.Location = new Point(75, 26); + panelYellow.Name = "panelYellow"; + panelYellow.Size = new Size(45, 45); + panelYellow.TabIndex = 2; + panelYellow.MouseDown += Panel_MouseDown; + // + // panelPink + // + panelPink.BackColor = Color.Pink; + panelPink.Location = new Point(200, 26); + panelPink.Name = "panelPink"; + panelPink.Size = new Size(45, 45); + panelPink.TabIndex = 4; + panelPink.MouseDown += Panel_MouseDown; + // + // panelRed + // + panelRed.BackColor = Color.Red; + panelRed.Location = new Point(15, 26); + panelRed.Name = "panelRed"; + panelRed.Size = new Size(45, 45); + panelRed.TabIndex = 0; + panelRed.MouseDown += Panel_MouseDown; + // + // checkBoxTent + // + checkBoxTent.AutoSize = true; + checkBoxTent.Location = new Point(24, 204); + checkBoxTent.Name = "checkBoxTent"; + checkBoxTent.Size = new Size(195, 24); + checkBoxTent.TabIndex = 7; + checkBoxTent.Text = "Признак наличия тента"; + checkBoxTent.UseVisualStyleBackColor = true; + // // checkBoxAwning // checkBoxAwning.AutoSize = true; @@ -138,6 +266,7 @@ labelModifiedObject.TabIndex = 1; labelModifiedObject.Text = "Продвинутый"; labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter; + labelModifiedObject.MouseDown += LabelObject_MouseDown; // // labelSimpleObject // @@ -148,127 +277,19 @@ labelSimpleObject.TabIndex = 0; labelSimpleObject.Text = "Простой"; labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter; - // - // checkBoxTent - // - checkBoxTent.AutoSize = true; - checkBoxTent.Location = new Point(24, 204); - checkBoxTent.Name = "checkBoxTent"; - checkBoxTent.Size = new Size(195, 24); - checkBoxTent.TabIndex = 7; - checkBoxTent.Text = "Признак наличия тента"; - checkBoxTent.UseVisualStyleBackColor = true; - // - // groupBoxColours - // - groupBoxColours.Controls.Add(panelPurple); - groupBoxColours.Controls.Add(panelWhite); - groupBoxColours.Controls.Add(panelBlue); - groupBoxColours.Controls.Add(panelGreen); - groupBoxColours.Controls.Add(panelGray); - groupBoxColours.Controls.Add(panelOrange); - groupBoxColours.Controls.Add(panelBlack); - groupBoxColours.Controls.Add(panelYellow); - groupBoxColours.Controls.Add(panelPink); - groupBoxColours.Controls.Add(panelRed); - groupBoxColours.Location = new Point(260, 26); - groupBoxColours.Name = "groupBoxColours"; - groupBoxColours.Size = new Size(320, 135); - groupBoxColours.TabIndex = 8; - groupBoxColours.TabStop = false; - groupBoxColours.Text = "Цвета"; - // - // panelRed - // - panelRed.BackColor = Color.Red; - panelRed.Location = new Point(15, 26); - panelRed.Name = "panelRed"; - panelRed.Size = new Size(45, 45); - panelRed.TabIndex = 0; - // - // panelOrange - // - panelOrange.BackColor = Color.Orange; - panelOrange.Location = new Point(15, 77); - panelOrange.Name = "panelOrange"; - panelOrange.Size = new Size(45, 45); - panelOrange.TabIndex = 1; - // - // panelGreen - // - panelGreen.BackColor = Color.Green; - panelGreen.Location = new Point(75, 77); - panelGreen.Name = "panelGreen"; - panelGreen.Size = new Size(45, 45); - panelGreen.TabIndex = 3; - // - // panelYellow - // - panelYellow.BackColor = Color.Yellow; - panelYellow.Location = new Point(75, 26); - panelYellow.Name = "panelYellow"; - panelYellow.Size = new Size(45, 45); - panelYellow.TabIndex = 2; - // - // panelWhite - // - panelWhite.BackColor = Color.White; - panelWhite.Location = new Point(262, 77); - panelWhite.Name = "panelWhite"; - panelWhite.Size = new Size(45, 45); - panelWhite.TabIndex = 7; - // - // panelGray - // - panelGray.BackColor = Color.Gray; - panelGray.Location = new Point(200, 77); - panelGray.Name = "panelGray"; - panelGray.Size = new Size(45, 45); - panelGray.TabIndex = 5; - // - // panelBlack - // - panelBlack.BackColor = Color.Black; - panelBlack.Location = new Point(262, 26); - panelBlack.Name = "panelBlack"; - panelBlack.Size = new Size(45, 45); - panelBlack.TabIndex = 6; - // - // panelPink - // - panelPink.BackColor = Color.Pink; - panelPink.Location = new Point(200, 26); - panelPink.Name = "panelPink"; - panelPink.Size = new Size(45, 45); - panelPink.TabIndex = 4; - // - // panelPurple - // - panelPurple.BackColor = Color.Purple; - panelPurple.Location = new Point(135, 77); - panelPurple.Name = "panelPurple"; - panelPurple.Size = new Size(45, 45); - panelPurple.TabIndex = 5; - // - // panelBlue - // - panelBlue.BackColor = Color.Blue; - panelBlue.Location = new Point(135, 26); - panelBlue.Name = "panelBlue"; - panelBlue.Size = new Size(45, 45); - panelBlue.TabIndex = 4; + labelSimpleObject.MouseDown += LabelObject_MouseDown; // // pictureBoxObject // - pictureBoxObject.Location = new Point(3, 21); + pictureBoxObject.Location = new Point(3, 76); pictureBoxObject.Name = "pictureBoxObject"; - pictureBoxObject.Size = new Size(226, 159); + pictureBoxObject.Size = new Size(226, 114); pictureBoxObject.TabIndex = 1; pictureBoxObject.TabStop = false; // // buttonAdd // - buttonAdd.Location = new Point(637, 204); + buttonAdd.Location = new Point(627, 225); buttonAdd.Name = "buttonAdd"; buttonAdd.Size = new Size(94, 29); buttonAdd.TabIndex = 2; @@ -277,28 +298,45 @@ // // buttonCancel // - buttonCancel.Location = new Point(742, 204); + buttonCancel.Location = new Point(751, 225); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(94, 29); buttonCancel.TabIndex = 3; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; // - // panel1 - // - panel1.Location = new Point(621, 33); - panel1.Name = "panel1"; - panel1.Size = new Size(224, 125); - panel1.TabIndex = 4; - // // panelObject // panelObject.AllowDrop = true; + panelObject.Controls.Add(labelAdditionalColor); + panelObject.Controls.Add(labelBaseColor); panelObject.Controls.Add(pictureBoxObject); - panelObject.Location = new Point(624, 12); + panelObject.Location = new Point(621, 12); panelObject.Name = "panelObject"; - panelObject.Size = new Size(232, 186); + panelObject.Size = new Size(232, 207); panelObject.TabIndex = 4; + panelObject.DragDrop += PanelObject_DragDrop; + panelObject.DragEnter += PanelObject_DragEnter; + // + // labelAdditionalColor + // + labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; + labelAdditionalColor.Location = new Point(122, 14); + labelAdditionalColor.Name = "labelAdditionalColor"; + labelAdditionalColor.Size = new Size(102, 44); + labelAdditionalColor.TabIndex = 3; + labelAdditionalColor.Text = "Доп. цвет"; + labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter; + // + // labelBaseColor + // + labelBaseColor.BorderStyle = BorderStyle.FixedSingle; + labelBaseColor.Location = new Point(6, 14); + labelBaseColor.Name = "labelBaseColor"; + labelBaseColor.Size = new Size(102, 44); + labelBaseColor.TabIndex = 2; + labelBaseColor.Text = "Цвет"; + labelBaseColor.TextAlign = ContentAlignment.MiddleCenter; // // FormTruckConfig // @@ -313,9 +351,9 @@ Text = "Создание объекта"; groupBoxConfig.ResumeLayout(false); groupBoxConfig.PerformLayout(); + groupBoxColours.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)numericUpDownWeight).EndInit(); ((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit(); - groupBoxColours.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit(); panelObject.ResumeLayout(false); ResumeLayout(false); @@ -348,5 +386,7 @@ private Button buttonCancel; private Panel panel1; private Panel panelObject; + private Label labelBaseColor; + private Label labelAdditionalColor; } } \ No newline at end of file diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index 2ed08cc..745bf71 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -7,14 +7,104 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using ProjectDumpTruck.Drawnings; -namespace ProjectDumpTruck + +namespace ProjectDumpTruck; + +/// +/// Форма конфигурации объекта +/// +public partial class FormTruckConfig : Form { - public partial class FormTruckConfig : Form + /// + /// Объект - прорисовка грузовика + /// + private DrawningTruck _truck = null; + + /// + /// Конструктор + /// + public FormTruckConfig() { - public FormTruckConfig() + InitializeComponent(); + + panelRed.MouseDown += Panel_MouseDown; + panelOrange.MouseDown += Panel_MouseDown; + panelYellow.MouseDown += Panel_MouseDown; + panelGreen.MouseDown += Panel_MouseDown; + panelBlue.MouseDown += Panel_MouseDown; + panelPurple.MouseDown += Panel_MouseDown; + panelPink.MouseDown += Panel_MouseDown; + panelGray.MouseDown += Panel_MouseDown; + panelBlack.MouseDown += Panel_MouseDown; + panelWhite.MouseDown += Panel_MouseDown; + } + + /// + /// Прорисовка объекта + /// + private void DrawObject() + { + Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height); + Graphics gr = Graphics.FromImage(bmp); + _truck?.SetPictureSize(pictureBoxObject.Width, pictureBoxObject.Height); + _truck?.SetPosition(5, 5); + _truck?.DrawTransport(gr); + pictureBoxObject.Image = bmp; + } + + + /// + /// Передаем информацию при нажатии на Label + /// + /// + /// + private void LabelObject_MouseDown(object sender, MouseEventArgs e) + { + (sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy); + } + + /// + /// Проверка получаемой информации(ее типа на соответствие требуемому) + /// + /// + /// + private void PanelObject_DragEnter(object sender, DragEventArgs e) + { + e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None; + } + + /// + /// Действия при приеме перетаскиваемой информации + /// + /// + /// + private void PanelObject_DragDrop(object sender, DragEventArgs e) + { + switch (e.Data?.GetData(DataFormats.Text)?.ToString()) { - InitializeComponent(); + case "labelSimpleObject": + _truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White); + break; + + case "labelModifiedObject": + _truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black, + checkBoxAwning.Checked, checkBoxTent.Checked); + break; } + + DrawObject(); + + } + + /// + /// Панель отправка цвета при нажатии на Panel + /// + /// + /// + private void Panel_MouseDown(object? sender, MouseEventArgs e) + { + (sender as Control)?.DoDragDrop((sender as Control)?.BackColor!, DragDropEffects.Move | DragDropEffects.Copy); } } -- 2.25.1 From d551b7b9e03133d052ba11817d45667e9e4b057f Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Mon, 8 Apr 2024 02:06:54 +0400 Subject: [PATCH 3/9] =?UTF-8?q?=D0=9D=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=B5=D1=82=20=D1=81=D0=BC=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=86=D0=B2=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormTruckCollection.Designer.cs | 15 +--- .../ProjectDumpTruck/FormTruckCollection.cs | 67 ++++----------- .../FormTruckConfig.Designer.cs | 25 +++--- .../ProjectDumpTruck/FormTruckConfig.cs | 78 +++++++++++++++++- .../ProjectDumpTruck/TruckDelegate.cs | 15 ++++ .../Visualizers/attribcache140.bin | Bin 0 -> 8431 bytes 6 files changed, 120 insertions(+), 80 deletions(-) create mode 100644 ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs create mode 100644 ProjectDumpTruck/Visual Studio 2022/Visualizers/attribcache140.bin diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.Designer.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.Designer.cs index e25c083..e889451 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.Designer.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.Designer.cs @@ -39,7 +39,6 @@ labelCollectionName = new Label(); buttonCompanyCreate = new Button(); panelCompanyTools = new Panel(); - buttonAddDumpTruck = new Button(); buttonAddTruck = new Button(); buttonRemoveTruck = new Button(); buttonRefresh = new Button(); @@ -158,7 +157,6 @@ // // panelCompanyTools // - panelCompanyTools.Controls.Add(buttonAddDumpTruck); panelCompanyTools.Controls.Add(buttonAddTruck); panelCompanyTools.Controls.Add(buttonRemoveTruck); panelCompanyTools.Controls.Add(buttonRefresh); @@ -171,19 +169,9 @@ panelCompanyTools.Size = new Size(232, 300); panelCompanyTools.TabIndex = 10; // - // buttonAddDumpTruck - // - buttonAddDumpTruck.Location = new Point(3, 51); - buttonAddDumpTruck.Name = "buttonAddDumpTruck"; - buttonAddDumpTruck.Size = new Size(226, 48); - buttonAddDumpTruck.TabIndex = 2; - buttonAddDumpTruck.Text = "Добавление самосвала"; - buttonAddDumpTruck.UseVisualStyleBackColor = true; - buttonAddDumpTruck.Click += ButtonAddDumpTruck_Click; - // // buttonAddTruck // - buttonAddTruck.Location = new Point(3, 3); + buttonAddTruck.Location = new Point(3, 35); buttonAddTruck.Name = "buttonAddTruck"; buttonAddTruck.Size = new Size(226, 42); buttonAddTruck.TabIndex = 0; @@ -271,7 +259,6 @@ #endregion private GroupBox groupBoxTools; - private Button buttonAddDumpTruck; private Button buttonGoToCheck; private Button buttonRemoveTruck; private MaskedTextBox maskedTextBoxPosition; diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.cs index ec67500..1e74ff6 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckCollection.cs @@ -50,31 +50,29 @@ public partial class FormTruckCollection : Form } /// - /// Создание объекта класса-перемещения + /// Добавление грузовика /// - /// Тип создаваемого объекта - private void CreateObject(string type) + /// + /// + private void ButtonAddTruck_Click(object sender, EventArgs e) { - if (_company == null) + FormTruckConfig form = new FormTruckConfig(); + form.Show(); + form.AddEvent(SetTruck); + } + + /// + /// Добавление грузовика в автомобиль + /// + /// + private void SetTruck(DrawningTruck truck) + { + if (_company == null || truck == null) { return; } - Random random = new(); - DrawningTruck drawningTruck; - switch (type) - { - case nameof(DrawningTruck): - drawningTruck = new DrawningTruck(random.Next(100, 300), - random.Next(1000, 3000), GetColor(random)); - break; - case nameof(DrawningDumpTruck): - drawningTruck = new DrawningDumpTruck(random.Next(100, 300), random.Next(1000, 3000), - GetColor(random), GetColor(random), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2))); - break; - default: - return; - } - if (_company + drawningTruck != -1) + + if (_company + truck != -1) { MessageBox.Show("Объект добавлен"); pictureBox.Image = _company.Show(); @@ -84,35 +82,6 @@ public partial class FormTruckCollection : Form MessageBox.Show("Не удалось добавить объект"); } } - /// - /// Получение цвета - /// - /// Генератор случайных чисел - /// - private static Color GetColor(Random random) - { - Color color = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)); - ColorDialog dialog = new(); - if (dialog.ShowDialog() == DialogResult.OK) - { - color = dialog.Color; - } - return color; - } - - /// - /// Добавление грузовика - /// - /// - /// - private void ButtonAddTruck_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningTruck)); - - /// - /// Добавление самосвала - /// - /// - /// - private void ButtonAddDumpTruck_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningDumpTruck)); /// /// Удаление объекта diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs index 98d6bc5..b71b8b1 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs @@ -29,7 +29,6 @@ private void InitializeComponent() { groupBoxConfig = new GroupBox(); - panel1 = new Panel(); groupBoxColours = new GroupBox(); panelPurple = new Panel(); panelWhite = new Panel(); @@ -65,7 +64,6 @@ // // groupBoxConfig // - groupBoxConfig.Controls.Add(panel1); groupBoxConfig.Controls.Add(groupBoxColours); groupBoxConfig.Controls.Add(checkBoxTent); groupBoxConfig.Controls.Add(checkBoxAwning); @@ -83,13 +81,6 @@ groupBoxConfig.TabStop = false; groupBoxConfig.Text = "Параметры"; // - // panel1 - // - panel1.Location = new Point(621, 33); - panel1.Name = "panel1"; - panel1.Size = new Size(224, 125); - panel1.TabIndex = 4; - // // groupBoxColours // groupBoxColours.Controls.Add(panelPurple); @@ -281,9 +272,9 @@ // // pictureBoxObject // - pictureBoxObject.Location = new Point(3, 76); + pictureBoxObject.Location = new Point(3, 61); pictureBoxObject.Name = "pictureBoxObject"; - pictureBoxObject.Size = new Size(226, 114); + pictureBoxObject.Size = new Size(226, 143); pictureBoxObject.TabIndex = 1; pictureBoxObject.TabStop = false; // @@ -295,6 +286,7 @@ buttonAdd.TabIndex = 2; buttonAdd.Text = "Добавить"; buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; // // buttonCancel // @@ -321,28 +313,32 @@ // labelAdditionalColor // labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; - labelAdditionalColor.Location = new Point(122, 14); + labelAdditionalColor.Location = new Point(122, 9); labelAdditionalColor.Name = "labelAdditionalColor"; labelAdditionalColor.Size = new Size(102, 44); labelAdditionalColor.TabIndex = 3; labelAdditionalColor.Text = "Доп. цвет"; labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter; + labelAdditionalColor.DragDrop += LabelAdditionalColor_DragDrop; + labelAdditionalColor.DragEnter += LabelAdditionalColor_DragEnter; // // labelBaseColor // labelBaseColor.BorderStyle = BorderStyle.FixedSingle; - labelBaseColor.Location = new Point(6, 14); + labelBaseColor.Location = new Point(14, 9); labelBaseColor.Name = "labelBaseColor"; labelBaseColor.Size = new Size(102, 44); labelBaseColor.TabIndex = 2; labelBaseColor.Text = "Цвет"; labelBaseColor.TextAlign = ContentAlignment.MiddleCenter; + labelBaseColor.DragDrop += LabelBaseColor_DragDrop; + labelBaseColor.DragEnter += LabelBaseColor_DragEnter; // // FormTruckConfig // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(857, 266); + ClientSize = new Size(863, 266); Controls.Add(panelObject); Controls.Add(buttonCancel); Controls.Add(buttonAdd); @@ -384,7 +380,6 @@ private PictureBox pictureBoxObject; private Button buttonAdd; private Button buttonCancel; - private Panel panel1; private Panel panelObject; private Label labelBaseColor; private Label labelAdditionalColor; diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index 745bf71..7eb92fe 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ProjectDumpTruck.Drawnings; +using ProjectDumpTruck.Entities; namespace ProjectDumpTruck; @@ -20,13 +21,19 @@ public partial class FormTruckConfig : Form /// /// Объект - прорисовка грузовика /// - private DrawningTruck _truck = null; + private DrawningTruck? _truck; + + /// + /// Событие для передачи объекта + /// + private event TruckDelegate? TruckDelegate; /// /// Конструктор /// public FormTruckConfig() { + InitializeComponent(); panelRed.MouseDown += Panel_MouseDown; @@ -39,6 +46,16 @@ public partial class FormTruckConfig : Form panelGray.MouseDown += Panel_MouseDown; panelBlack.MouseDown += Panel_MouseDown; panelWhite.MouseDown += Panel_MouseDown; + + + + buttonCancel.Click += (sender, e) => Close(); + + } + + public void AddEvent(TruckDelegate truckDelegate) + { + TruckDelegate += truckDelegate; } /// @@ -49,7 +66,7 @@ public partial class FormTruckConfig : Form Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height); Graphics gr = Graphics.FromImage(bmp); _truck?.SetPictureSize(pictureBoxObject.Width, pictureBoxObject.Height); - _truck?.SetPosition(5, 5); + _truck?.SetPosition(30, 30); _truck?.DrawTransport(gr); pictureBoxObject.Image = bmp; } @@ -107,4 +124,61 @@ public partial class FormTruckConfig : Form { (sender as Control)?.DoDragDrop((sender as Control)?.BackColor!, DragDropEffects.Move | DragDropEffects.Copy); } + + /// + /// Передача объекта + /// + /// + /// + private void ButtonAdd_Click(object sender, EventArgs e) + { + if (_truck != null) + { + TruckDelegate?.Invoke(_truck); + Close(); + } + } + + private void LabelBaseColor_DragDrop(object sender, DragEventArgs e) + { + if (_truck == null) return; + _truck.EntityTruck?.SetBodyColor((Color)e.Data.GetData(typeof(Color))); + DrawObject(); + } + + private void LabelBaseColor_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(typeof(Color))) + { + e.Effect = DragDropEffects.Copy; + } + else + { + e.Effect = DragDropEffects.None; + } + } + + private void LabelAdditionalColor_DragDrop(object sender, DragEventArgs e) + { + if (_truck?.EntityTruck is EntityDumpTruck _dumpTruck) + { + _dumpTruck.SetAdditionalColor((Color)e.Data.GetData(typeof(Color))); + } + DrawObject(); + } + + private void LabelAdditionalColor_DragEnter(object sender, DragEventArgs e) + { + if (_truck is DrawningDumpTruck) + { + if (e.Data.GetDataPresent(typeof(Color))) + { + e.Effect = DragDropEffects.Copy; + } + else + { + e.Effect = DragDropEffects.None; + } + } + } } diff --git a/ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs b/ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs new file mode 100644 index 0000000..002ab38 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs @@ -0,0 +1,15 @@ +using ProjectDumpTruck.Drawnings; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectDumpTruck; + +/// +/// Делегат переадчи объекта класса-прорисовки +/// +/// +public delegate void TruckDelegate(DrawningTruck truck); + diff --git a/ProjectDumpTruck/Visual Studio 2022/Visualizers/attribcache140.bin b/ProjectDumpTruck/Visual Studio 2022/Visualizers/attribcache140.bin new file mode 100644 index 0000000000000000000000000000000000000000..42108e49c35aebac07ed56656bbbe38182f4c42e GIT binary patch literal 8431 zcmeHMOLODK5e8FEYHOXxzP#Dp*a^IG96z+oO7><`TT!JbJ|x6^nII*t4JQV{AvF;Q zFatmmO|x>!A^#yiAeU6-mZN`#@BS(29?XCM2!gbimD850#KEAur|0XQ?w-bL>YF!u z_rHI$@a4@n{{92y+Ss#PX4C$)|9)W{-~aHNf80~Przpz%`qcBuxL9^=n^-<|9j|yu z9Kxto)T&M}Cd};HM)n;N_{_9-)OOIfsr3<=cHML0?DrpkFnlt6 zI^5kIJb7$>V7>wy`*@4W>TbX+GR#(4?4Ia!K(?X$-Pkhf0vgzo@~SXacRC?T;ca8q zG{;2USNZQ;tp&C%XXJQ3M@Hq{95Vxq$EF>Swn^FNdrINHG5d4|lRM5|=R4|*zr*oo zp{N@|RQ1Xt6Lc7*@IzxZYY@*fM?|dmGeK0EOu$eklI7Chlk{u^F6a2U#IL7_o3QU( zhKDJJR^YdW9n%?+T($=h8}-k|#HUs+xm2q{FTfQJrk@bz<}yf-DquF(uepIU$ff^< z&_{Cysi($q#mQUxK5*}g&jQZ1}E(W%=dw3)F&c5eg;eV&-(2W_y`L+k%2& z2I()Wx$W$6ODqw~9GK=`O9S78?i@N zQ_#!whp&0qK$?c>K&8T7T40+Ncpxnx(2W`5)f4Ir+)MAk^vJc{uYPy@@833`6nH|A zsZdbBRboP*x^b*&tN$0ckNkdJ>^+$byNr-UDiBu_ym_21zuZn%z=-*+g(4nXhE@V}^w?kA;kzM46v_Eag{NO6Z3id!j;Hi0X}En@~(QkP+6!3RQo6ibC# zZI_~6Kz@p(r*ri={yrDvQQnJ_*H+WZYOo^cJK%$GPq3lb`EY3o^@I-mGhB`j=IRll zqca~T!qEyyBB7wjcbA$r5ZXW~yk&&Stk)`yB=Unon+r%=T6f`saliuaEZcn7g`H1G zKk~I7abHsxZ;Cyw2n1#DHs;!1@gVShykdgubjcOR7Jmh@QTQPJG-KWD6MGfkFIO*k z1Z6&}Q|EjYue?lxmgzOiXT&-`aIZLu33XNeits{N48<0HwOW;q3EdS50N7p3hJF zy~SbDpqYw3j1C}VWb1_G(jlXRRbfVU?2SJn)ypwOnar%Q@1a1#a617(@4#&t-#h)ZvGYgYjH# zm{+(A{P5?n;K_zwbm+hns~6A#EwPcO6n>83>;gM?STvxh*rNbH+f&dH%V*f*9K_^7 znANa*7)pYHkP(H&1ZbfQ$Z0VNwIvB^lUzpeNsa;3fI(}|kKV+e#j3IomGp6FJ;&C& zYhW)L{StK+L&5*H40Z{vfu_x{ZMlFk6asMYdJ+h5m zn^fFOsK>sm?`JCupB|v+zp&RssQzs_i3(-ZF)<-jjS9zvs%_?u&;efPkYhNk8euSj#JgCD5BHt$vPV10G z@uBT{6h9cDI*ADgrxZRT!6!g`CC7XgFE3&;b{EZ#4|2trzd;SeXZZ;UM{||`^4nxM z65Gf=lTnXP*Vh}COJX)IB5;Rx;Cul0AZb`3p H7qI*fF$W@c literal 0 HcmV?d00001 -- 2.25.1 From c578482ba0499b9b4eae1d7c4b026eb66d650cf1 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Wed, 17 Apr 2024 12:30:47 +0400 Subject: [PATCH 4/9] e boi it works --- .../FormTruckConfig.Designer.cs | 7 ++++-- .../ProjectDumpTruck/FormTruckConfig.cs | 23 ++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs index b71b8b1..01dd0c4 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.Designer.cs @@ -183,6 +183,7 @@ // // panelRed // + panelRed.AllowDrop = true; panelRed.BackColor = Color.Red; panelRed.Location = new Point(15, 26); panelRed.Name = "panelRed"; @@ -312,6 +313,7 @@ // // labelAdditionalColor // + labelAdditionalColor.AllowDrop = true; labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; labelAdditionalColor.Location = new Point(122, 9); labelAdditionalColor.Name = "labelAdditionalColor"; @@ -324,6 +326,7 @@ // // labelBaseColor // + labelBaseColor.AllowDrop = true; labelBaseColor.BorderStyle = BorderStyle.FixedSingle; labelBaseColor.Location = new Point(14, 9); labelBaseColor.Name = "labelBaseColor"; @@ -331,8 +334,8 @@ labelBaseColor.TabIndex = 2; labelBaseColor.Text = "Цвет"; labelBaseColor.TextAlign = ContentAlignment.MiddleCenter; - labelBaseColor.DragDrop += LabelBaseColor_DragDrop; - labelBaseColor.DragEnter += LabelBaseColor_DragEnter; + labelBaseColor.DragDrop += LabelBodyColor_DragDrop; + labelBaseColor.DragEnter += LabelBodyColor_DragEnter; // // FormTruckConfig // diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index 7eb92fe..7fb8495 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -47,7 +47,7 @@ public partial class FormTruckConfig : Form panelBlack.MouseDown += Panel_MouseDown; panelWhite.MouseDown += Panel_MouseDown; - + buttonCancel.Click += (sender, e) => Close(); @@ -139,23 +139,20 @@ public partial class FormTruckConfig : Form } } - private void LabelBaseColor_DragDrop(object sender, DragEventArgs e) + /// + /// Действия при приеме перетаскиваемой информации(Основной цвет) + /// + /// + /// + private void LabelBodyColor_DragDrop(object sender, DragEventArgs e) { - if (_truck == null) return; - _truck.EntityTruck?.SetBodyColor((Color)e.Data.GetData(typeof(Color))); + _truck?.EntityTruck?.SetBodyColor((Color)e.Data?.GetData(typeof(Color))); DrawObject(); } - private void LabelBaseColor_DragEnter(object sender, DragEventArgs e) + private void LabelBodyColor_DragEnter(object sender, DragEventArgs e) { - if (e.Data.GetDataPresent(typeof(Color))) - { - e.Effect = DragDropEffects.Copy; - } - else - { - e.Effect = DragDropEffects.None; - } + e.Effect = e.Data?.GetDataPresent(typeof(Color)) ?? false ? DragDropEffects.Copy : DragDropEffects.None; } private void LabelAdditionalColor_DragDrop(object sender, DragEventArgs e) -- 2.25.1 From b2a1cd88091ccf83cebb68262e7ffe35934cdc48 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Fri, 19 Apr 2024 23:05:31 +0400 Subject: [PATCH 5/9] done. --- ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index 7fb8495..efc3ebe 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -26,7 +26,7 @@ public partial class FormTruckConfig : Form /// /// Событие для передачи объекта /// - private event TruckDelegate? TruckDelegate; + private event Action? TruckDelegate; /// /// Конструктор @@ -53,7 +53,7 @@ public partial class FormTruckConfig : Form } - public void AddEvent(TruckDelegate truckDelegate) + public void AddEvent(Action truckDelegate) { TruckDelegate += truckDelegate; } @@ -73,7 +73,7 @@ public partial class FormTruckConfig : Form /// - /// Передаем информацию при нажатии на Label + /// Передаем информацию при нажатии на Label(Объект) /// /// /// @@ -83,7 +83,7 @@ public partial class FormTruckConfig : Form } /// - /// Проверка получаемой информации(ее типа на соответствие требуемому) + /// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому) /// /// /// @@ -178,4 +178,5 @@ public partial class FormTruckConfig : Form } } } + } -- 2.25.1 From 5e702200a21e4b9d0b0797b844a36a15286ddf96 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Thu, 2 May 2024 14:09:49 +0400 Subject: [PATCH 6/9] =?UTF-8?q?=D0=BF=D1=89=D0=B2=20=D0=B8=D0=B4=D1=83?= =?UTF-8?q?=D1=8B=D1=8B=20=D1=8C=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectDumpTruck/FormTruckConfig.cs | 100 ++++++++++++------ 1 file changed, 70 insertions(+), 30 deletions(-) diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index efc3ebe..b7c1561 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -72,47 +72,87 @@ public partial class FormTruckConfig : Form } - /// - /// Передаем информацию при нажатии на Label(Объект) - /// - /// - /// + ///// + ///// Передаем информацию при нажатии на Label(Объект) + ///// + ///// + ///// + //private void LabelObject_MouseDown(object sender, MouseEventArgs e) + //{ + // (sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy); + //} + + ///// + ///// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому) + ///// + ///// + ///// + //private void PanelObject_DragEnter(object sender, DragEventArgs e) + //{ + // e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None; + //} + + ///// + ///// Действия при приеме перетаскиваемой информации + ///// + ///// + ///// + //private void PanelObject_DragDrop(object sender, DragEventArgs e) + //{ + // switch (e.Data?.GetData(DataFormats.Text)?.ToString()) + // { + // case "labelSimpleObject": + // _truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White); + // break; + + // case "labelModifiedObject": + // _truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black, + // checkBoxAwning.Checked, checkBoxTent.Checked); + // break; + // } + + // DrawObject(); + + //} private void LabelObject_MouseDown(object sender, MouseEventArgs e) { - (sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy); + Label? label = sender as Label; + if (label?.Name == "labelSimpleObject") + { + label?.DoDragDrop(new DrawningTruck((int)numericUpDownSpeed.Value, + (double)numericUpDownWeight.Value, Color.White), DragDropEffects.Copy); + } + else + { + label?.DoDragDrop(new DrawningDumpTruck((int)numericUpDownSpeed.Value, + (double)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxAwning.Checked, checkBoxTent.Checked), DragDropEffects.Copy); + } } - /// - /// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому) - /// - /// - /// - private void PanelObject_DragEnter(object sender, DragEventArgs e) - { - e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None; - } - - /// - /// Действия при приеме перетаскиваемой информации - /// - /// - /// private void PanelObject_DragDrop(object sender, DragEventArgs e) { - switch (e.Data?.GetData(DataFormats.Text)?.ToString()) + if ((DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)) != null) { - case "labelSimpleObject": - _truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White); - break; - - case "labelModifiedObject": - _truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black, - checkBoxAwning.Checked, checkBoxTent.Checked); - break; + _truck = (DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)); + } + else if ((DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)) != null) + { + _truck = (DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)); } DrawObject(); + } + private void PanelObject_DragEnter(object sender, DragEventArgs e) + { + if ((e.Data.GetDataPresent(typeof(DrawningTruck))) || e.Data.GetDataPresent(typeof(DrawningDumpTruck))) + { + e.Effect = DragDropEffects.Copy; + } + else + { + e.Effect = DragDropEffects.None; + } } /// -- 2.25.1 From d802aa0ec6fb185105c3a75f108ef1bab97efdf3 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Thu, 2 May 2024 14:12:07 +0400 Subject: [PATCH 7/9] evjkz. --- .../ProjectDumpTruck/FormTruckConfig.cs | 141 +++++++++--------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index b7c1561..372b970 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -72,88 +72,89 @@ public partial class FormTruckConfig : Form } - ///// - ///// Передаем информацию при нажатии на Label(Объект) - ///// - ///// - ///// - //private void LabelObject_MouseDown(object sender, MouseEventArgs e) - //{ - // (sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy); - //} - - ///// - ///// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому) - ///// - ///// - ///// - //private void PanelObject_DragEnter(object sender, DragEventArgs e) - //{ - // e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None; - //} - - ///// - ///// Действия при приеме перетаскиваемой информации - ///// - ///// - ///// - //private void PanelObject_DragDrop(object sender, DragEventArgs e) - //{ - // switch (e.Data?.GetData(DataFormats.Text)?.ToString()) - // { - // case "labelSimpleObject": - // _truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White); - // break; - - // case "labelModifiedObject": - // _truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black, - // checkBoxAwning.Checked, checkBoxTent.Checked); - // break; - // } - - // DrawObject(); - - //} + /// + /// Передаем информацию при нажатии на Label(Объект) + /// + /// + /// private void LabelObject_MouseDown(object sender, MouseEventArgs e) { - Label? label = sender as Label; - if (label?.Name == "labelSimpleObject") - { - label?.DoDragDrop(new DrawningTruck((int)numericUpDownSpeed.Value, - (double)numericUpDownWeight.Value, Color.White), DragDropEffects.Copy); - } - else - { - label?.DoDragDrop(new DrawningDumpTruck((int)numericUpDownSpeed.Value, - (double)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxAwning.Checked, checkBoxTent.Checked), DragDropEffects.Copy); - } + (sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy); } + /// + /// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому) + /// + /// + /// + private void PanelObject_DragEnter(object sender, DragEventArgs e) + { + e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None; + } + + /// + /// Действия при приеме перетаскиваемой информации + /// + /// + /// private void PanelObject_DragDrop(object sender, DragEventArgs e) { - if ((DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)) != null) + switch (e.Data?.GetData(DataFormats.Text)?.ToString()) { - _truck = (DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)); - } - else if ((DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)) != null) - { - _truck = (DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)); + case "labelSimpleObject": + _truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White); + break; + + case "labelModifiedObject": + _truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black, + checkBoxAwning.Checked, checkBoxTent.Checked); + break; } DrawObject(); - } - private void PanelObject_DragEnter(object sender, DragEventArgs e) - { - if ((e.Data.GetDataPresent(typeof(DrawningTruck))) || e.Data.GetDataPresent(typeof(DrawningDumpTruck))) - { - e.Effect = DragDropEffects.Copy; - } - else - { - e.Effect = DragDropEffects.None; - } } + //допка + //private void LabelObject_MouseDown(object sender, MouseEventArgs e) + //{ + // Label? label = sender as Label; + // if (label?.Name == "labelSimpleObject") + // { + // label?.DoDragDrop(new DrawningTruck((int)numericUpDownSpeed.Value, + // (double)numericUpDownWeight.Value, Color.White), DragDropEffects.Copy); + // } + // else + // { + // label?.DoDragDrop(new DrawningDumpTruck((int)numericUpDownSpeed.Value, + // (double)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxAwning.Checked, checkBoxTent.Checked), DragDropEffects.Copy); + // } + //} + + //private void PanelObject_DragDrop(object sender, DragEventArgs e) + //{ + // if ((DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)) != null) + // { + // _truck = (DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)); + // } + // else if ((DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)) != null) + // { + // _truck = (DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)); + // } + + // DrawObject(); + //} + + //private void PanelObject_DragEnter(object sender, DragEventArgs e) + //{ + // if ((e.Data.GetDataPresent(typeof(DrawningTruck))) || e.Data.GetDataPresent(typeof(DrawningDumpTruck))) + // { + // e.Effect = DragDropEffects.Copy; + // } + // else + // { + // e.Effect = DragDropEffects.None; + // } + //} /// /// Панель отправка цвета при нажатии на Panel -- 2.25.1 From 8bab8db58ce2f8ba7176bcf6a3346cc712cc3aa7 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Fri, 3 May 2024 12:01:42 +0400 Subject: [PATCH 8/9] gjxnb dct --- .../ProjectDumpTruck/TruckDelegate.cs | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs diff --git a/ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs b/ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs deleted file mode 100644 index 002ab38..0000000 --- a/ProjectDumpTruck/ProjectDumpTruck/TruckDelegate.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ProjectDumpTruck.Drawnings; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProjectDumpTruck; - -/// -/// Делегат переадчи объекта класса-прорисовки -/// -/// -public delegate void TruckDelegate(DrawningTruck truck); - -- 2.25.1 From fef842950eef4d07ddf9233b821ba52d1b4f1477 Mon Sep 17 00:00:00 2001 From: Baryshev Dmitry Date: Wed, 15 May 2024 15:23:27 +0400 Subject: [PATCH 9/9] e boi --- .../ProjectDumpTruck/FormTruckConfig.cs | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs index 372b970..803f5e4 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTruckConfig.cs @@ -114,47 +114,7 @@ public partial class FormTruckConfig : Form DrawObject(); } - //допка - //private void LabelObject_MouseDown(object sender, MouseEventArgs e) - //{ - // Label? label = sender as Label; - // if (label?.Name == "labelSimpleObject") - // { - // label?.DoDragDrop(new DrawningTruck((int)numericUpDownSpeed.Value, - // (double)numericUpDownWeight.Value, Color.White), DragDropEffects.Copy); - // } - // else - // { - // label?.DoDragDrop(new DrawningDumpTruck((int)numericUpDownSpeed.Value, - // (double)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxAwning.Checked, checkBoxTent.Checked), DragDropEffects.Copy); - // } - //} - - //private void PanelObject_DragDrop(object sender, DragEventArgs e) - //{ - // if ((DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)) != null) - // { - // _truck = (DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)); - // } - // else if ((DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)) != null) - // { - // _truck = (DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)); - // } - - // DrawObject(); - //} - - //private void PanelObject_DragEnter(object sender, DragEventArgs e) - //{ - // if ((e.Data.GetDataPresent(typeof(DrawningTruck))) || e.Data.GetDataPresent(typeof(DrawningDumpTruck))) - // { - // e.Effect = DragDropEffects.Copy; - // } - // else - // { - // e.Effect = DragDropEffects.None; - // } - //} + /// /// Панель отправка цвета при нажатии на Panel -- 2.25.1