Commit 69221917 authored by Tim Falken's avatar Tim Falken
Browse files

toggle toolstrip availability

parent c8796eef
No preview for this file type
......@@ -28,7 +28,7 @@ namespace PaintLang
public Color TurnR = Color.FromArgb(128, 000, 255);
public Color TurnL = Color.FromArgb(000, 128, 255);
public Color Eraser = Color.FromArgb(255, 255, 255);
public Color Eraser2 = Color.FromArgb(000, 000, 000);
public Color SpeedSkip = Color.FromArgb(000, 000, 000);
public Color SelectedColor = Color.FromArgb(255, 000, 000);
......@@ -53,7 +53,7 @@ namespace PaintLang
TurnButton.BackColor = TurnR;
turnLeft.BackColor = TurnL;
EraserBtn.BackColor = Eraser;
eraserblack.BackColor = Eraser2;
eraserblack.BackColor = SpeedSkip;
PaintRedBtn.Text = "";
PaintGreenBtn.Text = "";
......@@ -203,9 +203,9 @@ namespace PaintLang
private void eraserblack_Click(object sender, EventArgs e)
{
SelectedColor = Eraser2;
SelectedColor = SpeedSkip;
selectedColorDisplay.BackColor = SelectedColor;
colorExplainer.Text = "Like the eraser, but black. Does nothing.";
colorExplainer.Text = "Optimizer. Makes the cursor immediately skip over, continuing in the same direction until it finds a non-black pixel. Faster than white.";
}
}
}
......@@ -104,21 +104,21 @@
// newToolStripMenuItem
//
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
......@@ -134,7 +134,7 @@
// executeQuickToolStripMenuItem
//
this.executeQuickToolStripMenuItem.Name = "executeQuickToolStripMenuItem";
this.executeQuickToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.executeQuickToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.executeQuickToolStripMenuItem.Text = "Execute Quick";
this.executeQuickToolStripMenuItem.Click += new System.EventHandler(this.executeQuickToolStripMenuItem_Click);
//
......@@ -147,42 +147,43 @@
this.startSlowToolStripMenuItem,
this.abortToolStripMenuItem});
this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
this.debugToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.debugToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.debugToolStripMenuItem.Text = "Debug";
this.debugToolStripMenuItem.Click += new System.EventHandler(this.debugToolStripMenuItem_Click);
//
// startQuickestToolStripMenuItem
//
this.startQuickestToolStripMenuItem.Name = "startQuickestToolStripMenuItem";
this.startQuickestToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
this.startQuickestToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.startQuickestToolStripMenuItem.Text = "Start Quickest";
this.startQuickestToolStripMenuItem.Click += new System.EventHandler(this.startQuickestToolStripMenuItem_Click);
//
// startToolStripMenuItem
//
this.startToolStripMenuItem.Name = "startToolStripMenuItem";
this.startToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
this.startToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.startToolStripMenuItem.Text = "Start Quick";
this.startToolStripMenuItem.Click += new System.EventHandler(this.startToolStripMenuItem_Click);
//
// startNormalToolStripMenuItem
//
this.startNormalToolStripMenuItem.Name = "startNormalToolStripMenuItem";
this.startNormalToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
this.startNormalToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.startNormalToolStripMenuItem.Text = "Start Normal";
this.startNormalToolStripMenuItem.Click += new System.EventHandler(this.startNormalToolStripMenuItem_Click);
//
// startSlowToolStripMenuItem
//
this.startSlowToolStripMenuItem.Name = "startSlowToolStripMenuItem";
this.startSlowToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
this.startSlowToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.startSlowToolStripMenuItem.Text = "Start Slow";
this.startSlowToolStripMenuItem.Click += new System.EventHandler(this.startSlowToolStripMenuItem_Click);
//
// abortToolStripMenuItem
//
this.abortToolStripMenuItem.Enabled = false;
this.abortToolStripMenuItem.Name = "abortToolStripMenuItem";
this.abortToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
this.abortToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.abortToolStripMenuItem.Text = "Abort";
this.abortToolStripMenuItem.Click += new System.EventHandler(this.abortToolStripMenuItem_Click);
//
......@@ -198,14 +199,14 @@
// clearToolStripMenuItem
//
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
this.clearToolStripMenuItem.Size = new System.Drawing.Size(106, 22);
this.clearToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.clearToolStripMenuItem.Text = "Clear";
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
//
// resizeToolStripMenuItem
//
this.resizeToolStripMenuItem.Name = "resizeToolStripMenuItem";
this.resizeToolStripMenuItem.Size = new System.Drawing.Size(106, 22);
this.resizeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.resizeToolStripMenuItem.Text = "Resize";
this.resizeToolStripMenuItem.Click += new System.EventHandler(this.resizeToolStripMenuItem_Click);
//
......
......@@ -286,8 +286,22 @@ namespace PaintLang
cursorDirection = Directions.Right;
invokeDelegate del = () =>
{
invokeDelegate del = () =>
{
abortToolStripMenuItem.Enabled = true;
executeQuickToolStripMenuItem.Enabled = false;
startQuickestToolStripMenuItem.Enabled = false;
startSlowToolStripMenuItem.Enabled = false;
startToolStripMenuItem.Enabled = false;
startNormalToolStripMenuItem.Enabled = false;
openToolStripMenuItem.Enabled = false;
newToolStripMenuItem.Enabled = false;
fileToolStripMenuItem.Enabled = false;
canvasToolStripMenuItem.Enabled = false;
clearToolStripMenuItem.Enabled = false;
saveToolStripMenuItem.Enabled = false;
resizeToolStripMenuItem.Enabled = false;
outputWindow.Reset();
outputWindow.ShowBrush = true;
memoryDisplayer.Reset();
......@@ -316,15 +330,23 @@ namespace PaintLang
{
case Directions.Right:
cursorX++;
while (cursorX < LogicMap.Width && LogicMap.GetPixel(cursorX, cursorY) == colorPicker.SpeedSkip)
cursorX++;
break;
case Directions.Left:
cursorX--;
while (cursorX >= 0 && LogicMap.GetPixel(cursorX, cursorY) == colorPicker.SpeedSkip)
cursorX--;
break;
case Directions.Up:
cursorY--;
while (cursorY >= 0 && LogicMap.GetPixel(cursorX, cursorY) == colorPicker.SpeedSkip)
cursorY--;
break;
case Directions.Down:
cursorY++;
while (cursorY < LogicMap.Height && LogicMap.GetPixel(cursorX, cursorY) == colorPicker.SpeedSkip)
cursorY++;
break;
}
......@@ -351,6 +373,20 @@ namespace PaintLang
{
SetCursorVisible(false);
outputWindow.ShowBrush = false;
abortToolStripMenuItem.Enabled = false;
executeQuickToolStripMenuItem.Enabled = true;
startQuickestToolStripMenuItem.Enabled = true;
startSlowToolStripMenuItem.Enabled = true;
startToolStripMenuItem.Enabled = true;
startNormalToolStripMenuItem.Enabled = true;
openToolStripMenuItem.Enabled = true;
newToolStripMenuItem.Enabled = true;
fileToolStripMenuItem.Enabled = true;
canvasToolStripMenuItem.Enabled = true;
clearToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
resizeToolStripMenuItem.Enabled = true;
};
Invoke(del);
......@@ -554,6 +590,20 @@ namespace PaintLang
{
executionThread.Abort();
executing = false;
abortToolStripMenuItem.Enabled = false;
executeQuickToolStripMenuItem.Enabled = true;
startQuickestToolStripMenuItem.Enabled = true;
startSlowToolStripMenuItem.Enabled = true;
startToolStripMenuItem.Enabled = true;
startNormalToolStripMenuItem.Enabled = true;
openToolStripMenuItem.Enabled = true;
newToolStripMenuItem.Enabled = true;
fileToolStripMenuItem.Enabled = true;
canvasToolStripMenuItem.Enabled = true;
clearToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
resizeToolStripMenuItem.Enabled = true;
}
private void startNormalToolStripMenuItem_Click(object sender, EventArgs e)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment