summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-11-12 22:58:50 +0000
committerIan C <ianc@noddybox.co.uk>2005-11-12 22:58:50 +0000
commit960f7c1405a724c43de63a3e506ef438220593e0 (patch)
tree39703118ef9618d2f0ff7e061523050931c75e2b
parent3b0ebcf5ea2d9088b7378aa34d421851f8f6adcb (diff)
Added ability to use Window Colour DialogHEADmaster
-rw-r--r--AlphaColourDialog.cs95
1 files changed, 60 insertions, 35 deletions
diff --git a/AlphaColourDialog.cs b/AlphaColourDialog.cs
index 430722f..3b2de42 100644
--- a/AlphaColourDialog.cs
+++ b/AlphaColourDialog.cs
@@ -29,15 +29,15 @@ namespace BitmapFontEd
/// </summary>
public class AlphaColourDialog : System.Windows.Forms.Form
{
- private System.Windows.Forms.Label m_common7;
+ private System.Windows.Forms.ComboBox m_named;
private System.Windows.Forms.Label m_common4;
- private System.Windows.Forms.Label m_common5;
private System.Windows.Forms.Label m_common3;
+ private System.Windows.Forms.Label m_common5;
private System.Windows.Forms.TextBox m_red;
+ private System.Windows.Forms.Label m_common7;
private System.Windows.Forms.TrackBar m_greenSlider;
private System.Windows.Forms.TextBox m_alpha;
private System.Windows.Forms.Label m_preview;
- private System.Windows.Forms.ComboBox m_named;
private System.Windows.Forms.TrackBar m_redSlider;
private System.Windows.Forms.TrackBar m_alphaSlider;
private System.Windows.Forms.Label label1;
@@ -76,6 +76,7 @@ namespace BitmapFontEd
}
m_allowAlpha=true;
+ Color=Color.White;
}
public Color Color
@@ -149,15 +150,15 @@ namespace BitmapFontEd
this.label1 = new System.Windows.Forms.Label();
this.m_alphaSlider = new System.Windows.Forms.TrackBar();
this.m_redSlider = new System.Windows.Forms.TrackBar();
- this.m_named = new System.Windows.Forms.ComboBox();
this.m_preview = new System.Windows.Forms.Label();
this.m_alpha = new System.Windows.Forms.TextBox();
this.m_greenSlider = new System.Windows.Forms.TrackBar();
+ this.m_common7 = new System.Windows.Forms.Label();
this.m_red = new System.Windows.Forms.TextBox();
- this.m_common3 = new System.Windows.Forms.Label();
this.m_common5 = new System.Windows.Forms.Label();
+ this.m_common3 = new System.Windows.Forms.Label();
this.m_common4 = new System.Windows.Forms.Label();
- this.m_common7 = new System.Windows.Forms.Label();
+ this.m_named = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.m_blueSlider)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.m_alphaSlider)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.m_redSlider)).BeginInit();
@@ -328,17 +329,6 @@ namespace BitmapFontEd
this.m_redSlider.TickFrequency = 5;
this.m_redSlider.Scroll += new System.EventHandler(this.OnRed);
//
- // m_named
- //
- this.m_named.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.m_named.Location = new System.Drawing.Point(8, 296);
- this.m_named.MaxDropDownItems = 20;
- this.m_named.Name = "m_named";
- this.m_named.Size = new System.Drawing.Size(168, 21);
- this.m_named.Sorted = true;
- this.m_named.TabIndex = 25;
- this.m_named.SelectedIndexChanged += new System.EventHandler(this.OnNamedColour);
- //
// m_preview
//
this.m_preview.BackColor = System.Drawing.Color.Black;
@@ -347,6 +337,9 @@ namespace BitmapFontEd
this.m_preview.Name = "m_preview";
this.m_preview.Size = new System.Drawing.Size(168, 168);
this.m_preview.TabIndex = 14;
+ this.m_preview.Text = "Click Here to use standard Windows Colour Picker";
+ this.m_preview.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ this.m_preview.Click += new System.EventHandler(this.OnSelectColour);
//
// m_alpha
//
@@ -369,6 +362,16 @@ namespace BitmapFontEd
this.m_greenSlider.TickFrequency = 5;
this.m_greenSlider.Scroll += new System.EventHandler(this.OnGreen);
//
+ // m_common7
+ //
+ this.m_common7.BackColor = System.Drawing.Color.Fuchsia;
+ this.m_common7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.m_common7.Location = new System.Drawing.Point(96, 240);
+ this.m_common7.Name = "m_common7";
+ this.m_common7.Size = new System.Drawing.Size(24, 24);
+ this.m_common7.TabIndex = 22;
+ this.m_common7.Click += new System.EventHandler(this.OnCommon);
+ //
// m_red
//
this.m_red.Location = new System.Drawing.Point(192, 296);
@@ -379,16 +382,6 @@ namespace BitmapFontEd
this.m_red.TabIndex = 8;
this.m_red.Text = "textBox1";
//
- // m_common3
- //
- this.m_common3.BackColor = System.Drawing.Color.Red;
- this.m_common3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_common3.Location = new System.Drawing.Point(96, 208);
- this.m_common3.Name = "m_common3";
- this.m_common3.Size = new System.Drawing.Size(24, 24);
- this.m_common3.TabIndex = 18;
- this.m_common3.Click += new System.EventHandler(this.OnCommon);
- //
// m_common5
//
this.m_common5.BackColor = System.Drawing.Color.Blue;
@@ -399,6 +392,16 @@ namespace BitmapFontEd
this.m_common5.TabIndex = 20;
this.m_common5.Click += new System.EventHandler(this.OnCommon);
//
+ // m_common3
+ //
+ this.m_common3.BackColor = System.Drawing.Color.Red;
+ this.m_common3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.m_common3.Location = new System.Drawing.Point(96, 208);
+ this.m_common3.Name = "m_common3";
+ this.m_common3.Size = new System.Drawing.Size(24, 24);
+ this.m_common3.TabIndex = 18;
+ this.m_common3.Click += new System.EventHandler(this.OnCommon);
+ //
// m_common4
//
this.m_common4.BackColor = System.Drawing.Color.Lime;
@@ -409,15 +412,16 @@ namespace BitmapFontEd
this.m_common4.TabIndex = 19;
this.m_common4.Click += new System.EventHandler(this.OnCommon);
//
- // m_common7
+ // m_named
//
- this.m_common7.BackColor = System.Drawing.Color.Fuchsia;
- this.m_common7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_common7.Location = new System.Drawing.Point(96, 240);
- this.m_common7.Name = "m_common7";
- this.m_common7.Size = new System.Drawing.Size(24, 24);
- this.m_common7.TabIndex = 22;
- this.m_common7.Click += new System.EventHandler(this.OnCommon);
+ this.m_named.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.m_named.Location = new System.Drawing.Point(8, 296);
+ this.m_named.MaxDropDownItems = 20;
+ this.m_named.Name = "m_named";
+ this.m_named.Size = new System.Drawing.Size(168, 21);
+ this.m_named.Sorted = true;
+ this.m_named.TabIndex = 25;
+ this.m_named.SelectedIndexChanged += new System.EventHandler(this.OnNamedColour);
//
// AlphaColourDialog
//
@@ -504,5 +508,26 @@ namespace BitmapFontEd
Color=Color.FromKnownColor((KnownColor)Enum.Parse(typeof(KnownColor),s));
}
+ void OnSelectColour(object sender, System.EventArgs e)
+ {
+ ColorDialog dlg=new ColorDialog();
+
+ dlg.Color=Color.FromArgb(m_alphaSlider.Value,
+ m_redSlider.Value,
+ m_greenSlider.Value,
+ m_blueSlider.Value);
+
+ dlg.AnyColor=true;
+ dlg.SolidColorOnly=false;
+ dlg.FullOpen=true;
+
+ if (dlg.ShowDialog()==DialogResult.OK)
+ {
+ m_redSlider.Value=dlg.Color.R;
+ m_greenSlider.Value=dlg.Color.G;
+ m_blueSlider.Value=dlg.Color.B;
+ SetColour();
+ }
+ }
}
}