Add config form.
This commit is contained in:
parent
3d89eca38e
commit
bfc075b964
347
Airbus/Airbus/FormPlaneConfig.Designer.cs
generated
Normal file
347
Airbus/Airbus/FormPlaneConfig.Designer.cs
generated
Normal file
@ -0,0 +1,347 @@
|
|||||||
|
namespace Airbus
|
||||||
|
{
|
||||||
|
partial class FormPlaneConfig
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
this.groupBoxConfig = new System.Windows.Forms.GroupBox();
|
||||||
|
this.labelSpeed = new System.Windows.Forms.Label();
|
||||||
|
this.labelWeight = new System.Windows.Forms.Label();
|
||||||
|
this.numericUpDownSpeed = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.numericUpDownWeight = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.checkBoxAddEngine = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkBoxAddСompartment = new System.Windows.Forms.CheckBox();
|
||||||
|
this.groupBoxColors = new System.Windows.Forms.GroupBox();
|
||||||
|
this.panelWhite = new System.Windows.Forms.Panel();
|
||||||
|
this.panelGray = new System.Windows.Forms.Panel();
|
||||||
|
this.panelBlack = new System.Windows.Forms.Panel();
|
||||||
|
this.panelPurple = new System.Windows.Forms.Panel();
|
||||||
|
this.panelYellow = new System.Windows.Forms.Panel();
|
||||||
|
this.panelBlue = new System.Windows.Forms.Panel();
|
||||||
|
this.panelGreen = new System.Windows.Forms.Panel();
|
||||||
|
this.panelRed = new System.Windows.Forms.Panel();
|
||||||
|
this.labelSimpleObject = new System.Windows.Forms.Label();
|
||||||
|
this.labelModifiedObject = new System.Windows.Forms.Label();
|
||||||
|
this.pictureBoxObject = new System.Windows.Forms.PictureBox();
|
||||||
|
this.anelObject = new System.Windows.Forms.Panel();
|
||||||
|
this.labelBaseColor = new System.Windows.Forms.Label();
|
||||||
|
this.labelAddColor = new System.Windows.Forms.Label();
|
||||||
|
this.buttonAddObject = new System.Windows.Forms.Button();
|
||||||
|
this.buttonCancel = new System.Windows.Forms.Button();
|
||||||
|
this.groupBoxConfig.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpeed)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWeight)).BeginInit();
|
||||||
|
this.groupBoxColors.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxObject)).BeginInit();
|
||||||
|
this.anelObject.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// groupBoxConfig
|
||||||
|
//
|
||||||
|
this.groupBoxConfig.Controls.Add(this.labelModifiedObject);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.labelSimpleObject);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.groupBoxColors);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.checkBoxAddСompartment);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.checkBoxAddEngine);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.numericUpDownWeight);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.numericUpDownSpeed);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.labelWeight);
|
||||||
|
this.groupBoxConfig.Controls.Add(this.labelSpeed);
|
||||||
|
this.groupBoxConfig.Location = new System.Drawing.Point(12, 12);
|
||||||
|
this.groupBoxConfig.Name = "groupBoxConfig";
|
||||||
|
this.groupBoxConfig.Size = new System.Drawing.Size(644, 174);
|
||||||
|
this.groupBoxConfig.TabIndex = 0;
|
||||||
|
this.groupBoxConfig.TabStop = false;
|
||||||
|
this.groupBoxConfig.Text = "Параметры";
|
||||||
|
//
|
||||||
|
// labelSpeed
|
||||||
|
//
|
||||||
|
this.labelSpeed.AutoSize = true;
|
||||||
|
this.labelSpeed.Location = new System.Drawing.Point(17, 31);
|
||||||
|
this.labelSpeed.Name = "labelSpeed";
|
||||||
|
this.labelSpeed.Size = new System.Drawing.Size(62, 15);
|
||||||
|
this.labelSpeed.TabIndex = 0;
|
||||||
|
this.labelSpeed.Text = "Скорость:";
|
||||||
|
//
|
||||||
|
// labelWeight
|
||||||
|
//
|
||||||
|
this.labelWeight.AutoSize = true;
|
||||||
|
this.labelWeight.Location = new System.Drawing.Point(17, 66);
|
||||||
|
this.labelWeight.Name = "labelWeight";
|
||||||
|
this.labelWeight.Size = new System.Drawing.Size(29, 15);
|
||||||
|
this.labelWeight.TabIndex = 1;
|
||||||
|
this.labelWeight.Text = "Вес:";
|
||||||
|
//
|
||||||
|
// numericUpDownSpeed
|
||||||
|
//
|
||||||
|
this.numericUpDownSpeed.Location = new System.Drawing.Point(89, 29);
|
||||||
|
this.numericUpDownSpeed.Name = "numericUpDownSpeed";
|
||||||
|
this.numericUpDownSpeed.Size = new System.Drawing.Size(69, 23);
|
||||||
|
this.numericUpDownSpeed.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// numericUpDownWeight
|
||||||
|
//
|
||||||
|
this.numericUpDownWeight.Location = new System.Drawing.Point(89, 58);
|
||||||
|
this.numericUpDownWeight.Name = "numericUpDownWeight";
|
||||||
|
this.numericUpDownWeight.Size = new System.Drawing.Size(69, 23);
|
||||||
|
this.numericUpDownWeight.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// checkBoxAddEngine
|
||||||
|
//
|
||||||
|
this.checkBoxAddEngine.AutoSize = true;
|
||||||
|
this.checkBoxAddEngine.Location = new System.Drawing.Point(17, 106);
|
||||||
|
this.checkBoxAddEngine.Name = "checkBoxAddEngine";
|
||||||
|
this.checkBoxAddEngine.Size = new System.Drawing.Size(281, 19);
|
||||||
|
this.checkBoxAddEngine.TabIndex = 4;
|
||||||
|
this.checkBoxAddEngine.Text = "Признак наличия дополнительного двигателя";
|
||||||
|
this.checkBoxAddEngine.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkBoxAddСompartment
|
||||||
|
//
|
||||||
|
this.checkBoxAddСompartment.AutoSize = true;
|
||||||
|
this.checkBoxAddСompartment.Location = new System.Drawing.Point(17, 142);
|
||||||
|
this.checkBoxAddСompartment.Name = "checkBoxAddСompartment";
|
||||||
|
this.checkBoxAddСompartment.Size = new System.Drawing.Size(351, 19);
|
||||||
|
this.checkBoxAddСompartment.TabIndex = 5;
|
||||||
|
this.checkBoxAddСompartment.Text = "Признак наличия дополнительного пассажирского отсека";
|
||||||
|
this.checkBoxAddСompartment.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// groupBoxColors
|
||||||
|
//
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelRed);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelGreen);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelBlue);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelYellow);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelPurple);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelBlack);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelGray);
|
||||||
|
this.groupBoxColors.Controls.Add(this.panelWhite);
|
||||||
|
this.groupBoxColors.Location = new System.Drawing.Point(402, 22);
|
||||||
|
this.groupBoxColors.Name = "groupBoxColors";
|
||||||
|
this.groupBoxColors.Size = new System.Drawing.Size(187, 103);
|
||||||
|
this.groupBoxColors.TabIndex = 6;
|
||||||
|
this.groupBoxColors.TabStop = false;
|
||||||
|
this.groupBoxColors.Text = "Цвета";
|
||||||
|
//
|
||||||
|
// panelWhite
|
||||||
|
//
|
||||||
|
this.panelWhite.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||||
|
this.panelWhite.Location = new System.Drawing.Point(6, 22);
|
||||||
|
this.panelWhite.Name = "panelWhite";
|
||||||
|
this.panelWhite.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelWhite.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// panelGray
|
||||||
|
//
|
||||||
|
this.panelGray.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||||
|
this.panelGray.Location = new System.Drawing.Point(51, 22);
|
||||||
|
this.panelGray.Name = "panelGray";
|
||||||
|
this.panelGray.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelGray.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// panelBlack
|
||||||
|
//
|
||||||
|
this.panelBlack.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||||
|
this.panelBlack.Location = new System.Drawing.Point(96, 22);
|
||||||
|
this.panelBlack.Name = "panelBlack";
|
||||||
|
this.panelBlack.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelBlack.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// panelPurple
|
||||||
|
//
|
||||||
|
this.panelPurple.BackColor = System.Drawing.Color.Purple;
|
||||||
|
this.panelPurple.Location = new System.Drawing.Point(141, 22);
|
||||||
|
this.panelPurple.Name = "panelPurple";
|
||||||
|
this.panelPurple.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelPurple.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// panelYellow
|
||||||
|
//
|
||||||
|
this.panelYellow.BackColor = System.Drawing.Color.Yellow;
|
||||||
|
this.panelYellow.Location = new System.Drawing.Point(6, 60);
|
||||||
|
this.panelYellow.Name = "panelYellow";
|
||||||
|
this.panelYellow.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelYellow.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// panelBlue
|
||||||
|
//
|
||||||
|
this.panelBlue.BackColor = System.Drawing.Color.Blue;
|
||||||
|
this.panelBlue.Location = new System.Drawing.Point(51, 60);
|
||||||
|
this.panelBlue.Name = "panelBlue";
|
||||||
|
this.panelBlue.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelBlue.TabIndex = 1;
|
||||||
|
this.panelBlue.Paint += new System.Windows.Forms.PaintEventHandler(this.panel6_Paint);
|
||||||
|
//
|
||||||
|
// panelGreen
|
||||||
|
//
|
||||||
|
this.panelGreen.BackColor = System.Drawing.Color.Green;
|
||||||
|
this.panelGreen.Location = new System.Drawing.Point(96, 60);
|
||||||
|
this.panelGreen.Name = "panelGreen";
|
||||||
|
this.panelGreen.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelGreen.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// panelRed
|
||||||
|
//
|
||||||
|
this.panelRed.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.panelRed.Location = new System.Drawing.Point(141, 60);
|
||||||
|
this.panelRed.Name = "panelRed";
|
||||||
|
this.panelRed.Size = new System.Drawing.Size(39, 32);
|
||||||
|
this.panelRed.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// labelSimpleObject
|
||||||
|
//
|
||||||
|
this.labelSimpleObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.labelSimpleObject.Location = new System.Drawing.Point(386, 142);
|
||||||
|
this.labelSimpleObject.Name = "labelSimpleObject";
|
||||||
|
this.labelSimpleObject.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.labelSimpleObject.TabIndex = 7;
|
||||||
|
this.labelSimpleObject.Text = "Простой";
|
||||||
|
this.labelSimpleObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.labelSimpleObject.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LabelObject_MouseDown);
|
||||||
|
//
|
||||||
|
// labelModifiedObject
|
||||||
|
//
|
||||||
|
this.labelModifiedObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.labelModifiedObject.Location = new System.Drawing.Point(500, 142);
|
||||||
|
this.labelModifiedObject.Name = "labelModifiedObject";
|
||||||
|
this.labelModifiedObject.Size = new System.Drawing.Size(103, 23);
|
||||||
|
this.labelModifiedObject.TabIndex = 8;
|
||||||
|
this.labelModifiedObject.Text = "Продвитнутый";
|
||||||
|
this.labelModifiedObject.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.labelModifiedObject.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LabelObject_MouseDown);
|
||||||
|
//
|
||||||
|
// pictureBoxObject
|
||||||
|
//
|
||||||
|
this.pictureBoxObject.Location = new System.Drawing.Point(17, 41);
|
||||||
|
this.pictureBoxObject.Name = "pictureBoxObject";
|
||||||
|
this.pictureBoxObject.Size = new System.Drawing.Size(206, 71);
|
||||||
|
this.pictureBoxObject.TabIndex = 1;
|
||||||
|
this.pictureBoxObject.TabStop = false;
|
||||||
|
//
|
||||||
|
// anelObject
|
||||||
|
//
|
||||||
|
this.anelObject.AllowDrop = true;
|
||||||
|
this.anelObject.Controls.Add(this.labelAddColor);
|
||||||
|
this.anelObject.Controls.Add(this.labelBaseColor);
|
||||||
|
this.anelObject.Controls.Add(this.pictureBoxObject);
|
||||||
|
this.anelObject.Location = new System.Drawing.Point(673, 2);
|
||||||
|
this.anelObject.Name = "anelObject";
|
||||||
|
this.anelObject.Size = new System.Drawing.Size(237, 124);
|
||||||
|
this.anelObject.TabIndex = 2;
|
||||||
|
this.anelObject.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelColor_MouseDown);
|
||||||
|
//
|
||||||
|
// labelBaseColor
|
||||||
|
//
|
||||||
|
this.labelBaseColor.AllowDrop = true;
|
||||||
|
this.labelBaseColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.labelBaseColor.Location = new System.Drawing.Point(17, 10);
|
||||||
|
this.labelBaseColor.Name = "labelBaseColor";
|
||||||
|
this.labelBaseColor.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.labelBaseColor.TabIndex = 8;
|
||||||
|
this.labelBaseColor.Text = "Цвет";
|
||||||
|
this.labelBaseColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.labelBaseColor.MouseEnter += new System.EventHandler(this.PanelObject_DragEnter);
|
||||||
|
//
|
||||||
|
// labelAddColor
|
||||||
|
//
|
||||||
|
this.labelAddColor.AllowDrop = true;
|
||||||
|
this.labelAddColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.labelAddColor.Location = new System.Drawing.Point(123, 10);
|
||||||
|
this.labelAddColor.Name = "labelAddColor";
|
||||||
|
this.labelAddColor.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.labelAddColor.TabIndex = 9;
|
||||||
|
this.labelAddColor.Text = "Доп. цвет";
|
||||||
|
this.labelAddColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
//
|
||||||
|
// buttonAddObject
|
||||||
|
//
|
||||||
|
this.buttonAddObject.Location = new System.Drawing.Point(673, 149);
|
||||||
|
this.buttonAddObject.Name = "buttonAddObject";
|
||||||
|
this.buttonAddObject.Size = new System.Drawing.Size(99, 23);
|
||||||
|
this.buttonAddObject.TabIndex = 3;
|
||||||
|
this.buttonAddObject.Text = "Добавить";
|
||||||
|
this.buttonAddObject.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
this.buttonCancel.Location = new System.Drawing.Point(810, 149);
|
||||||
|
this.buttonCancel.Name = "buttonCancel";
|
||||||
|
this.buttonCancel.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.buttonCancel.TabIndex = 4;
|
||||||
|
this.buttonCancel.Text = "Отмена";
|
||||||
|
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// FormPlaneConfig
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(933, 184);
|
||||||
|
this.Controls.Add(this.buttonCancel);
|
||||||
|
this.Controls.Add(this.buttonAddObject);
|
||||||
|
this.Controls.Add(this.anelObject);
|
||||||
|
this.Controls.Add(this.groupBoxConfig);
|
||||||
|
this.Name = "FormPlaneConfig";
|
||||||
|
this.Text = "Создание объекта";
|
||||||
|
this.groupBoxConfig.ResumeLayout(false);
|
||||||
|
this.groupBoxConfig.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSpeed)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWeight)).EndInit();
|
||||||
|
this.groupBoxColors.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxObject)).EndInit();
|
||||||
|
this.anelObject.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private GroupBox groupBoxConfig;
|
||||||
|
private Label labelModifiedObject;
|
||||||
|
private Label labelSimpleObject;
|
||||||
|
private GroupBox groupBoxColors;
|
||||||
|
private Panel panelRed;
|
||||||
|
private Panel panelGreen;
|
||||||
|
private Panel panelBlue;
|
||||||
|
private Panel panelYellow;
|
||||||
|
private Panel panelPurple;
|
||||||
|
private Panel panelBlack;
|
||||||
|
private Panel panelGray;
|
||||||
|
private Panel panelWhite;
|
||||||
|
private CheckBox checkBoxAddСompartment;
|
||||||
|
private CheckBox checkBoxAddEngine;
|
||||||
|
private NumericUpDown numericUpDownWeight;
|
||||||
|
private NumericUpDown numericUpDownSpeed;
|
||||||
|
private Label labelWeight;
|
||||||
|
private Label labelSpeed;
|
||||||
|
private PictureBox pictureBoxObject;
|
||||||
|
private Panel anelObject;
|
||||||
|
private Label labelAddColor;
|
||||||
|
private Label labelBaseColor;
|
||||||
|
private Button buttonAddObject;
|
||||||
|
private Button buttonCancel;
|
||||||
|
}
|
||||||
|
}
|
111
Airbus/Airbus/FormPlaneConfig.cs
Normal file
111
Airbus/Airbus/FormPlaneConfig.cs
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Airbus
|
||||||
|
{
|
||||||
|
public partial class FormPlaneConfig : Form
|
||||||
|
{//переменная-выбранная машина
|
||||||
|
DrawningAirbus _plane = null;
|
||||||
|
|
||||||
|
//конструктор
|
||||||
|
public FormPlaneConfig()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
panelBlack.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelPurple.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelGray.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelGreen.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelRed.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelWhite.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelYellow.MouseDown += PanelColor_MouseDown;
|
||||||
|
panelBlue.MouseDown += PanelColor_MouseDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawPlane()
|
||||||
|
{
|
||||||
|
Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height);
|
||||||
|
Graphics gr = Graphics.FromImage(bmp);
|
||||||
|
_plane?.SetPosition(5, 5, pictureBoxObject.Width, pictureBoxObject.Height);
|
||||||
|
_plane?.DrawTransport(gr);
|
||||||
|
pictureBoxObject.Image = bmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LabelObject_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Label).DoDragDrop((sender as Label).Name, DragDropEffects.Move | DragDropEffects.Copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
//проверка получаемой информации (ее типа на соответствие требуемому)
|
||||||
|
private void PanelObject_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Data.GetDataPresent(DataFormats.Text))
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.Copy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//действия при приеме перетаскиваемой информации
|
||||||
|
private void PanelObject_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
switch (e.Data.GetData(DataFormats.Text).ToString())
|
||||||
|
{
|
||||||
|
case "labelSimpleObject":
|
||||||
|
_plane = new DrawningAirbus((int)numericUpDownSpeed.Value, (int)numericUpDownWeight.Value, Color.White);
|
||||||
|
break;
|
||||||
|
case "labelModifiedObject":
|
||||||
|
_plane = new DrawningSuperAirbus((int)numericUpDownSpeed.Value, (int)numericUpDownWeight.Value, Color.White, Color.Black,
|
||||||
|
checkBoxAddСompartment.Checked, checkBoxAddEngine.Checked);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawPlane();
|
||||||
|
}
|
||||||
|
|
||||||
|
//отправляем цвет с панели
|
||||||
|
private void PanelColor_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
(sender as Control).DoDragDrop((sender as Control).BackColor, DragDropEffects.Move | DragDropEffects.Copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
//проверка получаемой информации (её типа на соответсвие требуемому)
|
||||||
|
private void LabelBaseColor_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Data.GetDataPresent(typeof(Color)))
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.Copy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//принимаем основной цвет
|
||||||
|
private void LabelBaseColor_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
//TODO Call method from object _plane and set Color
|
||||||
|
}
|
||||||
|
|
||||||
|
//принимаем дополнительный цвет
|
||||||
|
private void labelAddColor_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
//TODO Call method from object _plane is DrawningSuperAirbus and set add color
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PanelObject_DragEnter(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
60
Airbus/Airbus/FormPlaneConfig.resx
Normal file
60
Airbus/Airbus/FormPlaneConfig.resx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<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>
|
Loading…
Reference in New Issue
Block a user