diff --git a/.gitignore b/.gitignore
index 259148f..1ee5385 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,32 +1,362 @@
-# Prerequisites
-*.d
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
-# Compiled Object files
-*.slo
-*.lo
-*.o
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
*.obj
-
-# Precompiled Headers
-*.gch
+*.iobj
*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
-# Compiled Dynamic libraries
-*.so
-*.dylib
-*.dll
+# Chutzpah Test files
+_Chutzpah*
-# Fortran module files
-*.mod
-*.smod
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
-# Compiled Static libraries
-*.lai
-*.la
-*.a
-*.lib
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
-# Executables
-*.exe
-*.out
-*.app
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
diff --git a/How to use.docx b/How to use.docx
deleted file mode 100644
index 8f55f86..0000000
Binary files a/How to use.docx and /dev/null differ
diff --git a/README.md b/README.md
index 2dad5cf..9303587 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,21 @@
-# MultRedactor
-Редактор мультиков
-
-Задачи
-https://docs.google.com/spreadsheets/d/1ka-DjMCEskMYwHZOzJRvlgEZpGA5g-WNFh_pH3sF3y4/edit#gid=1972460334
+# MultRedactor
+
+## Что это?
+_MultRedactor_ - удобный графический редактор мультфильмов. Вы создаёте персонажей, задаёте им параметры, а эта программка преобразует всё в исходный код C++, и, по нажатию соответствующей кнопки, скомпилирует его. Правда удобно?
+
+## Как использовать?
+1. Запустите приложение.
+2. В левой части окна, в поле ввода, напишите название мультфильма.
+3. Всё в той же левой части выберите фон.
+4. Нажмите кнопку "Добавить персонажа".
+5. Выберите вид движения, границы (```x,y``` начала и ```x,y``` конца), тайминг (в секундах) и картинку.
+6. Назовите своего персонажа (необязательно) и нажмите кнопку "Сохранить персонажа".
+7. Если нужно, добавьте ещё персонажей.
+8. Нажмите кнопку "Сохранить мульт", выберите расположение файлов и введите название главного файла. Естественно, нужно нажать "Сохранить".
+9. Через некоторое время появится сообщение "Готово!". Нажмите кнопку "Компилировать". В открывшемся окошечке всё и так понятно расписано, здесь пояснять ничего не буду.
+10. По окончанию компиляции появится сообщение "Готово!". Да, теперь точно готово. Перейдите в каталог с мультфильмом - там найдёте *.exe-файл. Это готовый мультик.
+
+## TODO
+ - Написать нормальную инструкцию с картинками
+ - Доделать код движения персонажей, т.к. сейчас это всё очень криво...
+ - https://docs.google.com/spreadsheets/d/1ka-DjMCEskMYwHZOzJRvlgEZpGA5g-WNFh_pH3sF3y4/edit#gid=1972460334
diff --git a/WindowsFormsApplication1/.vs/WindowsFormsApplication1/v16/.suo b/WindowsFormsApplication1/.vs/WindowsFormsApplication1/v16/.suo
new file mode 100644
index 0000000..7753833
Binary files /dev/null and b/WindowsFormsApplication1/.vs/WindowsFormsApplication1/v16/.suo differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1.v12.suo b/WindowsFormsApplication1/WindowsFormsApplication1.v12.suo
deleted file mode 100644
index af83503..0000000
Binary files a/WindowsFormsApplication1/WindowsFormsApplication1.v12.suo and /dev/null differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs
index cd8fc1c..fa7c043 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs
@@ -1,9 +1,5 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace WindowsFormsApplication1
{
@@ -11,39 +7,43 @@ namespace WindowsFormsApplication1
{
public static void CreatePerson(string filename, string name, Person p)
{
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\");" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".angle = 0;" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(Environment.NewLine);
+ sw.Write(" Person " + name + ";" + Environment.NewLine);
+ sw.Write(" " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.address) + "\");" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Write(" " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".angle = 0;" + Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Close();
}
public static void MovePerson(string filename, string name, Person p)
{
- File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".angle = " + name + ".angle + 360 / 20 * " + p.circles + " / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x = (" + p.x1 + " + " + p.x2 + ")/2 + (" + p.x1 + " - " + p.x2 + ")/2 * cos (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y = (" + p.y1 + " + " + p.y2 + ")/2 + (" + p.y1 + " - " + p.y2 + ")/2 * sin (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
- File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
- p.width + "/" + p.sprite + ", " +
- p.height + "," +
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(" if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
+ sw.Write(" " + name + ".angle = " + name + ".angle + 360 / 20 * " + p.circles + " / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ sw.Write(" " + name + ".x = (" + p.x1 + " + " + p.x2 + ")/2 + (" + p.x1 + " - " + p.x2 + ")/2 * cos (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
+ sw.Write(" " + name + ".y = (" + p.y1 + " + " + p.y2 + ")/2 + (" + p.y1 + " - " + p.y2 + ")/2 * sin (" + name + ".angle * 3.1416 / 180);" + Environment.NewLine);
+ sw.Write(" txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
+ p.width + "/" + p.sprite + ", " +
+ p.height + "," +
name + ".texture, " +
p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
- File.AppendAllText(filename, " {" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra++;" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Write(" if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
+ sw.Write(" {" + Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Close();
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.Designer.cs
new file mode 100644
index 0000000..1f0b23d
--- /dev/null
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.Designer.cs
@@ -0,0 +1,142 @@
+namespace WindowsFormsApplication1
+{
+ partial class CompileForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.linkLabel1 = new System.Windows.Forms.LinkLabel();
+ this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
+ this.button2 = new System.Windows.Forms.Button();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.label1.Location = new System.Drawing.Point(12, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(196, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Полный путь к каталогу MinGW";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(12, 25);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(196, 20);
+ this.textBox1.TabIndex = 1;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(214, 24);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(74, 22);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Обзор...";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // linkLabel1
+ //
+ this.linkLabel1.AutoSize = true;
+ this.linkLabel1.Location = new System.Drawing.Point(12, 48);
+ this.linkLabel1.Name = "linkLabel1";
+ this.linkLabel1.Size = new System.Drawing.Size(257, 13);
+ this.linkLabel1.TabIndex = 3;
+ this.linkLabel1.TabStop = true;
+ this.linkLabel1.Text = "У меня нет установленного компилятора MinGW";
+ this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
+ //
+ // button2
+ //
+ this.button2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.button2.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.button2.Location = new System.Drawing.Point(0, 176);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(300, 28);
+ this.button2.TabIndex = 4;
+ this.button2.Text = "Старт!";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(12, 85);
+ this.textBox2.Multiline = true;
+ this.textBox2.Name = "textBox2";
+ this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.textBox2.Size = new System.Drawing.Size(276, 82);
+ this.textBox2.TabIndex = 5;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.label2.Location = new System.Drawing.Point(12, 69);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(127, 13);
+ this.label2.TabIndex = 6;
+ this.label2.Text = "Вывод компилятора";
+ //
+ // CompileForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(300, 204);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.linkLabel1);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.label1);
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "CompileForm";
+ this.Text = "Компилировать";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.LinkLabel linkLabel1;
+ private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Label label2;
+ }
+}
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.cs
new file mode 100644
index 0000000..6d8f92c
--- /dev/null
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace WindowsFormsApplication1
+{
+ public partial class CompileForm : Form
+ {
+ private string codeFilename = "";
+ private string mingwDir = "";
+ public CompileForm(string _codeFilename)
+ {
+ InitializeComponent();
+ codeFilename = _codeFilename;
+ }
+
+ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ if (MessageBox.Show("Для создания *.exe-файла мультфильма нужна специальная программа - компилятор.\n" +
+ "Мы используем компилятор MinGW. Чтобы его скачать, нажмите OK в этом диалоге,\n" +
+ "но учтите, что все нужные файлы весят ≈800МиБ!\n\n" +
+ "После загрузки Вам нужно распаковать архив в удобное Вам место,\n" +
+ "а затем, в этом окне, выбрать каталог mingw, который теперь лежит в \"удобном Вам месте\".",
+ "Скачать MinGW", MessageBoxButtons.OKCancel, MessageBoxIcon.Information).ToString() == "OK")
+ {
+ Process.Start("https://is.gd/Krp8r4");
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (folderBrowserDialog1.ShowDialog().ToString() == "OK")
+ {
+ mingwDir = folderBrowserDialog1.SelectedPath;
+ }
+ textBox1.Text = mingwDir;
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ if (mingwDir != "")
+ {
+ try
+ {
+ textBox2.Text += ("Компиляция " + codeFilename + " в " +
+ Path.GetFileNameWithoutExtension(codeFilename) + ".exe с помощью " +
+ mingwDir + "\\bin\\mingw32-g++.exe:" + Environment.NewLine + Environment.NewLine);
+ new Thread(new ThreadStart(CompilingFunction)).Start();
+ }
+ catch (Exception ex)
+ {
+ _ = MessageBox.Show("Произошла ошибка!\n" + ex.Message);
+ }
+ }
+ else
+ {
+ _ = MessageBox.Show("Сначала укажите каталог с MinGW!", "Ошибка",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void CompilingFunction()
+ {
+ Process mingwp = new Process();
+ mingwp.StartInfo = new ProcessStartInfo()
+ {
+ FileName = mingwDir + "\\bin\\mingw32-g++.exe",
+ Arguments = codeFilename + " -o " + Path.GetDirectoryName(codeFilename) + "\\" +
+ Path.GetFileNameWithoutExtension(codeFilename) + ".exe",
+ UseShellExecute = false,
+ WindowStyle = ProcessWindowStyle.Hidden,
+ StandardOutputEncoding = Encoding.GetEncoding(866),
+ StandardErrorEncoding = Encoding.GetEncoding(866),
+ CreateNoWindow = true,
+ RedirectStandardOutput = true,
+ RedirectStandardError = true
+ };
+ mingwp.OutputDataReceived += new DataReceivedEventHandler(CompilerOutputHandler);
+ mingwp.ErrorDataReceived += new DataReceivedEventHandler(CompilerOutputHandler);
+ mingwp.Start();
+ mingwp.BeginOutputReadLine();
+ mingwp.BeginErrorReadLine();
+ mingwp.WaitForExit(20000);
+ textBox2.Invoke(new Action(() => { textBox2.AppendText("Готово!" + Environment.NewLine); }));
+ }
+
+ private void CompilerOutputHandler(object sendingProcess, DataReceivedEventArgs outputLine)
+ {
+ textBox2.Invoke(new Action(() => { textBox2.AppendText(outputLine.Data + Environment.NewLine); }));
+ }
+ }
+}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.resx b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.resx
new file mode 100644
index 0000000..c3f254d
--- /dev/null
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/CompileForm.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 25
+
+
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs
index 95271d1..fed4b5f 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs
@@ -1,7 +1,5 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
@@ -11,67 +9,81 @@ namespace WindowsFormsApplication1
public static void CreateStruct(string filename)
{
File.WriteAllText(filename, "");
- File.AppendAllText(filename, "#include \"TXLib.h\"" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, "struct Person" + Environment.NewLine);
- File.AppendAllText(filename, "{" + Environment.NewLine);
- File.AppendAllText(filename, " double x;" + Environment.NewLine);
- File.AppendAllText(filename, " double x2;" + Environment.NewLine);
- File.AppendAllText(filename, " double y;" + Environment.NewLine);
- File.AppendAllText(filename, " double y2;" + Environment.NewLine);
- File.AppendAllText(filename, " double angle;" + Environment.NewLine);
- File.AppendAllText(filename, " double nomer_kadra;" + Environment.NewLine);
- File.AppendAllText(filename, " HDC texture;" + Environment.NewLine);
- File.AppendAllText(filename, " int MID_x;" + Environment.NewLine);
- File.AppendAllText(filename, " int MID_y;" + Environment.NewLine);
- File.AppendAllText(filename, " int rad;" + Environment.NewLine);
- File.AppendAllText(filename, " int skorost;" + Environment.NewLine);
- File.AppendAllText(filename, " int gr_dvigx;" + Environment.NewLine);
- File.AppendAllText(filename, " int gr_dvigy;" + Environment.NewLine);
- File.AppendAllText(filename, " int nach_dv;" + Environment.NewLine);
- File.AppendAllText(filename, " int ampl_y;" + Environment.NewLine);
- File.AppendAllText(filename, " int ampl_x;" + Environment.NewLine);
- File.AppendAllText(filename, " double BeginTime;" + Environment.NewLine);
- File.AppendAllText(filename, " double EndTime;" + Environment.NewLine);
- File.AppendAllText(filename, " double Time;" + Environment.NewLine);
- File.AppendAllText(filename, "};" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename);
+ sw.Write("#include \"TXLib.h\"" + Environment.NewLine);
+ sw.Write( Environment.NewLine);
+ sw.Write("struct Person" + Environment.NewLine);
+ sw.Write("{" + Environment.NewLine);
+ sw.Write(" double x;" + Environment.NewLine);
+ sw.Write(" double x2;" + Environment.NewLine);
+ sw.Write(" double y;" + Environment.NewLine);
+ sw.Write(" double y2;" + Environment.NewLine);
+ sw.Write(" double angle;" + Environment.NewLine);
+ sw.Write(" double nomer_kadra;" + Environment.NewLine);
+ sw.Write(" HDC texture;" + Environment.NewLine);
+ sw.Write(" int MID_x;" + Environment.NewLine);
+ sw.Write(" int MID_y;" + Environment.NewLine);
+ sw.Write(" int rad;" + Environment.NewLine);
+ sw.Write(" int skorost;" + Environment.NewLine);
+ sw.Write(" int gr_dvigx;" + Environment.NewLine);
+ sw.Write(" int gr_dvigy;" + Environment.NewLine);
+ sw.Write(" int nach_dv;" + Environment.NewLine);
+ sw.Write(" int ampl_y;" + Environment.NewLine);
+ sw.Write(" int ampl_x;" + Environment.NewLine);
+ sw.Write(" double BeginTime;" + Environment.NewLine);
+ sw.Write(" double EndTime;" + Environment.NewLine);
+ sw.Write(" double Time;" + Environment.NewLine);
+ sw.Write("};" + Environment.NewLine);
+ sw.Write( Environment.NewLine);
+ sw.Close();
}
- public static void OpenMain(string filename, PictureBox PictureBoxBackground, String adressBackground)
+ public static void OpenMain(string filename, PictureBox PictureBoxBackground, String addressBackground)
{
- File.AppendAllText(filename, "int main()" + Environment.NewLine);
- File.AppendAllText(filename, "{" + Environment.NewLine);
- File.AppendAllText(filename, " txCreateWindow(" +
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write("int main()" + Environment.NewLine);
+ sw.Write("{" + Environment.NewLine);
+ sw.Write(" txCreateWindow(" +
PictureBoxBackground.Image.Width.ToString() + ", " +
PictureBoxBackground.Image.Height.ToString() + ");" + Environment.NewLine);
- File.AppendAllText(filename, " double myTime = 0;" + Environment.NewLine);
- File.AppendAllText(filename, " HDC texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(adressBackground) + "\");" + Environment.NewLine);
+ sw.Write(" double myTime = 0;" + Environment.NewLine);
+ sw.Write(" HDC texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(addressBackground) + "\");" +
+ Environment.NewLine);
+ sw.Close();
}
public static void CloseWhile(string filename)
{
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " myTime += 0.05;" + Environment.NewLine);
- File.AppendAllText(filename, " txSleep(50);" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(Environment.NewLine);
+ sw.Write(" myTime += 0.05;" + Environment.NewLine);
+ sw.Write(" txSleep(50);" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Close();
}
public static void OpenWhile(string filename, int maxTime)
{
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " while (myTime <= " + maxTime + ")" + Environment.NewLine);
- File.AppendAllText(filename, " {" + Environment.NewLine);
- File.AppendAllText(filename, " txSetColor(TX_RED);" + Environment.NewLine);
- File.AppendAllText(filename, " txSetFillColor(TX_RED);" + Environment.NewLine);
- File.AppendAllText(filename, " txBitBlt(txDC(), 0, 0, txGetExtentX(), txGetExtentY(), texture, 0, 0);" + Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(Environment.NewLine);
+ sw.Write(" while (myTime <= " + maxTime + ")" + Environment.NewLine);
+ sw.Write(" {" + Environment.NewLine);
+ sw.Write(" txSetColor(TX_RED);" + Environment.NewLine);
+ sw.Write(" txSetFillColor(TX_RED);" + Environment.NewLine);
+ sw.Write(" txBitBlt(txDC(), 0, 0, txGetExtentX(), txGetExtentY(), texture, 0, 0);" +
+ Environment.NewLine);
+ sw.Close();
}
- public static void Ending(string filename)
+ public static void Ending(string filename, bool autoexit = false)
{
- File.AppendAllText(filename, " txDeleteDC(texture);" + Environment.NewLine);
- File.AppendAllText(filename, " return 0;" + Environment.NewLine);
- File.AppendAllText(filename, "}" + Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(" txDeleteDC(texture);" + Environment.NewLine);
+ if (autoexit)
+ sw.Write(" txDisableAutoPause();");
+ sw.Write(" return 0;" + Environment.NewLine);
+ sw.Write("}" + Environment.NewLine);
+ sw.Close();
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs
index d769c27..7c13710 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs
@@ -1,9 +1,5 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace WindowsFormsApplication1
{
@@ -11,36 +7,45 @@ namespace WindowsFormsApplication1
{
public static void CreatePerson(string filename, string name, Person p)
{
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra = 0; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(Environment.NewLine);
+ sw.Write(" Person " + name + ";" + Environment.NewLine);
+ sw.Write(" " + name + ".x = " + p.x1 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".y = " + p.y1 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra = 0; " + Environment.NewLine);
+ sw.Write(" " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.address) + "\"); " +
+ Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Close();
}
public static void MovePerson(string filename, string name, Person p)
{
- File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(" if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" +
+ Environment.NewLine);
+ sw.Write(" " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" +
+ p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ sw.Write(" " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" +
+ p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
+ sw.Write(" txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
p.width + "/" + p.sprite + ", " +
p.height + "," +
name + ".texture, " +
p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
- File.AppendAllText(filename, " {" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra++;" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Write(" if (" + name + ".nomer_kadra >= " + p.sprite + ")" +
+ Environment.NewLine);
+ sw.Write(" {" + Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Close();
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs
index ed3620b..af2c112 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs
@@ -33,6 +33,8 @@ namespace WindowsFormsApplication1
this.LabelName = new System.Windows.Forms.Label();
this.nazvanieTextBox = new System.Windows.Forms.TextBox();
this.leftPanel = new System.Windows.Forms.Panel();
+ this.button1 = new System.Windows.Forms.Button();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
this.Char_Stats = new System.Windows.Forms.Label();
this.Char_Info = new System.Windows.Forms.Label();
this.PictureBoxBackground = new System.Windows.Forms.PictureBox();
@@ -42,13 +44,13 @@ namespace WindowsFormsApplication1
this.rightPanel = new System.Windows.Forms.Panel();
this.SaveCharButton = new System.Windows.Forms.Button();
this.personPanel = new System.Windows.Forms.Panel();
+ this.SpriteNumberTextBox = new System.Windows.Forms.NumericUpDown();
this.charNameBox = new System.Windows.Forms.TextBox();
this.circlesTextBox = new System.Windows.Forms.TextBox();
this.circlesLabel = new System.Windows.Forms.Label();
this.charNameLabel = new System.Windows.Forms.Label();
this.openSpace = new System.Windows.Forms.PictureBox();
this.SpriteNumberLabel = new System.Windows.Forms.Label();
- this.SpriteNumberTextBox = new System.Windows.Forms.TextBox();
this.OpenButton = new System.Windows.Forms.Button();
this.LabelPic = new System.Windows.Forms.Label();
this.LabelTime = new System.Windows.Forms.Label();
@@ -69,6 +71,7 @@ namespace WindowsFormsApplication1
((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).BeginInit();
this.rightPanel.SuspendLayout();
this.personPanel.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.SpriteNumberTextBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.openSpace)).BeginInit();
this.SuspendLayout();
//
@@ -76,43 +79,41 @@ namespace WindowsFormsApplication1
//
this.LabelData.AutoSize = true;
this.LabelData.Font = new System.Drawing.Font("Arial Black", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
- this.LabelData.Location = new System.Drawing.Point(0, 11);
- this.LabelData.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelData.Location = new System.Drawing.Point(3, 3);
this.LabelData.Name = "LabelData";
- this.LabelData.Size = new System.Drawing.Size(290, 28);
+ this.LabelData.Size = new System.Drawing.Size(234, 23);
this.LabelData.TabIndex = 0;
this.LabelData.Text = "Данные о мультфильме:";
//
// LabelLengh
//
this.LabelLengh.AutoSize = true;
- this.LabelLengh.Location = new System.Drawing.Point(19, 74);
- this.LabelLengh.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelLengh.Location = new System.Drawing.Point(4, 32);
this.LabelLengh.Name = "LabelLengh";
- this.LabelLengh.Size = new System.Drawing.Size(167, 17);
+ this.LabelLengh.Size = new System.Drawing.Size(130, 13);
this.LabelLengh.TabIndex = 1;
this.LabelLengh.Text = "Длительность: 0 секунд";
//
// LabelName
//
this.LabelName.AutoSize = true;
- this.LabelName.Location = new System.Drawing.Point(19, 106);
- this.LabelName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelName.Location = new System.Drawing.Point(4, 58);
this.LabelName.Name = "LabelName";
- this.LabelName.Size = new System.Drawing.Size(76, 17);
+ this.LabelName.Size = new System.Drawing.Size(60, 13);
this.LabelName.TabIndex = 2;
this.LabelName.Text = "Название:";
//
// nazvanieTextBox
//
- this.nazvanieTextBox.Location = new System.Drawing.Point(107, 106);
- this.nazvanieTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.nazvanieTextBox.Location = new System.Drawing.Point(86, 55);
this.nazvanieTextBox.Name = "nazvanieTextBox";
- this.nazvanieTextBox.Size = new System.Drawing.Size(183, 22);
+ this.nazvanieTextBox.Size = new System.Drawing.Size(138, 20);
this.nazvanieTextBox.TabIndex = 3;
//
// leftPanel
//
+ this.leftPanel.Controls.Add(this.button1);
+ this.leftPanel.Controls.Add(this.checkBox1);
this.leftPanel.Controls.Add(this.Char_Stats);
this.leftPanel.Controls.Add(this.Char_Info);
this.leftPanel.Controls.Add(this.PictureBoxBackground);
@@ -124,38 +125,56 @@ namespace WindowsFormsApplication1
this.leftPanel.Controls.Add(this.LabelName);
this.leftPanel.Dock = System.Windows.Forms.DockStyle.Left;
this.leftPanel.Location = new System.Drawing.Point(0, 0);
- this.leftPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.leftPanel.Name = "leftPanel";
- this.leftPanel.Size = new System.Drawing.Size(396, 468);
+ this.leftPanel.Size = new System.Drawing.Size(297, 380);
this.leftPanel.TabIndex = 4;
//
+ // button1
+ //
+ this.button1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.button1.Location = new System.Drawing.Point(0, 350);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(297, 30);
+ this.button1.TabIndex = 26;
+ this.button1.Text = "Компилировать";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // checkBox1
+ //
+ this.checkBox1.AutoSize = true;
+ this.checkBox1.Location = new System.Drawing.Point(7, 193);
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.Size = new System.Drawing.Size(245, 17);
+ this.checkBox1.TabIndex = 25;
+ this.checkBox1.Text = "Автозакрытие мультфильма по окончанию";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ //
// Char_Stats
//
this.Char_Stats.AutoSize = true;
- this.Char_Stats.Location = new System.Drawing.Point(19, 337);
- this.Char_Stats.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.Char_Stats.Location = new System.Drawing.Point(12, 240);
this.Char_Stats.Name = "Char_Stats";
- this.Char_Stats.Size = new System.Drawing.Size(344, 17);
+ this.Char_Stats.Size = new System.Drawing.Size(259, 13);
this.Char_Stats.TabIndex = 24;
this.Char_Stats.Text = "number name state view delete";
//
// Char_Info
//
this.Char_Info.AutoSize = true;
- this.Char_Info.Location = new System.Drawing.Point(59, 286);
- this.Char_Info.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.Char_Info.Location = new System.Drawing.Point(44, 226);
this.Char_Info.Name = "Char_Info";
- this.Char_Info.Size = new System.Drawing.Size(229, 17);
+ this.Char_Info.Size = new System.Drawing.Size(180, 13);
this.Char_Info.TabIndex = 23;
this.Char_Info.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ";
this.Char_Info.Click += new System.EventHandler(this.Char_Info_Click);
//
// PictureBoxBackground
//
- this.PictureBoxBackground.Location = new System.Drawing.Point(21, 194);
- this.PictureBoxBackground.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.PictureBoxBackground.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.PictureBoxBackground.Location = new System.Drawing.Point(84, 111);
this.PictureBoxBackground.Name = "PictureBoxBackground";
- this.PictureBoxBackground.Size = new System.Drawing.Size(156, 89);
+ this.PictureBoxBackground.Size = new System.Drawing.Size(117, 72);
this.PictureBoxBackground.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PictureBoxBackground.TabIndex = 12;
this.PictureBoxBackground.TabStop = false;
@@ -163,19 +182,17 @@ namespace WindowsFormsApplication1
// LabelBackground
//
this.LabelBackground.AutoSize = true;
- this.LabelBackground.Location = new System.Drawing.Point(19, 140);
- this.LabelBackground.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelBackground.Location = new System.Drawing.Point(4, 87);
this.LabelBackground.Name = "LabelBackground";
- this.LabelBackground.Size = new System.Drawing.Size(100, 17);
+ this.LabelBackground.Size = new System.Drawing.Size(77, 13);
this.LabelBackground.TabIndex = 11;
this.LabelBackground.Text = "Выбрать фон:";
//
// dobavitFonButton
//
- this.dobavitFonButton.Location = new System.Drawing.Point(23, 160);
- this.dobavitFonButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.dobavitFonButton.Location = new System.Drawing.Point(85, 81);
this.dobavitFonButton.Name = "dobavitFonButton";
- this.dobavitFonButton.Size = new System.Drawing.Size(155, 30);
+ this.dobavitFonButton.Size = new System.Drawing.Size(116, 24);
this.dobavitFonButton.TabIndex = 10;
this.dobavitFonButton.Text = "Добавить";
this.dobavitFonButton.UseVisualStyleBackColor = true;
@@ -183,10 +200,9 @@ namespace WindowsFormsApplication1
//
// splitter1
//
- this.splitter1.Location = new System.Drawing.Point(396, 0);
- this.splitter1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.splitter1.Location = new System.Drawing.Point(297, 0);
this.splitter1.Name = "splitter1";
- this.splitter1.Size = new System.Drawing.Size(4, 468);
+ this.splitter1.Size = new System.Drawing.Size(3, 380);
this.splitter1.TabIndex = 5;
this.splitter1.TabStop = false;
//
@@ -197,19 +213,17 @@ namespace WindowsFormsApplication1
this.rightPanel.Controls.Add(this.SaveMultButton);
this.rightPanel.Controls.Add(this.ButtonAddChar);
this.rightPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.rightPanel.Location = new System.Drawing.Point(400, 0);
- this.rightPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.rightPanel.Location = new System.Drawing.Point(300, 0);
this.rightPanel.Name = "rightPanel";
- this.rightPanel.Size = new System.Drawing.Size(503, 468);
+ this.rightPanel.Size = new System.Drawing.Size(377, 380);
this.rightPanel.TabIndex = 6;
//
// SaveCharButton
//
this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.SaveCharButton.Location = new System.Drawing.Point(0, 394);
- this.SaveCharButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.SaveCharButton.Location = new System.Drawing.Point(0, 320);
this.SaveCharButton.Name = "SaveCharButton";
- this.SaveCharButton.Size = new System.Drawing.Size(503, 37);
+ this.SaveCharButton.Size = new System.Drawing.Size(377, 30);
this.SaveCharButton.TabIndex = 3;
this.SaveCharButton.Text = "Сохранить персонажа";
this.SaveCharButton.UseVisualStyleBackColor = true;
@@ -217,13 +231,13 @@ namespace WindowsFormsApplication1
//
// personPanel
//
+ this.personPanel.Controls.Add(this.SpriteNumberTextBox);
this.personPanel.Controls.Add(this.charNameBox);
this.personPanel.Controls.Add(this.circlesTextBox);
this.personPanel.Controls.Add(this.circlesLabel);
this.personPanel.Controls.Add(this.charNameLabel);
this.personPanel.Controls.Add(this.openSpace);
this.personPanel.Controls.Add(this.SpriteNumberLabel);
- this.personPanel.Controls.Add(this.SpriteNumberTextBox);
this.personPanel.Controls.Add(this.OpenButton);
this.personPanel.Controls.Add(this.LabelPic);
this.personPanel.Controls.Add(this.LabelTime);
@@ -237,55 +251,62 @@ namespace WindowsFormsApplication1
this.personPanel.Controls.Add(this.ComboBoxMove);
this.personPanel.Controls.Add(this.LabelMoveType);
this.personPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.personPanel.Location = new System.Drawing.Point(0, 32);
- this.personPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.personPanel.Location = new System.Drawing.Point(0, 26);
this.personPanel.Name = "personPanel";
- this.personPanel.Size = new System.Drawing.Size(503, 399);
+ this.personPanel.Size = new System.Drawing.Size(377, 324);
this.personPanel.TabIndex = 2;
this.personPanel.Visible = false;
//
+ // SpriteNumberTextBox
+ //
+ this.SpriteNumberTextBox.Location = new System.Drawing.Point(128, 136);
+ this.SpriteNumberTextBox.Name = "SpriteNumberTextBox";
+ this.SpriteNumberTextBox.Size = new System.Drawing.Size(43, 20);
+ this.SpriteNumberTextBox.TabIndex = 22;
+ this.SpriteNumberTextBox.Value = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ //
// charNameBox
//
- this.charNameBox.Location = new System.Drawing.Point(113, 108);
- this.charNameBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.charNameBox.Location = new System.Drawing.Point(115, 84);
this.charNameBox.Name = "charNameBox";
- this.charNameBox.Size = new System.Drawing.Size(183, 22);
+ this.charNameBox.Size = new System.Drawing.Size(138, 20);
this.charNameBox.TabIndex = 19;
//
// circlesTextBox
//
- this.circlesTextBox.Location = new System.Drawing.Point(113, 140);
- this.circlesTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.circlesTextBox.Location = new System.Drawing.Point(115, 110);
this.circlesTextBox.Name = "circlesTextBox";
- this.circlesTextBox.Size = new System.Drawing.Size(183, 22);
+ this.circlesTextBox.Size = new System.Drawing.Size(138, 20);
this.circlesTextBox.TabIndex = 21;
//
// circlesLabel
//
this.circlesLabel.AutoSize = true;
- this.circlesLabel.Location = new System.Drawing.Point(5, 140);
- this.circlesLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.circlesLabel.Location = new System.Drawing.Point(3, 113);
this.circlesLabel.Name = "circlesLabel";
- this.circlesLabel.Size = new System.Drawing.Size(103, 17);
+ this.circlesLabel.Size = new System.Drawing.Size(81, 13);
this.circlesLabel.TabIndex = 20;
this.circlesLabel.Text = "Кол-во кругов:";
//
// charNameLabel
//
this.charNameLabel.AutoSize = true;
- this.charNameLabel.Location = new System.Drawing.Point(25, 108);
- this.charNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.charNameLabel.Location = new System.Drawing.Point(3, 87);
this.charNameLabel.Name = "charNameLabel";
- this.charNameLabel.Size = new System.Drawing.Size(76, 17);
+ this.charNameLabel.Size = new System.Drawing.Size(60, 13);
this.charNameLabel.TabIndex = 18;
this.charNameLabel.Text = "Название:";
//
// openSpace
//
- this.openSpace.Location = new System.Drawing.Point(247, 238);
- this.openSpace.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.openSpace.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.openSpace.Location = new System.Drawing.Point(72, 203);
this.openSpace.Name = "openSpace";
- this.openSpace.Size = new System.Drawing.Size(248, 89);
+ this.openSpace.Size = new System.Drawing.Size(192, 72);
this.openSpace.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.openSpace.TabIndex = 17;
this.openSpace.TabStop = false;
@@ -293,27 +314,17 @@ namespace WindowsFormsApplication1
// SpriteNumberLabel
//
this.SpriteNumberLabel.AutoSize = true;
- this.SpriteNumberLabel.Location = new System.Drawing.Point(5, 193);
- this.SpriteNumberLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.SpriteNumberLabel.Location = new System.Drawing.Point(3, 139);
this.SpriteNumberLabel.Name = "SpriteNumberLabel";
- this.SpriteNumberLabel.Size = new System.Drawing.Size(155, 17);
+ this.SpriteNumberLabel.Size = new System.Drawing.Size(119, 13);
this.SpriteNumberLabel.TabIndex = 16;
this.SpriteNumberLabel.Text = "Количество спрайтов:";
//
- // SpriteNumberTextBox
- //
- this.SpriteNumberTextBox.Location = new System.Drawing.Point(9, 213);
- this.SpriteNumberTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.SpriteNumberTextBox.Name = "SpriteNumberTextBox";
- this.SpriteNumberTextBox.Size = new System.Drawing.Size(109, 22);
- this.SpriteNumberTextBox.TabIndex = 15;
- //
// OpenButton
//
- this.OpenButton.Location = new System.Drawing.Point(247, 193);
- this.OpenButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.OpenButton.Location = new System.Drawing.Point(72, 167);
this.OpenButton.Name = "OpenButton";
- this.OpenButton.Size = new System.Drawing.Size(256, 37);
+ this.OpenButton.Size = new System.Drawing.Size(192, 30);
this.OpenButton.TabIndex = 14;
this.OpenButton.Text = "Открыть персонажа";
this.OpenButton.UseVisualStyleBackColor = true;
@@ -322,120 +333,108 @@ namespace WindowsFormsApplication1
// LabelPic
//
this.LabelPic.AutoSize = true;
- this.LabelPic.Location = new System.Drawing.Point(168, 193);
- this.LabelPic.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelPic.Location = new System.Drawing.Point(3, 174);
this.LabelPic.Name = "LabelPic";
- this.LabelPic.Size = new System.Drawing.Size(75, 17);
+ this.LabelPic.Size = new System.Drawing.Size(58, 13);
this.LabelPic.TabIndex = 12;
this.LabelPic.Text = "Картинка:";
//
// LabelTime
//
this.LabelTime.AutoSize = true;
- this.LabelTime.Location = new System.Drawing.Point(25, 79);
- this.LabelTime.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelTime.Location = new System.Drawing.Point(3, 61);
this.LabelTime.Name = "LabelTime";
- this.LabelTime.Size = new System.Drawing.Size(67, 17);
+ this.LabelTime.Size = new System.Drawing.Size(54, 13);
this.LabelTime.TabIndex = 11;
this.LabelTime.Text = "Тайминг:";
//
// LabelDef2
//
this.LabelDef2.AutoSize = true;
- this.LabelDef2.Location = new System.Drawing.Point(320, 79);
- this.LabelDef2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelDef2.Location = new System.Drawing.Point(223, 61);
this.LabelDef2.Name = "LabelDef2";
- this.LabelDef2.Size = new System.Drawing.Size(18, 17);
+ this.LabelDef2.Size = new System.Drawing.Size(13, 13);
this.LabelDef2.TabIndex = 10;
this.LabelDef2.Text = "--";
//
// LabelDef1
//
this.LabelDef1.AutoSize = true;
- this.LabelDef1.Location = new System.Drawing.Point(320, 43);
- this.LabelDef1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelDef1.Location = new System.Drawing.Point(223, 36);
this.LabelDef1.Name = "LabelDef1";
- this.LabelDef1.Size = new System.Drawing.Size(18, 17);
+ this.LabelDef1.Size = new System.Drawing.Size(13, 13);
this.LabelDef1.TabIndex = 9;
this.LabelDef1.Text = "--";
//
// LabelWalls
//
this.LabelWalls.AutoSize = true;
- this.LabelWalls.Location = new System.Drawing.Point(25, 43);
- this.LabelWalls.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelWalls.Location = new System.Drawing.Point(3, 36);
this.LabelWalls.Name = "LabelWalls";
- this.LabelWalls.Size = new System.Drawing.Size(138, 17);
+ this.LabelWalls.Size = new System.Drawing.Size(107, 13);
this.LabelWalls.TabIndex = 8;
this.LabelWalls.Text = "Границы движения:";
//
// TextBoxTime1
//
- this.TextBoxTime1.Location = new System.Drawing.Point(176, 75);
- this.TextBoxTime1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.TextBoxTime1.Location = new System.Drawing.Point(116, 59);
this.TextBoxTime1.Name = "TextBoxTime1";
- this.TextBoxTime1.Size = new System.Drawing.Size(132, 22);
+ this.TextBoxTime1.Size = new System.Drawing.Size(100, 20);
this.TextBoxTime1.TabIndex = 5;
//
// TextBoxTime2
//
- this.TextBoxTime2.Location = new System.Drawing.Point(345, 75);
- this.TextBoxTime2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.TextBoxTime2.Location = new System.Drawing.Point(243, 59);
this.TextBoxTime2.Name = "TextBoxTime2";
- this.TextBoxTime2.Size = new System.Drawing.Size(132, 22);
+ this.TextBoxTime2.Size = new System.Drawing.Size(100, 20);
this.TextBoxTime2.TabIndex = 4;
//
// TextBoxWall2
//
- this.TextBoxWall2.Location = new System.Drawing.Point(345, 39);
- this.TextBoxWall2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.TextBoxWall2.Location = new System.Drawing.Point(243, 33);
this.TextBoxWall2.Name = "TextBoxWall2";
- this.TextBoxWall2.Size = new System.Drawing.Size(132, 22);
+ this.TextBoxWall2.Size = new System.Drawing.Size(100, 20);
this.TextBoxWall2.TabIndex = 3;
this.TextBoxWall2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress);
//
// TextBoxWall1
//
- this.TextBoxWall1.Location = new System.Drawing.Point(176, 39);
- this.TextBoxWall1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.TextBoxWall1.Location = new System.Drawing.Point(116, 33);
this.TextBoxWall1.Name = "TextBoxWall1";
- this.TextBoxWall1.Size = new System.Drawing.Size(132, 22);
+ this.TextBoxWall1.Size = new System.Drawing.Size(100, 20);
this.TextBoxWall1.TabIndex = 2;
this.TextBoxWall1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress);
//
// ComboBoxMove
//
+ this.ComboBoxMove.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ComboBoxMove.FormattingEnabled = true;
this.ComboBoxMove.Items.AddRange(new object[] {
"Прямо",
"Диагонально",
"Волнами",
"Кругами"});
- this.ComboBoxMove.Location = new System.Drawing.Point(148, 4);
- this.ComboBoxMove.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.ComboBoxMove.Location = new System.Drawing.Point(115, 3);
this.ComboBoxMove.Name = "ComboBoxMove";
- this.ComboBoxMove.Size = new System.Drawing.Size(160, 24);
+ this.ComboBoxMove.Size = new System.Drawing.Size(121, 21);
this.ComboBoxMove.TabIndex = 1;
- this.ComboBoxMove.Text = "Прямо";
this.ComboBoxMove.SelectedIndexChanged += new System.EventHandler(this.ComboBoxMove_SelectedIndexChanged);
//
// LabelMoveType
//
this.LabelMoveType.AutoSize = true;
- this.LabelMoveType.Location = new System.Drawing.Point(31, 4);
- this.LabelMoveType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.LabelMoveType.Location = new System.Drawing.Point(3, 6);
this.LabelMoveType.Name = "LabelMoveType";
- this.LabelMoveType.Size = new System.Drawing.Size(105, 17);
+ this.LabelMoveType.Size = new System.Drawing.Size(82, 13);
this.LabelMoveType.TabIndex = 0;
this.LabelMoveType.Text = "Вид движения:";
//
// SaveMultButton
//
this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.SaveMultButton.Location = new System.Drawing.Point(0, 431);
- this.SaveMultButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.SaveMultButton.Location = new System.Drawing.Point(0, 350);
this.SaveMultButton.Name = "SaveMultButton";
- this.SaveMultButton.Size = new System.Drawing.Size(503, 37);
+ this.SaveMultButton.Size = new System.Drawing.Size(377, 30);
this.SaveMultButton.TabIndex = 1;
this.SaveMultButton.Text = "Сохранить мульт";
this.SaveMultButton.UseVisualStyleBackColor = true;
@@ -445,9 +444,8 @@ namespace WindowsFormsApplication1
//
this.ButtonAddChar.Dock = System.Windows.Forms.DockStyle.Top;
this.ButtonAddChar.Location = new System.Drawing.Point(0, 0);
- this.ButtonAddChar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ButtonAddChar.Name = "ButtonAddChar";
- this.ButtonAddChar.Size = new System.Drawing.Size(503, 32);
+ this.ButtonAddChar.Size = new System.Drawing.Size(377, 26);
this.ButtonAddChar.TabIndex = 0;
this.ButtonAddChar.Text = "Добавить персонажа";
this.ButtonAddChar.UseVisualStyleBackColor = true;
@@ -459,13 +457,12 @@ namespace WindowsFormsApplication1
//
// MainForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(903, 468);
+ this.ClientSize = new System.Drawing.Size(677, 380);
this.Controls.Add(this.rightPanel);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.leftPanel);
- this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "MainForm";
this.RightToLeftLayout = true;
this.Text = "Свойства персонажа";
@@ -476,6 +473,7 @@ namespace WindowsFormsApplication1
this.rightPanel.ResumeLayout(false);
this.personPanel.ResumeLayout(false);
this.personPanel.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.SpriteNumberTextBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.openSpace)).EndInit();
this.ResumeLayout(false);
@@ -509,7 +507,6 @@ namespace WindowsFormsApplication1
private System.Windows.Forms.Button OpenButton;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Label SpriteNumberLabel;
- private System.Windows.Forms.TextBox SpriteNumberTextBox;
private System.Windows.Forms.Label LabelBackground;
private System.Windows.Forms.Button dobavitFonButton;
private System.Windows.Forms.PictureBox PictureBoxBackground;
@@ -520,5 +517,8 @@ namespace WindowsFormsApplication1
private System.Windows.Forms.Label charNameLabel;
private System.Windows.Forms.TextBox circlesTextBox;
private System.Windows.Forms.Label circlesLabel;
+ private System.Windows.Forms.NumericUpDown SpriteNumberTextBox;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.CheckBox checkBox1;
}
}
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs
index da5184d..9039333 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs
@@ -1,31 +1,27 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
using System.IO;
-using System.Text;
+using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class MainForm : Form
{
- Person[] persons = new Person[200];
-
- int yPersa = 300;
+ Person[] persons = new Person[8];
+ int yPersa = 263;
int nomerPersa = 0;
int pNomer = 0;
int maxTime = 0;
- PictureBox[] pic1 = new PictureBox[1000];
- String adressBackground = "";
+ //PictureBox[] pic1 = new PictureBox[1000];
+ String addressBackground = "";
+ string mainFilename = "";
public MainForm()
{
InitializeComponent();
-
- openFileDialog1.Filter = "Kartinki|*.bmp";
- saveFileDialog1.Filter = "cpp files|*.cpp";
+ ComboBoxMove.SelectedIndex = 0;
+ openFileDialog1.Filter = "Bitmap Pictures|*.bmp";
+ saveFileDialog1.Filter = "C++ Code Files|*.cpp";
}
private void buttonAddCharClick(object sender, EventArgs e)
@@ -48,126 +44,21 @@ namespace WindowsFormsApplication1
{
if (personPanel.Visible == false)
{
- MessageBox.Show("Где параметры? Покажи мне, ткни мне в них!");
+ MessageBox.Show("Где параметры? Покажи мне, ткни меня в них!");
return;
}
personPanel.Visible = true;
if (pNomer == -120)
{
- persons[nomerPersa].l1 = new Label();
- persons[nomerPersa].l1.Top = yPersa;
- persons[nomerPersa].l1.Left = 30;
- persons[nomerPersa].l1.Width = 20;
- persons[nomerPersa].l1.Visible = true;
- persons[nomerPersa].l1.Text = (nomerPersa + 1).ToString();
- this.leftPanel.Controls.Add(persons[nomerPersa].l1);
-
- persons[nomerPersa].l2 = new Label();
- persons[nomerPersa].l2.Top = yPersa;
- persons[nomerPersa].l2.Left = 60;
- persons[nomerPersa].l2.Width = 60;
- persons[nomerPersa].l2.Visible = true;
- persons[nomerPersa].l2.Text = "Перс" + (nomerPersa + 1).ToString();
- this.leftPanel.Controls.Add(persons[nomerPersa].l2);
-
- persons[nomerPersa].l3 = new Label();
- persons[nomerPersa].l3.Top = yPersa;
- persons[nomerPersa].l3.Left = 120;
- persons[nomerPersa].l3.Width = 40;
- persons[nomerPersa].l3.Visible = true;
- persons[nomerPersa].l3.Text = "saved";
- this.leftPanel.Controls.Add(persons[nomerPersa].l3);
-
- persons[nomerPersa].b1 = new Button();
- persons[nomerPersa].b1.Top = yPersa;
- persons[nomerPersa].b1.Left = 170;
- persons[nomerPersa].b1.Width = 50;
- persons[nomerPersa].b1.Visible = true;
- persons[nomerPersa].b1.Text = "Edit";
- persons[nomerPersa].b1.MouseClick +=
- new MouseEventHandler(this.Char_Creator_Button_Click);
- this.leftPanel.Controls.Add(persons[nomerPersa].b1);
-
- ToolTip tView = new ToolTip();
- tView.IsBalloon = true;
- tView.InitialDelay = 0;
- tView.ShowAlways = true;
- tView.AutoPopDelay = 2000;
- tView.SetToolTip(persons[nomerPersa].b1, "View/edit person");
-
- persons[nomerPersa].b2 = new Button();
- persons[nomerPersa].b2.Top = yPersa;
- persons[nomerPersa].b2.Left = 230;
- persons[nomerPersa].b2.Width = 50;
- persons[nomerPersa].b2.Visible = true;
- persons[nomerPersa].b2.Text = "Del";
- persons[nomerPersa].b2.Click +=
- new System.EventHandler(this.Char_Info_Click);
- this.leftPanel.Controls.Add(persons[nomerPersa].b2);
-
- ToolTip tDelete = new ToolTip();
- tDelete.IsBalloon = true;
- tDelete.InitialDelay = 0;
- tDelete.ShowAlways = true;
- tDelete.AutoPopDelay = 2000;
- tDelete.SetToolTip(persons[nomerPersa].b2, "Delete this person");
-
- persons[nomerPersa].coord = TextBoxWall1.Text;
- persons[nomerPersa].coord2 = TextBoxWall2.Text;
- persons[nomerPersa].time1 = TextBoxTime1.Text;
- persons[nomerPersa].time2 = TextBoxTime2.Text;
- persons[nomerPersa].sprite = SpriteNumberTextBox.Text;
- persons[nomerPersa].moveside = ComboBoxMove.Text;
- persons[nomerPersa].nomer = nomerPersa;
- persons[nomerPersa].charname = charNameBox.Text;
- persons[nomerPersa].circles = circlesTextBox.Text;
- persons[nomerPersa].l2.Text = charNameBox.Text;
-
- String[] coordinatyNachala = TextBoxWall1.Text.Split(new String[] { "," }, StringSplitOptions.None);
- if (coordinatyNachala.Length > 1)
- {
- persons[nomerPersa].x1 = coordinatyNachala[0];
- persons[nomerPersa].y1 = coordinatyNachala[1];
- }
-
- String[] coordinatyKonza = TextBoxWall2.Text.Split(new String[] { "," }, StringSplitOptions.None);
- if (coordinatyKonza.Length > 1)
- {
- persons[nomerPersa].x2 = coordinatyKonza[0];
- persons[nomerPersa].y2 = coordinatyKonza[1];
- }
-
+ persons[nomerPersa] = AddRowToPersList(persons[nomerPersa], false);
nomerPersa++;
- yPersa = yPersa + 30;
+ yPersa += 30;
openSpace.Image = null;
}
else
{
- persons[pNomer].coord = TextBoxWall1.Text;
- persons[pNomer].coord2 = TextBoxWall2.Text;
- persons[pNomer].time1 = TextBoxTime1.Text;
- persons[pNomer].time2 = TextBoxTime2.Text;
- persons[pNomer].sprite = SpriteNumberTextBox.Text;
- persons[pNomer].moveside = ComboBoxMove.Text;
- persons[pNomer].nomer = pNomer;
-
- String[] coordinatyNachala = TextBoxWall1.Text.Split(new String[] { "," }, StringSplitOptions.None);
- if (coordinatyNachala.Length > 1)
- {
- persons[pNomer].x1 = coordinatyNachala[0];
- persons[pNomer].y1 = coordinatyNachala[1];
- }
- String[] coordinatyKonza = TextBoxWall2.Text.Split(new String[] { "," }, StringSplitOptions.None);
- if (coordinatyKonza.Length > 1)
- {
- persons[pNomer].x2 = coordinatyKonza[0];
- persons[pNomer].y2 = coordinatyKonza[1];
- }
-
- persons[pNomer].charname = charNameBox.Text;
- persons[pNomer].circles = circlesTextBox.Text;
- persons[pNomer].l2.Text = charNameBox.Text;
+ persons[pNomer] = AddRowToPersList(persons[pNomer], true);
}
for (int nomer = 0; nomer < nomerPersa; nomer++)
@@ -181,6 +72,97 @@ namespace WindowsFormsApplication1
LabelLengh.Text = "Длительность: " + maxTime.ToString() + " секунд";
}
+ private Person AddRowToPersList(Person p, bool use_pnumber = false)
+ {
+ if (!use_pnumber)
+ {
+ p.l1 = new Label();
+ p.l1.Top = yPersa;
+ p.l1.Left = 30;
+ p.l1.Width = 20;
+ p.l1.Visible = true;
+ p.l1.Text = (nomerPersa + 1).ToString();
+ leftPanel.Controls.Add(p.l1);
+
+ p.l2 = new Label();
+ p.l2.Top = yPersa;
+ p.l2.Left = 60;
+ p.l2.Width = 60;
+ p.l2.Visible = true;
+ p.l2.Text = "Перс" + (nomerPersa + 1).ToString();
+ leftPanel.Controls.Add(p.l2);
+
+ p.l3 = new Label();
+ p.l3.Top = yPersa;
+ p.l3.Left = 120;
+ p.l3.Width = 40;
+ p.l3.Visible = true;
+ p.l3.Text = "saved";
+ leftPanel.Controls.Add(p.l3);
+
+ p.b1 = new Button();
+ p.b1.Top = yPersa;
+ p.b1.Left = 170;
+ p.b1.Width = 50;
+ p.b1.Visible = true;
+ p.b1.Text = "Edit";
+ p.b1.MouseClick +=
+ new MouseEventHandler(Char_Creator_Button_Click);
+ leftPanel.Controls.Add(p.b1);
+
+ ToolTip tView = new ToolTip();
+ tView.IsBalloon = true;
+ tView.InitialDelay = 0;
+ tView.ShowAlways = true;
+ tView.AutoPopDelay = 2000;
+ tView.SetToolTip(p.b1, "View/edit person");
+
+ p.b2 = new Button();
+ p.b2.Top = yPersa;
+ p.b2.Left = 230;
+ p.b2.Width = 50;
+ p.b2.Visible = true;
+ p.b2.Text = "Del";
+ p.b2.Click +=
+ new EventHandler(Char_Info_Click);
+ leftPanel.Controls.Add(p.b2);
+
+ ToolTip tDelete = new ToolTip();
+ tDelete.IsBalloon = true;
+ tDelete.InitialDelay = 0;
+ tDelete.ShowAlways = true;
+ tDelete.AutoPopDelay = 2000;
+ tDelete.SetToolTip(p.b2, "Delete this person");
+ }
+
+ p.coord = TextBoxWall1.Text;
+ p.coord2 = TextBoxWall2.Text;
+ p.time1 = TextBoxTime1.Text;
+ p.time2 = TextBoxTime2.Text;
+ p.sprite = SpriteNumberTextBox.Text;
+ p.moveside = ComboBoxMove.Text;
+ p.nomer = (use_pnumber) ? pNomer : nomerPersa;
+ p.charname = charNameBox.Text;
+ p.circles = circlesTextBox.Text;
+ p.l2.Text = charNameBox.Text;
+
+ String[] coordinatyNachala = TextBoxWall1.Text.Split(new String[] { "," }, StringSplitOptions.None);
+ if (coordinatyNachala.Length > 1)
+ {
+ p.x1 = coordinatyNachala[0];
+ p.y1 = coordinatyNachala[1];
+ }
+
+ String[] coordinatyKonza = TextBoxWall2.Text.Split(new String[] { "," }, StringSplitOptions.None);
+ if (coordinatyKonza.Length > 1)
+ {
+ p.x2 = coordinatyKonza[0];
+ p.y2 = coordinatyKonza[1];
+ }
+
+ return p;
+ }
+
private void OpenAddCharClick(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
@@ -188,13 +170,13 @@ namespace WindowsFormsApplication1
openSpace.Image = Image.FromFile(openFileDialog1.FileName);
if (pNomer == -120)
{
- persons[nomerPersa].adress = openFileDialog1.FileName;
+ persons[nomerPersa].address = openFileDialog1.FileName;
persons[nomerPersa].width = openSpace.Image.Width.ToString();
persons[nomerPersa].height = openSpace.Image.Height.ToString();
}
else
{
- persons[pNomer].adress = openFileDialog1.FileName;
+ persons[pNomer].address = openFileDialog1.FileName;
persons[pNomer].width = openSpace.Image.Width.ToString();
persons[pNomer].height = openSpace.Image.Height.ToString();
}
@@ -205,20 +187,20 @@ namespace WindowsFormsApplication1
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
return;
PictureBoxBackground.Image = Image.FromFile(openFileDialog1.FileName);
- adressBackground = openFileDialog1.FileName;
+ addressBackground = openFileDialog1.FileName;
}
private void SaveMultButton_Click(object sender, EventArgs e)
{
if (PictureBoxBackground.Image == null)
{
- MessageBox.Show("Что ты собрался выводить то, поехавший (фон)?");
+ MessageBox.Show("Что ты собрался выводить-то, поехавший (фон)?");
return;
}
for (int nomer = 0; nomer < nomerPersa; nomer++)
{
- if (String.IsNullOrEmpty(persons[nomer].adress))
+ if (String.IsNullOrEmpty(persons[nomer].address))
{
MessageBox.Show("Картинка №" + (nomer + 1).ToString() + " пустая");
return;
@@ -257,78 +239,86 @@ namespace WindowsFormsApplication1
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
- string filename = saveFileDialog1.FileName;
-
- //Add TXLib and pics
- File.Copy(Path.Combine(Application.StartupPath, "TXLib.h"), filename.Replace(Path.GetFileName(filename), "TXLib.h"), true);
- string adres_papki = filename.Replace(Path.GetFileName(filename), "Pictures");
- if (!Directory.Exists(adres_papki))
+ try
{
- Directory.CreateDirectory(adres_papki);
- }
+ mainFilename = saveFileDialog1.FileName;
- if (adressBackground != adres_papki + "\\" + Path.GetFileName(adressBackground))
+ //Adding TXLibrary and pictures
+ File.WriteAllText(Path.GetDirectoryName(mainFilename) + "\\TXLib.h", Properties.Resources.TXLib);
+ string dir_path = Path.GetDirectoryName(mainFilename) + "\\Pictures";
+ if (!Directory.Exists(dir_path))
+ {
+ Directory.CreateDirectory(dir_path);
+ }
+
+ if (addressBackground != dir_path + "\\" + Path.GetFileName(addressBackground))
+ {
+ File.Copy(addressBackground, dir_path + "\\" + Path.GetFileName(addressBackground), true);
+ }
+
+ Files.CreateStruct(mainFilename);
+ Files.OpenMain(mainFilename, PictureBoxBackground, addressBackground);
+
+ for (int nomer = 0; nomer < nomerPersa; nomer++)
+ {
+ File.Copy(persons[nomer].address, dir_path + "\\" + Path.GetFileName(persons[nomer].address), true);
+
+ if (dir_path == dir_path + "\\" + Path.GetFileName(persons[nomer].address))
+ {
+ File.Copy(persons[nomer].address, dir_path + "\\" + Path.GetFileName(persons[nomer].address), true);
+ }
+
+ if (persons[nomer].moveside == "Прямо")
+ {
+ Line.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Волнами")
+ {
+ Sinus.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Кругами")
+ {
+ Circle.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Диагонально")
+ {
+ Line.CreatePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ }
+
+ Files.OpenWhile(mainFilename, maxTime);
+
+ for (int nomer = 0; nomer < nomerPersa; nomer++)
+ {
+ if (persons[nomer].moveside == "Прямо")
+ {
+ Line.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Волнами")
+ {
+ Sinus.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Кругами")
+ {
+ Circle.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ else if (persons[nomer].moveside == "Диагонально")
+ {
+ Line.MovePerson(mainFilename, Person.PersonName(nomer), persons[nomer]);
+ }
+ }
+
+ Files.CloseWhile(mainFilename);
+ DeletePics(mainFilename, nomerPersa);
+ Files.Ending(mainFilename, checkBox1.Checked);
+
+ MessageBox.Show("Готово!");
+ }
+ catch (Exception ex)
{
- File.Copy(adressBackground, adres_papki + "\\" + Path.GetFileName(adressBackground), true);
+ _ = MessageBox.Show("Произошла ошибка!\n" + ex.Message, "Ошибка",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
}
-
- Files.CreateStruct(filename);
- Files.OpenMain(filename, PictureBoxBackground, adressBackground);
-
- for (int nomer = 0; nomer < nomerPersa; nomer++)
- {
- File.Copy(persons[nomer].adress, adres_papki + "\\" + Path.GetFileName(persons[nomer].adress), true);
-
- if (adres_papki == adres_papki + "\\" + Path.GetFileName(persons[nomer].adress))
- {
- File.Copy(persons[nomer].adress, adres_papki + "\\" + Path.GetFileName(persons[nomer].adress), true);
- }
-
- if (persons[nomer].moveside == "Прямо")
- {
- Line.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Волнами")
- {
- Sinus.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Кругами")
- {
- Circle.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Диагонально")
- {
- Line.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- }
-
- Files.OpenWhile(filename, maxTime);
-
- for (int nomer = 0; nomer < nomerPersa; nomer++)
- {
- if (persons[nomer].moveside == "Прямо")
- {
- Line.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Волнами")
- {
- Sinus.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Кругами")
- {
- Circle.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- else if (persons[nomer].moveside == "Диагонально")
- {
- Line.MovePerson(filename, Person.PersonName(nomer), persons[nomer]);
- }
- }
-
- Files.CloseWhile(filename);
- DeletePics(filename, nomerPersa);
- Files.Ending(filename);
-
- MessageBox.Show("Successfully");
}
}
@@ -348,9 +338,9 @@ namespace WindowsFormsApplication1
charNameBox.Text = persons[nomer].charname;
circlesTextBox.Text = persons[nomer].circles;
- if (!String.IsNullOrEmpty(persons[nomer].adress))
+ if (!String.IsNullOrEmpty(persons[nomer].address))
{
- openSpace.Image = Image.FromFile(persons[nomer].adress);
+ openSpace.Image = Image.FromFile(persons[nomer].address);
}
else
{
@@ -362,13 +352,13 @@ namespace WindowsFormsApplication1
private void Char_Info_Click(object sender, EventArgs e)
{
- this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l1);
- this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l2);
- this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l3);
- this.leftPanel.Controls.Remove(persons[nomerPersa - 1].b1);
- this.leftPanel.Controls.Remove(persons[nomerPersa - 1].b2);
+ leftPanel.Controls.Remove(persons[nomerPersa - 1].l1);
+ leftPanel.Controls.Remove(persons[nomerPersa - 1].l2);
+ leftPanel.Controls.Remove(persons[nomerPersa - 1].l3);
+ leftPanel.Controls.Remove(persons[nomerPersa - 1].b1);
+ leftPanel.Controls.Remove(persons[nomerPersa - 1].b2);
nomerPersa--;
- yPersa = yPersa - 30;
+ yPersa -= 30;
}
private void TextBoxWall1_KeyPress(object sender, KeyPressEventArgs e)
@@ -413,5 +403,17 @@ namespace WindowsFormsApplication1
circlesLabel.Visible = false;
}
}
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (!String.IsNullOrEmpty(mainFilename))
+ {
+ new CompileForm(mainFilename).ShowDialog();
+ }
+ else
+ {
+ _ = MessageBox.Show("Сначала сохраните мультфильм!");
+ }
+ }
}
}
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx
index d2d8b5c..642c454 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.resx
@@ -124,6 +124,6 @@
153, 17
- 39
+ 25
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs
index b646672..cb6612d 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Person.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
@@ -18,12 +14,12 @@ namespace WindowsFormsApplication1
public int nomer;
public String coord;
public String coord2;
- //Dobavit polya
+ // TODO: Add fields
public String x1;
public String y1;
public String x2;
public String y2;
- public String adress;
+ public String address;
public String time1;
public String time2;
public String sprite;
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/KOT.jpg b/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/KOT.jpg
deleted file mode 100644
index ae67eb7..0000000
Binary files a/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/KOT.jpg and /dev/null differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/kartinka.bmp b/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/cat.bmp
similarity index 66%
rename from WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/kartinka.bmp
rename to WindowsFormsApplication1/WindowsFormsApplication1/Pictures/cat.bmp
index 3ca76a0..24731f3 100644
Binary files a/WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/kartinka.bmp and b/WindowsFormsApplication1/WindowsFormsApplication1/Pictures/cat.bmp differ
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs
index bb5f151..f44f974 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.Designer.cs
@@ -19,7 +19,7 @@ namespace WindowsFormsApplication1.Properties {
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -59,5 +59,20 @@ namespace WindowsFormsApplication1.Properties {
resourceCulture = value;
}
}
+
+ ///
+ /// Ищет локализованную строку, похожую на //=================================================================================================================
+ ///// [These sections are for folding control in Code::Blocks]
+ /////{ [Best viewed with "Fold all on file open" option enabled] [best screen width is 115 chars]
+ /////=================================================================================================================
+ /////!
+ /////! @file TXLib.h
+ /////! @brief Библиотека Тупого Художника (The Dumb Artist Libr [остаток строки не уместился]";.
+ ///
+ internal static string TXLib {
+ get {
+ return ResourceManager.GetString("TXLib", resourceCulture);
+ }
+ }
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx
index ffecec8..a688e92 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Properties/Resources.resx
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
+
@@ -68,9 +69,10 @@
-
+
+
@@ -85,9 +87,10 @@
-
+
+
@@ -109,9 +112,13 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ ..\TXLib.h;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1251
+
\ No newline at end of file
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs
index 75061f0..0e63ea6 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs
@@ -1,8 +1,5 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
-using System.Text;
namespace WindowsFormsApplication1
{
@@ -10,37 +7,45 @@ namespace WindowsFormsApplication1
{
public static void CreatePerson(string filename, string name, Person p)
{
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x = " + p.x1 + ";" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y = " + p.y1 + ";" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nach_dv = (" + p.y1 + "+" + p.y2 + ")/2;" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".ampl_y = abs(" + p.y1 + "-" + name + ".nach_dv)/2;" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".ampl_x = 10;" + Environment.NewLine);
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(Environment.NewLine);
+ sw.Write(" Person " + name + ";" + Environment.NewLine);
+ sw.Write(" " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.address) + "\"); " +
+ Environment.NewLine);
+ sw.Write(" " + name + ".x = " + p.x1 + ";" + Environment.NewLine);
+ sw.Write(" " + name + ".y = " + p.y1 + ";" + Environment.NewLine);
+ sw.Write(" " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ sw.Write(" " + name + ".nach_dv = (" + p.y1 + "+" + p.y2 + ")/2;" + Environment.NewLine);
+ sw.Write(" " + name + ".ampl_y = abs(" + p.y1 + "-" + name + ".nach_dv)/2;" + Environment.NewLine);
+ sw.Write(" " + name + ".ampl_x = 10;" + Environment.NewLine);
+ sw.Close();
}
public static void MovePerson(string filename, string name, Person p)
{
- File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".y = " + name + ".nach_dv + " + name + ".ampl_y * sin(" + name + ".x / " + name + ".ampl_x);" + Environment.NewLine);
- File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
+ StreamWriter sw = new StreamWriter(filename, true);
+ sw.Write(" if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine);
+ sw.Write(" " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" +
+ p.time1 + ");" + Environment.NewLine);
+ sw.Write(" " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" +
+ p.time1 + ");" + Environment.NewLine);
+ sw.Write(" " + name + ".y = " + name + ".nach_dv + " + name + ".ampl_y * sin(" + name +
+ ".x / " + name + ".ampl_x);" + Environment.NewLine);
+ sw.Write(" txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " +
p.width + "/" + p.sprite + ", " +
p.height + "," +
name + ".texture, " +
p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine);
- File.AppendAllText(filename, Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine);
- File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
- File.AppendAllText(filename, " {" + Environment.NewLine);
- File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
- File.AppendAllText(filename, " }" + Environment.NewLine);
+ sw.Write(Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra++;" + Environment.NewLine);
+ sw.Write(" if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine);
+ sw.Write(" {" + Environment.NewLine);
+ sw.Write(" " + name + ".nomer_kadra = 0;" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Write(" }" + Environment.NewLine);
+ sw.Close();
}
}
}
diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/TXLib.h b/WindowsFormsApplication1/WindowsFormsApplication1/TXLib.h
similarity index 97%
rename from WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/TXLib.h
rename to WindowsFormsApplication1/WindowsFormsApplication1/TXLib.h
index 7142542..b54383f 100644
--- a/WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/TXLib.h
+++ b/WindowsFormsApplication1/WindowsFormsApplication1/TXLib.h
@@ -1,8499 +1,8499 @@
-//=================================================================================================================
-// [These sections are for folding control in Code::Blocks]
-//{ [Best viewed with "Fold all on file open" option enabled] [best screen width is 115 chars]
-//=================================================================================================================
-//!
-//! @file TXLib.h
-//! @brief (The Dumb Artist Library, TX Library, TXLib).
-//!
-//! $Version: 00172a, Revision: 104 $
-//! $Copyright: (C) Ded (Ilya Dedinsky, http://txlib.ru) $
-//! $Date: 2014-08-09 16:37:26 +0400 $
-//!
-//! TX Library - Win32 ++.
-//! ""
-//! . .
-//!
-//! 1 TX Library -
-//! .
-//!
-//! TX Library is a tiny 2D graphics library for Win32 written in C++. This is a small
-//! sandbox for the very beginners to help them to learn basic programming principles.
-//! The documentation is currently in Russian.
-//!
-//! : txlib.ru.
-//!
-//! . SourceForge.
-//!
-//! @warning -. . @nn
-//! .
-//! .
-//!
-//! @par SourceForge:
-//! -
-//! -
-//!
-//! @par
-//! -#
-//! .., .., .., .., .., .., ..
-//! . Batman
-//! Proceedings in Sheep Philosophy, 2003, Vol. 22. pp. 23-24.
-//!
-// $Copyright: (C) Ded (Ilya Dedinsky, http://txlib.ru) $
-//-----------------------------------------------------------------------------------------------------------------
-//!
-//! @defgroup Drawing
-//! @defgroup Mouse
-//! @defgroup Dialogs
-//! @defgroup Misc
-//! @defgroup Service
-//! @defgroup Technical
-//}
-//=================================================================================================================
-
-#if !defined (__TXLIB_H_INCLUDED) // <<<<<<<<< The code is here, unfold it <<<<<<<<<<<<<<<<<<<<<<<<<
-#define __TXLIB_H_INCLUDED
-
-//-----------------------------------------------------------------------------------------------------------------
-//{ Version information
-//-----------------------------------------------------------------------------------------------------------------
-
-//! @cond INTERNAL
-#define _TX_V_FROM_CVS(_1,file,ver,rev,date,auth,_2) "TXLib [Ver: " #ver ", Rev: " #rev "]"
-#define _TX_A_FROM_CVS(_1,file,ver,rev,date,auth,_2) "Copyright (C) " auth
-#define _TX_v_FROM_CVS(_1,file,ver,rev,date,auth,_2) ((0x##ver << 16) | 0x##rev)
-//! @endcond
-
-//{----------------------------------------------------------------------------------------------------------------
-//! @ingroup Technical
-//! @brief .
-//!
-//! @code
-//! #define _TX_VERSION "TXLib [Version: 1.72a, Revision 50]" ()
-//! #define _TX_AUTHOR "Copyright (C) Ded (Ilya Dedinsky, http://txlib.ru)"
-//! @endcode
-//! .
-//!
-//! @see txVersion()
-//!
-//! @hideinitializer
-//}----------------------------------------------------------------------------------------------------------------
-//! @{
-
-#define _TX_VERSION _TX_V_FROM_CVS ($VersionInfo: , TXLib.h, 00172a, 104, 2014-08-09 16:37:26 +0400, "Ded (Ilya Dedinsky, http://txlib.ru) ", $)
-#define _TX_AUTHOR _TX_A_FROM_CVS ($VersionInfo: , TXLib.h, 00172a, 104, 2014-08-09 16:37:26 +0400, "Ded (Ilya Dedinsky, http://txlib.ru) ", $)
-
-//! @}
-//{----------------------------------------------------------------------------------------------------------------
-//! @ingroup Technical
-//! @brief .
-//!
-//! : - , - , - .
-//! , @c 0x172a0050 - @c 0.172a, @c 50.
-//!
-//! .
-//!
-//! @see txVersion()
-//! @usage @code
-//! #if !(defined (_TX_VER) && (_TX_VER >= 0x172a0000))
-//! #error Must use TXLib.h version >= 1.72 to compile this.
-//! #endif
-//! @endcode
-//!
-//! @hideinitializer
-//}----------------------------------------------------------------------------------------------------------------
-
-#define _TX_VER _TX_v_FROM_CVS ($VersionInfo: , TXLib.h, 00172a, 104, 2014-08-09 16:37:26 +0400, "Ded (Ilya Dedinsky, http://txlib.ru) ", $)
-
-//}
-//-----------------------------------------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------------------------------------
-//{ Compiler- and platform-specific
-//! @name
-//-----------------------------------------------------------------------------------------------------------------
-//! @{ @cond INTERNAL
-
-#if !defined (__cplusplus)
-
- #ifdef __GNUC__
- #error
- #error --------------------------------------------------------------------------------------------------------
- #endif
- #error TXLib.h: Must use C++ to compile TXLib.h.
- #error
- #error CHECK source file EXTENSION. Maybe it is ".C". It must be ".CPP".
- #error If your file is named, for example, "Untitled.C", go to menu [File], then
- #error then [Save As] and rename it to "Untitled.CPP". Please do NOT use spaces.
- #error --------------------------------------------------------------------------------------------------------
- #error
-
-#endif
-
-#if !defined (WIN32) && !defined (__WIN32__) && !defined(_WIN32) && !defined(_WIN32_WINNT)
-
- #ifdef __GNUC__
- #error
- #error --------------------------------------------------------------------------------------------------------
- #endif
- #error TXLib.h: Windows (MSVC/Win32 or GCC/MinGW) is the only supported system, sorry.
- #error
- #error In Linux or iOS, you should write your own TXLib and share it with your friends,
- #error or use wine.
- #error --------------------------------------------------------------------------------------------------------
- #error
-
-#endif
-
-#if defined (UNICODE) || defined (_UNICODE)
-
- #ifdef __GNUC__
- #warning TXLib.h: Disabling the UNICODE
- #endif
-
- #undef UNICODE // Burn Unicode, burn
- #undef _UNICODE
-
- #if defined (_WINDOWS_H) || defined (_INC_WINDOWS) || defined (_WINDOWS_) || defined (__WINDOWS__)
-
- #ifdef __GNUC__
- #error
- #error --------------------------------------------------------------------------------------------------------
- #endif
- #error TXLib.h: Should include "TXLib.h" BEFORE or INSTEAD of in UNICODE mode.
- #error
- #error REARRANGE your #include directives, or DISABLE the UNICODE mode.
- #error --------------------------------------------------------------------------------------------------------
- #error
-
- #endif
-
-#endif
-
-#if defined (__STRICT_ANSI__) // Try to extend strict ANSI rules
-
- #ifdef __GNUC__
- #warning TXLib.h: Trying to extend strict ANSI compatibility
- #endif
-
- #undef __STRICT_ANSI__
- #define __STRICT_ANSI__UNDEFINED
-
- #if defined (_STRING_H_) || defined (_INC_STRING) || defined (_STDIO_H_) || defined (_INC_STDIO)
-
- #ifdef __GNUC__
- #error
- #error --------------------------------------------------------------------------------------------------------
- #endif
- #error TXLib.h: Should include "TXLib.h" BEFORE or in Strict ANSI mode.
- #error
- #error REARRANGE your #include directives, or DISABLE ANSI-compliancy.
- #error --------------------------------------------------------------------------------------------------------
- #error
-
- #endif
-
-#endif
-
-#if defined (__GNUC__)
-
- #define _GCC_VER ( __GNUC__*100 + __GNUC_MINOR__*10 + __GNUC_PATCHLEVEL__ )
-
- #if defined (_GCC_VER) && (_GCC_VER >= 420)
-
- #if (_GCC_VER >= 460)
- #pragma GCC diagnostic push
- #endif
-
- #pragma GCC optimize ("no-strict-aliasing")
- #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-
- #pragma GCC diagnostic ignored "-Wshadow"
-
- #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
- #pragma GCC diagnostic ignored "-Wunreachable-code"
- #pragma GCC diagnostic ignored "-Wold-style-cast"
- #pragma GCC diagnostic ignored "-Wunused-label" // Just for fun in _txCanvas_OnCmdAbout()
- #pragma GCC diagnostic ignored "-Winline"
-
- #define _TX_THREAD __thread
-
- #else
- #define _TX_THREAD
-
- #endif
-
- #define _TX_CHECK_FORMAT( at ) __attribute__ (( format (printf, (at), (at)+1) ))
-
- template
- inline T _txNOP (T value) { return value; } // To suppress performance warnings in assert etc
-
- // From MinGW\include\float.h which is replaced by MinGW\lib\gcc\i686-pc-mingw32\x.x.x\include\float.h
- extern "C" unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask);
- extern "C" void __cdecl _fpreset (void);
-
-#else
-
- #define _TX_CHECK_FORMAT( at )
-
- #define _txNOP( value ) ( value )
-
-#endif
-
-#if defined (_MSC_VER)
-
- #pragma warning (push, 4) // Set maximum warning level
-
- #pragma warning (disable: 4127) // conditional expression is constant
- #pragma warning (disable: 4351) // new behavior: elements of array will be default initialized
- #pragma warning (disable: 4702) // unreachable code
-
- #define _TX_THREAD __declspec (thread)
-
-#endif
-
-#if defined (_MSC_VER) && (_MSC_VER == 1200) // MSVC 6 (1998)
-
- #define _MSC_VER_6 // Flag the bad dog
-
- #pragma warning (disable: 4511) // copy constructor could not be generated
- #pragma warning (disable: 4512) // assignment operator could not be generated
- #pragma warning (disable: 4514) // unreferenced inline function has been removed
- #pragma warning (disable: 4663) // C++ language change: to explicitly specialize class template
- #pragma warning (disable: 4710) // function not inlined
- #pragma warning (disable: 4786) // identifier was truncated to '255' characters in the debug information
-
- #if !defined (WINVER)
- #define WINVER 0x0400 // MSVC 6: Defaults to Windows 95
- #endif
-
- #if !defined (NDEBUG)
- #define _CRTDBG_MAP_ALLOC 1 // Set debug mode heap allocation
- #endif
-
-#endif
-
-#if defined (_MSC_VER) && (_MSC_VER >= 1400) // MSVC 8 (2005) or greater
-
- #pragma warning (disable: 26135) // missing locking annotation
- #pragma warning (disable: 28125) // the function must be called from within a try/except block
- #pragma warning (disable: 28159) // consider using another function instead
-
- #pragma setlocale ("russian") // Set source file encoding, see also _TX_CP
-
- #if !defined (NDEBUG)
- #pragma check_stack (on) // Turn on stack probes at runtime
- #pragma strict_gs_check (push, on) // Detects stack buffer overruns
- #endif
-
- #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
- #define _TX_TRUNCATE , _TRUNCATE
-
-#else
-
- #define strcpy_s strcpy // MSVC prior to 8 (2005) versions and GCC
- #define strncpy_s strncpy // do NOT have secure variants of these
- #define strncat_s strncat // functions, so use insecure ones.
- #define wcsncpy_s wcsncpy // ...
- #define _snprintf_s _snprintf //
- #define _vsnprintf_s _vsnprintf //
-
- #define strerror_s( buf, code ) ( strncpy ((buf), strerror (code), sizeof(buf)-1) )
- #define ctime_s( buf, sizeof_buf, time ) ( strncpy ((buf), ctime (time), (sizeof_buf)-1) )
- #define getenv_s( sz, buf, sizeof_buf, name ) ( (void)(sz), strncpy ((buf), getenv (name), (sizeof_buf)-1) )
- #define strtok_s( buf, delim, ctx ) ( (void)(ctx), strtok ((buf), (delim)) )
-
- #if !( defined (_GCC_VER) && (_GCC_VER == 471) && defined (__x86_64__) ) // GCC 4.7.1 x64 already has it
- #define _controlfp_s( oldCtl, newCtl, mask ) ( *(oldCtl) = _controlfp (newCtl, mask), 0 )
- #endif
-
- #define _TX_TRUNCATE
-
-#endif
-
-#if defined (__INTEL_COMPILER)
-
- #pragma warning (disable: 174) // remark: expression has no effect
- #pragma warning (disable: 304) // remark: access control not specified ("public" by default)
- #pragma warning (disable: 522) // remark: function "..." redeclared "inline" after being called
- #pragma warning (disable: 981) // remark: operands are evaluated in unspecified order
- #pragma warning (disable: 1684) // conversion from pointer to same-sized integral type (potential portability problem)
-
-#endif
-
-#if !defined (WINVER)
- #define WINVER 0x0500 // Defaults to Windows 2000
- #define WINDOWS_ENABLE_CPLUSPLUS // Allow use of type-limit macros in ,
-#endif // they allowed by default if WINVER >= 0x0600.
-
-#if !defined (_WIN32_WINNT)
- #define _WIN32_WINNT WINVER // Defaults to the same as WINVER
-#endif
-
-#if !defined (_WIN32_IE)
- #define _WIN32_IE WINVER // Defaults to the same as WINVER
-#endif
-
-#define _USE_MATH_DEFINES // math.h's M_PI etc.
-
-//! @} @endcond
-//}
-//-----------------------------------------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------------------------------------
-//{ The Includes
-//-----------------------------------------------------------------------------------------------------------------
-
-#ifdef _MSC_VER_6
- #pragma warning (push, 3) // MSVC 6: At level 4, some std headers emit warnings O_o
-#endif
-
-//-----------------------------------------------------------------------------------------------------------------
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include