From 319948b096029194a0dc27d5319794433f487a7b Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 15 May 2005 23:16:49 +0000 Subject: Added recent colour history to editor --- BitmapChar.cs | 5 - BitmapFontEd.GfxEditor.resources | Bin 8374 -> 13351 bytes GfxEditor.cs | 447 ++++++++++++++++++++++++++++----------- MainForm.cs | 86 ++++---- 4 files changed, 372 insertions(+), 166 deletions(-) diff --git a/BitmapChar.cs b/BitmapChar.cs index e1cf532..b161d4f 100644 --- a/BitmapChar.cs +++ b/BitmapChar.cs @@ -234,11 +234,6 @@ namespace BitmapFontEd else { s[x,y]=Color.FromArgb(255,(col&0xff0000)>>16,(col&0xff00)>>8,col&0xff); - - if (s[x,y].R==0 && s[x,y].G==0 && s[x,y].B==0) - { - s[x,y]=Color.Black; - } } } } diff --git a/BitmapFontEd.GfxEditor.resources b/BitmapFontEd.GfxEditor.resources index 094b568..275f1ce 100644 Binary files a/BitmapFontEd.GfxEditor.resources and b/BitmapFontEd.GfxEditor.resources differ diff --git a/GfxEditor.cs b/GfxEditor.cs index 048317e..d1249e6 100644 --- a/GfxEditor.cs +++ b/GfxEditor.cs @@ -33,21 +33,35 @@ namespace BitmapFontEd [ToolboxItem(true)] public class GfxEditor : System.Windows.Forms.UserControl { - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label m_bgPreview; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox m_edit; - private System.Windows.Forms.ComboBox m_modeList; private System.Windows.Forms.Label m_fgPreview; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.PictureBox m_preview; + private System.Windows.Forms.ComboBox m_modeList; + private System.Windows.Forms.PictureBox m_edit; + private System.Windows.Forms.Label m_recent1; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label m_recent4; + private System.Windows.Forms.Label m_recent5; + private System.Windows.Forms.Label m_recent6; + private System.Windows.Forms.Label m_recent7; + private System.Windows.Forms.Label m_bgPreview; + private System.Windows.Forms.Label m_recent2; private System.Windows.Forms.NumericUpDown m_sizeY; + private System.Windows.Forms.PictureBox m_preview; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label m_pos; + private System.Windows.Forms.Label m_recent3; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Button m_undoButton; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown m_sizeX; + private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; - private System.Windows.Forms.NumericUpDown m_sizeX; - private System.Windows.Forms.Label m_pos; - private System.Windows.Forms.Button m_undoButton; + private System.Windows.Forms.Label m_recent8; private const uint SIZE=256; private Color TRANS=Color.Empty; @@ -99,6 +113,8 @@ namespace BitmapFontEd private uint m_cpHeight; private Color[,] m_cpBuff; + private Label[] m_recent; + public GfxEditor() { // @@ -134,6 +150,10 @@ namespace BitmapFontEd m_modeList.SelectedIndex=0; m_cpMenu=new CopyMenu(); + + m_recent=new Label[] + {m_recent1,m_recent2,m_recent3,m_recent4, + m_recent5,m_recent6,m_recent7,m_recent8}; } #region Windows Forms Designer generated code @@ -143,41 +163,84 @@ namespace BitmapFontEd /// not be able to load this method if it was changed manually. /// private void InitializeComponent() { - this.m_undoButton = new System.Windows.Forms.Button(); - this.m_pos = new System.Windows.Forms.Label(); - this.m_sizeX = new System.Windows.Forms.NumericUpDown(); + this.m_recent8 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); - this.m_sizeY = new System.Windows.Forms.NumericUpDown(); - this.m_preview = new System.Windows.Forms.PictureBox(); - this.label2 = new System.Windows.Forms.Label(); - this.m_fgPreview = new System.Windows.Forms.Label(); - this.m_modeList = new System.Windows.Forms.ComboBox(); - this.m_edit = new System.Windows.Forms.PictureBox(); + this.label7 = new System.Windows.Forms.Label(); + this.m_sizeX = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); - this.m_bgPreview = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); + this.m_undoButton = new System.Windows.Forms.Button(); + this.label15 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.m_recent3 = new System.Windows.Forms.Label(); + this.m_pos = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.m_preview = new System.Windows.Forms.PictureBox(); + this.m_sizeY = new System.Windows.Forms.NumericUpDown(); + this.m_recent2 = new System.Windows.Forms.Label(); + this.m_bgPreview = new System.Windows.Forms.Label(); + this.m_recent7 = new System.Windows.Forms.Label(); + this.m_recent6 = new System.Windows.Forms.Label(); + this.m_recent5 = new System.Windows.Forms.Label(); + this.m_recent4 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_recent1 = new System.Windows.Forms.Label(); + this.m_edit = new System.Windows.Forms.PictureBox(); + this.m_modeList = new System.Windows.Forms.ComboBox(); + this.m_fgPreview = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.m_sizeX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.m_sizeY)).BeginInit(); this.SuspendLayout(); // - // m_undoButton + // m_recent8 // - this.m_undoButton.Location = new System.Drawing.Point(8, 272); - this.m_undoButton.Name = "m_undoButton"; - this.m_undoButton.Size = new System.Drawing.Size(72, 24); - this.m_undoButton.TabIndex = 16; - this.m_undoButton.Text = "Undo"; - this.m_undoButton.Click += new System.EventHandler(this.OnUndo); + this.m_recent8.BackColor = System.Drawing.Color.Black; + this.m_recent8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent8.Location = new System.Drawing.Point(352, 272); + this.m_recent8.Name = "m_recent8"; + this.m_recent8.Size = new System.Drawing.Size(16, 16); + this.m_recent8.TabIndex = 32; + this.m_recent8.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); // - // m_pos + // label4 // - this.m_pos.Location = new System.Drawing.Point(160, 272); - this.m_pos.Name = "m_pos"; - this.m_pos.Size = new System.Drawing.Size(104, 24); - this.m_pos.TabIndex = 23; - this.m_pos.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.label4.Location = new System.Drawing.Point(280, 96); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(32, 16); + this.label4.TabIndex = 10; + this.label4.Text = "Left"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(336, 96); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(40, 16); + this.label5.TabIndex = 12; + this.label5.Text = "Right"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(336, 8); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(48, 16); + this.label6.TabIndex = 22; + this.label6.Text = "Height"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(280, 232); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(88, 16); + this.label7.TabIndex = 24; + this.label7.Text = "Recent Colours"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // m_sizeX // @@ -195,7 +258,7 @@ namespace BitmapFontEd 0}); this.m_sizeX.Name = "m_sizeX"; this.m_sizeX.ReadOnly = true; - this.m_sizeX.Size = new System.Drawing.Size(48, 20); + this.m_sizeX.Size = new System.Drawing.Size(48, 21); this.m_sizeX.TabIndex = 19; this.m_sizeX.Value = new System.Decimal(new int[] { 1, @@ -205,32 +268,98 @@ namespace BitmapFontEd this.m_sizeX.ValueChanged += new System.EventHandler(this.OnSizeWidth); this.m_sizeX.Leave += new System.EventHandler(this.OnSizeWidth); // - // label4 + // label1 // - this.label4.Location = new System.Drawing.Point(280, 96); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(32, 16); - this.label4.TabIndex = 10; - this.label4.Text = "Left"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label1.Location = new System.Drawing.Point(280, 48); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(64, 16); + this.label1.TabIndex = 3; + this.label1.Text = "Draw Mode"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label5 + // label2 // - this.label5.Location = new System.Drawing.Point(336, 96); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(40, 16); - this.label5.TabIndex = 12; - this.label5.Text = "Right"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label2.Location = new System.Drawing.Point(280, 160); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(56, 16); + this.label2.TabIndex = 21; + this.label2.Text = "Preview"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // label6 + // label3 // - this.label6.Location = new System.Drawing.Point(336, 8); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(48, 16); - this.label6.TabIndex = 22; - this.label6.Text = "Height"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label3.Location = new System.Drawing.Point(280, 8); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(48, 16); + this.label3.TabIndex = 8; + this.label3.Text = "Width"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // m_undoButton + // + this.m_undoButton.Location = new System.Drawing.Point(8, 272); + this.m_undoButton.Name = "m_undoButton"; + this.m_undoButton.Size = new System.Drawing.Size(72, 24); + this.m_undoButton.TabIndex = 16; + this.m_undoButton.Text = "Undo"; + this.m_undoButton.Click += new System.EventHandler(this.OnUndo); + // + // label15 + // + this.label15.Location = new System.Drawing.Point(0, 0); + this.label15.Name = "label15"; + this.label15.TabIndex = 0; + // + // label14 + // + this.label14.BackColor = System.Drawing.Color.White; + this.label14.Location = new System.Drawing.Point(152, 144); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(16, 16); + this.label14.TabIndex = 29; + // + // m_recent3 + // + this.m_recent3.BackColor = System.Drawing.Color.Black; + this.m_recent3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent3.Location = new System.Drawing.Point(328, 248); + this.m_recent3.Name = "m_recent3"; + this.m_recent3.Size = new System.Drawing.Size(16, 16); + this.m_recent3.TabIndex = 27; + this.m_recent3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); + // + // m_pos + // + this.m_pos.Location = new System.Drawing.Point(160, 272); + this.m_pos.Name = "m_pos"; + this.m_pos.Size = new System.Drawing.Size(104, 24); + this.m_pos.TabIndex = 23; + this.m_pos.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // label13 + // + this.label13.BackColor = System.Drawing.Color.White; + this.label13.Location = new System.Drawing.Point(176, 144); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(16, 16); + this.label13.TabIndex = 30; + // + // label12 + // + this.label12.BackColor = System.Drawing.Color.White; + this.label12.Location = new System.Drawing.Point(200, 144); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(16, 16); + this.label12.TabIndex = 31; + // + // m_preview + // + this.m_preview.BackColor = System.Drawing.SystemColors.Control; + this.m_preview.Location = new System.Drawing.Point(288, 184); + this.m_preview.Name = "m_preview"; + this.m_preview.Size = new System.Drawing.Size(34, 34); + this.m_preview.TabIndex = 1; + this.m_preview.TabStop = false; // // m_sizeY // @@ -248,7 +377,7 @@ namespace BitmapFontEd 0}); this.m_sizeY.Name = "m_sizeY"; this.m_sizeY.ReadOnly = true; - this.m_sizeY.Size = new System.Drawing.Size(48, 20); + this.m_sizeY.Size = new System.Drawing.Size(48, 21); this.m_sizeY.TabIndex = 20; this.m_sizeY.Value = new System.Decimal(new int[] { 1, @@ -258,33 +387,97 @@ namespace BitmapFontEd this.m_sizeY.ValueChanged += new System.EventHandler(this.OnSizeHeight); this.m_sizeY.Leave += new System.EventHandler(this.OnSizeHeight); // - // m_preview + // m_recent2 // - this.m_preview.BackColor = System.Drawing.SystemColors.Control; - this.m_preview.Location = new System.Drawing.Point(288, 208); - this.m_preview.Name = "m_preview"; - this.m_preview.Size = new System.Drawing.Size(34, 34); - this.m_preview.TabIndex = 1; - this.m_preview.TabStop = false; + this.m_recent2.BackColor = System.Drawing.Color.Black; + this.m_recent2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent2.Location = new System.Drawing.Point(304, 248); + this.m_recent2.Name = "m_recent2"; + this.m_recent2.Size = new System.Drawing.Size(16, 16); + this.m_recent2.TabIndex = 26; + this.m_recent2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); // - // label2 + // m_bgPreview // - this.label2.Location = new System.Drawing.Point(280, 176); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(56, 16); - this.label2.TabIndex = 21; - this.label2.Text = "Preview"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.m_bgPreview.BackColor = System.Drawing.Color.Black; + this.m_bgPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_bgPreview.Location = new System.Drawing.Point(336, 112); + this.m_bgPreview.Name = "m_bgPreview"; + this.m_bgPreview.Size = new System.Drawing.Size(40, 40); + this.m_bgPreview.TabIndex = 18; + this.m_bgPreview.Click += new System.EventHandler(this.OnBackground); // - // m_fgPreview + // m_recent7 // - this.m_fgPreview.BackColor = System.Drawing.Color.White; - this.m_fgPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.m_fgPreview.Location = new System.Drawing.Point(280, 120); - this.m_fgPreview.Name = "m_fgPreview"; - this.m_fgPreview.Size = new System.Drawing.Size(40, 40); - this.m_fgPreview.TabIndex = 17; - this.m_fgPreview.Click += new System.EventHandler(this.OnForeground); + this.m_recent7.BackColor = System.Drawing.Color.Black; + this.m_recent7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent7.Location = new System.Drawing.Point(328, 272); + this.m_recent7.Name = "m_recent7"; + this.m_recent7.Size = new System.Drawing.Size(16, 16); + this.m_recent7.TabIndex = 31; + this.m_recent7.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); + // + // m_recent6 + // + this.m_recent6.BackColor = System.Drawing.Color.Black; + this.m_recent6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent6.Location = new System.Drawing.Point(304, 272); + this.m_recent6.Name = "m_recent6"; + this.m_recent6.Size = new System.Drawing.Size(16, 16); + this.m_recent6.TabIndex = 30; + this.m_recent6.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); + // + // m_recent5 + // + this.m_recent5.BackColor = System.Drawing.Color.Black; + this.m_recent5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent5.Location = new System.Drawing.Point(280, 272); + this.m_recent5.Name = "m_recent5"; + this.m_recent5.Size = new System.Drawing.Size(16, 16); + this.m_recent5.TabIndex = 29; + this.m_recent5.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); + // + // m_recent4 + // + this.m_recent4.BackColor = System.Drawing.Color.Black; + this.m_recent4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent4.Location = new System.Drawing.Point(352, 248); + this.m_recent4.Name = "m_recent4"; + this.m_recent4.Size = new System.Drawing.Size(16, 16); + this.m_recent4.TabIndex = 28; + this.m_recent4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); + // + // label11 + // + this.label11.BackColor = System.Drawing.Color.White; + this.label11.Location = new System.Drawing.Point(224, 144); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(16, 16); + this.label11.TabIndex = 32; + // + // m_recent1 + // + this.m_recent1.BackColor = System.Drawing.Color.White; + this.m_recent1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_recent1.Location = new System.Drawing.Point(280, 248); + this.m_recent1.Name = "m_recent1"; + this.m_recent1.Size = new System.Drawing.Size(16, 16); + this.m_recent1.TabIndex = 25; + this.m_recent1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent); + // + // m_edit + // + this.m_edit.BackColor = System.Drawing.SystemColors.Control; + this.m_edit.Location = new System.Drawing.Point(8, 8); + this.m_edit.Name = "m_edit"; + this.m_edit.Size = new System.Drawing.Size(256, 256); + this.m_edit.TabIndex = 0; + this.m_edit.TabStop = false; + this.m_edit.MouseEnter += new System.EventHandler(this.OnEnterEditor); + this.m_edit.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); + this.m_edit.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); + this.m_edit.MouseLeave += new System.EventHandler(this.OnLeaveEditor); + this.m_edit.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); // // m_modeList // @@ -307,50 +500,27 @@ namespace BitmapFontEd this.m_modeList.TabIndex = 15; this.m_modeList.SelectedIndexChanged += new System.EventHandler(this.OnModeSelect); // - // m_edit - // - this.m_edit.BackColor = System.Drawing.SystemColors.Control; - this.m_edit.Location = new System.Drawing.Point(8, 8); - this.m_edit.Name = "m_edit"; - this.m_edit.Size = new System.Drawing.Size(256, 256); - this.m_edit.TabIndex = 0; - this.m_edit.TabStop = false; - this.m_edit.MouseEnter += new System.EventHandler(this.OnEnterEditor); - this.m_edit.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); - this.m_edit.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); - this.m_edit.MouseLeave += new System.EventHandler(this.OnLeaveEditor); - this.m_edit.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(280, 48); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(64, 16); - this.label1.TabIndex = 3; - this.label1.Text = "Draw Mode"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // m_bgPreview - // - this.m_bgPreview.BackColor = System.Drawing.Color.Black; - this.m_bgPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.m_bgPreview.Location = new System.Drawing.Point(336, 120); - this.m_bgPreview.Name = "m_bgPreview"; - this.m_bgPreview.Size = new System.Drawing.Size(40, 40); - this.m_bgPreview.TabIndex = 18; - this.m_bgPreview.Click += new System.EventHandler(this.OnBackground); - // - // label3 + // m_fgPreview // - this.label3.Location = new System.Drawing.Point(280, 8); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(48, 16); - this.label3.TabIndex = 8; - this.label3.Text = "Width"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.m_fgPreview.BackColor = System.Drawing.Color.White; + this.m_fgPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.m_fgPreview.Location = new System.Drawing.Point(280, 112); + this.m_fgPreview.Name = "m_fgPreview"; + this.m_fgPreview.Size = new System.Drawing.Size(40, 40); + this.m_fgPreview.TabIndex = 17; + this.m_fgPreview.Click += new System.EventHandler(this.OnForeground); // // GfxEditor // + this.Controls.Add(this.m_recent8); + this.Controls.Add(this.m_recent7); + this.Controls.Add(this.m_recent6); + this.Controls.Add(this.m_recent5); + this.Controls.Add(this.m_recent4); + this.Controls.Add(this.m_recent3); + this.Controls.Add(this.m_recent2); + this.Controls.Add(this.m_recent1); + this.Controls.Add(this.label7); this.Controls.Add(this.m_pos); this.Controls.Add(this.label6); this.Controls.Add(this.label2); @@ -412,6 +582,31 @@ namespace BitmapFontEd #endregion + // ------------------------------------------------------- + // MISC + // ------------------------------------------------------- + #region Misc Routines + + private void AddRecentColour(Color c) + { + foreach (Label l in m_recent) + { + if (l.BackColor==c) + { + return; + } + } + + for(int f=m_recent.Length-1;f>0;f--) + { + m_recent[f].BackColor=m_recent[f-1].BackColor; + } + + m_recent[0].BackColor=c; + } + + #endregion + // ------------------------------------------------------- // SPRITE/GENERAL DRAWING // ------------------------------------------------------- @@ -1083,6 +1278,7 @@ namespace BitmapFontEd if (d.ShowDialog()==DialogResult.OK) { m_fgPreview.BackColor=d.Color; + AddRecentColour(d.Color); } } @@ -1096,6 +1292,21 @@ namespace BitmapFontEd if (d.ShowDialog()==DialogResult.OK) { m_bgPreview.BackColor=d.Color; + AddRecentColour(d.Color); + } + } + + void OnRecent(object sender, System.Windows.Forms.MouseEventArgs e) + { + Label l=(Label)sender; + + if (e.Button==MouseButtons.Left) + { + m_fgPreview.BackColor=l.BackColor; + } + else if (e.Button==MouseButtons.Right) + { + m_bgPreview.BackColor=l.BackColor; } } diff --git a/MainForm.cs b/MainForm.cs index 9e803d7..6f71c5e 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -35,20 +35,20 @@ namespace BitmapFontEd private System.Windows.Forms.GroupBox m_adjustGroup; private System.Windows.Forms.MainMenu m_menu; private System.Windows.Forms.ComboBox m_asciiSelect; - private System.Windows.Forms.MenuItem m_about; + private System.Windows.Forms.MenuItem m_fileMenu; private System.Windows.Forms.MenuItem m_open; private System.Windows.Forms.MenuItem menuItem6; private System.Windows.Forms.MenuItem m_saveAs; private System.Windows.Forms.TrackBar m_charSelect; - private System.Windows.Forms.MenuItem m_fileMenu; private System.Windows.Forms.MenuItem m_quit; private System.Windows.Forms.MenuItem m_new; + private System.Windows.Forms.GroupBox m_editGroup; + private System.Windows.Forms.Button m_revert; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button m_resize; - private System.Windows.Forms.GroupBox m_editGroup; + private System.Windows.Forms.MenuItem m_about; private System.Windows.Forms.MenuItem m_save; - private System.Windows.Forms.Button m_revert; private System.Windows.Forms.NumericUpDown m_codeSelect; private System.Windows.Forms.GroupBox m_globaladjustGroup; private System.Windows.Forms.MenuItem m_helpMenu; @@ -114,20 +114,20 @@ namespace BitmapFontEd this.m_helpMenu = new System.Windows.Forms.MenuItem(); this.m_globaladjustGroup = new System.Windows.Forms.GroupBox(); this.m_codeSelect = new System.Windows.Forms.NumericUpDown(); - this.m_revert = new System.Windows.Forms.Button(); this.m_save = new System.Windows.Forms.MenuItem(); - this.m_editGroup = new System.Windows.Forms.GroupBox(); + this.m_about = new System.Windows.Forms.MenuItem(); this.m_resize = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); + this.m_revert = new System.Windows.Forms.Button(); + this.m_editGroup = new System.Windows.Forms.GroupBox(); this.m_new = new System.Windows.Forms.MenuItem(); this.m_quit = new System.Windows.Forms.MenuItem(); - this.m_fileMenu = new System.Windows.Forms.MenuItem(); this.m_charSelect = new System.Windows.Forms.TrackBar(); this.m_saveAs = new System.Windows.Forms.MenuItem(); this.menuItem6 = new System.Windows.Forms.MenuItem(); this.m_open = new System.Windows.Forms.MenuItem(); - this.m_about = new System.Windows.Forms.MenuItem(); + this.m_fileMenu = new System.Windows.Forms.MenuItem(); this.m_asciiSelect = new System.Windows.Forms.ComboBox(); this.m_menu = new System.Windows.Forms.MainMenu(); this.m_adjustGroup = new System.Windows.Forms.GroupBox(); @@ -172,7 +172,7 @@ namespace BitmapFontEd 0}); this.m_codeSelect.Name = "m_codeSelect"; this.m_codeSelect.ReadOnly = true; - this.m_codeSelect.Size = new System.Drawing.Size(64, 20); + this.m_codeSelect.Size = new System.Drawing.Size(64, 21); this.m_codeSelect.TabIndex = 9; this.m_codeSelect.Value = new System.Decimal(new int[] { 32, @@ -181,15 +181,6 @@ namespace BitmapFontEd 0}); this.m_codeSelect.ValueChanged += new System.EventHandler(this.OnSelectByCode); // - // m_revert - // - this.m_revert.Location = new System.Drawing.Point(304, 64); - this.m_revert.Name = "m_revert"; - this.m_revert.Size = new System.Drawing.Size(88, 24); - this.m_revert.TabIndex = 6; - this.m_revert.Text = "Revert"; - this.m_revert.Click += new System.EventHandler(this.OnRevert); - // // m_save // this.m_save.Index = 2; @@ -197,14 +188,11 @@ namespace BitmapFontEd this.m_save.Text = "&Save"; this.m_save.Click += new System.EventHandler(this.OnSave); // - // m_editGroup + // m_about // - this.m_editGroup.Location = new System.Drawing.Point(8, 8); - this.m_editGroup.Name = "m_editGroup"; - this.m_editGroup.Size = new System.Drawing.Size(408, 328); - this.m_editGroup.TabIndex = 0; - this.m_editGroup.TabStop = false; - this.m_editGroup.Text = "Editor"; + this.m_about.Index = 0; + this.m_about.Text = "&About"; + this.m_about.Click += new System.EventHandler(this.OnAbout); // // m_resize // @@ -233,6 +221,24 @@ namespace BitmapFontEd this.label2.Text = "Character:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // m_revert + // + this.m_revert.Location = new System.Drawing.Point(304, 64); + this.m_revert.Name = "m_revert"; + this.m_revert.Size = new System.Drawing.Size(88, 24); + this.m_revert.TabIndex = 6; + this.m_revert.Text = "Revert"; + this.m_revert.Click += new System.EventHandler(this.OnRevert); + // + // m_editGroup + // + this.m_editGroup.Location = new System.Drawing.Point(8, 8); + this.m_editGroup.Name = "m_editGroup"; + this.m_editGroup.Size = new System.Drawing.Size(408, 328); + this.m_editGroup.TabIndex = 0; + this.m_editGroup.TabStop = false; + this.m_editGroup.Text = "Editor"; + // // m_new // this.m_new.Index = 0; @@ -247,18 +253,6 @@ namespace BitmapFontEd this.m_quit.Text = "&Quit"; this.m_quit.Click += new System.EventHandler(this.OnQuit); // - // m_fileMenu - // - this.m_fileMenu.Index = 0; - this.m_fileMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.m_new, - this.m_open, - this.m_save, - this.m_saveAs, - this.menuItem6, - this.m_quit}); - this.m_fileMenu.Text = "&File"; - // // m_charSelect // this.m_charSelect.Location = new System.Drawing.Point(8, 16); @@ -287,11 +281,17 @@ namespace BitmapFontEd this.m_open.Text = "&Open"; this.m_open.Click += new System.EventHandler(this.OnOpen); // - // m_about + // m_fileMenu // - this.m_about.Index = 0; - this.m_about.Text = "&About"; - this.m_about.Click += new System.EventHandler(this.OnAbout); + this.m_fileMenu.Index = 0; + this.m_fileMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.m_new, + this.m_open, + this.m_save, + this.m_saveAs, + this.menuItem6, + this.m_quit}); + this.m_fileMenu.Text = "&File"; // // m_asciiSelect // @@ -317,7 +317,7 @@ namespace BitmapFontEd this.m_adjustGroup.Size = new System.Drawing.Size(216, 384); this.m_adjustGroup.TabIndex = 3; this.m_adjustGroup.TabStop = false; - this.m_adjustGroup.Text = "Character Adjustments"; + this.m_adjustGroup.Text = "Adjustments and Effects"; // // m_selectGroup // @@ -344,7 +344,7 @@ namespace BitmapFontEd // // MainForm // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.ClientSize = new System.Drawing.Size(650, 479); this.Controls.Add(this.m_adjustGroup); this.Controls.Add(this.m_globaladjustGroup); -- cgit v1.2.3