From 77fcf5d3be7ea00465ffa133fc0871a960152d02 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 12 Jun 2005 23:10:27 +0000 Subject: Added button to set unused chars to 1x1 --- BitmapFontEd.MainForm.resources | Bin 19645 -> 20021 bytes MainForm.cs | 99 +++++++++++++++++++++++++--------------- 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/BitmapFontEd.MainForm.resources b/BitmapFontEd.MainForm.resources index 6d3dca8..c0c9be8 100644 Binary files a/BitmapFontEd.MainForm.resources and b/BitmapFontEd.MainForm.resources differ diff --git a/MainForm.cs b/MainForm.cs index ea68be1..7148c78 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -36,7 +36,7 @@ namespace BitmapFontEd private System.Windows.Forms.Label label1; private System.Windows.Forms.MenuItem m_helpMenu; private System.Windows.Forms.NumericUpDown m_codeSelect; - private System.Windows.Forms.Label label5; + private System.Windows.Forms.GroupBox m_globaladjustGroup; private System.Windows.Forms.GroupBox m_adjustGroup; private System.Windows.Forms.Button m_scrollDown; private System.Windows.Forms.Button m_scrollUp; @@ -49,7 +49,6 @@ namespace BitmapFontEd private System.Windows.Forms.Button m_topleft; private System.Windows.Forms.Button m_revert; private System.Windows.Forms.Button m_dropShadow; - private System.Windows.Forms.GroupBox m_globaladjustGroup; private System.Windows.Forms.MenuItem m_about; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button m_scrollRight; @@ -65,7 +64,9 @@ namespace BitmapFontEd private System.Windows.Forms.Button m_edge; private System.Windows.Forms.MenuItem m_quit; private System.Windows.Forms.MenuItem m_save; + private System.Windows.Forms.Label label5; private System.Windows.Forms.MenuItem m_saveAs; + private System.Windows.Forms.Button m_minunused; private System.Windows.Forms.Button m_scrollLeft; private System.Windows.Forms.GroupBox m_editGroup; private System.Windows.Forms.MenuItem m_new; @@ -147,7 +148,9 @@ namespace BitmapFontEd this.m_new = new System.Windows.Forms.MenuItem(); this.m_editGroup = new System.Windows.Forms.GroupBox(); this.m_scrollLeft = new System.Windows.Forms.Button(); + this.m_minunused = new System.Windows.Forms.Button(); this.m_saveAs = new System.Windows.Forms.MenuItem(); + this.label5 = new System.Windows.Forms.Label(); this.m_save = new System.Windows.Forms.MenuItem(); this.m_quit = new System.Windows.Forms.MenuItem(); this.m_edge = new System.Windows.Forms.Button(); @@ -163,7 +166,6 @@ namespace BitmapFontEd this.m_scrollRight = new System.Windows.Forms.Button(); this.label3 = new System.Windows.Forms.Label(); this.m_about = new System.Windows.Forms.MenuItem(); - this.m_globaladjustGroup = new System.Windows.Forms.GroupBox(); this.m_dropShadow = new System.Windows.Forms.Button(); this.m_revert = new System.Windows.Forms.Button(); this.m_topleft = new System.Windows.Forms.Button(); @@ -176,15 +178,15 @@ namespace BitmapFontEd this.m_scrollUp = new System.Windows.Forms.Button(); this.m_scrollDown = new System.Windows.Forms.Button(); this.m_adjustGroup = new System.Windows.Forms.GroupBox(); - this.label5 = new System.Windows.Forms.Label(); + this.m_globaladjustGroup = new System.Windows.Forms.GroupBox(); this.m_codeSelect = new System.Windows.Forms.NumericUpDown(); this.m_helpMenu = new System.Windows.Forms.MenuItem(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.m_selectGroup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.m_charSelect)).BeginInit(); - this.m_globaladjustGroup.SuspendLayout(); this.m_adjustGroup.SuspendLayout(); + this.m_globaladjustGroup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.m_codeSelect)).BeginInit(); this.SuspendLayout(); // @@ -216,7 +218,7 @@ namespace BitmapFontEd this.m_selectGroup.Controls.Add(this.label1); this.m_selectGroup.Location = new System.Drawing.Point(8, 344); this.m_selectGroup.Name = "m_selectGroup"; - this.m_selectGroup.Size = new System.Drawing.Size(408, 104); + this.m_selectGroup.Size = new System.Drawing.Size(408, 112); this.m_selectGroup.TabIndex = 1; this.m_selectGroup.TabStop = false; this.m_selectGroup.Text = "Character"; @@ -262,6 +264,15 @@ namespace BitmapFontEd this.m_scrollLeft.Text = "Left"; this.m_scrollLeft.Click += new System.EventHandler(this.OnLeftScroll); // + // m_minunused + // + this.m_minunused.Location = new System.Drawing.Point(8, 80); + this.m_minunused.Name = "m_minunused"; + this.m_minunused.Size = new System.Drawing.Size(96, 24); + this.m_minunused.TabIndex = 5; + this.m_minunused.Text = "Unused to 1x1"; + this.m_minunused.Click += new System.EventHandler(this.OnMinimizeUnused); + // // m_saveAs // this.m_saveAs.Index = 3; @@ -269,6 +280,15 @@ namespace BitmapFontEd this.m_saveAs.Text = "S&ave as..."; this.m_saveAs.Click += new System.EventHandler(this.OnSaveAs); // + // label5 + // + this.label5.Location = new System.Drawing.Point(8, 200); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(72, 16); + this.label5.TabIndex = 11; + this.label5.Text = "Rotate"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // m_save // this.m_save.Index = 2; @@ -285,7 +305,7 @@ namespace BitmapFontEd // // m_edge // - this.m_edge.Location = new System.Drawing.Point(112, 272); + this.m_edge.Location = new System.Drawing.Point(112, 264); this.m_edge.Name = "m_edge"; this.m_edge.Size = new System.Drawing.Size(96, 24); this.m_edge.TabIndex = 17; @@ -346,7 +366,7 @@ namespace BitmapFontEd // // label6 // - this.label6.Location = new System.Drawing.Point(8, 256); + this.label6.Location = new System.Drawing.Point(8, 248); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(88, 16); this.label6.TabIndex = 14; @@ -355,7 +375,7 @@ namespace BitmapFontEd // // m_grabFont // - this.m_grabFont.Location = new System.Drawing.Point(8, 304); + this.m_grabFont.Location = new System.Drawing.Point(8, 296); this.m_grabFont.Name = "m_grabFont"; this.m_grabFont.Size = new System.Drawing.Size(96, 24); this.m_grabFont.TabIndex = 18; @@ -394,22 +414,9 @@ namespace BitmapFontEd this.m_about.Text = "&About"; this.m_about.Click += new System.EventHandler(this.OnAbout); // - // m_globaladjustGroup - // - this.m_globaladjustGroup.Controls.Add(this.m_setsize); - this.m_globaladjustGroup.Controls.Add(this.m_autoheight); - this.m_globaladjustGroup.Controls.Add(this.m_topleft); - this.m_globaladjustGroup.Controls.Add(this.m_resize); - this.m_globaladjustGroup.Location = new System.Drawing.Point(424, 8); - this.m_globaladjustGroup.Name = "m_globaladjustGroup"; - this.m_globaladjustGroup.Size = new System.Drawing.Size(216, 80); - this.m_globaladjustGroup.TabIndex = 2; - this.m_globaladjustGroup.TabStop = false; - this.m_globaladjustGroup.Text = "Global Adjustments"; - // // m_dropShadow // - this.m_dropShadow.Location = new System.Drawing.Point(8, 272); + this.m_dropShadow.Location = new System.Drawing.Point(8, 264); this.m_dropShadow.Name = "m_dropShadow"; this.m_dropShadow.Size = new System.Drawing.Size(96, 24); this.m_dropShadow.TabIndex = 16; @@ -525,21 +532,26 @@ namespace BitmapFontEd this.m_adjustGroup.Controls.Add(this.label3); this.m_adjustGroup.Controls.Add(this.m_clear); this.m_adjustGroup.Controls.Add(this.m_applyAll); - this.m_adjustGroup.Location = new System.Drawing.Point(424, 96); + this.m_adjustGroup.Location = new System.Drawing.Point(424, 128); this.m_adjustGroup.Name = "m_adjustGroup"; - this.m_adjustGroup.Size = new System.Drawing.Size(216, 352); + this.m_adjustGroup.Size = new System.Drawing.Size(216, 328); this.m_adjustGroup.TabIndex = 3; this.m_adjustGroup.TabStop = false; this.m_adjustGroup.Text = "Adjustments and Effects"; // - // label5 + // m_globaladjustGroup // - this.label5.Location = new System.Drawing.Point(8, 200); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(72, 16); - this.label5.TabIndex = 11; - this.label5.Text = "Rotate"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.m_globaladjustGroup.Controls.Add(this.m_minunused); + this.m_globaladjustGroup.Controls.Add(this.m_setsize); + this.m_globaladjustGroup.Controls.Add(this.m_autoheight); + this.m_globaladjustGroup.Controls.Add(this.m_topleft); + this.m_globaladjustGroup.Controls.Add(this.m_resize); + this.m_globaladjustGroup.Location = new System.Drawing.Point(424, 8); + this.m_globaladjustGroup.Name = "m_globaladjustGroup"; + this.m_globaladjustGroup.Size = new System.Drawing.Size(216, 112); + this.m_globaladjustGroup.TabIndex = 2; + this.m_globaladjustGroup.TabStop = false; + this.m_globaladjustGroup.Text = "Global Adjustments"; // // m_codeSelect // @@ -556,7 +568,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 = 10; this.m_codeSelect.Value = new System.Decimal(new int[] { 32, @@ -592,8 +604,8 @@ namespace BitmapFontEd // // MainForm // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(650, 479); + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.ClientSize = new System.Drawing.Size(650, 471); this.Controls.Add(this.m_adjustGroup); this.Controls.Add(this.m_globaladjustGroup); this.Controls.Add(this.m_selectGroup); @@ -607,8 +619,8 @@ namespace BitmapFontEd this.Closing += new System.ComponentModel.CancelEventHandler(this.OnClosing); this.m_selectGroup.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.m_charSelect)).EndInit(); - this.m_globaladjustGroup.ResumeLayout(false); this.m_adjustGroup.ResumeLayout(false); + this.m_globaladjustGroup.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.m_codeSelect)).EndInit(); this.ResumeLayout(false); } @@ -1207,5 +1219,20 @@ namespace BitmapFontEd m_edit.BitmapChar=new BitmapChar(m_chars[m_selected]); } } + + void OnMinimizeUnused(object sender, System.EventArgs e) + { + FetchEdit(); + + foreach (BitmapChar c in m_chars) + { + if (c.FirstUsedColumn==-1) + { + c.Resize(1,1); + } + } + + m_edit.BitmapChar=new BitmapChar(m_chars[m_selected]); + } } } -- cgit v1.2.3