-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHeadsUpDisplay.cs
64 lines (56 loc) · 2.6 KB
/
HeadsUpDisplay.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Game_of_Life
{
public partial class HeadsUpDisplay : UserControl
{
MainWindow mainWindow;
public HeadsUpDisplay(MainWindow mw)
{
mainWindow = mw;
InitializeComponent();
}
public void UpdateHUD(int generation, int cellCount, string boundaryType, string uniName, string uniSize, int cellsAlive, int cellsDead)
{
lbCurrentGen.ForeColor = Properties.Settings.Default.ColorCurrentGen;
lbCurrentGen.Font = Properties.Settings.Default.FontGen;
lbCellCount.Font = Properties.Settings.Default.FontCellCount;
lbCellCount.ForeColor = Properties.Settings.Default.ColorCellCount;
lbBoundaryType.Font = Properties.Settings.Default.FontBoundaryType;
lbBoundaryType.ForeColor = Properties.Settings.Default.ColorBoundaryType;
lbUniverseName.Font = Properties.Settings.Default.FontUniName;
lbUniverseName.ForeColor = Properties.Settings.Default.ColorUniName;
lbUnivSize.Font = Properties.Settings.Default.FontUniSize;
lbUnivSize.ForeColor = Properties.Settings.Default.ColorUniSize;
lbAlive.Font = Properties.Settings.Default.FontCellsAlive;
lbAlive.ForeColor = Properties.Settings.Default.ColorCellCountAlive;
lbDead.Font = Properties.Settings.Default.FontCellsDead;
lbDead.ForeColor = Properties.Settings.Default.ColorCellCountDead;
lbCurrentGen.Text = "Genration: " + generation.ToString();
lbCellCount.Text = "Cell Count: " + cellCount.ToString();
lbBoundaryType.Text = "Boundary Type: " + boundaryType;
lbUniverseName.Text = "Universe Name: " + uniName;
lbUnivSize.Text = "Size: " + uniSize;
lbAlive.Text = "Alive Cells: " + cellsAlive.ToString();
lbDead.Text = "Dead Cells: " + cellsDead.ToString();
}
/** These functions pass through mouse clicks down to the
* graphics panel. Without these, clicks intended to turn
* on/off cells would be ignored when the HUD is displayed.
**/
private void PassThrough_MouseClick(object sender, MouseEventArgs e)
{
mainWindow.graphicsPanel1_MouseClick(sender, e);
}
private void PassThrough_Click(object sender, EventArgs e)
{
}
}
}