Fixed several bugs, preparing for release.

Branch_1.5.0
Nathan Crawford 2007-12-13 04:20:45 +00:00
rodzic 906c68104c
commit 2ae0f499b0
15 zmienionych plików z 140 dodań i 56 usunięć

Wyświetl plik

@ -824,11 +824,14 @@ namespace PesFile
//panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
//panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
xGraph = Graphics.FromImage(DrawArea);
xGraph.TranslateTransform(threadThickness, threadThickness);
//xGraph.FillRectangle(Brushes.White, 0, 0, DrawArea.Width, DrawArea.Height);
for (int i = 0; i < blocks.Count; i++)
{
if (blocks[i].stitches.Length > 1)//must have 2 points to make a line
{
//Color tempcolor = Color.FromArgb(127,blocks[i].color);
//Pen tempPen = new Pen(tempcolor, threadThickness);
Pen tempPen = new Pen(blocks[i].color, threadThickness);
tempPen.StartCap = System.Drawing.Drawing2D.LineCap.Round;
tempPen.EndCap = System.Drawing.Drawing2D.LineCap.Round;

Wyświetl plik

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.1.39")]
[assembly: AssemblyFileVersion("1.0.1.39")]
[assembly: AssemblyVersion("1.0.1.43")]
[assembly: AssemblyFileVersion("1.0.1.43")]

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.2.1.11")]
[assembly: AssemblyFileVersion("1.2.1.11")]
[assembly: AssemblyVersion("1.2.1.33")]
[assembly: AssemblyFileVersion("1.2.1.33")]

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -40,6 +40,8 @@ namespace embroideryReader
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForUpdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -52,8 +54,6 @@ namespace embroideryReader
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
this.printDialog1 = new System.Windows.Forms.PrintDialog();
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.menuStrip1.SuspendLayout();
this.panel2.SuspendLayout();
this.statusStrip1.SuspendLayout();
@ -106,12 +106,12 @@ namespace embroideryReader
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(145, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(157, 6);
//
// printToolStripMenuItem
//
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
this.printToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.printToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.printToolStripMenuItem.Text = "Print...";
this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click);
//
@ -125,12 +125,12 @@ namespace embroideryReader
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(145, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(157, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
@ -144,6 +144,19 @@ namespace embroideryReader
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Enabled = false;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(152, 6);
//
// preferencesToolStripMenuItem
//
this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
@ -192,9 +205,10 @@ namespace embroideryReader
//
this.panel2.AutoScroll = true;
this.panel2.Controls.Add(this.panel1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 24);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(67, 42);
this.panel2.Size = new System.Drawing.Size(572, 332);
this.panel2.TabIndex = 10;
//
// statusStrip1
@ -209,6 +223,7 @@ namespace embroideryReader
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.BackColor = System.Drawing.Color.Transparent;
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17);
//
@ -230,32 +245,18 @@ namespace embroideryReader
this.printPreviewDialog1.Name = "printPreviewDialog1";
this.printPreviewDialog1.Visible = false;
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(152, 6);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(572, 378);
this.Controls.Add(this.panel2);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.panel2);
this.MainMenuStrip = this.menuStrip1;
this.Name = "frmMain";
this.Text = "Form1";
this.Resize += new System.EventHandler(this.Form1_Resize);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.ResizeEnd += new System.EventHandler(this.Form1_ResizeEnd);
this.Load += new System.EventHandler(this.Form1_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();

Wyświetl plik

@ -40,11 +40,11 @@ namespace embroideryReader
// }
//}
private void loadSettings()
private void checkSettings()
{
string updateLoc;
updateLoc = settings.getValue("update location");
if (updateLoc == null || updateLoc.Length == 0)
if (String.IsNullOrEmpty(updateLoc))
{
settings.setValue("update location", "http://www.njcrawford.com/embreader/");
}
@ -71,7 +71,7 @@ namespace embroideryReader
private void Form1_Load(object sender, EventArgs e)
{
loadSettings();
checkSettings();
this.Text = "Embroidery Reader";
if (args.Length > 1)
{
@ -135,7 +135,7 @@ namespace embroideryReader
if (design.getStatus() == PesFile.statusEnum.Ready)
{
this.Text = System.IO.Path.GetFileName(filename) + " - Embroidery Reader";
sizePanel2();
//sizePanel2();
Single threadThickness = 5;
if (settings.getValue("thread thickness") != null)
@ -148,7 +148,7 @@ namespace embroideryReader
{
}
}
DrawArea= design.designToBitmap(threadThickness);
DrawArea = design.designToBitmap(threadThickness);
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
panel1.Invalidate();
@ -161,10 +161,12 @@ namespace embroideryReader
{
toolStripStatusLabel1.Text = "";
}
copyToolStripMenuItem.Enabled = true;
}
else
{
MessageBox.Show("An error occured while reading the file:" + Environment.NewLine + design.getLastError());
copyToolStripMenuItem.Enabled = false;
}
}
@ -260,7 +262,7 @@ namespace embroideryReader
// }
//}
//if (isNewerVersion)
if (updater.IsUpdateAvailable())
if (updater.IsUpdateAvailable() && settings.getValue("update location") != null)
{
if (MessageBox.Show("Version " + updater.VersionAvailable() + " is available." + Environment.NewLine + "You have version " + currentVersion() + ". Would you like to go to the Embroidery Reader website to download it?", "New version available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
@ -360,26 +362,31 @@ namespace embroideryReader
}
}
private void Form1_ResizeEnd(object sender, EventArgs e)
{
//private void Form1_ResizeEnd(object sender, EventArgs e)
//{
//panel2.Top = 32;
//panel2.Left = 0;
//panel2.Height = this.Height - 50;
//panel2.Width = this.Width - 50;
}
//}
private void Form1_Resize(object sender, EventArgs e)
{
//private void Form1_Resize(object sender, EventArgs e)
//{
//panel2.Height = this.Height - 75;
//panel2.Width = this.Width-8;
sizePanel2();
}
//sizePanel2();
//}
private void sizePanel2()
{
panel2.Height = this.Height - 73;
panel2.Width = this.Width - 8;
}
//private void sizePanel2()
//{
//panel2.Height = this.Height - 73;
//panel2.Width = this.Width - 8;
//panel2.Height = this.Height - (statusStrip1.Height + menuStrip1.Height + 33);
//panel2.Top = menuStrip1.Bottom;
//panel2.Height = statusStrip1.Top - menuStrip1.Bottom;
//panel2.Width = this.Width - 8;
//panel2.Width = panel3.Right;
//}
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{
@ -388,7 +395,7 @@ namespace embroideryReader
if (tempForm.ShowDialog() == DialogResult.OK)
{
settings = tempForm.settings;
loadSettings();
checkSettings();
}
}
@ -435,14 +442,17 @@ namespace embroideryReader
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
Clipboard.Clear();
Bitmap temp = new Bitmap(DrawArea.Width, DrawArea.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Graphics tempGraph = Graphics.FromImage(temp);
tempGraph.FillRectangle(Brushes.White, 0, 0, temp.Width, temp.Height);
tempGraph.DrawImageUnscaled(DrawArea, 0, 0);
tempGraph.Dispose();
//temp = System.Drawing.Imaging.PixelFormat.Format24bppRgb;
Clipboard.SetImage(temp);
if (DrawArea != null)
{
Clipboard.Clear();
Bitmap temp = new Bitmap(DrawArea.Width, DrawArea.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Graphics tempGraph = Graphics.FromImage(temp);
tempGraph.FillRectangle(Brushes.White, 0, 0, temp.Width, temp.Height);
tempGraph.DrawImageUnscaled(DrawArea, 0, 0);
tempGraph.Dispose();
//temp = System.Drawing.Imaging.PixelFormat.Format24bppRgb;
Clipboard.SetImage(temp);
}
}
}
}

Wyświetl plik

@ -34,6 +34,9 @@ namespace embroideryReader
this.btnResetColor = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.txtThreadThickness = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnColor
@ -68,7 +71,7 @@ namespace embroideryReader
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(67, 83);
this.btnOK.Location = new System.Drawing.Point(67, 117);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 3;
@ -78,7 +81,8 @@ namespace embroideryReader
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(148, 83);
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(148, 117);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 4;
@ -86,13 +90,41 @@ namespace embroideryReader
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 74);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(92, 13);
this.label1.TabIndex = 5;
this.label1.Text = "Thread thickness:";
//
// txtThreadThickness
//
this.txtThreadThickness.Location = new System.Drawing.Point(110, 71);
this.txtThreadThickness.Name = "txtThreadThickness";
this.txtThreadThickness.Size = new System.Drawing.Size(32, 20);
this.txtThreadThickness.TabIndex = 6;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(145, 74);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(33, 13);
this.label2.TabIndex = 7;
this.label2.Text = "pixels";
//
// frmSettingsDialog
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(234, 118);
this.ClientSize = new System.Drawing.Size(234, 152);
this.Controls.Add(this.label2);
this.Controls.Add(this.txtThreadThickness);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnResetColor);
@ -105,6 +137,7 @@ namespace embroideryReader
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Embroidery Reader Settings";
this.ResumeLayout(false);
this.PerformLayout();
}
@ -116,5 +149,8 @@ namespace embroideryReader
private System.Windows.Forms.Button btnResetColor;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtThreadThickness;
private System.Windows.Forms.Label label2;
}
}

Wyświetl plik

@ -32,6 +32,26 @@ namespace embroideryReader
settings.getValue("background color", "green"),
settings.getValue("background color", "blue"));
}
if (settings.getValue("thread thickness") != null)
{
Single threadThickness = 5;
try
{
threadThickness = Convert.ToSingle(settings.getValue("thread thickness"));
}
catch (Exception ex)
{
}
if (threadThickness < 1)
{
threadThickness = 1;
}
txtThreadThickness.Text = threadThickness.ToString();
}
else
{
txtThreadThickness.Text = "5";
}
}
}
@ -92,12 +112,26 @@ namespace embroideryReader
settings.setValue("background color", "red", lblColor.BackColor.R.ToString());
settings.setValue("background color", "green", lblColor.BackColor.G.ToString());
settings.setValue("background color", "blue", lblColor.BackColor.B.ToString());
}
else
{
settings.setValue("background color", "enabled", "no");
}
}
Single threadThickness = 5;
try
{
threadThickness = Convert.ToSingle(txtThreadThickness.Text);
if (threadThickness < 1)
{
threadThickness = 1;
}
settings.setValue("thread thickness", threadThickness.ToString());
}
catch (Exception ex)
{
}
}
}
}

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.