Made UI tweaks
This commit is contained in:
@@ -48,8 +48,26 @@ namespace Test_Merge
|
|||||||
newButton.Size = buttonDimensions;
|
newButton.Size = buttonDimensions;
|
||||||
newButton.Location = new Point(0,driverCount * buttonDimensions.Height);
|
newButton.Location = new Point(0,driverCount * buttonDimensions.Height);
|
||||||
|
|
||||||
newButton.Text = liveData[driverCount].Name;
|
DriverData driver = liveData[driverCount];
|
||||||
|
|
||||||
|
if (driver.Position == -1)
|
||||||
|
{
|
||||||
|
//Its a DNF
|
||||||
|
newButton.Enabled = false;
|
||||||
|
}
|
||||||
|
if(driver.Position > 1)
|
||||||
|
{
|
||||||
|
newButton.Text = driver.Name + " +" + Reader.ConvertMsToTime(driver.GapToLeader);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newButton.Text = driver.Name;
|
||||||
|
}
|
||||||
|
|
||||||
newButton.Name = liveData[driverCount].Name;
|
newButton.Name = liveData[driverCount].Name;
|
||||||
|
newButton.TextAlign = ContentAlignment.MiddleLeft;
|
||||||
|
|
||||||
|
newButton.Click += Form1.btnDriver_Click;
|
||||||
|
|
||||||
buttons[driverCount] = newButton;
|
buttons[driverCount] = newButton;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -309,6 +309,7 @@ namespace Test_Merge
|
|||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
Ready = false;
|
Ready = false;
|
||||||
|
if (Driver != null)
|
||||||
Driver.Dispose();
|
Driver.Dispose();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -317,6 +318,7 @@ namespace Test_Merge
|
|||||||
public void ResetDriver()
|
public void ResetDriver()
|
||||||
{
|
{
|
||||||
Ready = false;
|
Ready = false;
|
||||||
|
if (Driver != null)
|
||||||
Driver.Dispose();
|
Driver.Dispose();
|
||||||
Driver = null;
|
Driver = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,5 +209,10 @@ namespace Test_Merge
|
|||||||
if (tbxResult.Text != "")
|
if (tbxResult.Text != "")
|
||||||
GpUrl = textBox1.Text;
|
GpUrl = textBox1.Text;
|
||||||
}
|
}
|
||||||
|
public static void btnDriver_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//Happens when a driver button has been clicked
|
||||||
|
MessageBox.Show((sender as Button).Name + " has been selected");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,6 +275,8 @@ namespace Test_Merge
|
|||||||
//Next there could be a Title Zone and TrackInfoZone
|
//Next there could be a Title Zone and TrackInfoZone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//mainResults = mainResults.OrderBy(driver => driver.Position >= 0).ThenBy(driver => driver.Position).ToList();
|
||||||
|
mainResults = mainResults.OrderBy(driver => driver.Position).ToList();
|
||||||
return mainResults;
|
return mainResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user