Рабочая версия
This commit is contained in:
parent
c307fff27c
commit
0d20d952a8
@ -15,7 +15,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
|
||||
/// <summary>
|
||||
/// Размер места (высота)
|
||||
/// </summary>
|
||||
protected readonly int _placeSizeHeight = 80;
|
||||
protected readonly int _placeSizeHeight = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Ширина окна
|
||||
|
@ -12,12 +12,47 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
|
||||
|
||||
protected override void DrawBackgound(Graphics g)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
Pen pen = new(Color.Black, 4);
|
||||
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
|
||||
{
|
||||
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
|
||||
{
|
||||
g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight,
|
||||
i * _placeSizeWidth + _placeSizeWidth - 40, j * _placeSizeHeight);
|
||||
}
|
||||
g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, _pictureHeight / _placeSizeHeight * _placeSizeHeight);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetObjectsPosition()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
int width = _pictureWidth / _placeSizeWidth;
|
||||
int height = _pictureHeight / _placeSizeHeight;
|
||||
|
||||
int curWidth = 0;
|
||||
int curHeight = 0;
|
||||
|
||||
for (int i = 0; i < (_collection?.Count ?? 0); i++)
|
||||
{
|
||||
if (_collection.Get(i) != null)
|
||||
{
|
||||
_collection.Get(i).SetPictureSize(_pictureWidth, _pictureHeight);
|
||||
_collection.Get(i).SetPosition(_placeSizeWidth * curWidth + 10, curHeight * _placeSizeHeight);
|
||||
}
|
||||
|
||||
if (curWidth < width - 1)
|
||||
curWidth++;
|
||||
else
|
||||
{
|
||||
curWidth = 0;
|
||||
curHeight++;
|
||||
}
|
||||
if (curHeight > height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -67,6 +67,7 @@
|
||||
buttonRefresh.TabIndex = 6;
|
||||
buttonRefresh.Text = "Обновить";
|
||||
buttonRefresh.UseVisualStyleBackColor = true;
|
||||
buttonRefresh.Click += ButtonRefresh_Click;
|
||||
//
|
||||
// buttonGoToCheck
|
||||
//
|
||||
@ -88,6 +89,7 @@
|
||||
buttonRemoveAirplane.TabIndex = 4;
|
||||
buttonRemoveAirplane.Text = "Удалить самолет";
|
||||
buttonRemoveAirplane.UseVisualStyleBackColor = true;
|
||||
buttonRemoveAirplane.Click += ButtonRemoveAirplane_Click;
|
||||
//
|
||||
// maskedTextBoxPosition
|
||||
//
|
||||
@ -107,6 +109,7 @@
|
||||
buttonAddAirplaneWithRadar.TabIndex = 2;
|
||||
buttonAddAirplaneWithRadar.Text = "Добавить самолет с радаром";
|
||||
buttonAddAirplaneWithRadar.UseVisualStyleBackColor = true;
|
||||
buttonAddAirplaneWithRadar.Click += ButtonAddAirplaneWithRadar_Click;
|
||||
//
|
||||
// buttonAddAirplane
|
||||
//
|
||||
@ -117,6 +120,7 @@
|
||||
buttonAddAirplane.TabIndex = 1;
|
||||
buttonAddAirplane.Text = "Добавить самолет";
|
||||
buttonAddAirplane.UseVisualStyleBackColor = true;
|
||||
buttonAddAirplane.Click += ButtonAddAirplane_Click;
|
||||
//
|
||||
// comboBoxSelectorCompany
|
||||
//
|
||||
@ -128,6 +132,7 @@
|
||||
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
|
||||
comboBoxSelectorCompany.Size = new Size(188, 23);
|
||||
comboBoxSelectorCompany.TabIndex = 0;
|
||||
comboBoxSelectorCompany.Click += ComboBoxSelectorCompany_SelectedIndexChanged;
|
||||
//
|
||||
// pictureBox
|
||||
//
|
||||
|
@ -55,9 +55,10 @@ namespace ProjectAirplaneWithRadar
|
||||
break;
|
||||
case nameof(DrawingAirplaneWithRadar):
|
||||
drawingAirplane = new DrawingAirplaneWithRadar(random.Next(100, 300), random.Next(1000, 3000),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
GetColor(random),
|
||||
GetColor(random),
|
||||
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)));
|
||||
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
|
@ -11,7 +11,7 @@ namespace ProjectAirplaneWithRadar
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new FormAirplaneWithRadar());
|
||||
Application.Run(new FormAirplaneCollection());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user