diff --git a/WarmlyLocomotive/Delegate.cs b/WarmlyLocomotive/Delegate.cs
new file mode 100644
index 0000000..650fe3a
--- /dev/null
+++ b/WarmlyLocomotive/Delegate.cs
@@ -0,0 +1,13 @@
+using WarmlyLocomotive.DrawningObjects;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+namespace WarmlyLocomotive
+{
+ ///
+ /// Делегат для передачи объекта
+ ///
+ public delegate void WarmlyLocomotiveDelegate(DrawningWarmlyLocomotive warmlylocomotive);
+}
diff --git a/WarmlyLocomotive/FormWarmlyLocomotiveConfig.Designer.cs b/WarmlyLocomotive/FormWarmlyLocomotiveConfig.Designer.cs
index d322743..9f1309f 100644
--- a/WarmlyLocomotive/FormWarmlyLocomotiveConfig.Designer.cs
+++ b/WarmlyLocomotive/FormWarmlyLocomotiveConfig.Designer.cs
@@ -77,6 +77,8 @@
groupBoxOptions.TabIndex = 0;
groupBoxOptions.TabStop = false;
groupBoxOptions.Text = "Параметры";
+ groupBoxOptions.DragDrop += PanelObject_DragDrop;
+ groupBoxOptions.DragEnter += PanelObject_DragEnter;
//
// labelSimpleObject
//
@@ -124,7 +126,7 @@
panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(32, 31);
panelYellow.TabIndex = 1;
- panelYellow.MouseDown += LabelObject_MouseDown;
+ panelYellow.MouseDown += PanelColor_MouseDown;
//
// panelPurple
//
@@ -133,7 +135,7 @@
panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(32, 31);
panelPurple.TabIndex = 1;
- panelPurple.MouseDown += LabelObject_MouseDown;
+ panelPurple.MouseDown += PanelColor_MouseDown;
//
// panelBlue
//
@@ -142,7 +144,7 @@
panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(32, 31);
panelBlue.TabIndex = 1;
- panelBlue.MouseDown += LabelObject_MouseDown;
+ panelBlue.MouseDown += PanelColor_MouseDown;
//
// panelBlack
//
@@ -151,7 +153,7 @@
panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(32, 31);
panelBlack.TabIndex = 1;
- panelBlack.MouseDown += LabelObject_MouseDown;
+ panelBlack.MouseDown += PanelColor_MouseDown;
//
// panelGray
//
@@ -160,7 +162,7 @@
panelGray.Name = "panelGray";
panelGray.Size = new Size(32, 29);
panelGray.TabIndex = 1;
- panelGray.MouseDown += LabelObject_MouseDown;
+ panelGray.MouseDown += PanelColor_MouseDown;
//
// panelGreen
//
@@ -169,7 +171,7 @@
panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(32, 31);
panelGreen.TabIndex = 1;
- panelGreen.MouseDown += LabelObject_MouseDown;
+ panelGreen.MouseDown += PanelColor_MouseDown;
//
// panelWhite
//
@@ -178,7 +180,7 @@
panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(32, 31);
panelWhite.TabIndex = 1;
- panelWhite.MouseDown += LabelObject_MouseDown;
+ panelWhite.MouseDown += PanelColor_MouseDown;
//
// panelRed
//
@@ -187,7 +189,7 @@
panelRed.Name = "panelRed";
panelRed.Size = new Size(32, 31);
panelRed.TabIndex = 0;
- panelRed.MouseDown += LabelObject_MouseDown;
+ panelRed.MouseDown += PanelColor_MouseDown;
//
// checkBoxLuggage
//
@@ -279,6 +281,7 @@
buttonCancel.TabIndex = 5;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
+ buttonCancel.Click += buttonCancel_Click;
//
// buttonOk
//
@@ -301,6 +304,7 @@
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
labelAdditionalColor.DragDrop += labelAdditionalColor_DragDrop;
labelAdditionalColor.DragEnter += labelAdditionalColor_DragEnter;
+ labelAdditionalColor.MouseDown += LabelObject_MouseDown;
//
// labelMainColor
//
@@ -313,6 +317,7 @@
labelMainColor.TextAlign = ContentAlignment.MiddleCenter;
labelMainColor.DragDrop += labelMainColor_DragDrop;
labelMainColor.DragEnter += labelMainColor_DragEnter;
+ labelMainColor.MouseDown += LabelObject_MouseDown;
//
// FormWarmlyLocomotiveConfig
//
diff --git a/WarmlyLocomotive/FormWarmlyLocomotiveConfig.cs b/WarmlyLocomotive/FormWarmlyLocomotiveConfig.cs
index 54e64f5..05cd127 100644
--- a/WarmlyLocomotive/FormWarmlyLocomotiveConfig.cs
+++ b/WarmlyLocomotive/FormWarmlyLocomotiveConfig.cs
@@ -48,22 +48,24 @@ namespace WarmlyLocomotive
///
/// Конструктор
///
- public FormWarmlyLocomotiveConfig()
+ public FormWarmlyLocomotiveConfig(int pictureWidth, int pictureHeight)
{
InitializeComponent();
- panelBlack.MouseDown += PanelColor;
- panelPurple.MouseDown += PanelColor;
- panelGray.MouseDown += PanelColor;
- panelGreen.MouseDown += PanelColor;
- panelRed.MouseDown += PanelColor;
- panelWhite.MouseDown += PanelColor;
- panelYellow.MouseDown += PanelColor;
- panelBlue.MouseDown += PanelColor;
+ _pictureWidth = pictureWidth;
+ _pictureHeight = pictureHeight;
+ panelBlack.MouseDown += PanelColor_MouseDown;
+ panelPurple.MouseDown += PanelColor_MouseDown;
+ panelGray.MouseDown += PanelColor_MouseDown;
+ panelGreen.MouseDown += PanelColor_MouseDown;
+ panelRed.MouseDown += PanelColor_MouseDown;
+ panelWhite.MouseDown += PanelColor_MouseDown;
+ panelYellow.MouseDown += PanelColor_MouseDown;
+ panelBlue.MouseDown += PanelColor_MouseDown;
buttonCancel.Click += (s, e) => Close();
}
///
- /// Отрисовать машину
+ /// Отрисовать тепловоз
///
private void DrawCar()
{
@@ -193,5 +195,9 @@ namespace WarmlyLocomotive
{
}
+
+ private void buttonCancel_Click(object sender, EventArgs e)
+ {
+ }
}
}
diff --git a/WarmlyLocomotive/Program.cs b/WarmlyLocomotive/Program.cs
index fc272d5..063fbae 100644
--- a/WarmlyLocomotive/Program.cs
+++ b/WarmlyLocomotive/Program.cs
@@ -12,7 +12,6 @@ namespace WarmlyLocomotive
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new FormWarmlyLocomotiveCollection());
- Application.Run(new WarmlyLocomotiveForm());
}
}
}
\ No newline at end of file