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; + } + } /// /// Добавление карты ///