From de5812d86cc5f374df4e69e1d05af962e9e9e570 Mon Sep 17 00:00:00 2001 From: platoff aeeee Date: Tue, 5 Dec 2023 19:35:57 +0400 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=205?= =?UTF-8?q?=20=D0=BB=D0=B0=D0=B1=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tank/Tank/Drawings/DrawingArmoredCar.cs | 4 ++-- Tank/Tank/FormArmoredCarCollection.cs | 2 +- Tank/Tank/FormTankConfig.Designer.cs | 18 ++++++++++-------- Tank/Tank/FormTankConfig.cs | 5 ++--- Tank/Tank/Generics/TanksGenericCollection.cs | 3 ++- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Tank/Tank/Drawings/DrawingArmoredCar.cs b/Tank/Tank/Drawings/DrawingArmoredCar.cs index 96b5092..b85a5d7 100644 --- a/Tank/Tank/Drawings/DrawingArmoredCar.cs +++ b/Tank/Tank/Drawings/DrawingArmoredCar.cs @@ -63,11 +63,11 @@ namespace Tank.DrawingObjects /// /// Ширина окна /// - private int _pictureWidth; + public int _pictureWidth; /// /// Высота окна /// - private int _pictureHeight; + public int _pictureHeight; /// /// Левая координата прорисовки автомобиля /// diff --git a/Tank/Tank/FormArmoredCarCollection.cs b/Tank/Tank/FormArmoredCarCollection.cs index 869e17f..f734bf9 100644 --- a/Tank/Tank/FormArmoredCarCollection.cs +++ b/Tank/Tank/FormArmoredCarCollection.cs @@ -72,8 +72,8 @@ namespace Tank return; } FormTankConfig form = new FormTankConfig(); - form.AddEvent(AddArmoredCar); form.Show(); + form.AddEvent(AddArmoredCar); } private void ButtonRemoveArmoredCar_Click(object sender, EventArgs e) diff --git a/Tank/Tank/FormTankConfig.Designer.cs b/Tank/Tank/FormTankConfig.Designer.cs index d854a83..b66d50c 100644 --- a/Tank/Tank/FormTankConfig.Designer.cs +++ b/Tank/Tank/FormTankConfig.Designer.cs @@ -309,18 +309,18 @@ // this.PanelObject.AllowDrop = true; this.PanelObject.Controls.Add(this.pictureBoxObject); - this.PanelObject.Location = new System.Drawing.Point(494, 123); + this.PanelObject.Location = new System.Drawing.Point(494, 137); this.PanelObject.Name = "PanelObject"; - this.PanelObject.Size = new System.Drawing.Size(279, 176); + this.PanelObject.Size = new System.Drawing.Size(294, 190); this.PanelObject.TabIndex = 11; this.PanelObject.DragDrop += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragDrop); this.PanelObject.DragEnter += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragEnter); // // pictureBoxObject // - this.pictureBoxObject.Location = new System.Drawing.Point(3, 26); + this.pictureBoxObject.Location = new System.Drawing.Point(6, 14); this.pictureBoxObject.Name = "pictureBoxObject"; - this.pictureBoxObject.Size = new System.Drawing.Size(248, 125); + this.pictureBoxObject.Size = new System.Drawing.Size(270, 157); this.pictureBoxObject.TabIndex = 10; this.pictureBoxObject.TabStop = false; // @@ -331,17 +331,18 @@ this.panelColor.Controls.Add(this.label_Color); this.panelColor.Location = new System.Drawing.Point(500, 52); this.panelColor.Name = "panelColor"; - this.panelColor.Size = new System.Drawing.Size(266, 65); + this.panelColor.Size = new System.Drawing.Size(288, 65); this.panelColor.TabIndex = 11; this.panelColor.DragDrop += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragDrop); this.panelColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.PanelObject_DragEnter); // // label_Additional_Color // + this.label_Additional_Color.AllowDrop = true; this.label_Additional_Color.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label_Additional_Color.Location = new System.Drawing.Point(145, 4); + this.label_Additional_Color.Location = new System.Drawing.Point(151, 4); this.label_Additional_Color.Name = "label_Additional_Color"; - this.label_Additional_Color.Size = new System.Drawing.Size(100, 47); + this.label_Additional_Color.Size = new System.Drawing.Size(111, 47); this.label_Additional_Color.TabIndex = 13; this.label_Additional_Color.Text = "Доп.цвет"; this.label_Additional_Color.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -350,10 +351,11 @@ // // label_Color // + this.label_Color.AllowDrop = true; this.label_Color.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.label_Color.Location = new System.Drawing.Point(14, 4); this.label_Color.Name = "label_Color"; - this.label_Color.Size = new System.Drawing.Size(102, 47); + this.label_Color.Size = new System.Drawing.Size(115, 47); this.label_Color.TabIndex = 12; this.label_Color.Text = "Цвет"; this.label_Color.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; diff --git a/Tank/Tank/FormTankConfig.cs b/Tank/Tank/FormTankConfig.cs index b54d1e6..0cd1931 100644 --- a/Tank/Tank/FormTankConfig.cs +++ b/Tank/Tank/FormTankConfig.cs @@ -76,13 +76,12 @@ namespace Tank { return; } - ((Label)sender).BackColor = (Color)e.Data.GetData(typeof(Color)); switch (((Label)sender).Name) { - case "labelColor": + case "label_Color": _Tank.Tank.setBodyColor((Color)e.Data.GetData(typeof(Color))); break; - case "labelAdditionalColor": + case "label_Additional_Color": if (!(_Tank is DrawingTank)) return; (_Tank.Tank as EntityTank).setAdditionalColor((Color)e.Data.GetData(typeof(Color))); diff --git a/Tank/Tank/Generics/TanksGenericCollection.cs b/Tank/Tank/Generics/TanksGenericCollection.cs index ff0838f..4ef4941 100644 --- a/Tank/Tank/Generics/TanksGenericCollection.cs +++ b/Tank/Tank/Generics/TanksGenericCollection.cs @@ -133,9 +133,10 @@ namespace Tank.Generics { if (tank != null) { + tank._pictureWidth = _pictureWidth; + tank._pictureHeight = _pictureHeight; tank.SetPosition((i % (_pictureWidth / _placeSizeWidth)) * _placeSizeWidth, (i / (_pictureWidth / _placeSizeWidth)) * _placeSizeHeight); - tank.DrawTransport(g); } i++;