PIbd-23. Kislitsa E.D. Lab work 03 #3 #3
@ -12,9 +12,9 @@ namespace ProjectAirFighter.Generics
|
||||
|
||||
private readonly int _pictureHeight;
|
||||
|
||||
private readonly int _placeSizeWidth = 133;
|
||||
private readonly int _placeSizeWidth = 166;
|
||||
|
||||
private readonly int _placeSizeHeight = 50;
|
||||
private readonly int _placeSizeHeight = 160;
|
||||
|
||||
private readonly SetGeneric<T> _collection;
|
||||
|
||||
@ -76,15 +76,25 @@ pos)
|
||||
|
||||
private void DrawObjects(Graphics g)
|
||||
{
|
||||
int c = 0,r = _pictureHeight/_placeSizeHeight;
|
||||
|
||||
for (int i = 0; i < _collection.Count; i++)
|
||||
{
|
||||
DrawningAirplane airplane = _collection.Get(i);
|
||||
if (airplane != null)
|
||||
{
|
||||
int inRow = _pictureWidth / _placeSizeWidth;
|
||||
airplane.SetPosition(i % inRow * _placeSizeWidth, (_collection.Count / inRow - 1 - i / inRow) * _placeSizeHeight );
|
||||
airplane.SetPosition(_pictureWidth - _placeSizeWidth - (i % inRow * _placeSizeWidth), (_collection.Count / inRow - 1 - i / inRow) * _placeSizeHeight + (_placeSizeHeight - _placeSizeHeight * 125 / 1000) / 2);
|
||||
airplane.DrawTransport(g);
|
||||
|
||||
c++;
|
||||
if (c - 1 == inRow)
|
||||
{
|
||||
c = 0;
|
||||
r--;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
16
AirFighter/FormAirplaneCollection.Designer.cs
generated
16
AirFighter/FormAirplaneCollection.Designer.cs
generated
@ -44,23 +44,23 @@
|
||||
this.toolGroupBox.Controls.Add(this.updateCollectionButton);
|
||||
this.toolGroupBox.Controls.Add(this.deleteAirplaneButton);
|
||||
this.toolGroupBox.Controls.Add(this.addAirplaneButton);
|
||||
this.toolGroupBox.Location = new System.Drawing.Point(623, 12);
|
||||
this.toolGroupBox.Location = new System.Drawing.Point(688, 12);
|
||||
this.toolGroupBox.Name = "toolGroupBox";
|
||||
this.toolGroupBox.Size = new System.Drawing.Size(227, 426);
|
||||
this.toolGroupBox.Size = new System.Drawing.Size(251, 426);
|
||||
this.toolGroupBox.TabIndex = 0;
|
||||
this.toolGroupBox.TabStop = false;
|
||||
this.toolGroupBox.Text = "Инструменты";
|
||||
//
|
||||
// maskedTextBox
|
||||
//
|
||||
this.maskedTextBox.Location = new System.Drawing.Point(6, 72);
|
||||
this.maskedTextBox.Location = new System.Drawing.Point(20, 72);
|
||||
this.maskedTextBox.Name = "maskedTextBox";
|
||||
this.maskedTextBox.Size = new System.Drawing.Size(125, 27);
|
||||
this.maskedTextBox.TabIndex = 4;
|
||||
//
|
||||
// updateCollectionButton
|
||||
//
|
||||
this.updateCollectionButton.Location = new System.Drawing.Point(6, 151);
|
||||
this.updateCollectionButton.Location = new System.Drawing.Point(20, 151);
|
||||
this.updateCollectionButton.Name = "updateCollectionButton";
|
||||
this.updateCollectionButton.Size = new System.Drawing.Size(215, 40);
|
||||
this.updateCollectionButton.TabIndex = 3;
|
||||
@ -70,7 +70,7 @@
|
||||
//
|
||||
// deleteAirplaneButton
|
||||
//
|
||||
this.deleteAirplaneButton.Location = new System.Drawing.Point(6, 105);
|
||||
this.deleteAirplaneButton.Location = new System.Drawing.Point(20, 105);
|
||||
this.deleteAirplaneButton.Name = "deleteAirplaneButton";
|
||||
this.deleteAirplaneButton.Size = new System.Drawing.Size(215, 40);
|
||||
this.deleteAirplaneButton.TabIndex = 2;
|
||||
@ -80,7 +80,7 @@
|
||||
//
|
||||
// addAirplaneButton
|
||||
//
|
||||
this.addAirplaneButton.Location = new System.Drawing.Point(6, 26);
|
||||
this.addAirplaneButton.Location = new System.Drawing.Point(20, 26);
|
||||
this.addAirplaneButton.Name = "addAirplaneButton";
|
||||
this.addAirplaneButton.Size = new System.Drawing.Size(215, 40);
|
||||
this.addAirplaneButton.TabIndex = 0;
|
||||
@ -92,7 +92,7 @@
|
||||
//
|
||||
this.pictureBoxCollection.Location = new System.Drawing.Point(12, 12);
|
||||
this.pictureBoxCollection.Name = "pictureBoxCollection";
|
||||
this.pictureBoxCollection.Size = new System.Drawing.Size(605, 426);
|
||||
this.pictureBoxCollection.Size = new System.Drawing.Size(670, 426);
|
||||
this.pictureBoxCollection.TabIndex = 1;
|
||||
this.pictureBoxCollection.TabStop = false;
|
||||
//
|
||||
@ -100,7 +100,7 @@
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(862, 450);
|
||||
this.ClientSize = new System.Drawing.Size(951, 446);
|
||||
this.Controls.Add(this.pictureBoxCollection);
|
||||
this.Controls.Add(this.toolGroupBox);
|
||||
this.Name = "FormAirplaneCollection";
|
||||
|
Loading…
Reference in New Issue
Block a user