From 600287f275063dde1ea6f55fd9aa5247d27256cf Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 21 May 2005 02:38:48 +0000 Subject: Changed use of uints to ints (casting was getting silly). Fixed some funnies with edits -- font import now seem to work, somehow. --- MainForm.cs | 85 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 42 insertions(+), 43 deletions(-) (limited to 'MainForm.cs') diff --git a/MainForm.cs b/MainForm.cs index 6a48840..fa13599 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; @@ -46,8 +46,6 @@ namespace BitmapFontEd private System.Windows.Forms.Button m_rotRight; 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.Button m_glow; private System.Windows.Forms.MenuItem m_about; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button m_scrollRight; @@ -60,8 +58,10 @@ namespace BitmapFontEd private System.Windows.Forms.MainMenu m_menu; private System.Windows.Forms.Button m_resize; private System.Windows.Forms.ComboBox m_asciiSelect; + 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_scrollLeft; private System.Windows.Forms.GroupBox m_editGroup; @@ -143,8 +143,10 @@ namespace BitmapFontEd this.m_editGroup = new System.Windows.Forms.GroupBox(); this.m_scrollLeft = 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(); this.m_asciiSelect = new System.Windows.Forms.ComboBox(); this.m_resize = new System.Windows.Forms.Button(); this.m_menu = new System.Windows.Forms.MainMenu(); @@ -157,8 +159,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_glow = new System.Windows.Forms.Button(); - 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_rotRight = new System.Windows.Forms.Button(); @@ -168,15 +168,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(); // @@ -252,6 +252,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; @@ -266,6 +275,15 @@ namespace BitmapFontEd this.m_quit.Text = "&Quit"; this.m_quit.Click += new System.EventHandler(this.OnQuit); // + // m_edge + // + this.m_edge.Location = new System.Drawing.Point(112, 272); + this.m_edge.Name = "m_edge"; + this.m_edge.Size = new System.Drawing.Size(96, 24); + this.m_edge.TabIndex = 17; + this.m_edge.Text = "Edge"; + this.m_edge.Click += new System.EventHandler(this.OnEdge); + // // m_asciiSelect // this.m_asciiSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -368,25 +386,6 @@ namespace BitmapFontEd this.m_about.Text = "&About"; this.m_about.Click += new System.EventHandler(this.OnAbout); // - // m_glow - // - this.m_glow.Location = new System.Drawing.Point(112, 272); - this.m_glow.Name = "m_glow"; - this.m_glow.Size = new System.Drawing.Size(96, 24); - this.m_glow.TabIndex = 17; - this.m_glow.Text = "Glow"; - this.m_glow.Click += new System.EventHandler(this.OnGlow); - // - // m_globaladjustGroup - // - 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, 48); - 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); @@ -461,7 +460,7 @@ namespace BitmapFontEd // m_adjustGroup // this.m_adjustGroup.Controls.Add(this.m_grabFont); - this.m_adjustGroup.Controls.Add(this.m_glow); + this.m_adjustGroup.Controls.Add(this.m_edge); this.m_adjustGroup.Controls.Add(this.m_dropShadow); this.m_adjustGroup.Controls.Add(this.label6); this.m_adjustGroup.Controls.Add(this.m_rotRight); @@ -484,14 +483,15 @@ namespace BitmapFontEd 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_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, 48); + this.m_globaladjustGroup.TabIndex = 2; + this.m_globaladjustGroup.TabStop = false; + this.m_globaladjustGroup.Text = "Global Adjustments"; // // m_codeSelect // @@ -559,8 +559,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); } @@ -737,8 +737,8 @@ namespace BitmapFontEd void OnResize(object sender, System.EventArgs e) { - uint w=m_edit.CharWidth; - uint h=m_edit.CharHeight; + int w=m_edit.CharWidth; + int h=m_edit.CharHeight; if (Util.YesNo("Sure you want to resize all characters to " + w + " by " + h)) { @@ -911,7 +911,7 @@ namespace BitmapFontEd } } - void OnGlow(object sender, System.EventArgs e) + void OnEdge(object sender, System.EventArgs e) { AlphaColourDialog d=new AlphaColourDialog("Select Glow Colour"); @@ -927,12 +927,12 @@ namespace BitmapFontEd { foreach (BitmapChar c in m_chars) { - c.Glow(m_glowCol); + c.Edge(m_glowCol); } } else { - m_chars[m_selected].Glow(m_glowCol); + m_chars[m_selected].Edge(m_glowCol); } m_edit.BitmapChar=new BitmapChar(m_chars[m_selected]); @@ -965,11 +965,11 @@ namespace BitmapFontEd my=Math.Min(my+1,GfxEditor.MAX_SIZE); System.Diagnostics.Debug.WriteLine("(post)mx="+mx+" my="+my); - c.Resize((uint)mx,(uint)my); + c.Resize(mx,my); for(x=0;x