diff --git a/Traktor/Traktor/DrawField.Designer.cs b/Traktor/Traktor/DrawField.Designer.cs
new file mode 100644
index 0000000..d9f7264
--- /dev/null
+++ b/Traktor/Traktor/DrawField.Designer.cs
@@ -0,0 +1,176 @@
+namespace Traktor
+{
+ partial class DrawField
+ {
+ ///
+ /// 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()
+ {
+ this.pictureBoxTraktor = new System.Windows.Forms.PictureBox();
+ this.statusStrip = new System.Windows.Forms.StatusStrip();
+ this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel();
+ this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel();
+ this.toolStripStatusLabelBodyColor = new System.Windows.Forms.ToolStripStatusLabel();
+ this.buttonCreate = new System.Windows.Forms.Button();
+ this.buttonLEFT = new System.Windows.Forms.Button();
+ this.buttonRIGHT = new System.Windows.Forms.Button();
+ this.buttonDOWN = new System.Windows.Forms.Button();
+ this.buttonUP = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTraktor)).BeginInit();
+ this.statusStrip.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pictureBoxTraktor
+ //
+ this.pictureBoxTraktor.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pictureBoxTraktor.Location = new System.Drawing.Point(0, 0);
+ this.pictureBoxTraktor.Name = "pictureBoxTraktor";
+ this.pictureBoxTraktor.Size = new System.Drawing.Size(800, 450);
+ this.pictureBoxTraktor.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBoxTraktor.TabIndex = 0;
+ this.pictureBoxTraktor.TabStop = false;
+ this.pictureBoxTraktor.Resize += new System.EventHandler(this.PictureBoxTraktor_Resize);
+ //
+ // statusStrip
+ //
+ this.statusStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
+ this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabelSpeed,
+ this.toolStripStatusLabelWeight,
+ this.toolStripStatusLabelBodyColor});
+ this.statusStrip.Location = new System.Drawing.Point(0, 424);
+ this.statusStrip.Name = "statusStrip";
+ this.statusStrip.Size = new System.Drawing.Size(800, 26);
+ this.statusStrip.TabIndex = 1;
+ //
+ // toolStripStatusLabelSpeed
+ //
+ this.toolStripStatusLabelSpeed.Name = "toolStripStatusLabelSpeed";
+ this.toolStripStatusLabelSpeed.Size = new System.Drawing.Size(80, 20);
+ this.toolStripStatusLabelSpeed.Text = "Скорость: ";
+ //
+ // toolStripStatusLabelWeight
+ //
+ this.toolStripStatusLabelWeight.Name = "toolStripStatusLabelWeight";
+ this.toolStripStatusLabelWeight.Size = new System.Drawing.Size(40, 20);
+ this.toolStripStatusLabelWeight.Text = "Вес: ";
+ //
+ // toolStripStatusLabelBodyColor
+ //
+ this.toolStripStatusLabelBodyColor.Name = "toolStripStatusLabelBodyColor";
+ this.toolStripStatusLabelBodyColor.Size = new System.Drawing.Size(95, 20);
+ this.toolStripStatusLabelBodyColor.Text = "Цвет кузова:";
+ //
+ // buttonCreate
+ //
+ this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.buttonCreate.Location = new System.Drawing.Point(29, 362);
+ this.buttonCreate.Name = "buttonCreate";
+ this.buttonCreate.Size = new System.Drawing.Size(94, 29);
+ this.buttonCreate.TabIndex = 2;
+ this.buttonCreate.Text = "Создать";
+ this.buttonCreate.UseVisualStyleBackColor = true;
+ this.buttonCreate.Click += new System.EventHandler(this.ButtonCreate_Click);
+ //
+ // buttonLEFT
+ //
+ this.buttonLEFT.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonLEFT.BackgroundImage = global::Traktor.Properties.Resources.arrowLeft;
+ this.buttonLEFT.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonLEFT.Location = new System.Drawing.Point(673, 361);
+ this.buttonLEFT.Name = "buttonLEFT";
+ this.buttonLEFT.Size = new System.Drawing.Size(30, 30);
+ this.buttonLEFT.TabIndex = 3;
+ this.buttonLEFT.UseVisualStyleBackColor = true;
+ //
+ // buttonRIGHT
+ //
+ this.buttonRIGHT.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonRIGHT.BackgroundImage = global::Traktor.Properties.Resources.arrowRight;
+ this.buttonRIGHT.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonRIGHT.Location = new System.Drawing.Point(745, 361);
+ this.buttonRIGHT.Name = "buttonRIGHT";
+ this.buttonRIGHT.Size = new System.Drawing.Size(30, 30);
+ this.buttonRIGHT.TabIndex = 4;
+ this.buttonRIGHT.UseVisualStyleBackColor = true;
+ //
+ // buttonDOWN
+ //
+ this.buttonDOWN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonDOWN.BackgroundImage = global::Traktor.Properties.Resources.arrowDown;
+ this.buttonDOWN.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonDOWN.Location = new System.Drawing.Point(709, 379);
+ this.buttonDOWN.Name = "buttonDOWN";
+ this.buttonDOWN.Size = new System.Drawing.Size(30, 30);
+ this.buttonDOWN.TabIndex = 5;
+ this.buttonDOWN.UseVisualStyleBackColor = true;
+ //
+ // buttonUP
+ //
+ this.buttonUP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonUP.BackgroundImage = global::Traktor.Properties.Resources.arrowUp;
+ this.buttonUP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonUP.Location = new System.Drawing.Point(709, 343);
+ this.buttonUP.Name = "buttonUP";
+ this.buttonUP.Size = new System.Drawing.Size(30, 30);
+ this.buttonUP.TabIndex = 6;
+ this.buttonUP.UseVisualStyleBackColor = true;
+ //
+ // DrawField
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.statusStrip);
+ this.Controls.Add(this.buttonUP);
+ this.Controls.Add(this.buttonDOWN);
+ this.Controls.Add(this.buttonRIGHT);
+ this.Controls.Add(this.buttonLEFT);
+ this.Controls.Add(this.buttonCreate);
+ this.Controls.Add(this.pictureBoxTraktor);
+ this.Name = "DrawField";
+ this.Text = "Трактор";
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTraktor)).EndInit();
+ this.statusStrip.ResumeLayout(false);
+ this.statusStrip.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private PictureBox pictureBoxTraktor;
+ private StatusStrip statusStrip;
+ private ToolStripStatusLabel toolStripStatusLabelSpeed;
+ private ToolStripStatusLabel toolStripStatusLabelWeight;
+ private ToolStripStatusLabel toolStripStatusLabelBodyColor;
+ private Button buttonCreate;
+ private Button buttonLEFT;
+ private Button buttonRIGHT;
+ private Button buttonDOWN;
+ private Button buttonUP;
+ }
+}
\ No newline at end of file
diff --git a/Traktor/Traktor/DrawField.cs b/Traktor/Traktor/DrawField.cs
new file mode 100644
index 0000000..0b29dc8
--- /dev/null
+++ b/Traktor/Traktor/DrawField.cs
@@ -0,0 +1,40 @@
+namespace Traktor
+{
+ public partial class DrawField : Form
+ {
+ private TraktorDraw _Traktor;
+
+ public DrawField()
+ {
+ InitializeComponent();
+ }
+
+ //
+ private void Draw()
+ {
+ Bitmap bmp = new(pictureBoxTraktor.Width, pictureBoxTraktor.Height);
+ Graphics gr = Graphics.FromImage(bmp);
+ _Traktor?.DrawEntity(gr);
+ pictureBoxTraktor.Image = bmp;
+ }
+
+ //
+ private void ButtonCreate_Click(object sender, EventArgs e)
+ {
+ Random random = new Random();
+ _Traktor = new TraktorDraw();
+ _Traktor.Init(random.Next(10, 70), random.Next(2500, 7000), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)));
+ _Traktor.SetPosition(random.Next(10, 50), random.Next(10, 50), pictureBoxTraktor.Width, pictureBoxTraktor.Height);
+ toolStripStatusLabelSpeed.Text = $": {_Traktor.Traktor.Speed}";
+ toolStripStatusLabelWeight.Text = $": {_Traktor.Traktor.Weight}";
+ toolStripStatusLabelBodyColor.Text = $" : {_Traktor.Traktor.BodyColor.Name}";
+ Draw();
+ }
+
+ private void PictureBoxTraktor_Resize(object sender, EventArgs e)
+ {
+ _Traktor?.ChangeBorders(pictureBoxTraktor.Width, pictureBoxTraktor.Height);
+ Draw();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Traktor/Traktor/DrawField.resx b/Traktor/Traktor/DrawField.resx
new file mode 100644
index 0000000..2c0949d
--- /dev/null
+++ b/Traktor/Traktor/DrawField.resx
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/Traktor/Traktor/Form1.Designer.cs b/Traktor/Traktor/Form1.Designer.cs
deleted file mode 100644
index 552ebe5..0000000
--- a/Traktor/Traktor/Form1.Designer.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace Traktor
-{
- partial class Form1
- {
- ///
- /// 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()
- {
- this.components = new System.ComponentModel.Container();
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(800, 450);
- this.Text = "Form1";
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Traktor/Traktor/Form1.cs b/Traktor/Traktor/Form1.cs
deleted file mode 100644
index fb1db22..0000000
--- a/Traktor/Traktor/Form1.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Traktor
-{
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/Traktor/Traktor/Program.cs b/Traktor/Traktor/Program.cs
index 6bdd61c..c7b1b20 100644
--- a/Traktor/Traktor/Program.cs
+++ b/Traktor/Traktor/Program.cs
@@ -11,7 +11,7 @@ namespace Traktor
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
- Application.Run(new Form1());
+ Application.Run(new DrawField());
}
}
}
\ No newline at end of file
diff --git a/Traktor/Traktor/Properties/Resources.Designer.cs b/Traktor/Traktor/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..f6f63c8
--- /dev/null
+++ b/Traktor/Traktor/Properties/Resources.Designer.cs
@@ -0,0 +1,114 @@
+//------------------------------------------------------------------------------
+//
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
+//
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
+//
+//------------------------------------------------------------------------------
+
+namespace Traktor.Properties {
+ using System;
+
+
+ ///
+ /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
+ ///
+ // Этот класс создан автоматически классом StronglyTypedResourceBuilder
+ // с помощью такого средства, как ResGen или Visual Studio.
+ // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
+ // с параметром /str или перестройте свой проект VS.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Traktor.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Перезаписывает свойство CurrentUICulture текущего потока для всех
+ /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowDown {
+ get {
+ object obj = ResourceManager.GetObject("arrowDown", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowLeft {
+ get {
+ object obj = ResourceManager.GetObject("arrowLeft", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowRight {
+ get {
+ object obj = ResourceManager.GetObject("arrowRight", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap arrowUp {
+ get {
+ object obj = ResourceManager.GetObject("arrowUp", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap kisspng_computer_icons_arrow_encapsulated_postscript_left_arrow_5ac00b2487fba8_612718301522535204557 {
+ get {
+ object obj = ResourceManager.GetObject("kisspng-computer-icons-arrow-encapsulated-postscript-left-arrow-5ac00b2487fba8.61" +
+ "2718301522535204557", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/Traktor/Traktor/Form1.resx b/Traktor/Traktor/Properties/Resources.resx
similarity index 78%
rename from Traktor/Traktor/Form1.resx
rename to Traktor/Traktor/Properties/Resources.resx
index 1af7de1..b0b0fbb 100644
--- a/Traktor/Traktor/Form1.resx
+++ b/Traktor/Traktor/Properties/Resources.resx
@@ -117,4 +117,20 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ ..\Resources\kisspng-computer-icons-arrow-encapsulated-postscript-left-arrow-5ac00b2487fba8.612718301522535204557.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrowUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/Traktor/Traktor/Resources/arrowDown.png b/Traktor/Traktor/Resources/arrowDown.png
new file mode 100644
index 0000000..56c7aaf
Binary files /dev/null and b/Traktor/Traktor/Resources/arrowDown.png differ
diff --git a/Traktor/Traktor/Resources/arrowLeft.png b/Traktor/Traktor/Resources/arrowLeft.png
new file mode 100644
index 0000000..55b0ae9
Binary files /dev/null and b/Traktor/Traktor/Resources/arrowLeft.png differ
diff --git a/Traktor/Traktor/Resources/arrowRight.png b/Traktor/Traktor/Resources/arrowRight.png
new file mode 100644
index 0000000..9a3a8c1
Binary files /dev/null and b/Traktor/Traktor/Resources/arrowRight.png differ
diff --git a/Traktor/Traktor/Resources/arrowUp.png b/Traktor/Traktor/Resources/arrowUp.png
new file mode 100644
index 0000000..3a10dd6
Binary files /dev/null and b/Traktor/Traktor/Resources/arrowUp.png differ
diff --git a/Traktor/Traktor/Resources/kisspng-computer-icons-arrow-encapsulated-postscript-left-arrow-5ac00b2487fba8.612718301522535204557.png b/Traktor/Traktor/Resources/kisspng-computer-icons-arrow-encapsulated-postscript-left-arrow-5ac00b2487fba8.612718301522535204557.png
new file mode 100644
index 0000000..9a3a8c1
Binary files /dev/null and b/Traktor/Traktor/Resources/kisspng-computer-icons-arrow-encapsulated-postscript-left-arrow-5ac00b2487fba8.612718301522535204557.png differ
diff --git a/Traktor/Traktor/Traktor.csproj b/Traktor/Traktor/Traktor.csproj
index b57c89e..13ee123 100644
--- a/Traktor/Traktor/Traktor.csproj
+++ b/Traktor/Traktor/Traktor.csproj
@@ -8,4 +8,19 @@
enable
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
\ No newline at end of file
diff --git a/Traktor/Traktor/TraktorDraw.cs b/Traktor/Traktor/TraktorDraw.cs
index a3f3497..22b86c4 100644
--- a/Traktor/Traktor/TraktorDraw.cs
+++ b/Traktor/Traktor/TraktorDraw.cs
@@ -34,7 +34,7 @@ namespace Traktor
//Установка позиции сущности
public void SetPosition(int x, int y, int widgh, int height)
- {
+ {//сделать проверку!!!!!
startPosX = x;
startPosY = y;
pictureHeight = height;
@@ -80,6 +80,13 @@ namespace Traktor
//Отрисовка сущности
public void DrawEntity(Graphics g)
{
+ if (startPosX < 0 || startPosY < 0 || !pictureHeight.HasValue || !pictureWidth.HasValue)
+ {
+ return;
+ }
+
+ Pen pen = new Pen(Color.Blue);
+
}
@@ -104,4 +111,4 @@ namespace Traktor
}
}
}
-}
+}
\ No newline at end of file