From 7a2cc9457800ba4e2963713673ed775a61a8c1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=97=D0=B0=D1=85=D0=B0=D1=80=D0=BE=D0=B2?= Date: Mon, 21 Nov 2022 21:03:07 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=203=D0=9B=D0=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Traktor/FormMapWithSetTraktor.Designer.cs | 16 ++++++++-------- Traktor/Traktor/FormMapWithSetTraktor.cs | 10 +++------- Traktor/Traktor/MapWithSetTraktorGeneric.cs | 10 +++++----- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Traktor/Traktor/FormMapWithSetTraktor.Designer.cs b/Traktor/Traktor/FormMapWithSetTraktor.Designer.cs index 62be93d..c89431b 100644 --- a/Traktor/Traktor/FormMapWithSetTraktor.Designer.cs +++ b/Traktor/Traktor/FormMapWithSetTraktor.Designer.cs @@ -57,9 +57,9 @@ this.groupBox1.Controls.Add(this.buttonAddTraktor); this.groupBox1.Controls.Add(this.comboBoxSelectorMap); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Right; - this.groupBox1.Location = new System.Drawing.Point(540, 0); + this.groupBox1.Location = new System.Drawing.Point(629, 0); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(250, 423); + this.groupBox1.Size = new System.Drawing.Size(250, 514); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "Инструменты"; @@ -69,7 +69,7 @@ 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(95, 371); + this.buttonRight.Location = new System.Drawing.Point(95, 462); this.buttonRight.Name = "buttonRight"; this.buttonRight.Size = new System.Drawing.Size(40, 40); this.buttonRight.TabIndex = 10; @@ -81,7 +81,7 @@ 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(55, 371); + this.buttonDown.Location = new System.Drawing.Point(55, 462); this.buttonDown.Name = "buttonDown"; this.buttonDown.Size = new System.Drawing.Size(40, 40); this.buttonDown.TabIndex = 9; @@ -93,7 +93,7 @@ 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(15, 371); + this.buttonLeft.Location = new System.Drawing.Point(15, 462); this.buttonLeft.Name = "buttonLeft"; this.buttonLeft.Size = new System.Drawing.Size(40, 40); this.buttonLeft.TabIndex = 8; @@ -105,7 +105,7 @@ 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(55, 331); + this.buttonUp.Location = new System.Drawing.Point(55, 422); this.buttonUp.Name = "buttonUp"; this.buttonUp.Size = new System.Drawing.Size(40, 40); this.buttonUp.TabIndex = 7; @@ -176,7 +176,7 @@ this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox.Location = new System.Drawing.Point(0, 0); this.pictureBox.Name = "pictureBox"; - this.pictureBox.Size = new System.Drawing.Size(540, 423); + this.pictureBox.Size = new System.Drawing.Size(629, 514); this.pictureBox.TabIndex = 1; this.pictureBox.TabStop = false; // @@ -184,7 +184,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(790, 423); + this.ClientSize = new System.Drawing.Size(879, 514); this.Controls.Add(this.pictureBox); this.Controls.Add(this.groupBox1); this.Name = "FormMapWithSetTraktor"; diff --git a/Traktor/Traktor/FormMapWithSetTraktor.cs b/Traktor/Traktor/FormMapWithSetTraktor.cs index d00464d..a580e12 100644 --- a/Traktor/Traktor/FormMapWithSetTraktor.cs +++ b/Traktor/Traktor/FormMapWithSetTraktor.cs @@ -14,15 +14,11 @@ namespace Traktor { private MapWithSetTraktorGeneric _mapTraktorCollectionGeneric; - //DrawingBus SelectedBus { get; private set; } - public FormMapWithSetTraktor() { InitializeComponent(); AbstractMap map = new SimpleMap(); - _mapTraktorCollectionGeneric = new MapWithSetTraktorGeneric( - pictureBox.Width, pictureBox.Height, map); - + _mapTraktorCollectionGeneric = new MapWithSetTraktorGeneric(pictureBox.Width, pictureBox.Height, map); } private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) @@ -64,9 +60,9 @@ namespace Traktor return; } - DrawningObjectTraktor bus = new(form.SelectedTraktor); + DrawningObjectTraktor traktor = new(form.SelectedTraktor); - if (_mapTraktorCollectionGeneric + bus != -1) + if (_mapTraktorCollectionGeneric + traktor != -1) { MessageBox.Show("Объект добавлен"); pictureBox.Image = _mapTraktorCollectionGeneric.ShowSet(); diff --git a/Traktor/Traktor/MapWithSetTraktorGeneric.cs b/Traktor/Traktor/MapWithSetTraktorGeneric.cs index e6d5220..8476959 100644 --- a/Traktor/Traktor/MapWithSetTraktorGeneric.cs +++ b/Traktor/Traktor/MapWithSetTraktorGeneric.cs @@ -12,7 +12,7 @@ namespace Traktor { private readonly int _pictureWidth; private readonly int _pictureHeight; - private readonly int _placeSizeWidth = 180; + private readonly int _placeSizeWidth = 200; private readonly int _placeSizeHeight = 150; private readonly SetTraktorGeneric _setTraktors; private readonly U _map; @@ -51,10 +51,10 @@ namespace Traktor Shaking(); for (int i = 0; i < _setTraktors.Count; i++) { - var bus = _setTraktors.Get(i); - if (bus != null) + var traktor = _setTraktors.Get(i); + if (traktor != null) { - return _map.CreateMap(_pictureWidth, _pictureHeight, bus); + return _map.CreateMap(_pictureWidth, _pictureHeight, traktor); } } return new(_pictureWidth, _pictureHeight); @@ -121,7 +121,7 @@ namespace Traktor for (int i = _setTraktors.Count; i >= 0; i--) { _setTraktors.Get(i)?.SetObject( - _pictureWidth - _placeSizeWidth * curWidth - 20, + _placeSizeWidth * curWidth - 170, curHeight * _placeSizeHeight + 30, _pictureWidth, _pictureHeight); _setTraktors.Get(i)?.DrawningObject(g);