sl@0
|
1 |
using System;
|
sl@0
|
2 |
using System.Collections.Generic;
|
sl@0
|
3 |
using System.ComponentModel;
|
sl@0
|
4 |
using System.Data;
|
sl@0
|
5 |
using System.Drawing;
|
sl@0
|
6 |
using System.Linq;
|
sl@0
|
7 |
using System.Text;
|
sl@0
|
8 |
using System.Threading.Tasks;
|
sl@0
|
9 |
using System.Windows.Forms;
|
sl@0
|
10 |
using CodeProject.Dialog;
|
sl@0
|
11 |
|
sl@0
|
12 |
namespace SharpDisplayManager
|
sl@0
|
13 |
{
|
sl@0
|
14 |
public partial class MainForm : Form
|
sl@0
|
15 |
{
|
sl@2
|
16 |
DateTime LastTickTime;
|
sl@3
|
17 |
Display iDisplay;
|
sl@2
|
18 |
|
sl@0
|
19 |
public MainForm()
|
sl@0
|
20 |
{
|
sl@2
|
21 |
LastTickTime = DateTime.Now;
|
sl@3
|
22 |
iDisplay = new Display();
|
sl@2
|
23 |
|
sl@0
|
24 |
InitializeComponent();
|
sl@0
|
25 |
}
|
sl@0
|
26 |
|
sl@0
|
27 |
private void buttonFont_Click(object sender, EventArgs e)
|
sl@0
|
28 |
{
|
sl@0
|
29 |
//fontDialog.ShowColor = true;
|
sl@0
|
30 |
//fontDialog.ShowApply = true;
|
sl@0
|
31 |
fontDialog.ShowEffects = true;
|
sl@0
|
32 |
//fontDialog.ShowHelp = true;
|
sl@0
|
33 |
|
sl@0
|
34 |
//fontDlg.MaxSize = 40;
|
sl@0
|
35 |
//fontDlg.MinSize = 22;
|
sl@0
|
36 |
|
sl@0
|
37 |
//fontDialog.Parent = this;
|
sl@0
|
38 |
//fontDialog.StartPosition = FormStartPosition.CenterParent;
|
sl@0
|
39 |
|
sl@0
|
40 |
//DlgBox.ShowDialog(fontDialog);
|
sl@0
|
41 |
|
sl@0
|
42 |
//if (fontDialog.ShowDialog(this) != DialogResult.Cancel)
|
sl@0
|
43 |
if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel)
|
sl@0
|
44 |
{
|
sl@0
|
45 |
|
sl@0
|
46 |
MsgBox.Show("MessageBox MsgBox", "MsgBox caption");
|
sl@0
|
47 |
|
sl@0
|
48 |
//MessageBox.Show("Ok");
|
sl@0
|
49 |
//textBox1.Font = fontDlg.Font;
|
sl@0
|
50 |
//label1.Font = fontDlg.Font;
|
sl@0
|
51 |
//textBox1.BackColor = fontDlg.Color;
|
sl@0
|
52 |
//label1.ForeColor = fontDlg.Color;
|
sl@0
|
53 |
}
|
sl@0
|
54 |
}
|
sl@0
|
55 |
|
sl@0
|
56 |
private void buttonCapture_Click(object sender, EventArgs e)
|
sl@0
|
57 |
{
|
sl@0
|
58 |
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(tableLayoutPanel.Width, tableLayoutPanel.Height);
|
sl@0
|
59 |
tableLayoutPanel.DrawToBitmap(bmp, tableLayoutPanel.ClientRectangle);
|
sl@0
|
60 |
bmp.Save("c:\\capture.png");
|
sl@0
|
61 |
}
|
sl@2
|
62 |
|
sl@2
|
63 |
private void timer_Tick(object sender, EventArgs e)
|
sl@2
|
64 |
{
|
sl@2
|
65 |
//Update our animations
|
sl@2
|
66 |
DateTime NewTickTime = DateTime.Now;
|
sl@2
|
67 |
|
sl@2
|
68 |
marqueeLabelTop.UpdateAnimation(LastTickTime, NewTickTime);
|
sl@2
|
69 |
marqueeLabelBottom.UpdateAnimation(LastTickTime, NewTickTime);
|
sl@2
|
70 |
|
sl@2
|
71 |
LastTickTime = NewTickTime;
|
sl@2
|
72 |
}
|
sl@3
|
73 |
|
sl@3
|
74 |
private void buttonOpen_Click(object sender, EventArgs e)
|
sl@3
|
75 |
{
|
sl@3
|
76 |
if (iDisplay.Open())
|
sl@3
|
77 |
{
|
sl@3
|
78 |
trackBarBrightness.Minimum = iDisplay.MinBrightness();
|
sl@3
|
79 |
trackBarBrightness.Maximum = iDisplay.MaxBrightness();
|
sl@3
|
80 |
}
|
sl@3
|
81 |
|
sl@3
|
82 |
}
|
sl@3
|
83 |
|
sl@3
|
84 |
private void buttonClose_Click(object sender, EventArgs e)
|
sl@3
|
85 |
{
|
sl@3
|
86 |
iDisplay.Close();
|
sl@3
|
87 |
}
|
sl@3
|
88 |
|
sl@3
|
89 |
private void buttonClear_Click(object sender, EventArgs e)
|
sl@3
|
90 |
{
|
sl@3
|
91 |
iDisplay.Clear();
|
sl@3
|
92 |
iDisplay.SwapBuffers();
|
sl@3
|
93 |
}
|
sl@3
|
94 |
|
sl@3
|
95 |
private void buttonFill_Click(object sender, EventArgs e)
|
sl@3
|
96 |
{
|
sl@3
|
97 |
iDisplay.Fill();
|
sl@3
|
98 |
iDisplay.SwapBuffers();
|
sl@3
|
99 |
}
|
sl@3
|
100 |
|
sl@3
|
101 |
private void trackBarBrightness_Scroll(object sender, EventArgs e)
|
sl@3
|
102 |
{
|
sl@3
|
103 |
iDisplay.SetBrightness(trackBarBrightness.Value);
|
sl@3
|
104 |
}
|
sl@0
|
105 |
}
|
sl@0
|
106 |
}
|