From 2d6108c489835e630dee8ebe48329c5ee40c79ea Mon Sep 17 00:00:00 2001 From: Arklightning Date: Mon, 7 Nov 2022 23:45:44 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=86=D0=B2=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Trolleybus/Trolleybus/DrawingTrolleybus.cs | 3 +- .../FormMapWithSetTrolleybus.Designer.cs | 136 +++++++++--------- .../Trolleybus/MapWithSetTrolleybusGeneric.cs | 2 +- 3 files changed, 72 insertions(+), 69 deletions(-) diff --git a/Trolleybus/Trolleybus/DrawingTrolleybus.cs b/Trolleybus/Trolleybus/DrawingTrolleybus.cs index 38e8d7a..38c81ca 100644 --- a/Trolleybus/Trolleybus/DrawingTrolleybus.cs +++ b/Trolleybus/Trolleybus/DrawingTrolleybus.cs @@ -136,8 +136,9 @@ namespace Trolleybus } Pen pen = new Pen(Color.Black); Brush brBlue = new SolidBrush(Color.LightBlue); - Brush dBlue = new SolidBrush(Color.DarkBlue); Brush bWhite = new SolidBrush(Color.White); + Brush br = new SolidBrush(Trolleybus?.BodyColor ?? Color.Black); + g.FillRectangle(br, _startPosX, _startPosY, 200, 50); g.DrawRectangle(pen, _startPosX, _startPosY, 200, 50); g.DrawRectangle(pen, _startPosX + 100, _startPosY + 10, 20, 40); Pen WinBlue = new Pen(Color.Blue); diff --git a/Trolleybus/Trolleybus/FormMapWithSetTrolleybus.Designer.cs b/Trolleybus/Trolleybus/FormMapWithSetTrolleybus.Designer.cs index e0c5493..7d03b3a 100644 --- a/Trolleybus/Trolleybus/FormMapWithSetTrolleybus.Designer.cs +++ b/Trolleybus/Trolleybus/FormMapWithSetTrolleybus.Designer.cs @@ -29,6 +29,12 @@ private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.buttonDeleteMap = new System.Windows.Forms.Button(); + this.listBoxMaps = new System.Windows.Forms.ListBox(); + this.buttonAddMap = new System.Windows.Forms.Button(); + this.textBoxNewMapName = new System.Windows.Forms.TextBox(); + this.comboBoxSelectorMap = new System.Windows.Forms.ComboBox(); this.buttonLeft = new System.Windows.Forms.Button(); this.buttonRight = new System.Windows.Forms.Button(); this.buttonDown = new System.Windows.Forms.Button(); @@ -38,16 +44,10 @@ this.buttonRemoveTrolleybus = new System.Windows.Forms.Button(); this.maskedTextBoxPosition = new System.Windows.Forms.MaskedTextBox(); this.buttonAddTrolleybus = new System.Windows.Forms.Button(); - this.comboBoxSelectorMap = new System.Windows.Forms.ComboBox(); this.pictureBox = new System.Windows.Forms.PictureBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.textBoxNewMapName = new System.Windows.Forms.TextBox(); - this.buttonAddMap = new System.Windows.Forms.Button(); - this.listBoxMaps = new System.Windows.Forms.ListBox(); - this.buttonDeleteMap = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // // groupBox1 @@ -70,6 +70,67 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = "Инструменты"; // + // groupBox2 + // + this.groupBox2.Controls.Add(this.buttonDeleteMap); + this.groupBox2.Controls.Add(this.listBoxMaps); + this.groupBox2.Controls.Add(this.buttonAddMap); + this.groupBox2.Controls.Add(this.textBoxNewMapName); + this.groupBox2.Controls.Add(this.comboBoxSelectorMap); + this.groupBox2.Location = new System.Drawing.Point(6, 19); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(181, 287); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Карты"; + // + // buttonDeleteMap + // + this.buttonDeleteMap.Location = new System.Drawing.Point(7, 204); + this.buttonDeleteMap.Name = "buttonDeleteMap"; + this.buttonDeleteMap.Size = new System.Drawing.Size(168, 23); + this.buttonDeleteMap.TabIndex = 4; + this.buttonDeleteMap.Text = "Удалить Карту"; + this.buttonDeleteMap.UseVisualStyleBackColor = true; + this.buttonDeleteMap.Click += new System.EventHandler(this.ButtonDeleteMap_Click); + // + // listBoxMaps + // + this.listBoxMaps.FormattingEnabled = true; + this.listBoxMaps.Location = new System.Drawing.Point(7, 102); + this.listBoxMaps.Name = "listBoxMaps"; + this.listBoxMaps.Size = new System.Drawing.Size(168, 95); + this.listBoxMaps.TabIndex = 3; + // + // buttonAddMap + // + this.buttonAddMap.Location = new System.Drawing.Point(7, 72); + this.buttonAddMap.Name = "buttonAddMap"; + this.buttonAddMap.Size = new System.Drawing.Size(168, 23); + this.buttonAddMap.TabIndex = 2; + this.buttonAddMap.Text = "Добавить Карту"; + this.buttonAddMap.UseVisualStyleBackColor = true; + this.buttonAddMap.Click += new System.EventHandler(this.ButtonAddMap_Click); + // + // textBoxNewMapName + // + this.textBoxNewMapName.Location = new System.Drawing.Point(7, 18); + this.textBoxNewMapName.Name = "textBoxNewMapName"; + this.textBoxNewMapName.Size = new System.Drawing.Size(168, 20); + this.textBoxNewMapName.TabIndex = 1; + // + // comboBoxSelectorMap + // + this.comboBoxSelectorMap.FormattingEnabled = true; + this.comboBoxSelectorMap.Items.AddRange(new object[] { + "Простая карта", + "Сложная карта"}); + this.comboBoxSelectorMap.Location = new System.Drawing.Point(6, 44); + this.comboBoxSelectorMap.Name = "comboBoxSelectorMap"; + this.comboBoxSelectorMap.Size = new System.Drawing.Size(169, 21); + this.comboBoxSelectorMap.TabIndex = 0; + this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged); + // // buttonLeft // this.buttonLeft.BackgroundImage = global::Trolleybus.Properties.Resources.left30; @@ -161,18 +222,6 @@ this.buttonAddTrolleybus.UseVisualStyleBackColor = true; this.buttonAddTrolleybus.Click += new System.EventHandler(this.ButtonAddTrolleybus_Click); // - // comboBoxSelectorMap - // - this.comboBoxSelectorMap.FormattingEnabled = true; - this.comboBoxSelectorMap.Items.AddRange(new object[] { - "Простая карта", - "Сложная карта"}); - this.comboBoxSelectorMap.Location = new System.Drawing.Point(6, 44); - this.comboBoxSelectorMap.Name = "comboBoxSelectorMap"; - this.comboBoxSelectorMap.Size = new System.Drawing.Size(169, 21); - this.comboBoxSelectorMap.TabIndex = 0; - this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged); - // // pictureBox // this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; @@ -182,53 +231,6 @@ this.pictureBox.TabIndex = 1; this.pictureBox.TabStop = false; // - // groupBox2 - // - this.groupBox2.Controls.Add(this.buttonDeleteMap); - this.groupBox2.Controls.Add(this.listBoxMaps); - this.groupBox2.Controls.Add(this.buttonAddMap); - this.groupBox2.Controls.Add(this.textBoxNewMapName); - this.groupBox2.Controls.Add(this.comboBoxSelectorMap); - this.groupBox2.Location = new System.Drawing.Point(6, 19); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(181, 287); - this.groupBox2.TabIndex = 2; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Карты"; - // - // textBoxNewMapName - // - this.textBoxNewMapName.Location = new System.Drawing.Point(7, 18); - this.textBoxNewMapName.Name = "textBoxNewMapName"; - this.textBoxNewMapName.Size = new System.Drawing.Size(168, 20); - this.textBoxNewMapName.TabIndex = 1; - // - // buttonAddMap - // - this.buttonAddMap.Location = new System.Drawing.Point(7, 72); - this.buttonAddMap.Name = "buttonAddMap"; - this.buttonAddMap.Size = new System.Drawing.Size(168, 23); - this.buttonAddMap.TabIndex = 2; - this.buttonAddMap.Text = "Добавить Карту"; - this.buttonAddMap.UseVisualStyleBackColor = true; - // - // listBoxMaps - // - this.listBoxMaps.FormattingEnabled = true; - this.listBoxMaps.Location = new System.Drawing.Point(7, 102); - this.listBoxMaps.Name = "listBoxMaps"; - this.listBoxMaps.Size = new System.Drawing.Size(168, 95); - this.listBoxMaps.TabIndex = 3; - // - // buttonDeleteMap - // - this.buttonDeleteMap.Location = new System.Drawing.Point(7, 204); - this.buttonDeleteMap.Name = "buttonDeleteMap"; - this.buttonDeleteMap.Size = new System.Drawing.Size(168, 23); - this.buttonDeleteMap.TabIndex = 4; - this.buttonDeleteMap.Text = "Удалить Карту"; - this.buttonDeleteMap.UseVisualStyleBackColor = true; - // // FormMapWithSetTrolleybus // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -240,9 +242,9 @@ this.Text = "FormMapWithSetTrolleybus"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); } diff --git a/Trolleybus/Trolleybus/MapWithSetTrolleybusGeneric.cs b/Trolleybus/Trolleybus/MapWithSetTrolleybusGeneric.cs index 80c8143..f9d11bb 100644 --- a/Trolleybus/Trolleybus/MapWithSetTrolleybusGeneric.cs +++ b/Trolleybus/Trolleybus/MapWithSetTrolleybusGeneric.cs @@ -169,7 +169,7 @@ namespace Trolleybus { if (countInRow >= _pictureWidth / (_placeSizeWidth + 30)) { - xForLocomotive = _pictureWidth - _placeSizeWidth + 40; + xForLocomotive = _pictureWidth - 2 * _placeSizeWidth + 60; yForLocomotive += _placeSizeHeight; countInRow = 0; }