From c77db12841f202838327e2b2224d428e029d2429 Mon Sep 17 00:00:00 2001 From: Arsenee <32013422+Arsenee@users.noreply.github.com> Date: Fri, 6 Apr 2018 16:12:10 +0300 Subject: [PATCH 1/2] Add files via upload --- .../WindowsFormsApplication1/Files.cs | 2 +- .../MainForm.Designer.cs | 33 +++---------------- .../WindowsFormsApplication1/MainForm.cs | 23 ++++++++----- .../WindowsFormsApplication1/Sinus.cs | 2 +- 4 files changed, 21 insertions(+), 39 deletions(-) diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs index b0ab369..f41e5fa 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs @@ -38,7 +38,7 @@ namespace WindowsFormsApplication1 public static void OpenWhile(string filename) { File.AppendAllText(filename, Environment.NewLine); - File.AppendAllText(filename, " while (!GetAsyncKeyState(VK_ESCAPE));" + Environment.NewLine); + File.AppendAllText(filename, " while (!GetAsyncKeyState(VK_ESCAPE))" + Environment.NewLine); File.AppendAllText(filename, " {" + Environment.NewLine); File.AppendAllText(filename, " txSetColor(TX_RED);" + Environment.NewLine); File.AppendAllText(filename, " txSetFillColor(TX_RED);" + Environment.NewLine); diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs index b707aa0..fa42319 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs @@ -99,6 +99,7 @@ namespace WindowsFormsApplication1 this.nazvanieTextBox.Name = "nazvanieTextBox"; this.nazvanieTextBox.Size = new System.Drawing.Size(138, 20); this.nazvanieTextBox.TabIndex = 3; + this.nazvanieTextBox.TextChanged += new System.EventHandler(this.nazvanieTextBox_TextChanged); // // panel1 // @@ -125,32 +126,6 @@ namespace WindowsFormsApplication1 this.label13.TabIndex = 23; this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ"; // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(143, 308); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(39, 13); - this.label12.TabIndex = 22; - this.label12.Text = "номер"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(79, 308); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(39, 13); - this.label11.TabIndex = 22; - this.label11.Text = "время"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(9, 308); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(27, 13); - this.label10.TabIndex = 22; - this.label10.Text = "имя"; // PictureBoxBackground // this.PictureBoxBackground.Location = new System.Drawing.Point(17, 160); @@ -201,7 +176,7 @@ namespace WindowsFormsApplication1 // SaveCharButton // this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom; - this.SaveCharButton.Location = new System.Drawing.Point(0, 315); + this.SaveCharButton.Location = new System.Drawing.Point(0, 320); this.SaveCharButton.Name = "SaveCharButton"; this.SaveCharButton.Size = new System.Drawing.Size(377, 30); this.SaveCharButton.TabIndex = 3; @@ -228,7 +203,7 @@ namespace WindowsFormsApplication1 this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Location = new System.Drawing.Point(0, 26); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(392, 319); + this.panel3.Size = new System.Drawing.Size(377, 324); this.panel3.TabIndex = 2; this.panel3.Visible = false; // @@ -357,7 +332,7 @@ namespace WindowsFormsApplication1 // SaveMultButton // this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom; - this.SaveMultButton.Location = new System.Drawing.Point(0, 345); + this.SaveMultButton.Location = new System.Drawing.Point(0, 350); this.SaveMultButton.Name = "SaveMultButton"; this.SaveMultButton.Size = new System.Drawing.Size(377, 30); this.SaveMultButton.TabIndex = 1; diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs index 1a20b02..b64af58 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs @@ -209,15 +209,13 @@ namespace WindowsFormsApplication1 { if (openFileDialog1.ShowDialog() == DialogResult.Cancel) return; - string filename = openFileDialog1.FileName; - string fileText =File.ReadAllText(filename); - nazvanieTextBox.Text = fileText; - PictureBoxBackground.Image = Image.FromFile(Path.Combine(Application.StartupPath, "kartinka.jpg")); + PictureBoxBackground.Image = Image.FromFile(openFileDialog1.FileName); } private void SaveMultButton_Click(object sender, EventArgs e) { - if (saveFileDialog1.ShowDialog() == DialogResult.OK) + if (saveFileDialog1.ShowDialog() == DialogResult.OK && + PictureBoxBackground.Image != null) { string filename = saveFileDialog1.FileName; @@ -239,7 +237,7 @@ namespace WindowsFormsApplication1 Files.OpenWhile(filename); Sinus.MovePerson(filename, "per"); close_while(filename); - delete_pics2(filename, 5); + delete_pics(filename); } else if (ComboBoxMove.Text == "Кругами") { @@ -249,6 +247,15 @@ namespace WindowsFormsApplication1 close_while(filename); delete_pics(filename); } + else if (ComboBoxMove.Text == "Диагонально") + { + Sinus.CreatePerson(filename, "per", TextBoxWall1.Text); + old_place(filename, "per"); + Files.OpenWhile(filename); + go_pryamo(filename, "per"); + close_while(filename); + delete_pics(filename); + } Files.Ending(filename); @@ -276,9 +283,9 @@ namespace WindowsFormsApplication1 } } - private void SaveMultButton_Click(object sender, EventArgs e) + private void nazvanieTextBox_TextChanged(object sender, EventArgs e) { - //надо + } } } diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs index f8b4bce..fcf6ddf 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs @@ -12,7 +12,7 @@ namespace WindowsFormsApplication1 { File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); - File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\Personaj.bmp\");" + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\Personaj.bmp\");" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".x = " + xBeg + ";" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".y = " + xBeg + ";" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine); From 73835572bfaec9600c32235fef52fadeafcc074e Mon Sep 17 00:00:00 2001 From: Mikhail Abramov Date: Sat, 7 Apr 2018 06:26:31 +0300 Subject: [PATCH 2/2] Update MainForm.Designer.cs --- .../WindowsFormsApplication1/MainForm.Designer.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs index 9798434..7a17f4e 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs @@ -101,7 +101,6 @@ namespace WindowsFormsApplication1 this.nazvanieTextBox.Name = "nazvanieTextBox"; this.nazvanieTextBox.Size = new System.Drawing.Size(138, 20); this.nazvanieTextBox.TabIndex = 3; - this.nazvanieTextBox.TextChanged += new System.EventHandler(this.nazvanieTextBox_TextChanged); // // panel1 // @@ -423,4 +422,4 @@ namespace WindowsFormsApplication1 private System.Windows.Forms.Label label13; private System.Windows.Forms.PictureBox openSpace; } -} \ No newline at end of file +}