summaryrefslogtreecommitdiff
path: root/SetSizeForm.cs
blob: 74d67383a1dc5ce81d59c56d269e471b428479fd (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// XXX - YYY
// Copyright (C) 200X  Ian Cowburn
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
// $Id$
//

using System;
using System.Drawing;
using System.Windows.Forms;

namespace BitmapFontEd
{
	/// <summary>
	/// Description of SetSizeForm.
	/// </summary>
	public class SetSizeForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TrackBar m_width;
		private System.Windows.Forms.TrackBar m_height;
		private System.Windows.Forms.Button m_cancel;
		private System.Windows.Forms.Label m_widthtxt;
		private System.Windows.Forms.Label m_heighttxt;
		private System.Windows.Forms.Button m_ok;

		public SetSizeForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
		}
		
		public int CharWidth 	{get {return m_width.Value;}}
		public int CharHeight 	{get {return m_height.Value;}}
		
		#region Windows Forms Designer generated code
		/// <summary>
		/// This method is required for Windows Forms designer support.
		/// Do not change the method contents inside the source code editor. The Forms designer might
		/// not be able to load this method if it was changed manually.
		/// </summary>
		private void InitializeComponent() {
			this.m_ok = new System.Windows.Forms.Button();
			this.m_heighttxt = new System.Windows.Forms.Label();
			this.m_widthtxt = new System.Windows.Forms.Label();
			this.m_cancel = new System.Windows.Forms.Button();
			this.m_height = new System.Windows.Forms.TrackBar();
			this.m_width = new System.Windows.Forms.TrackBar();
			((System.ComponentModel.ISupportInitialize)(this.m_height)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_width)).BeginInit();
			this.SuspendLayout();
			// 
			// m_ok
			// 
			this.m_ok.Location = new System.Drawing.Point(88, 144);
			this.m_ok.Name = "m_ok";
			this.m_ok.Size = new System.Drawing.Size(88, 24);
			this.m_ok.TabIndex = 5;
			this.m_ok.Text = "OK";
			this.m_ok.Click += new System.EventHandler(this.OnOK);
			// 
			// m_heighttxt
			// 
			this.m_heighttxt.Location = new System.Drawing.Point(8, 72);
			this.m_heighttxt.Name = "m_heighttxt";
			this.m_heighttxt.Size = new System.Drawing.Size(266, 16);
			this.m_heighttxt.TabIndex = 3;
			this.m_heighttxt.Text = "Height: 16";
			// 
			// m_widthtxt
			// 
			this.m_widthtxt.Location = new System.Drawing.Point(8, 8);
			this.m_widthtxt.Name = "m_widthtxt";
			this.m_widthtxt.Size = new System.Drawing.Size(264, 16);
			this.m_widthtxt.TabIndex = 1;
			this.m_widthtxt.Text = "Width: 16";
			// 
			// m_cancel
			// 
			this.m_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.m_cancel.Location = new System.Drawing.Point(184, 144);
			this.m_cancel.Name = "m_cancel";
			this.m_cancel.Size = new System.Drawing.Size(88, 24);
			this.m_cancel.TabIndex = 4;
			this.m_cancel.Text = "Cancel";
			// 
			// m_height
			// 
			this.m_height.LargeChange = 4;
			this.m_height.Location = new System.Drawing.Point(0, 88);
			this.m_height.Maximum = 32;
			this.m_height.Minimum = 1;
			this.m_height.Name = "m_height";
			this.m_height.Size = new System.Drawing.Size(280, 42);
			this.m_height.TabIndex = 2;
			this.m_height.Value = 16;
			this.m_height.Scroll += new System.EventHandler(this.OnHeight);
			// 
			// m_width
			// 
			this.m_width.LargeChange = 4;
			this.m_width.Location = new System.Drawing.Point(0, 24);
			this.m_width.Maximum = 32;
			this.m_width.Minimum = 1;
			this.m_width.Name = "m_width";
			this.m_width.Size = new System.Drawing.Size(280, 42);
			this.m_width.TabIndex = 0;
			this.m_width.Value = 16;
			this.m_width.Scroll += new System.EventHandler(this.OnWidth);
			// 
			// SetSizeForm
			// 
			this.AcceptButton = this.m_ok;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.m_cancel;
			this.ClientSize = new System.Drawing.Size(282, 175);
			this.Controls.Add(this.m_ok);
			this.Controls.Add(this.m_cancel);
			this.Controls.Add(this.m_heighttxt);
			this.Controls.Add(this.m_height);
			this.Controls.Add(this.m_widthtxt);
			this.Controls.Add(this.m_width);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "SetSizeForm";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Set Size of All Characters";
			((System.ComponentModel.ISupportInitialize)(this.m_height)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_width)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion

		void OnWidth(object sender, System.EventArgs e)
		{
			m_widthtxt.Text="Width: " + m_width.Value;
		}
		
		void OnHeight(object sender, System.EventArgs e)
		{
			m_heighttxt.Text="Height: " + m_height.Value;
		}
		
		void OnOK(object sender, System.EventArgs e)
		{
			DialogResult=DialogResult.OK;
			Close();
		}
		
		void OnCancel(object sender, System.EventArgs e)
		{
			DialogResult=DialogResult.Cancel;
			Close();
		}
	}
}