From 9ab984f93dc03b0b49a2ffe333230952cacfa268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?10=D0=93=20=D0=95=D0=B3=D0=BE=D1=80=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sun, 6 Nov 2022 12:54:35 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormMapWithSetHoistingCrane.Designer.cs | 3 +++ .../FormMapWithSetHoistingCrane.cs | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs index 61c4991..11ed709 100644 --- a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs +++ b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs @@ -89,6 +89,7 @@ this.listBoxMaps.Name = "listBoxMaps"; this.listBoxMaps.Size = new System.Drawing.Size(199, 104); this.listBoxMaps.TabIndex = 4; + this.listBoxMaps.SelectedIndexChanged += new System.EventHandler(this.ListBoxMaps_SelectedIndexChanged); // // buttonAddMap // @@ -113,6 +114,8 @@ this.comboBoxSelectorMap.Name = "comboBoxSelectorMap"; this.comboBoxSelectorMap.Size = new System.Drawing.Size(200, 28); this.comboBoxSelectorMap.TabIndex = 0; + this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged); + // // textBoxNewMapName // diff --git a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs index 9063695..53c2d44 100644 --- a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs +++ b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs @@ -59,6 +59,29 @@ namespace HoistingCrane listBoxMaps.SelectedIndex = index; } } + private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) + { + AbstractMap map = null; + switch (comboBoxSelectorMap.Text) + { + case "Простая карта": + map = new SimpleMap(); + break; + case "Вторая карта": + map = new SecondMap(); + break; + + } + if (map != null) + { + _mapHoistingCraneCollectionGeneric = new MapWithSetHoistingCraneGeneric( + pictureBox.Width, pictureBox.Height, map); + } + else + { + _mapHoistingCraneCollectionGeneric = null; + } + } /// /// Добавление карты ///