PageRenderTime 103ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 60ms app.codeStats 0ms

/Samples/ExampleToolForm/ExampleForm.cs

#
C# | 37 lines | 25 code | 3 blank | 9 comment | 0 complexity | 8ed995119b5d497df99af207b82602ea MD5 | raw file
 1using System.Windows.Forms;
 2using Application = Delta.Engine.Application;
 3
 4namespace Delta.Tools.ExampleToolForm
 5{
 6	/// <summary>
 7	/// Example form, will just hock up some Windows Forms events.
 8	/// </summary>
 9	public partial class ExampleForm : Form
10	{
11		#region Constructor
12		/// <summary>
13		/// Create example form
14		/// </summary>
15		public ExampleForm()
16		{
17			InitializeComponent();
18
19			// The update button click event
20			statusUpdateButton.Click += delegate
21			{
22				// How big is the viewportPanel
23				viewportLabel.Text =
24					"Viewport: " + viewportPanel.ClientSize +
25					", Graphic=" + Application.Window.ViewportPixelWidth + ", " +
26					Application.Window.ViewportPixelHeight;
27			};
28
29			// Quit with the extra quit button (rest happens in Program.cs)
30			menuExitItem.Click += delegate
31			{
32				Application.Quit();
33			};
34		}
35		#endregion
36	}
37}