diff --git a/WarmlyShip/WarmlyShip/FormShipConfig.Designer.cs b/WarmlyShip/WarmlyShip/FormShipConfig.Designer.cs
index 5aaec59..33dd9bf 100644
--- a/WarmlyShip/WarmlyShip/FormShipConfig.Designer.cs
+++ b/WarmlyShip/WarmlyShip/FormShipConfig.Designer.cs
@@ -46,7 +46,7 @@
this.labelSpeed = new System.Windows.Forms.Label();
this.labelSimpleObject = new System.Windows.Forms.Label();
this.labelModifiedObject = new System.Windows.Forms.Label();
- this.panel1 = new System.Windows.Forms.Panel();
+ this.panelColor = new System.Windows.Forms.Panel();
this.pictureBoxObject = new System.Windows.Forms.PictureBox();
this.labelBodyColor = new System.Windows.Forms.Label();
this.labelAddColor = new System.Windows.Forms.Label();
@@ -56,7 +56,7 @@
this.groupBoxColor.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWeight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpeed)).BeginInit();
- this.panel1.SuspendLayout();
+ this.panelColor.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxObject)).BeginInit();
this.SuspendLayout();
//
@@ -102,6 +102,7 @@
this.panelRed.Name = "panelRed";
this.panelRed.Size = new System.Drawing.Size(50, 50);
this.panelRed.TabIndex = 1;
+ this.panelRed.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelColor_MouseDown);
//
// panelBlue
//
@@ -110,6 +111,7 @@
this.panelBlue.Name = "panelBlue";
this.panelBlue.Size = new System.Drawing.Size(50, 50);
this.panelBlue.TabIndex = 1;
+ this.panelBlue.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelColor_MouseDown);
//
// panelYellow
//
@@ -118,6 +120,7 @@
this.panelYellow.Name = "panelYellow";
this.panelYellow.Size = new System.Drawing.Size(50, 50);
this.panelYellow.TabIndex = 1;
+ this.panelYellow.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelColor_MouseDown);
//
// panelWhite
//
@@ -158,6 +161,7 @@
this.panelGreen.Name = "panelGreen";
this.panelGreen.Size = new System.Drawing.Size(50, 50);
this.panelGreen.TabIndex = 0;
+ this.panelGreen.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelColor_MouseDown);
//
// checkBoxSection
//
@@ -265,20 +269,20 @@
this.labelModifiedObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.labelModifiedObject.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LabelObject_MouseDown);
//
- // panel1
+ // panelColor
//
- this.panel1.AllowDrop = true;
- this.panel1.Controls.Add(this.button2);
- this.panel1.Controls.Add(this.button1);
- this.panel1.Controls.Add(this.labelAddColor);
- this.panel1.Controls.Add(this.labelBodyColor);
- this.panel1.Controls.Add(this.pictureBoxObject);
- this.panel1.Location = new System.Drawing.Point(625, 11);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(355, 351);
- this.panel1.TabIndex = 1;
- this.panel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragDrop);
- this.panel1.DragEnter += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragEnter);
+ this.panelColor.AllowDrop = true;
+ this.panelColor.Controls.Add(this.button2);
+ this.panelColor.Controls.Add(this.button1);
+ this.panelColor.Controls.Add(this.labelAddColor);
+ this.panelColor.Controls.Add(this.labelBodyColor);
+ this.panelColor.Controls.Add(this.pictureBoxObject);
+ this.panelColor.Location = new System.Drawing.Point(625, 11);
+ this.panelColor.Name = "panelColor";
+ this.panelColor.Size = new System.Drawing.Size(355, 351);
+ this.panelColor.TabIndex = 1;
+ this.panelColor.DragDrop += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragDrop);
+ this.panelColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragEnter);
//
// pictureBoxObject
//
@@ -333,7 +337,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(986, 369);
- this.Controls.Add(this.panel1);
+ this.Controls.Add(this.panelColor);
this.Controls.Add(this.groupBoxParameters);
this.Name = "FormShipConfig";
this.Text = "FormShipConfig";
@@ -342,7 +346,7 @@
this.groupBoxColor.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWeight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpeed)).EndInit();
- this.panel1.ResumeLayout(false);
+ this.panelColor.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxObject)).EndInit();
this.ResumeLayout(false);
@@ -368,7 +372,7 @@
private Label labelSpeed;
private Label labelModifiedObject;
private Label labelSimpleObject;
- private Panel panel1;
+ private Panel panelColor;
private Button button1;
private Label labelAddColor;
private Label labelBodyColor;
diff --git a/WarmlyShip/WarmlyShip/FormShipConfig.cs b/WarmlyShip/WarmlyShip/FormShipConfig.cs
index bc4e57f..0579d51 100644
--- a/WarmlyShip/WarmlyShip/FormShipConfig.cs
+++ b/WarmlyShip/WarmlyShip/FormShipConfig.cs
@@ -57,7 +57,7 @@ namespace WarmlyShip
/// Добавление события
///
/// Привязанный метод
- public void AddEvent(ShipDelegate ev)
+ internal void AddEvent(ShipDelegate ev)
{
if (EventAddShip == null)
{
@@ -118,6 +118,10 @@ namespace WarmlyShip
DrawShip();
}
// TODO Реализовать логику смены цветов: основного и дополнительного (для продвинутого объекта)
+ private void PanelColor_MouseDown(object sender, MouseEventArgs e)
+ {
+ (sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor, DragDropEffects.Move | DragDropEffects.Copy);
+ }
///
/// Добавление машины
///
diff --git a/WarmlyShip/WarmlyShip/ShipDelegate.cs b/WarmlyShip/WarmlyShip/ShipDelegate.cs
new file mode 100644
index 0000000..ad059b3
--- /dev/null
+++ b/WarmlyShip/WarmlyShip/ShipDelegate.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WarmlyShip.DrawingObjects;
+
+namespace WarmlyShip
+{
+ internal class ShipDelegate
+ {
+ ///
+ /// Делегат для передачи объекта-теплоход
+ ///
+ ///
+ public delegate void Action(DrawingWarmlyShip ship);
+ }
+}