Little UI tweaks

This commit is contained in:
2023-05-23 17:23:53 +02:00
parent 89c7e15a70
commit 462d07093a
2 changed files with 15 additions and 1 deletions

View File

@@ -85,6 +85,7 @@
// //
// btnStartDecoding // btnStartDecoding
// //
this.btnStartDecoding.Enabled = false;
this.btnStartDecoding.Location = new System.Drawing.Point(6, 54); this.btnStartDecoding.Location = new System.Drawing.Point(6, 54);
this.btnStartDecoding.Name = "btnStartDecoding"; this.btnStartDecoding.Name = "btnStartDecoding";
this.btnStartDecoding.Size = new System.Drawing.Size(127, 27); this.btnStartDecoding.Size = new System.Drawing.Size(127, 27);
@@ -104,6 +105,7 @@
// //
// btnStopUpdating // btnStopUpdating
// //
this.btnStopUpdating.Enabled = false;
this.btnStopUpdating.Location = new System.Drawing.Point(153, 54); this.btnStopUpdating.Location = new System.Drawing.Point(153, 54);
this.btnStopUpdating.Name = "btnStopUpdating"; this.btnStopUpdating.Name = "btnStopUpdating";
this.btnStopUpdating.Size = new System.Drawing.Size(128, 27); this.btnStopUpdating.Size = new System.Drawing.Size(128, 27);
@@ -118,7 +120,7 @@
this.btnResetEmulator.Name = "btnResetEmulator"; this.btnResetEmulator.Name = "btnResetEmulator";
this.btnResetEmulator.Size = new System.Drawing.Size(128, 27); this.btnResetEmulator.Size = new System.Drawing.Size(128, 27);
this.btnResetEmulator.TabIndex = 5; this.btnResetEmulator.TabIndex = 5;
this.btnResetEmulator.Text = "Reset"; this.btnResetEmulator.Text = "Start driver";
this.btnResetEmulator.UseVisualStyleBackColor = true; this.btnResetEmulator.UseVisualStyleBackColor = true;
this.btnResetEmulator.Click += new System.EventHandler(this.button1_Click); this.btnResetEmulator.Click += new System.EventHandler(this.button1_Click);
// //

View File

@@ -78,6 +78,7 @@ namespace Test_Merge
if (Emulator != null && Wrapper != null) if (Emulator != null && Wrapper != null)
{ {
// Disable UI controls to prevent re-entrancy // Disable UI controls to prevent re-entrancy
btnResetEmulator.Enabled = false;
btnStartDecoding.Enabled = false; btnStartDecoding.Enabled = false;
btnStopUpdating.Enabled = true; btnStopUpdating.Enabled = true;
btnSettings.Enabled = false; btnSettings.Enabled = false;
@@ -96,6 +97,11 @@ namespace Test_Merge
Bitmap screen = Emulator.Screenshot(); Bitmap screen = Emulator.Screenshot();
screen.Save("HopefullyDataScreenshot.png"); screen.Save("HopefullyDataScreenshot.png");
Invoke((MethodInvoker)delegate
{
pbxResult.Image = (Bitmap)screen.Clone();
});
Wrapper.ChangeImage(screen); Wrapper.ChangeImage(screen);
int errorCode = await Wrapper.Refresh(); int errorCode = await Wrapper.Refresh();
@@ -113,8 +119,10 @@ namespace Test_Merge
} }
} }
// Re-enable UI controls // Re-enable UI controls
btnStopUpdating.Text = "Stop";
btnStartDecoding.Enabled = true; btnStartDecoding.Enabled = true;
btnStopUpdating.Enabled = false; btnStopUpdating.Enabled = false;
btnResetEmulator.Enabled = true;
btnSettings.Enabled = true; btnSettings.Enabled = true;
} }
} }
@@ -142,10 +150,14 @@ namespace Test_Merge
{ {
// Set the cancellation flag // Set the cancellation flag
cancelRequested = true; cancelRequested = true;
btnStopUpdating.Enabled = false;
btnResetEmulator.Enabled = false;
btnStopUpdating.Text = "Stopping";
} }
private async void button1_Click(object sender, EventArgs e) private async void button1_Click(object sender, EventArgs e)
{ {
btnResetEmulator.Text = "Restart driver";
btnResetEmulator.Enabled = false; btnResetEmulator.Enabled = false;
btnSettings.Enabled = false; btnSettings.Enabled = false;
btnStartDecoding.Enabled = false; btnStartDecoding.Enabled = false;