diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down.png index e487340..38027b7 100644 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down.png and b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down.png differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down1.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down1.png deleted file mode 100644 index 38027b7..0000000 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_down1.png and /dev/null differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left.png index c860bf9..952a0e9 100644 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left.png and b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left.png differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left1.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left1.png deleted file mode 100644 index 952a0e9..0000000 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_left1.png and /dev/null differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right.png index e8b6ca0..51d3256 100644 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right.png and b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right.png differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right1.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right1.png deleted file mode 100644 index 51d3256..0000000 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_right1.png and /dev/null differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up.png index d20dff5..febc548 100644 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up.png and b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up.png differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up1.png b/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up1.png deleted file mode 100644 index febc548..0000000 Binary files a/PIbd-21_Potapov_N.S._Catamaran_Base.backup/PIbd-21_Potapov_N.S._Catamaran_Base/Resources/arrow_up1.png and /dev/null differ diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.Designer.cs b/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.Designer.cs index 78f0aaa..890a43c 100644 --- a/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.Designer.cs +++ b/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.Designer.cs @@ -29,41 +29,62 @@ namespace PIbd_21_Potapov_N.S._Catamaran_Base /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.btn_new = new System.Windows.Forms.Button(); this.statusStrip = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabelColor = new System.Windows.Forms.ToolStripStatusLabel(); this.groupBox = new System.Windows.Forms.GroupBox(); this.btn_up = new System.Windows.Forms.Button(); this.btn_down = new System.Windows.Forms.Button(); this.btn_left = new System.Windows.Forms.Button(); this.btn_right = new System.Windows.Forms.Button(); this.pictureBox = new System.Windows.Forms.PictureBox(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.statusStrip.SuspendLayout(); this.groupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); this.SuspendLayout(); // // btn_new // - this.btn_new.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btn_new.Location = new System.Drawing.Point(12, 606); + this.btn_new.Location = new System.Drawing.Point(12, 327); this.btn_new.Name = "btn_new"; - this.btn_new.Size = new System.Drawing.Size(75, 47); - this.btn_new.TabIndex = 5; - this.btn_new.Text = "new"; - this.btn_new.UseVisualStyleBackColor = true; + this.btn_new.Size = new System.Drawing.Size(75, 60); + this.btn_new.TabIndex = 10; + this.btn_new.Text = "New"; this.btn_new.Click += new System.EventHandler(this.btn_new_Click); // // statusStrip // this.statusStrip.ImageScalingSize = new System.Drawing.Size(20, 20); - this.statusStrip.Location = new System.Drawing.Point(0, 656); + this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabelSpeed, + this.toolStripStatusLabelWeight, + this.toolStripStatusLabelColor}); + this.statusStrip.Location = new System.Drawing.Point(0, 395); this.statusStrip.Name = "statusStrip"; - this.statusStrip.Size = new System.Drawing.Size(1074, 22); + this.statusStrip.Size = new System.Drawing.Size(1074, 24); this.statusStrip.TabIndex = 8; this.statusStrip.Text = "statusStrip"; // + // toolStripStatusLabelSpeed + // + this.toolStripStatusLabelSpeed.Name = "toolStripStatusLabelSpeed"; + this.toolStripStatusLabelSpeed.Size = new System.Drawing.Size(75, 19); + this.toolStripStatusLabelSpeed.Text = "Скорость: "; + // + // toolStripStatusLabelWeight + // + this.toolStripStatusLabelWeight.Name = "toolStripStatusLabelWeight"; + this.toolStripStatusLabelWeight.Size = new System.Drawing.Size(37, 19); + this.toolStripStatusLabelWeight.Text = "Вес: "; + // + // toolStripStatusLabelColor + // + this.toolStripStatusLabelColor.Name = "toolStripStatusLabelColor"; + this.toolStripStatusLabelColor.Size = new System.Drawing.Size(46, 19); + this.toolStripStatusLabelColor.Text = "Цвет: "; + // // groupBox // this.groupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -71,75 +92,90 @@ namespace PIbd_21_Potapov_N.S._Catamaran_Base this.groupBox.Controls.Add(this.btn_down); this.groupBox.Controls.Add(this.btn_left); this.groupBox.Controls.Add(this.btn_right); - this.groupBox.Location = new System.Drawing.Point(902, 531); + this.groupBox.Location = new System.Drawing.Point(923, 309); + this.groupBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox.Name = "groupBox"; - this.groupBox.Size = new System.Drawing.Size(172, 108); + this.groupBox.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.groupBox.Size = new System.Drawing.Size(139, 84); this.groupBox.TabIndex = 9; this.groupBox.TabStop = false; // // btn_up // + this.btn_up.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btn_up.Image = global::PIbd_21_Potapov_N.S._Catamaran_Base.Properties.Resources.arrow_up1; - this.btn_up.Location = new System.Drawing.Point(59, 0); + this.btn_up.Location = new System.Drawing.Point(51, 0); + this.btn_up.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btn_up.Name = "btn_up"; - this.btn_up.Size = new System.Drawing.Size(55, 55); + this.btn_up.Size = new System.Drawing.Size(40, 38); this.btn_up.TabIndex = 1; this.btn_up.UseVisualStyleBackColor = true; this.btn_up.Click += new System.EventHandler(this.btn_move_Click); // // btn_down // + this.btn_down.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btn_down.Image = global::PIbd_21_Potapov_N.S._Catamaran_Base.Properties.Resources.arrow_down1; - this.btn_down.Location = new System.Drawing.Point(59, 56); + this.btn_down.Location = new System.Drawing.Point(51, 40); + this.btn_down.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btn_down.Name = "btn_down"; - this.btn_down.Size = new System.Drawing.Size(55, 55); + this.btn_down.Size = new System.Drawing.Size(40, 38); this.btn_down.TabIndex = 2; + this.btn_down.Text = " "; this.btn_down.UseVisualStyleBackColor = true; this.btn_down.Click += new System.EventHandler(this.btn_move_Click); // // btn_left // + this.btn_left.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btn_left.Image = global::PIbd_21_Potapov_N.S._Catamaran_Base.Properties.Resources.arrow_left1; - this.btn_left.Location = new System.Drawing.Point(3, 56); + this.btn_left.Location = new System.Drawing.Point(5, 40); + this.btn_left.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btn_left.Name = "btn_left"; - this.btn_left.Size = new System.Drawing.Size(55, 55); + this.btn_left.Size = new System.Drawing.Size(40, 38); this.btn_left.TabIndex = 3; this.btn_left.UseVisualStyleBackColor = true; this.btn_left.Click += new System.EventHandler(this.btn_move_Click); // // btn_right // + this.btn_right.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btn_right.Image = global::PIbd_21_Potapov_N.S._Catamaran_Base.Properties.Resources.arrow_right1; - this.btn_right.Location = new System.Drawing.Point(115, 56); + this.btn_right.Location = new System.Drawing.Point(97, 42); + this.btn_right.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btn_right.Name = "btn_right"; - this.btn_right.Size = new System.Drawing.Size(55, 55); + this.btn_right.Size = new System.Drawing.Size(40, 38); this.btn_right.TabIndex = 4; this.btn_right.UseVisualStyleBackColor = true; this.btn_right.Click += new System.EventHandler(this.btn_move_Click); // // pictureBox // - this.pictureBox.Location = new System.Drawing.Point(-1, 1); + this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox.Location = new System.Drawing.Point(0, 0); + this.pictureBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.pictureBox.Name = "pictureBox"; - this.pictureBox.Size = new System.Drawing.Size(1063, 524); + this.pictureBox.Size = new System.Drawing.Size(1074, 419); this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox.TabIndex = 0; this.pictureBox.TabStop = false; // // Form // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 19F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1074, 678); + this.ClientSize = new System.Drawing.Size(1074, 419); this.Controls.Add(this.groupBox); - this.Controls.Add(this.statusStrip); this.Controls.Add(this.btn_new); + this.Controls.Add(this.statusStrip); this.Controls.Add(this.pictureBox); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "Form"; this.Text = "CatamaranTest"; + this.statusStrip.ResumeLayout(false); + this.statusStrip.PerformLayout(); this.groupBox.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -155,7 +191,9 @@ namespace PIbd_21_Potapov_N.S._Catamaran_Base private System.Windows.Forms.Button btn_new; private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.GroupBox groupBox; - private System.Windows.Forms.BindingSource bindingSource1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSpeed; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelWeight; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelColor; } } diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.cs b/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.cs index d62e114..d1103b3 100644 --- a/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.cs +++ b/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.cs @@ -22,10 +22,14 @@ namespace PIbd_21_Potapov_N.S._Catamaran_Base private void btn_new_Click(object sender, EventArgs e) { - catamaranDrawObj = new DrawCatamaran(); - catamaranDrawObj.Init(80.0f, Color.Black, Directions.Right, 20); - catamaranDrawObj.SetPosition(20, 50, pictureBox.Width, pictureBox.Height); + Random rnd = new Random(); + catamaranDrawObj = new DrawCatamaran(); + catamaranDrawObj.Init(rnd.Next(50, 100), Color.FromArgb(rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255)), Directions.Right, 20); + catamaranDrawObj.SetPosition(rnd.Next(10, 50), rnd.Next(10, 50), pictureBox.Width, pictureBox.Height); + toolStripStatusLabelSpeed.Text = $"Скорость: {catamaranDrawObj.Catamaran.Speed}"; + toolStripStatusLabelWeight.Text = $"Вес: {catamaranDrawObj.Catamaran.Weight}"; + toolStripStatusLabelColor.Text = $"Цвет: {catamaranDrawObj.Catamaran.EntityColor.Name}"; RedrawCatamaran(); } @@ -87,6 +91,5 @@ namespace PIbd_21_Potapov_N.S._Catamaran_Base } - } } diff --git a/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.resx b/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.resx index 32e093f..2c0949d 100644 --- a/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.resx +++ b/PIbd-21_Potapov_N.S._Catamaran_Base/PIbd-21_Potapov_N.S._Catamaran_Base/Form.resx @@ -1,64 +1,4 @@ - - - + @@ -120,7 +60,4 @@ 17, 17 - - 141, 20 - \ No newline at end of file