Исправления 3ЛР

This commit is contained in:
Владислав Захаров 2022-11-21 21:03:07 +04:00
parent 2670fb5696
commit 7a2cc94578
3 changed files with 16 additions and 20 deletions

View File

@ -57,9 +57,9 @@
this.groupBox1.Controls.Add(this.buttonAddTraktor); this.groupBox1.Controls.Add(this.buttonAddTraktor);
this.groupBox1.Controls.Add(this.comboBoxSelectorMap); this.groupBox1.Controls.Add(this.comboBoxSelectorMap);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Right; 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.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.TabIndex = 0;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "Инструменты"; 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.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.BackgroundImage = global::Traktor.Properties.Resources.arrowRight;
this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 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.Name = "buttonRight";
this.buttonRight.Size = new System.Drawing.Size(40, 40); this.buttonRight.Size = new System.Drawing.Size(40, 40);
this.buttonRight.TabIndex = 10; 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.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.BackgroundImage = global::Traktor.Properties.Resources.arrowDown;
this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 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.Name = "buttonDown";
this.buttonDown.Size = new System.Drawing.Size(40, 40); this.buttonDown.Size = new System.Drawing.Size(40, 40);
this.buttonDown.TabIndex = 9; 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.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.BackgroundImage = global::Traktor.Properties.Resources.arrowLeft;
this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 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.Name = "buttonLeft";
this.buttonLeft.Size = new System.Drawing.Size(40, 40); this.buttonLeft.Size = new System.Drawing.Size(40, 40);
this.buttonLeft.TabIndex = 8; 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.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.BackgroundImage = global::Traktor.Properties.Resources.arrowUp;
this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 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.Name = "buttonUp";
this.buttonUp.Size = new System.Drawing.Size(40, 40); this.buttonUp.Size = new System.Drawing.Size(40, 40);
this.buttonUp.TabIndex = 7; this.buttonUp.TabIndex = 7;
@ -176,7 +176,7 @@
this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox.Location = new System.Drawing.Point(0, 0); this.pictureBox.Location = new System.Drawing.Point(0, 0);
this.pictureBox.Name = "pictureBox"; 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.TabIndex = 1;
this.pictureBox.TabStop = false; this.pictureBox.TabStop = false;
// //
@ -184,7 +184,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.pictureBox);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Name = "FormMapWithSetTraktor"; this.Name = "FormMapWithSetTraktor";

View File

@ -14,15 +14,11 @@ namespace Traktor
{ {
private MapWithSetTraktorGeneric<DrawningObjectTraktor, AbstractMap> _mapTraktorCollectionGeneric; private MapWithSetTraktorGeneric<DrawningObjectTraktor, AbstractMap> _mapTraktorCollectionGeneric;
//DrawingBus SelectedBus { get; private set; }
public FormMapWithSetTraktor() public FormMapWithSetTraktor()
{ {
InitializeComponent(); InitializeComponent();
AbstractMap map = new SimpleMap(); AbstractMap map = new SimpleMap();
_mapTraktorCollectionGeneric = new MapWithSetTraktorGeneric<DrawningObjectTraktor, AbstractMap>( _mapTraktorCollectionGeneric = new MapWithSetTraktorGeneric<DrawningObjectTraktor, AbstractMap>(pictureBox.Width, pictureBox.Height, map);
pictureBox.Width, pictureBox.Height, map);
} }
private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e)
@ -64,9 +60,9 @@ namespace Traktor
return; return;
} }
DrawningObjectTraktor bus = new(form.SelectedTraktor); DrawningObjectTraktor traktor = new(form.SelectedTraktor);
if (_mapTraktorCollectionGeneric + bus != -1) if (_mapTraktorCollectionGeneric + traktor != -1)
{ {
MessageBox.Show("Объект добавлен"); MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapTraktorCollectionGeneric.ShowSet(); pictureBox.Image = _mapTraktorCollectionGeneric.ShowSet();

View File

@ -12,7 +12,7 @@ namespace Traktor
{ {
private readonly int _pictureWidth; private readonly int _pictureWidth;
private readonly int _pictureHeight; private readonly int _pictureHeight;
private readonly int _placeSizeWidth = 180; private readonly int _placeSizeWidth = 200;
private readonly int _placeSizeHeight = 150; private readonly int _placeSizeHeight = 150;
private readonly SetTraktorGeneric<T> _setTraktors; private readonly SetTraktorGeneric<T> _setTraktors;
private readonly U _map; private readonly U _map;
@ -51,10 +51,10 @@ namespace Traktor
Shaking(); Shaking();
for (int i = 0; i < _setTraktors.Count; i++) for (int i = 0; i < _setTraktors.Count; i++)
{ {
var bus = _setTraktors.Get(i); var traktor = _setTraktors.Get(i);
if (bus != null) if (traktor != null)
{ {
return _map.CreateMap(_pictureWidth, _pictureHeight, bus); return _map.CreateMap(_pictureWidth, _pictureHeight, traktor);
} }
} }
return new(_pictureWidth, _pictureHeight); return new(_pictureWidth, _pictureHeight);
@ -121,7 +121,7 @@ namespace Traktor
for (int i = _setTraktors.Count; i >= 0; i--) for (int i = _setTraktors.Count; i >= 0; i--)
{ {
_setTraktors.Get(i)?.SetObject( _setTraktors.Get(i)?.SetObject(
_pictureWidth - _placeSizeWidth * curWidth - 20, _placeSizeWidth * curWidth - 170,
curHeight * _placeSizeHeight + 30, _pictureWidth, _pictureHeight); curHeight * _placeSizeHeight + 30, _pictureWidth, _pictureHeight);
_setTraktors.Get(i)?.DrawningObject(g); _setTraktors.Get(i)?.DrawningObject(g);