Pibd-13 Kadyshev_M.I. LabWork05 Base #5

Closed
nezui wants to merge 3 commits from LabWork05 into LabWork04
3 changed files with 493 additions and 0 deletions
Showing only changes of commit 2c39c97efa - Show all commits

View File

@ -0,0 +1,323 @@
namespace ProjectAirFighter
{
partial class FormWarPlaneConfig
{
/// <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();
groupBoxColor = new GroupBox();
panelPurple = new Panel();
panelYellow = new Panel();
panelBlack = new Panel();
panelGray = new Panel();
panelBlue = new Panel();
panelWhite = new Panel();
panelGreen = new Panel();
panelRed = new Panel();
checkBoxAdditionalWing = new CheckBox();
checkBoxRocket = new CheckBox();
numericUpDownWheight = new NumericUpDown();
labelWheight = new Label();
numericUpDownSpeed = new NumericUpDown();
labelSpeed = new Label();
label = new Label();
labelSimpleObject = new Label();
pictureBoxObject = new PictureBox();
buttonAdd = new Button();
buttonCancel = new Button();
panelObject = new Panel();
groupBoxConfig.SuspendLayout();
groupBoxColor.SuspendLayout();
((System.ComponentModel.ISupportInitialize)numericUpDownWheight).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit();
panelObject.SuspendLayout();
SuspendLayout();
//
// groupBoxConfig
//
groupBoxConfig.Controls.Add(groupBoxColor);
groupBoxConfig.Controls.Add(checkBoxAdditionalWing);
groupBoxConfig.Controls.Add(checkBoxRocket);
groupBoxConfig.Controls.Add(numericUpDownWheight);
groupBoxConfig.Controls.Add(labelWheight);
groupBoxConfig.Controls.Add(numericUpDownSpeed);
groupBoxConfig.Controls.Add(labelSpeed);
groupBoxConfig.Controls.Add(label);
groupBoxConfig.Controls.Add(labelSimpleObject);
groupBoxConfig.Dock = DockStyle.Left;
groupBoxConfig.Location = new Point(0, 0);
groupBoxConfig.Name = "groupBoxConfig";
groupBoxConfig.Size = new Size(569, 266);
groupBoxConfig.TabIndex = 0;
groupBoxConfig.TabStop = false;
groupBoxConfig.Text = "Параметры";
//
// groupBoxColor
//
groupBoxColor.Controls.Add(panelPurple);
groupBoxColor.Controls.Add(panelYellow);
groupBoxColor.Controls.Add(panelBlack);
groupBoxColor.Controls.Add(panelGray);
groupBoxColor.Controls.Add(panelBlue);
groupBoxColor.Controls.Add(panelWhite);
groupBoxColor.Controls.Add(panelGreen);
groupBoxColor.Controls.Add(panelRed);
groupBoxColor.Location = new Point(219, 12);
groupBoxColor.Name = "groupBoxColor";
groupBoxColor.Size = new Size(335, 157);
groupBoxColor.TabIndex = 8;
groupBoxColor.TabStop = false;
groupBoxColor.Text = "Цвета";
//
// panelPurple
//
panelPurple.BackColor = Color.Purple;
panelPurple.Location = new Point(271, 99);
panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(58, 52);
panelPurple.TabIndex = 7;
//
// panelYellow
//
panelYellow.BackColor = Color.Yellow;
panelYellow.Location = new Point(271, 26);
panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(58, 52);
panelYellow.TabIndex = 3;
//
// panelBlack
//
panelBlack.BackColor = Color.Black;
panelBlack.Location = new Point(176, 99);
panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(58, 52);
panelBlack.TabIndex = 6;
//
// panelGray
//
panelGray.BackColor = Color.Gray;
panelGray.Location = new Point(89, 99);
panelGray.Name = "panelGray";
panelGray.Size = new Size(58, 52);
panelGray.TabIndex = 5;
//
// panelBlue
//
panelBlue.BackColor = Color.Blue;
panelBlue.Location = new Point(176, 26);
panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(58, 52);
panelBlue.TabIndex = 2;
//
// panelWhite
//
panelWhite.BackColor = Color.White;
panelWhite.Location = new Point(6, 99);
panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(58, 52);
panelWhite.TabIndex = 4;
//
// panelGreen
//
panelGreen.BackColor = Color.Green;
panelGreen.Location = new Point(89, 26);
panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(58, 52);
panelGreen.TabIndex = 1;
//
// panelRed
//
panelRed.BackColor = Color.Red;
panelRed.Location = new Point(6, 26);
panelRed.Name = "panelRed";
panelRed.Size = new Size(58, 52);
panelRed.TabIndex = 0;
//
// checkBoxAdditionalWing
//
checkBoxAdditionalWing.AutoSize = true;
checkBoxAdditionalWing.Location = new Point(12, 175);
checkBoxAdditionalWing.Name = "checkBoxAdditionalWing";
checkBoxAdditionalWing.Size = new Size(339, 24);
checkBoxAdditionalWing.TabIndex = 7;
checkBoxAdditionalWing.Text = "Признак наличия дополнительных крыльев";
checkBoxAdditionalWing.UseVisualStyleBackColor = true;
//
// checkBoxRocket
//
checkBoxRocket.AutoSize = true;
checkBoxRocket.Location = new Point(12, 145);
checkBoxRocket.Name = "checkBoxRocket";
checkBoxRocket.Size = new Size(196, 24);
checkBoxRocket.TabIndex = 6;
checkBoxRocket.Text = "Признак наличия ракет";
checkBoxRocket.UseVisualStyleBackColor = true;
//
// numericUpDownWheight
//
numericUpDownWheight.Location = new Point(96, 63);
numericUpDownWheight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownWheight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownWheight.Name = "numericUpDownWheight";
numericUpDownWheight.Size = new Size(85, 27);
numericUpDownWheight.TabIndex = 5;
numericUpDownWheight.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelWheight
//
labelWheight.AutoSize = true;
labelWheight.Location = new Point(17, 70);
labelWheight.Name = "labelWheight";
labelWheight.Size = new Size(33, 20);
labelWheight.TabIndex = 4;
labelWheight.Text = "Вес";
//
// numericUpDownSpeed
//
numericUpDownSpeed.Location = new Point(96, 26);
numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownSpeed.Name = "numericUpDownSpeed";
numericUpDownSpeed.Size = new Size(85, 27);
numericUpDownSpeed.TabIndex = 3;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(17, 24);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(73, 20);
labelSpeed.TabIndex = 2;
labelSpeed.Text = "Скорость";
//
// label
//
label.BorderStyle = BorderStyle.FixedSingle;
label.Location = new Point(459, 174);
label.Name = "label";
label.Size = new Size(106, 24);
label.TabIndex = 1;
label.Text = "Продвинутый";
label.TextAlign = ContentAlignment.MiddleCenter;
label.Click += labelObject_Click;
//
// labelSimpleObject
//
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
labelSimpleObject.Location = new Point(357, 174);
labelSimpleObject.Name = "labelSimpleObject";
labelSimpleObject.Size = new Size(96, 24);
labelSimpleObject.TabIndex = 0;
labelSimpleObject.Text = "Простой";
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
labelSimpleObject.Click += labelObject_Click;
//
// pictureBoxObject
//
pictureBoxObject.Location = new Point(26, 34);
pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(181, 117);
pictureBoxObject.TabIndex = 1;
pictureBoxObject.TabStop = false;
//
// buttonAdd
//
buttonAdd.Location = new Point(604, 179);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(94, 29);
buttonAdd.TabIndex = 2;
buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true;
//
// buttonCancel
//
buttonCancel.Location = new Point(713, 179);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 3;
buttonCancel.Text = "Отменить";
buttonCancel.UseVisualStyleBackColor = true;
//
// panelObject
//
panelObject.AllowDrop = true;
panelObject.Controls.Add(pictureBoxObject);
panelObject.Location = new Point(591, 12);
panelObject.Name = "panelObject";
panelObject.Size = new Size(225, 161);
panelObject.TabIndex = 4;
panelObject.DragEnter += PanelObject_DragEnter;
//
// FormWarPlaneConfig
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(819, 266);
Controls.Add(panelObject);
Controls.Add(buttonCancel);
Controls.Add(buttonAdd);
Controls.Add(groupBoxConfig);
Name = "FormWarPlaneConfig";
Text = "Создание объекта";
groupBoxConfig.ResumeLayout(false);
groupBoxConfig.PerformLayout();
groupBoxColor.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)numericUpDownWheight).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit();
panelObject.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private GroupBox groupBoxConfig;
private Label labelSimpleObject;
private Label label;
private Label labelSpeed;
private NumericUpDown numericUpDownSpeed;
private Label labelWheight;
private NumericUpDown numericUpDownWheight;
private CheckBox checkBoxRocket;
private CheckBox checkBoxAdditionalWing;
private GroupBox groupBoxColor;
private Panel panelRed;
private Panel panelYellow;
private Panel panelBlue;
private Panel panelGreen;
private Panel panelPurple;
private Panel panelBlack;
private Panel panelGray;
private Panel panelWhite;
private PictureBox pictureBoxObject;
private Button buttonAdd;
private Button buttonCancel;
private Panel panelObject;
}
}

View File

@ -0,0 +1,50 @@
using ProjectAirFighter.Drawning;
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 ProjectAirFighter
{
public partial class FormWarPlaneConfig : Form
{
private DrawningWarPlane _warPlane;
public FormWarPlaneConfig()
{
InitializeComponent();
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void labelObject_Click(object sender, EventArgs e)
{
(sender as Label)?.DoDragDrop((sender as Label)?.Name, DragDropEffects.Move | DragDropEffects.Copy);
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PanelObject_DragEnter(object sender, DragEventArgs e)
{
if (e.Data?.GetDataPresent(DataFormats.Text) ?? false)
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect= DragDropEffects.None;
}
}
}
}

View 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>