Лабораторная работа №5
This commit is contained in:
parent
af782b1882
commit
d0592af58e
237
ProjectMonorail/FormMonorailCollection.Designer.cs
generated
237
ProjectMonorail/FormMonorailCollection.Designer.cs
generated
@ -29,6 +29,12 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
groupBoxTools = new GroupBox();
|
groupBoxTools = new GroupBox();
|
||||||
|
panelCompanyTools = new Panel();
|
||||||
|
buttonAddMonorail = new Button();
|
||||||
|
maskedTextBox = new MaskedTextBox();
|
||||||
|
buttonRefresh = new Button();
|
||||||
|
buttonRemoveMonorail = new Button();
|
||||||
|
buttonGoToCheck = new Button();
|
||||||
buttonCreateCompany = new Button();
|
buttonCreateCompany = new Button();
|
||||||
panelStorage = new Panel();
|
panelStorage = new Panel();
|
||||||
buttonCollectionDelete = new Button();
|
buttonCollectionDelete = new Button();
|
||||||
@ -38,19 +44,12 @@
|
|||||||
radioButtonMassive = new RadioButton();
|
radioButtonMassive = new RadioButton();
|
||||||
textBoxCollectionName = new TextBox();
|
textBoxCollectionName = new TextBox();
|
||||||
labelCollectionName = new Label();
|
labelCollectionName = new Label();
|
||||||
buttonRefresh = new Button();
|
|
||||||
buttonGoToCheck = new Button();
|
|
||||||
buttonRemoveMonorail = new Button();
|
|
||||||
maskedTextBox = new MaskedTextBox();
|
|
||||||
buttonAddModernMonorail = new Button();
|
|
||||||
buttonAddMonorail = new Button();
|
|
||||||
comboBoxSelectorCompany = new ComboBox();
|
comboBoxSelectorCompany = new ComboBox();
|
||||||
pictureBox = new PictureBox();
|
pictureBox = new PictureBox();
|
||||||
panelCompanyTools = new Panel();
|
|
||||||
groupBoxTools.SuspendLayout();
|
groupBoxTools.SuspendLayout();
|
||||||
|
panelCompanyTools.SuspendLayout();
|
||||||
panelStorage.SuspendLayout();
|
panelStorage.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit();
|
||||||
panelCompanyTools.SuspendLayout();
|
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBoxTools
|
// groupBoxTools
|
||||||
@ -60,20 +59,87 @@
|
|||||||
groupBoxTools.Controls.Add(panelStorage);
|
groupBoxTools.Controls.Add(panelStorage);
|
||||||
groupBoxTools.Controls.Add(comboBoxSelectorCompany);
|
groupBoxTools.Controls.Add(comboBoxSelectorCompany);
|
||||||
groupBoxTools.Dock = DockStyle.Right;
|
groupBoxTools.Dock = DockStyle.Right;
|
||||||
groupBoxTools.Location = new Point(1109, 0);
|
groupBoxTools.Location = new Point(970, 0);
|
||||||
groupBoxTools.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
groupBoxTools.Name = "groupBoxTools";
|
groupBoxTools.Name = "groupBoxTools";
|
||||||
groupBoxTools.Padding = new Padding(3, 4, 3, 4);
|
groupBoxTools.Size = new Size(241, 662);
|
||||||
groupBoxTools.Size = new Size(275, 883);
|
|
||||||
groupBoxTools.TabIndex = 0;
|
groupBoxTools.TabIndex = 0;
|
||||||
groupBoxTools.TabStop = false;
|
groupBoxTools.TabStop = false;
|
||||||
groupBoxTools.Text = "Инструменты";
|
groupBoxTools.Text = "Инструменты";
|
||||||
//
|
//
|
||||||
|
// panelCompanyTools
|
||||||
|
//
|
||||||
|
panelCompanyTools.Controls.Add(buttonAddMonorail);
|
||||||
|
panelCompanyTools.Controls.Add(maskedTextBox);
|
||||||
|
panelCompanyTools.Controls.Add(buttonRefresh);
|
||||||
|
panelCompanyTools.Controls.Add(buttonRemoveMonorail);
|
||||||
|
panelCompanyTools.Controls.Add(buttonGoToCheck);
|
||||||
|
panelCompanyTools.Dock = DockStyle.Bottom;
|
||||||
|
panelCompanyTools.Enabled = false;
|
||||||
|
panelCompanyTools.Location = new Point(3, 337);
|
||||||
|
panelCompanyTools.Margin = new Padding(3, 2, 3, 2);
|
||||||
|
panelCompanyTools.Name = "panelCompanyTools";
|
||||||
|
panelCompanyTools.Size = new Size(235, 322);
|
||||||
|
panelCompanyTools.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// buttonAddMonorail
|
||||||
|
//
|
||||||
|
buttonAddMonorail.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
buttonAddMonorail.Location = new Point(8, 32);
|
||||||
|
buttonAddMonorail.Name = "buttonAddMonorail";
|
||||||
|
buttonAddMonorail.Size = new Size(221, 48);
|
||||||
|
buttonAddMonorail.TabIndex = 1;
|
||||||
|
buttonAddMonorail.Text = "Добавление монорельса";
|
||||||
|
buttonAddMonorail.UseVisualStyleBackColor = true;
|
||||||
|
buttonAddMonorail.Click += ButtonAddMonorail_Click;
|
||||||
|
//
|
||||||
|
// maskedTextBox
|
||||||
|
//
|
||||||
|
maskedTextBox.Location = new Point(5, 130);
|
||||||
|
maskedTextBox.Mask = "00";
|
||||||
|
maskedTextBox.Name = "maskedTextBox";
|
||||||
|
maskedTextBox.Size = new Size(223, 23);
|
||||||
|
maskedTextBox.TabIndex = 3;
|
||||||
|
maskedTextBox.ValidatingType = typeof(int);
|
||||||
|
//
|
||||||
|
// buttonRefresh
|
||||||
|
//
|
||||||
|
buttonRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
buttonRefresh.Location = new Point(8, 267);
|
||||||
|
buttonRefresh.Name = "buttonRefresh";
|
||||||
|
buttonRefresh.Size = new Size(219, 48);
|
||||||
|
buttonRefresh.TabIndex = 6;
|
||||||
|
buttonRefresh.Text = "Обновить";
|
||||||
|
buttonRefresh.UseVisualStyleBackColor = true;
|
||||||
|
buttonRefresh.Click += ButtonRefresh_Click;
|
||||||
|
//
|
||||||
|
// buttonRemoveMonorail
|
||||||
|
//
|
||||||
|
buttonRemoveMonorail.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
buttonRemoveMonorail.Location = new Point(8, 159);
|
||||||
|
buttonRemoveMonorail.Name = "buttonRemoveMonorail";
|
||||||
|
buttonRemoveMonorail.Size = new Size(221, 48);
|
||||||
|
buttonRemoveMonorail.TabIndex = 4;
|
||||||
|
buttonRemoveMonorail.Text = "Удалить монорельс";
|
||||||
|
buttonRemoveMonorail.UseVisualStyleBackColor = true;
|
||||||
|
buttonRemoveMonorail.Click += buttonRemoveMonorail_Click;
|
||||||
|
//
|
||||||
|
// buttonGoToCheck
|
||||||
|
//
|
||||||
|
buttonGoToCheck.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
buttonGoToCheck.Location = new Point(8, 213);
|
||||||
|
buttonGoToCheck.Name = "buttonGoToCheck";
|
||||||
|
buttonGoToCheck.Size = new Size(220, 48);
|
||||||
|
buttonGoToCheck.TabIndex = 5;
|
||||||
|
buttonGoToCheck.Text = "Передать на тесты";
|
||||||
|
buttonGoToCheck.UseVisualStyleBackColor = true;
|
||||||
|
buttonGoToCheck.Click += ButtonGoToCheck_Click;
|
||||||
|
//
|
||||||
// buttonCreateCompany
|
// buttonCreateCompany
|
||||||
//
|
//
|
||||||
buttonCreateCompany.Location = new Point(7, 388);
|
buttonCreateCompany.Location = new Point(6, 291);
|
||||||
|
buttonCreateCompany.Margin = new Padding(3, 2, 3, 2);
|
||||||
buttonCreateCompany.Name = "buttonCreateCompany";
|
buttonCreateCompany.Name = "buttonCreateCompany";
|
||||||
buttonCreateCompany.Size = new Size(254, 29);
|
buttonCreateCompany.Size = new Size(222, 22);
|
||||||
buttonCreateCompany.TabIndex = 7;
|
buttonCreateCompany.TabIndex = 7;
|
||||||
buttonCreateCompany.Text = "Создать компанию";
|
buttonCreateCompany.Text = "Создать компанию";
|
||||||
buttonCreateCompany.UseVisualStyleBackColor = true;
|
buttonCreateCompany.UseVisualStyleBackColor = true;
|
||||||
@ -89,16 +155,18 @@
|
|||||||
panelStorage.Controls.Add(textBoxCollectionName);
|
panelStorage.Controls.Add(textBoxCollectionName);
|
||||||
panelStorage.Controls.Add(labelCollectionName);
|
panelStorage.Controls.Add(labelCollectionName);
|
||||||
panelStorage.Dock = DockStyle.Top;
|
panelStorage.Dock = DockStyle.Top;
|
||||||
panelStorage.Location = new Point(3, 24);
|
panelStorage.Location = new Point(3, 19);
|
||||||
|
panelStorage.Margin = new Padding(3, 2, 3, 2);
|
||||||
panelStorage.Name = "panelStorage";
|
panelStorage.Name = "panelStorage";
|
||||||
panelStorage.Size = new Size(269, 322);
|
panelStorage.Size = new Size(235, 242);
|
||||||
panelStorage.TabIndex = 7;
|
panelStorage.TabIndex = 7;
|
||||||
//
|
//
|
||||||
// buttonCollectionDelete
|
// buttonCollectionDelete
|
||||||
//
|
//
|
||||||
buttonCollectionDelete.Location = new Point(6, 274);
|
buttonCollectionDelete.Location = new Point(5, 206);
|
||||||
|
buttonCollectionDelete.Margin = new Padding(3, 2, 3, 2);
|
||||||
buttonCollectionDelete.Name = "buttonCollectionDelete";
|
buttonCollectionDelete.Name = "buttonCollectionDelete";
|
||||||
buttonCollectionDelete.Size = new Size(254, 29);
|
buttonCollectionDelete.Size = new Size(222, 22);
|
||||||
buttonCollectionDelete.TabIndex = 6;
|
buttonCollectionDelete.TabIndex = 6;
|
||||||
buttonCollectionDelete.Text = "Удалить коллекцию";
|
buttonCollectionDelete.Text = "Удалить коллекцию";
|
||||||
buttonCollectionDelete.UseVisualStyleBackColor = true;
|
buttonCollectionDelete.UseVisualStyleBackColor = true;
|
||||||
@ -107,16 +175,19 @@
|
|||||||
// listBoxCollection
|
// listBoxCollection
|
||||||
//
|
//
|
||||||
listBoxCollection.FormattingEnabled = true;
|
listBoxCollection.FormattingEnabled = true;
|
||||||
listBoxCollection.Location = new Point(6, 164);
|
listBoxCollection.ItemHeight = 15;
|
||||||
|
listBoxCollection.Location = new Point(5, 123);
|
||||||
|
listBoxCollection.Margin = new Padding(3, 2, 3, 2);
|
||||||
listBoxCollection.Name = "listBoxCollection";
|
listBoxCollection.Name = "listBoxCollection";
|
||||||
listBoxCollection.Size = new Size(254, 104);
|
listBoxCollection.Size = new Size(223, 79);
|
||||||
listBoxCollection.TabIndex = 5;
|
listBoxCollection.TabIndex = 5;
|
||||||
//
|
//
|
||||||
// buttonCollectionAdd
|
// buttonCollectionAdd
|
||||||
//
|
//
|
||||||
buttonCollectionAdd.Location = new Point(6, 129);
|
buttonCollectionAdd.Location = new Point(5, 97);
|
||||||
|
buttonCollectionAdd.Margin = new Padding(3, 2, 3, 2);
|
||||||
buttonCollectionAdd.Name = "buttonCollectionAdd";
|
buttonCollectionAdd.Name = "buttonCollectionAdd";
|
||||||
buttonCollectionAdd.Size = new Size(254, 29);
|
buttonCollectionAdd.Size = new Size(222, 22);
|
||||||
buttonCollectionAdd.TabIndex = 4;
|
buttonCollectionAdd.TabIndex = 4;
|
||||||
buttonCollectionAdd.Text = "Добавить коллекцию";
|
buttonCollectionAdd.Text = "Добавить коллекцию";
|
||||||
buttonCollectionAdd.UseVisualStyleBackColor = true;
|
buttonCollectionAdd.UseVisualStyleBackColor = true;
|
||||||
@ -125,9 +196,10 @@
|
|||||||
// radioButtonList
|
// radioButtonList
|
||||||
//
|
//
|
||||||
radioButtonList.AutoSize = true;
|
radioButtonList.AutoSize = true;
|
||||||
radioButtonList.Location = new Point(129, 89);
|
radioButtonList.Location = new Point(113, 67);
|
||||||
|
radioButtonList.Margin = new Padding(3, 2, 3, 2);
|
||||||
radioButtonList.Name = "radioButtonList";
|
radioButtonList.Name = "radioButtonList";
|
||||||
radioButtonList.Size = new Size(80, 24);
|
radioButtonList.Size = new Size(66, 19);
|
||||||
radioButtonList.TabIndex = 3;
|
radioButtonList.TabIndex = 3;
|
||||||
radioButtonList.TabStop = true;
|
radioButtonList.TabStop = true;
|
||||||
radioButtonList.Text = "Список";
|
radioButtonList.Text = "Список";
|
||||||
@ -136,9 +208,10 @@
|
|||||||
// radioButtonMassive
|
// radioButtonMassive
|
||||||
//
|
//
|
||||||
radioButtonMassive.AutoSize = true;
|
radioButtonMassive.AutoSize = true;
|
||||||
radioButtonMassive.Location = new Point(23, 89);
|
radioButtonMassive.Location = new Point(20, 67);
|
||||||
|
radioButtonMassive.Margin = new Padding(3, 2, 3, 2);
|
||||||
radioButtonMassive.Name = "radioButtonMassive";
|
radioButtonMassive.Name = "radioButtonMassive";
|
||||||
radioButtonMassive.Size = new Size(82, 24);
|
radioButtonMassive.Size = new Size(67, 19);
|
||||||
radioButtonMassive.TabIndex = 2;
|
radioButtonMassive.TabIndex = 2;
|
||||||
radioButtonMassive.TabStop = true;
|
radioButtonMassive.TabStop = true;
|
||||||
radioButtonMassive.Text = "Массив";
|
radioButtonMassive.Text = "Массив";
|
||||||
@ -146,100 +219,30 @@
|
|||||||
//
|
//
|
||||||
// textBoxCollectionName
|
// textBoxCollectionName
|
||||||
//
|
//
|
||||||
textBoxCollectionName.Location = new Point(6, 37);
|
textBoxCollectionName.Location = new Point(5, 28);
|
||||||
|
textBoxCollectionName.Margin = new Padding(3, 2, 3, 2);
|
||||||
textBoxCollectionName.Name = "textBoxCollectionName";
|
textBoxCollectionName.Name = "textBoxCollectionName";
|
||||||
textBoxCollectionName.Size = new Size(254, 27);
|
textBoxCollectionName.Size = new Size(223, 23);
|
||||||
textBoxCollectionName.TabIndex = 1;
|
textBoxCollectionName.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// labelCollectionName
|
// labelCollectionName
|
||||||
//
|
//
|
||||||
labelCollectionName.AutoSize = true;
|
labelCollectionName.AutoSize = true;
|
||||||
labelCollectionName.Location = new Point(54, 14);
|
labelCollectionName.Location = new Point(47, 10);
|
||||||
labelCollectionName.Name = "labelCollectionName";
|
labelCollectionName.Name = "labelCollectionName";
|
||||||
labelCollectionName.Size = new Size(158, 20);
|
labelCollectionName.Size = new Size(125, 15);
|
||||||
labelCollectionName.TabIndex = 0;
|
labelCollectionName.TabIndex = 0;
|
||||||
labelCollectionName.Text = "Название коллекции:";
|
labelCollectionName.Text = "Название коллекции:";
|
||||||
//
|
//
|
||||||
// buttonRefresh
|
|
||||||
//
|
|
||||||
buttonRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
buttonRefresh.Location = new Point(4, 356);
|
|
||||||
buttonRefresh.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonRefresh.Name = "buttonRefresh";
|
|
||||||
buttonRefresh.Size = new Size(259, 64);
|
|
||||||
buttonRefresh.TabIndex = 6;
|
|
||||||
buttonRefresh.Text = "Обновить";
|
|
||||||
buttonRefresh.UseVisualStyleBackColor = true;
|
|
||||||
buttonRefresh.Click += ButtonRefresh_Click;
|
|
||||||
//
|
|
||||||
// buttonGoToCheck
|
|
||||||
//
|
|
||||||
buttonGoToCheck.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
buttonGoToCheck.Location = new Point(1, 284);
|
|
||||||
buttonGoToCheck.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonGoToCheck.Name = "buttonGoToCheck";
|
|
||||||
buttonGoToCheck.Size = new Size(259, 64);
|
|
||||||
buttonGoToCheck.TabIndex = 5;
|
|
||||||
buttonGoToCheck.Text = "Передать на тесты";
|
|
||||||
buttonGoToCheck.UseVisualStyleBackColor = true;
|
|
||||||
buttonGoToCheck.Click += ButtonGoToCheck_Click;
|
|
||||||
//
|
|
||||||
// buttonRemoveMonorail
|
|
||||||
//
|
|
||||||
buttonRemoveMonorail.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
buttonRemoveMonorail.Location = new Point(1, 212);
|
|
||||||
buttonRemoveMonorail.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonRemoveMonorail.Name = "buttonRemoveMonorail";
|
|
||||||
buttonRemoveMonorail.Size = new Size(259, 64);
|
|
||||||
buttonRemoveMonorail.TabIndex = 4;
|
|
||||||
buttonRemoveMonorail.Text = "Удалить монорельс";
|
|
||||||
buttonRemoveMonorail.UseVisualStyleBackColor = true;
|
|
||||||
buttonRemoveMonorail.Click += buttonRemoveMonorail_Click;
|
|
||||||
//
|
|
||||||
// maskedTextBox
|
|
||||||
//
|
|
||||||
maskedTextBox.Location = new Point(8, 177);
|
|
||||||
maskedTextBox.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
maskedTextBox.Mask = "00";
|
|
||||||
maskedTextBox.Name = "maskedTextBox";
|
|
||||||
maskedTextBox.Size = new Size(254, 27);
|
|
||||||
maskedTextBox.TabIndex = 3;
|
|
||||||
maskedTextBox.ValidatingType = typeof(int);
|
|
||||||
//
|
|
||||||
// buttonAddModernMonorail
|
|
||||||
//
|
|
||||||
buttonAddModernMonorail.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
buttonAddModernMonorail.Location = new Point(2, 105);
|
|
||||||
buttonAddModernMonorail.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonAddModernMonorail.Name = "buttonAddModernMonorail";
|
|
||||||
buttonAddModernMonorail.Size = new Size(259, 64);
|
|
||||||
buttonAddModernMonorail.TabIndex = 2;
|
|
||||||
buttonAddModernMonorail.Text = "Добавление современного монорельса";
|
|
||||||
buttonAddModernMonorail.UseVisualStyleBackColor = true;
|
|
||||||
buttonAddModernMonorail.Click += ButtonAddModernMonorail_Click;
|
|
||||||
//
|
|
||||||
// buttonAddMonorail
|
|
||||||
//
|
|
||||||
buttonAddMonorail.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
buttonAddMonorail.Location = new Point(6, 33);
|
|
||||||
buttonAddMonorail.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonAddMonorail.Name = "buttonAddMonorail";
|
|
||||||
buttonAddMonorail.Size = new Size(253, 64);
|
|
||||||
buttonAddMonorail.TabIndex = 1;
|
|
||||||
buttonAddMonorail.Text = "Добавление монорельса";
|
|
||||||
buttonAddMonorail.UseVisualStyleBackColor = true;
|
|
||||||
buttonAddMonorail.Click += ButtonAddMonorail_Click;
|
|
||||||
//
|
|
||||||
// comboBoxSelectorCompany
|
// comboBoxSelectorCompany
|
||||||
//
|
//
|
||||||
comboBoxSelectorCompany.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
comboBoxSelectorCompany.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboBoxSelectorCompany.FormattingEnabled = true;
|
comboBoxSelectorCompany.FormattingEnabled = true;
|
||||||
comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" });
|
comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" });
|
||||||
comboBoxSelectorCompany.Location = new Point(3, 353);
|
comboBoxSelectorCompany.Location = new Point(3, 265);
|
||||||
comboBoxSelectorCompany.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
|
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
|
||||||
comboBoxSelectorCompany.Size = new Size(261, 28);
|
comboBoxSelectorCompany.Size = new Size(229, 23);
|
||||||
comboBoxSelectorCompany.TabIndex = 0;
|
comboBoxSelectorCompany.TabIndex = 0;
|
||||||
comboBoxSelectorCompany.SelectedIndexChanged += ComboBoxSelectorCompany_SelectedIndexChanged;
|
comboBoxSelectorCompany.SelectedIndexChanged += ComboBoxSelectorCompany_SelectedIndexChanged;
|
||||||
//
|
//
|
||||||
@ -247,43 +250,26 @@
|
|||||||
//
|
//
|
||||||
pictureBox.Dock = DockStyle.Fill;
|
pictureBox.Dock = DockStyle.Fill;
|
||||||
pictureBox.Location = new Point(0, 0);
|
pictureBox.Location = new Point(0, 0);
|
||||||
pictureBox.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
pictureBox.Name = "pictureBox";
|
pictureBox.Name = "pictureBox";
|
||||||
pictureBox.Size = new Size(1109, 883);
|
pictureBox.Size = new Size(970, 662);
|
||||||
pictureBox.TabIndex = 1;
|
pictureBox.TabIndex = 1;
|
||||||
pictureBox.TabStop = false;
|
pictureBox.TabStop = false;
|
||||||
//
|
//
|
||||||
// panelCompanyTools
|
|
||||||
//
|
|
||||||
panelCompanyTools.Controls.Add(buttonAddMonorail);
|
|
||||||
panelCompanyTools.Controls.Add(buttonAddModernMonorail);
|
|
||||||
panelCompanyTools.Controls.Add(maskedTextBox);
|
|
||||||
panelCompanyTools.Controls.Add(buttonRefresh);
|
|
||||||
panelCompanyTools.Controls.Add(buttonRemoveMonorail);
|
|
||||||
panelCompanyTools.Controls.Add(buttonGoToCheck);
|
|
||||||
panelCompanyTools.Dock = DockStyle.Bottom;
|
|
||||||
panelCompanyTools.Enabled = false;
|
|
||||||
panelCompanyTools.Location = new Point(3, 450);
|
|
||||||
panelCompanyTools.Name = "panelCompanyTools";
|
|
||||||
panelCompanyTools.Size = new Size(269, 429);
|
|
||||||
panelCompanyTools.TabIndex = 8;
|
|
||||||
//
|
|
||||||
// FormMonorailCollection
|
// FormMonorailCollection
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1384, 883);
|
ClientSize = new Size(1211, 662);
|
||||||
Controls.Add(pictureBox);
|
Controls.Add(pictureBox);
|
||||||
Controls.Add(groupBoxTools);
|
Controls.Add(groupBoxTools);
|
||||||
Margin = new Padding(3, 4, 3, 4);
|
|
||||||
Name = "FormMonorailCollection";
|
Name = "FormMonorailCollection";
|
||||||
Text = "Коллекция монорельсов";
|
Text = "Коллекция монорельсов";
|
||||||
groupBoxTools.ResumeLayout(false);
|
groupBoxTools.ResumeLayout(false);
|
||||||
|
panelCompanyTools.ResumeLayout(false);
|
||||||
|
panelCompanyTools.PerformLayout();
|
||||||
panelStorage.ResumeLayout(false);
|
panelStorage.ResumeLayout(false);
|
||||||
panelStorage.PerformLayout();
|
panelStorage.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox).EndInit();
|
||||||
panelCompanyTools.ResumeLayout(false);
|
|
||||||
panelCompanyTools.PerformLayout();
|
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,7 +279,6 @@
|
|||||||
private ComboBox comboBoxSelectorCompany;
|
private ComboBox comboBoxSelectorCompany;
|
||||||
private Button buttonRemoveMonorail;
|
private Button buttonRemoveMonorail;
|
||||||
private MaskedTextBox maskedTextBox;
|
private MaskedTextBox maskedTextBox;
|
||||||
private Button buttonAddModernMonorail;
|
|
||||||
private Button buttonAddMonorail;
|
private Button buttonAddMonorail;
|
||||||
private PictureBox pictureBox;
|
private PictureBox pictureBox;
|
||||||
private Button buttonGoToCheck;
|
private Button buttonGoToCheck;
|
||||||
|
@ -42,31 +42,18 @@ namespace ProjectMonorail
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void ButtonAddMonorail_Click(object sender, EventArgs e)
|
||||||
/// Создание объекта класса-перемещения
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">Тип создоваемого объекта</param>
|
|
||||||
private void CreateObject(string type)
|
|
||||||
{
|
{
|
||||||
if (_company == null) return;
|
FormMonorailConfig form = new FormMonorailConfig();
|
||||||
|
form.Show();
|
||||||
Random random = new();
|
form.AddEventListener_Monorail(SetMonorail);
|
||||||
DrawingMonorail drawningMonorail;
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case nameof(DrawingMonorail):
|
|
||||||
drawningMonorail = new DrawingMonorail(random.Next(100, 300), random.Next(1000, 3000),
|
|
||||||
GetColor(random));
|
|
||||||
break;
|
|
||||||
case nameof(DrawingModernMonorail):
|
|
||||||
bool randomTrack = Convert.ToBoolean(random.Next(0, 2));
|
|
||||||
drawningMonorail = new DrawingModernMonorail(random.Next(100, 300), random.Next(1000, 3000), GetColor(random), GetColor(random), randomTrack, (randomTrack ? Convert.ToBoolean(random.Next(0, 2)) : true));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_company + drawningMonorail != -1)
|
private void SetMonorail(DrawingMonorail monorail)
|
||||||
|
{
|
||||||
|
if (monorail == null || _company == null) return;
|
||||||
|
|
||||||
|
if (_company + monorail != -1)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект добавлен");
|
MessageBox.Show("Объект добавлен");
|
||||||
pictureBox.Image = _company.Show();
|
pictureBox.Image = _company.Show();
|
||||||
@ -77,34 +64,6 @@ namespace ProjectMonorail
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Получение цвета
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="random">Генератор случайных чесел</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private static Color GetColor(Random random)
|
|
||||||
{
|
|
||||||
Color color = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
|
||||||
ColorDialog dialog = new ColorDialog();
|
|
||||||
|
|
||||||
if (dialog.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
color = dialog.Color;
|
|
||||||
}
|
|
||||||
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonAddMonorail_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
CreateObject(nameof(DrawingMonorail));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonAddModernMonorail_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
CreateObject(nameof(DrawingModernMonorail));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonRemoveMonorail_Click(object sender, EventArgs e)
|
private void buttonRemoveMonorail_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(maskedTextBox.Text) || _company == null) return;
|
if (string.IsNullOrEmpty(maskedTextBox.Text) || _company == null) return;
|
||||||
|
381
ProjectMonorail/FormMonorailConfig.Designer.cs
generated
Normal file
381
ProjectMonorail/FormMonorailConfig.Designer.cs
generated
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
namespace ProjectMonorail
|
||||||
|
{
|
||||||
|
partial class FormMonorailConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
groupBoxConfig = new GroupBox();
|
||||||
|
groupBoxColors = new GroupBox();
|
||||||
|
panelColor_Purple = new Panel();
|
||||||
|
panelColor_Black = new Panel();
|
||||||
|
panelColor_Yellow = new Panel();
|
||||||
|
panelColor_Grey = new Panel();
|
||||||
|
panelColor_Blue = new Panel();
|
||||||
|
panelColor_White = new Panel();
|
||||||
|
panelColor_Green = new Panel();
|
||||||
|
panelColor_Red = new Panel();
|
||||||
|
checkBoxCabin = new CheckBox();
|
||||||
|
checkBoxMonorailTrack = new CheckBox();
|
||||||
|
numericUpDownWeight = new NumericUpDown();
|
||||||
|
labelWeight = new Label();
|
||||||
|
numericUpDownSpeed = new NumericUpDown();
|
||||||
|
labelSpeed = new Label();
|
||||||
|
labelModifiedObject = new Label();
|
||||||
|
labelSimpleObject = new Label();
|
||||||
|
pictureBoxObject = new PictureBox();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
panelObject = new Panel();
|
||||||
|
labelBodyColor = new Label();
|
||||||
|
labelAdditionalColor = new Label();
|
||||||
|
panelBaseColor = new Panel();
|
||||||
|
panelAdditionalColor = new Panel();
|
||||||
|
groupBoxConfig.SuspendLayout();
|
||||||
|
groupBoxColors.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit();
|
||||||
|
panelObject.SuspendLayout();
|
||||||
|
panelBaseColor.SuspendLayout();
|
||||||
|
panelAdditionalColor.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// groupBoxConfig
|
||||||
|
//
|
||||||
|
groupBoxConfig.Controls.Add(groupBoxColors);
|
||||||
|
groupBoxConfig.Controls.Add(checkBoxCabin);
|
||||||
|
groupBoxConfig.Controls.Add(checkBoxMonorailTrack);
|
||||||
|
groupBoxConfig.Controls.Add(numericUpDownWeight);
|
||||||
|
groupBoxConfig.Controls.Add(labelWeight);
|
||||||
|
groupBoxConfig.Controls.Add(numericUpDownSpeed);
|
||||||
|
groupBoxConfig.Controls.Add(labelSpeed);
|
||||||
|
groupBoxConfig.Controls.Add(labelModifiedObject);
|
||||||
|
groupBoxConfig.Controls.Add(labelSimpleObject);
|
||||||
|
groupBoxConfig.Dock = DockStyle.Left;
|
||||||
|
groupBoxConfig.Location = new Point(0, 0);
|
||||||
|
groupBoxConfig.Name = "groupBoxConfig";
|
||||||
|
groupBoxConfig.Size = new Size(509, 177);
|
||||||
|
groupBoxConfig.TabIndex = 0;
|
||||||
|
groupBoxConfig.TabStop = false;
|
||||||
|
groupBoxConfig.Text = "Параметры";
|
||||||
|
//
|
||||||
|
// groupBoxColors
|
||||||
|
//
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Purple);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Black);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Yellow);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Grey);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Blue);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_White);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Green);
|
||||||
|
groupBoxColors.Controls.Add(panelColor_Red);
|
||||||
|
groupBoxColors.Location = new Point(276, 22);
|
||||||
|
groupBoxColors.Name = "groupBoxColors";
|
||||||
|
groupBoxColors.Size = new Size(206, 105);
|
||||||
|
groupBoxColors.TabIndex = 8;
|
||||||
|
groupBoxColors.TabStop = false;
|
||||||
|
groupBoxColors.Text = "Цвета";
|
||||||
|
//
|
||||||
|
// panelColor_Purple
|
||||||
|
//
|
||||||
|
panelColor_Purple.BackColor = Color.Purple;
|
||||||
|
panelColor_Purple.Location = new Point(173, 62);
|
||||||
|
panelColor_Purple.Name = "panelColor_Purple";
|
||||||
|
panelColor_Purple.Size = new Size(27, 29);
|
||||||
|
panelColor_Purple.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// panelColor_Black
|
||||||
|
//
|
||||||
|
panelColor_Black.BackColor = Color.Black;
|
||||||
|
panelColor_Black.Location = new Point(121, 62);
|
||||||
|
panelColor_Black.Name = "panelColor_Black";
|
||||||
|
panelColor_Black.Size = new Size(27, 29);
|
||||||
|
panelColor_Black.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// panelColor_Yellow
|
||||||
|
//
|
||||||
|
panelColor_Yellow.BackColor = Color.Yellow;
|
||||||
|
panelColor_Yellow.Location = new Point(173, 22);
|
||||||
|
panelColor_Yellow.Name = "panelColor_Yellow";
|
||||||
|
panelColor_Yellow.Size = new Size(27, 29);
|
||||||
|
panelColor_Yellow.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// panelColor_Grey
|
||||||
|
//
|
||||||
|
panelColor_Grey.BackColor = Color.Gray;
|
||||||
|
panelColor_Grey.Location = new Point(62, 62);
|
||||||
|
panelColor_Grey.Name = "panelColor_Grey";
|
||||||
|
panelColor_Grey.Size = new Size(27, 29);
|
||||||
|
panelColor_Grey.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// panelColor_Blue
|
||||||
|
//
|
||||||
|
panelColor_Blue.BackColor = Color.Blue;
|
||||||
|
panelColor_Blue.Location = new Point(121, 22);
|
||||||
|
panelColor_Blue.Name = "panelColor_Blue";
|
||||||
|
panelColor_Blue.Size = new Size(27, 29);
|
||||||
|
panelColor_Blue.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// panelColor_White
|
||||||
|
//
|
||||||
|
panelColor_White.BackColor = Color.White;
|
||||||
|
panelColor_White.Location = new Point(6, 62);
|
||||||
|
panelColor_White.Name = "panelColor_White";
|
||||||
|
panelColor_White.Size = new Size(27, 29);
|
||||||
|
panelColor_White.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// panelColor_Green
|
||||||
|
//
|
||||||
|
panelColor_Green.BackColor = Color.Green;
|
||||||
|
panelColor_Green.Location = new Point(62, 22);
|
||||||
|
panelColor_Green.Name = "panelColor_Green";
|
||||||
|
panelColor_Green.Size = new Size(27, 29);
|
||||||
|
panelColor_Green.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// panelColor_Red
|
||||||
|
//
|
||||||
|
panelColor_Red.BackColor = Color.Red;
|
||||||
|
panelColor_Red.Location = new Point(6, 22);
|
||||||
|
panelColor_Red.Name = "panelColor_Red";
|
||||||
|
panelColor_Red.Size = new Size(27, 29);
|
||||||
|
panelColor_Red.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// checkBoxCabin
|
||||||
|
//
|
||||||
|
checkBoxCabin.AutoSize = true;
|
||||||
|
checkBoxCabin.Location = new Point(12, 144);
|
||||||
|
checkBoxCabin.Name = "checkBoxCabin";
|
||||||
|
checkBoxCabin.Size = new Size(168, 19);
|
||||||
|
checkBoxCabin.TabIndex = 7;
|
||||||
|
checkBoxCabin.Text = "Признак наличия кабины";
|
||||||
|
checkBoxCabin.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkBoxMonorailTrack
|
||||||
|
//
|
||||||
|
checkBoxMonorailTrack.AutoSize = true;
|
||||||
|
checkBoxMonorailTrack.Location = new Point(12, 119);
|
||||||
|
checkBoxMonorailTrack.Name = "checkBoxMonorailTrack";
|
||||||
|
checkBoxMonorailTrack.Size = new Size(248, 19);
|
||||||
|
checkBoxMonorailTrack.TabIndex = 6;
|
||||||
|
checkBoxMonorailTrack.Text = "Признак наличия монорельсового пути";
|
||||||
|
checkBoxMonorailTrack.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// numericUpDownWeight
|
||||||
|
//
|
||||||
|
numericUpDownWeight.Location = new Point(80, 78);
|
||||||
|
numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
|
||||||
|
numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
|
||||||
|
numericUpDownWeight.Name = "numericUpDownWeight";
|
||||||
|
numericUpDownWeight.Size = new Size(120, 23);
|
||||||
|
numericUpDownWeight.TabIndex = 5;
|
||||||
|
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// labelWeight
|
||||||
|
//
|
||||||
|
labelWeight.AutoSize = true;
|
||||||
|
labelWeight.Location = new Point(12, 80);
|
||||||
|
labelWeight.Name = "labelWeight";
|
||||||
|
labelWeight.Size = new Size(29, 15);
|
||||||
|
labelWeight.TabIndex = 4;
|
||||||
|
labelWeight.Text = "Вес:";
|
||||||
|
//
|
||||||
|
// numericUpDownSpeed
|
||||||
|
//
|
||||||
|
numericUpDownSpeed.Location = new Point(80, 32);
|
||||||
|
numericUpDownSpeed.Name = "numericUpDownSpeed";
|
||||||
|
numericUpDownSpeed.Size = new Size(120, 23);
|
||||||
|
numericUpDownSpeed.TabIndex = 3;
|
||||||
|
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// labelSpeed
|
||||||
|
//
|
||||||
|
labelSpeed.AutoSize = true;
|
||||||
|
labelSpeed.Location = new Point(12, 34);
|
||||||
|
labelSpeed.Name = "labelSpeed";
|
||||||
|
labelSpeed.Size = new Size(62, 15);
|
||||||
|
labelSpeed.TabIndex = 2;
|
||||||
|
labelSpeed.Text = "Скорость:";
|
||||||
|
//
|
||||||
|
// labelModifiedObject
|
||||||
|
//
|
||||||
|
labelModifiedObject.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
labelModifiedObject.Location = new Point(382, 140);
|
||||||
|
labelModifiedObject.Name = "labelModifiedObject";
|
||||||
|
labelModifiedObject.Size = new Size(100, 23);
|
||||||
|
labelModifiedObject.TabIndex = 1;
|
||||||
|
labelModifiedObject.Text = "Продвинутый";
|
||||||
|
labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
labelModifiedObject.MouseDown += LabelObject_MouseDown;
|
||||||
|
//
|
||||||
|
// labelSimpleObject
|
||||||
|
//
|
||||||
|
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
labelSimpleObject.Location = new Point(276, 141);
|
||||||
|
labelSimpleObject.Name = "labelSimpleObject";
|
||||||
|
labelSimpleObject.Size = new Size(100, 23);
|
||||||
|
labelSimpleObject.TabIndex = 0;
|
||||||
|
labelSimpleObject.Text = "Простой";
|
||||||
|
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
labelSimpleObject.MouseDown += LabelObject_MouseDown;
|
||||||
|
//
|
||||||
|
// pictureBoxObject
|
||||||
|
//
|
||||||
|
pictureBoxObject.Location = new Point(17, 12);
|
||||||
|
pictureBoxObject.Name = "pictureBoxObject";
|
||||||
|
pictureBoxObject.Size = new Size(198, 71);
|
||||||
|
pictureBoxObject.TabIndex = 1;
|
||||||
|
pictureBoxObject.TabStop = false;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
buttonAdd.Location = new Point(525, 144);
|
||||||
|
buttonAdd.Name = "buttonAdd";
|
||||||
|
buttonAdd.Size = new Size(75, 23);
|
||||||
|
buttonAdd.TabIndex = 2;
|
||||||
|
buttonAdd.Text = "Добавить";
|
||||||
|
buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
buttonAdd.Click += ButtonAdd_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.Location = new Point(680, 144);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(75, 23);
|
||||||
|
buttonCancel.TabIndex = 3;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// panelObject
|
||||||
|
//
|
||||||
|
panelObject.AllowDrop = true;
|
||||||
|
panelObject.Controls.Add(pictureBoxObject);
|
||||||
|
panelObject.Location = new Point(525, 44);
|
||||||
|
panelObject.Name = "panelObject";
|
||||||
|
panelObject.Size = new Size(230, 93);
|
||||||
|
panelObject.TabIndex = 4;
|
||||||
|
panelObject.DragDrop += PanelObject_DragDrop;
|
||||||
|
panelObject.DragEnter += PanelObject_DragEnter;
|
||||||
|
//
|
||||||
|
// labelBodyColor
|
||||||
|
//
|
||||||
|
labelBodyColor.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
labelBodyColor.Location = new Point(9, 8);
|
||||||
|
labelBodyColor.Name = "labelBodyColor";
|
||||||
|
labelBodyColor.Size = new Size(100, 23);
|
||||||
|
labelBodyColor.TabIndex = 9;
|
||||||
|
labelBodyColor.Text = "Основной цвет";
|
||||||
|
labelBodyColor.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
//
|
||||||
|
// labelAdditionalColor
|
||||||
|
//
|
||||||
|
labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
labelAdditionalColor.Location = new Point(11, 10);
|
||||||
|
labelAdditionalColor.Name = "labelAdditionalColor";
|
||||||
|
labelAdditionalColor.Size = new Size(100, 23);
|
||||||
|
labelAdditionalColor.TabIndex = 10;
|
||||||
|
labelAdditionalColor.Text = "Доп. цвет";
|
||||||
|
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
labelAdditionalColor.DragDrop += PanelObject_DragDrop;
|
||||||
|
labelAdditionalColor.DragEnter += PanelObject_DragEnter;
|
||||||
|
//
|
||||||
|
// panelBaseColor
|
||||||
|
//
|
||||||
|
panelBaseColor.AllowDrop = true;
|
||||||
|
panelBaseColor.Controls.Add(labelBodyColor);
|
||||||
|
panelBaseColor.Location = new Point(525, 1);
|
||||||
|
panelBaseColor.Name = "panelBaseColor";
|
||||||
|
panelBaseColor.Size = new Size(124, 37);
|
||||||
|
panelBaseColor.TabIndex = 11;
|
||||||
|
panelBaseColor.DragDrop += PanelColorBody_DragDrop;
|
||||||
|
panelBaseColor.DragEnter += PanelColor_DragEnter;
|
||||||
|
//
|
||||||
|
// panelAdditionalColor
|
||||||
|
//
|
||||||
|
panelAdditionalColor.AllowDrop = true;
|
||||||
|
panelAdditionalColor.Controls.Add(labelAdditionalColor);
|
||||||
|
panelAdditionalColor.Location = new Point(651, -1);
|
||||||
|
panelAdditionalColor.Name = "panelAdditionalColor";
|
||||||
|
panelAdditionalColor.Size = new Size(117, 39);
|
||||||
|
panelAdditionalColor.TabIndex = 12;
|
||||||
|
panelAdditionalColor.DragDrop += PanelColorBody_DragDrop;
|
||||||
|
panelAdditionalColor.DragEnter += PanelColorAdditional_DragDrop;
|
||||||
|
//
|
||||||
|
// FormMonorailConfig
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(774, 177);
|
||||||
|
Controls.Add(panelAdditionalColor);
|
||||||
|
Controls.Add(panelBaseColor);
|
||||||
|
Controls.Add(panelObject);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonAdd);
|
||||||
|
Controls.Add(groupBoxConfig);
|
||||||
|
Name = "FormMonorailConfig";
|
||||||
|
Text = "Создание объекта";
|
||||||
|
groupBoxConfig.ResumeLayout(false);
|
||||||
|
groupBoxConfig.PerformLayout();
|
||||||
|
groupBoxColors.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit();
|
||||||
|
panelObject.ResumeLayout(false);
|
||||||
|
panelBaseColor.ResumeLayout(false);
|
||||||
|
panelAdditionalColor.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private GroupBox groupBoxConfig;
|
||||||
|
private Label labelSimpleObject;
|
||||||
|
private NumericUpDown numericUpDownWeight;
|
||||||
|
private Label labelWeight;
|
||||||
|
private NumericUpDown numericUpDownSpeed;
|
||||||
|
private Label labelSpeed;
|
||||||
|
private Label labelModifiedObject;
|
||||||
|
private CheckBox checkBoxMonorailTrack;
|
||||||
|
private CheckBox checkBoxCabin;
|
||||||
|
private GroupBox groupBoxColors;
|
||||||
|
private Panel panelColor_Purple;
|
||||||
|
private Panel panelColor_Black;
|
||||||
|
private Panel panelColor_Yellow;
|
||||||
|
private Panel panelColor_Grey;
|
||||||
|
private Panel panelColor_Blue;
|
||||||
|
private Panel panelColor_White;
|
||||||
|
private Panel panelColor_Green;
|
||||||
|
private Panel panelColor_Red;
|
||||||
|
private PictureBox pictureBoxObject;
|
||||||
|
private Button buttonAdd;
|
||||||
|
private Button buttonCancel;
|
||||||
|
private Panel panelObject;
|
||||||
|
private Label labelBodyColor;
|
||||||
|
private Label labelAdditionalColor;
|
||||||
|
private Panel panelBaseColor;
|
||||||
|
private Panel panelAdditionalColor;
|
||||||
|
}
|
||||||
|
}
|
134
ProjectMonorail/FormMonorailConfig.cs
Normal file
134
ProjectMonorail/FormMonorailConfig.cs
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
using ProjectMonorail.Scripts.Monorail.Delegates;
|
||||||
|
using ProjectMonorail.Scripts.Monorail.Drawnings;
|
||||||
|
using ProjectMonorail.Scripts.Monorail.Entities;
|
||||||
|
|
||||||
|
namespace ProjectMonorail
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Форма конфигурации объекта
|
||||||
|
/// </summary>
|
||||||
|
public partial class FormMonorailConfig : Form
|
||||||
|
{
|
||||||
|
#region Events & Delegates
|
||||||
|
private event DelegateMonorail OnSendEvent_Monorail;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Объект прорисовки монорельса
|
||||||
|
/// </summary>
|
||||||
|
private DrawingMonorail? _monorail;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
public FormMonorailConfig()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
panelColor_Red.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_Green.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_Blue.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_Yellow.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_Purple.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_White.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_Black.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelColor_Grey.MouseDown += PanelColor_MouseDown;
|
||||||
|
|
||||||
|
// TODO buttonCancel.Click with lambda
|
||||||
|
buttonCancel.Click += (object? obj, EventArgs e) => Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddEventListener_Monorail(DelegateMonorail method)
|
||||||
|
{
|
||||||
|
OnSendEvent_Monorail += method;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Прорисовка объекта
|
||||||
|
/// </summary>
|
||||||
|
private void DrawObject()
|
||||||
|
{
|
||||||
|
Bitmap bmp = new Bitmap(pictureBoxObject.Width, pictureBoxObject.Height);
|
||||||
|
Graphics g = Graphics.FromImage(bmp);
|
||||||
|
_monorail?.SetPictureSize(pictureBoxObject.Width, pictureBoxObject.Height);
|
||||||
|
_monorail?.SetPosition(10, 10);
|
||||||
|
_monorail?.DrawTransport(g);
|
||||||
|
pictureBoxObject.Image = bmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Передаем информацию при нажатии на Label
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void LabelObject_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Проверка полученной информации(ее типа на соответствие требуемому)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void PanelObject_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Действия при приеме перетаскиваемой информации
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void PanelObject_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
switch (e.Data?.GetData(DataFormats.Text)?.ToString())
|
||||||
|
{
|
||||||
|
case "labelSimpleObject":
|
||||||
|
_monorail = new DrawingMonorail((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White);
|
||||||
|
break;
|
||||||
|
case "labelModifiedObject":
|
||||||
|
_monorail = new DrawingModernMonorail((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White,
|
||||||
|
Color.Black, checkBoxMonorailTrack.Checked, checkBoxCabin.Checked);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
DrawObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Передаем информацию при нажатии на Panel
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void PanelColor_MouseDown(object? sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor ?? Color.Black, DragDropEffects.Move | DragDropEffects.Copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PanelColor_DragEnter(object? sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
e.Effect = e.Data?.GetDataPresent(typeof(Color)) ?? false ? DragDropEffects.Copy : DragDropEffects.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PanelColorBody_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
_monorail?.EntityMonorail?.SetBodyColor((Color)e.Data.GetData(typeof(Color)));
|
||||||
|
|
||||||
|
DrawObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PanelColorAdditional_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
((_monorail as DrawingModernMonorail)?.EntityMonorail as EntityModernMonorail)?.SetAdditionalColor((Color)e.Data.GetData(typeof(Color)));
|
||||||
|
|
||||||
|
DrawObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_monorail != null) OnSendEvent_Monorail?.Invoke(_monorail);
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
ProjectMonorail/FormMonorailConfig.resx
Normal file
120
ProjectMonorail/FormMonorailConfig.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -0,0 +1,6 @@
|
|||||||
|
using ProjectMonorail.Scripts.Monorail.Drawnings;
|
||||||
|
|
||||||
|
namespace ProjectMonorail.Scripts.Monorail.Delegates
|
||||||
|
{
|
||||||
|
public delegate void DelegateMonorail(DrawingMonorail monorail);
|
||||||
|
}
|
@ -20,6 +20,11 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Cabin { get; private set; }
|
public bool Cabin { get; private set; }
|
||||||
|
|
||||||
|
public void SetAdditionalColor(Color value)
|
||||||
|
{
|
||||||
|
AdditionalColor = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Инициальзация полей объекта-класса спортивного автомобиля
|
/// Инициальзация полей объекта-класса спортивного автомобиля
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -25,6 +25,11 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double Step => Speed * 100 / Weight;
|
public double Step => Speed * 100 / Weight;
|
||||||
|
|
||||||
|
public void SetBodyColor(Color value)
|
||||||
|
{
|
||||||
|
BodyColor = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Конструктор сущности
|
/// Конструктор сущности
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user