public void OnButtonActuated(Widget widget)
{
bool quit = false;
Log.Debug();
Invoke(new MethodInvoker(delegate()
{
switch (widget.Name)
{
case "B1":
textBoxEntry.Text = textBoxEntry.Text + widget.Value;
break;
case "B2":
textBoxEntry.Text = textBoxEntry.Text + widget.Value;
break;
case "B3":
textBoxEntry.Text = textBoxEntry.Text + widget.Value;
break;
case "B4":
textBoxEntry.Text = textBoxEntry.Text + widget.Value;
break;
case "buttonBackspace": // delete last letter
if (textBoxEntry.Text.Length == 1)
{
textBoxEntry.Text = string.Empty;
}
else if (textBoxEntry.Text.Length > 1)
{
textBoxEntry.Text = textBoxEntry.Text.Substring(0, textBoxEntry.Text.Length - 1);
}
break;
case "buttonReset":
clearTextBox();
break;
case "buttonExit":
quit = true;
break;
}
if (quit)
{
if (DialogUtils.Confirm(Resources.Exit))
{
Context.AppQuit = true;
Windows.CloseForm(this);
}
}
}));
}