code
This commit is contained in:
parent
61e6d0bda4
commit
e5b7b564b5
2
PowerCalc/MainForm.Designer.cs
generated
2
PowerCalc/MainForm.Designer.cs
generated
@ -177,7 +177,7 @@
|
|||||||
//
|
//
|
||||||
// evalButton
|
// evalButton
|
||||||
//
|
//
|
||||||
this.evalButton.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
this.evalButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.evalButton.Location = new System.Drawing.Point(3, 145);
|
this.evalButton.Location = new System.Drawing.Point(3, 145);
|
||||||
this.evalButton.Name = "evalButton";
|
this.evalButton.Name = "evalButton";
|
||||||
this.evalButton.Size = new System.Drawing.Size(59, 23);
|
this.evalButton.Size = new System.Drawing.Size(59, 23);
|
||||||
|
@ -35,6 +35,7 @@ namespace PowerCalc
|
|||||||
private void evalButton_Click(object sender, EventArgs e)
|
private void evalButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||||
|
Enabled = false;
|
||||||
evalThread = new Thread(() =>
|
evalThread = new Thread(() =>
|
||||||
{
|
{
|
||||||
Bitmap bmp = new Bitmap(evalBox.Width, evalBox.Height);
|
Bitmap bmp = new Bitmap(evalBox.Width, evalBox.Height);
|
||||||
@ -50,12 +51,12 @@ namespace PowerCalc
|
|||||||
{
|
{
|
||||||
lines.ForEach(s =>
|
lines.ForEach(s =>
|
||||||
{
|
{
|
||||||
for (int i = 0; i < evalBox.Width; i++)
|
for (double i = 0; i < evalBox.Width; i++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
s.Item3.Parameters.Clear();
|
s.Item3.Parameters.Clear();
|
||||||
s.Item3.Parameters.Add("x", i);
|
s.Item3.Parameters.Add("x", i/10);
|
||||||
double val = -1;
|
double val = -1;
|
||||||
object tmp = s.Item3.Evaluate();
|
object tmp = s.Item3.Evaluate();
|
||||||
if (tmp.GetType() == typeof(bool))
|
if (tmp.GetType() == typeof(bool))
|
||||||
@ -86,7 +87,7 @@ namespace PowerCalc
|
|||||||
log("Type mismatch! (" + tmp.GetType().ToString() + ")");
|
log("Type mismatch! (" + tmp.GetType().ToString() + ")");
|
||||||
float val1 = Convert.ToSingle(val);
|
float val1 = Convert.ToSingle(val);
|
||||||
if (i >= 0 && i < evalBox.Width && val1 >= 0 && val1 < evalBox.Height)
|
if (i >= 0 && i < evalBox.Width && val1 >= 0 && val1 < evalBox.Height)
|
||||||
s.Item2.Add(new PointF(i, val1));
|
s.Item2.Add(new PointF(Convert.ToSingle(i), evalBox.Height - val1));
|
||||||
}
|
}
|
||||||
catch (Exception e1)
|
catch (Exception e1)
|
||||||
{
|
{
|
||||||
@ -95,6 +96,7 @@ namespace PowerCalc
|
|||||||
#else
|
#else
|
||||||
log(e1.Message);
|
log(e1.Message);
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g.DrawLines(new Pen(s.Item1), s.Item2.ToArray());
|
g.DrawLines(new Pen(s.Item1), s.Item2.ToArray());
|
||||||
@ -112,6 +114,7 @@ namespace PowerCalc
|
|||||||
Invoke((MethodInvoker)delegate ()
|
Invoke((MethodInvoker)delegate ()
|
||||||
{
|
{
|
||||||
FormBorderStyle = FormBorderStyle.Sizable;
|
FormBorderStyle = FormBorderStyle.Sizable;
|
||||||
|
Enabled = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user