From 1587e5a10abf8ad41f5974da2b67b6400e5e1858 Mon Sep 17 00:00:00 2001 From: codeimp Date: Tue, 17 Mar 2009 12:40:10 +0000 Subject: [PATCH] Added the number of textures next to the Texture Sets --- Source/Windows/FlatBrowserForm.Designer.cs | 27 ++++++++++++------- Source/Windows/FlatBrowserForm.cs | 18 ++++++++++++- Source/Windows/FlatBrowserForm.resx | 4 +-- Source/Windows/TextureBrowserForm.Designer.cs | 27 ++++++++++++------- Source/Windows/TextureBrowserForm.cs | 16 +++++++++++ Source/Windows/TextureBrowserForm.resx | 7 +++-- 6 files changed, 76 insertions(+), 23 deletions(-) diff --git a/Source/Windows/FlatBrowserForm.Designer.cs b/Source/Windows/FlatBrowserForm.Designer.cs index 658b539c..0be28442 100644 --- a/Source/Windows/FlatBrowserForm.Designer.cs +++ b/Source/Windows/FlatBrowserForm.Designer.cs @@ -33,7 +33,8 @@ namespace CodeImp.DoomBuilder.Windows this.cancel = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button(); this.texturesets = new System.Windows.Forms.ListView(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.namecolumn = new System.Windows.Forms.ColumnHeader(); + this.countcolumn = new System.Windows.Forms.ColumnHeader(); this.smallimages = new System.Windows.Forms.ImageList(this.components); this.browser = new CodeImp.DoomBuilder.Controls.ImageBrowserControl(); this.SuspendLayout(); @@ -66,7 +67,8 @@ namespace CodeImp.DoomBuilder.Windows this.texturesets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.texturesets.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1}); + this.namecolumn, + this.countcolumn}); this.texturesets.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.texturesets.FullRowSelect = true; this.texturesets.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; @@ -74,17 +76,23 @@ namespace CodeImp.DoomBuilder.Windows this.texturesets.Location = new System.Drawing.Point(12, 9); this.texturesets.MultiSelect = false; this.texturesets.Name = "texturesets"; - this.texturesets.Size = new System.Drawing.Size(176, 576); + this.texturesets.Size = new System.Drawing.Size(200, 576); this.texturesets.SmallImageList = this.smallimages; this.texturesets.TabIndex = 24; this.texturesets.UseCompatibleStateImageBehavior = false; this.texturesets.View = System.Windows.Forms.View.Details; this.texturesets.SelectedIndexChanged += new System.EventHandler(this.texturesets_SelectedIndexChanged); // - // columnHeader1 + // namecolumn // - this.columnHeader1.Text = "Name"; - this.columnHeader1.Width = 152; + this.namecolumn.Text = "Name"; + this.namecolumn.Width = 152; + // + // countcolumn + // + this.countcolumn.Text = "Count"; + this.countcolumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.countcolumn.Width = 42; // // smallimages // @@ -104,10 +112,10 @@ namespace CodeImp.DoomBuilder.Windows this.browser.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.browser.HideInputBox = false; this.browser.LabelText = "Select or enter a flat name:"; - this.browser.Location = new System.Drawing.Point(197, 9); + this.browser.Location = new System.Drawing.Point(218, 9); this.browser.Name = "browser"; this.browser.PreventSelection = false; - this.browser.Size = new System.Drawing.Size(684, 610); + this.browser.Size = new System.Drawing.Size(663, 610); this.browser.TabIndex = 0; this.browser.SelectedItemDoubleClicked += new CodeImp.DoomBuilder.Controls.ImageBrowserControl.SelectedItemDoubleClickDelegate(this.browser_SelectedItemDoubleClicked); this.browser.SelectedItemChanged += new CodeImp.DoomBuilder.Controls.ImageBrowserControl.SelectedItemChangedDelegate(this.browser_SelectedItemChanged); @@ -145,7 +153,8 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.Button cancel; private System.Windows.Forms.Button apply; private System.Windows.Forms.ListView texturesets; - private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader namecolumn; private System.Windows.Forms.ImageList smallimages; + private System.Windows.Forms.ColumnHeader countcolumn; } } \ No newline at end of file diff --git a/Source/Windows/FlatBrowserForm.cs b/Source/Windows/FlatBrowserForm.cs index 356b2009..ed1e89cc 100644 --- a/Source/Windows/FlatBrowserForm.cs +++ b/Source/Windows/FlatBrowserForm.cs @@ -37,6 +37,9 @@ namespace CodeImp.DoomBuilder.Windows { internal partial class FlatBrowserForm : Form { + // Constants + private const int COLUMN_WIDTH_COUNT = 52; + // Variables private string selectedname; private Point lastposition; @@ -61,25 +64,38 @@ namespace CodeImp.DoomBuilder.Windows // Update the used textures General.Map.Data.UpdateUsedTextures(); + // Resize columns to maximize available width + countcolumn.Width = COLUMN_WIDTH_COUNT; + namecolumn.Width = texturesets.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth - countcolumn.Width - 2; + // Fill texture sets list with normal texture sets foreach(IFilledTextureSet ts in General.Map.Data.TextureSets) { item = texturesets.Items.Add(ts.Name); item.Tag = ts; item.ImageIndex = 0; + item.UseItemStyleForSubItems = false; + item.SubItems.Add(ts.Textures.Count.ToString(), item.ForeColor, + item.BackColor, new Font(item.Font, FontStyle.Regular)); } // Add special textures sets item = texturesets.Items.Add(General.Map.Data.AllTextureSet.Name); item.Tag = General.Map.Data.AllTextureSet; item.ImageIndex = 1; - + item.UseItemStyleForSubItems = false; + item.SubItems.Add(General.Map.Data.AllTextureSet.Textures.Count.ToString(), + item.ForeColor, item.BackColor, new Font(item.Font, FontStyle.Regular)); + // Add container-specific texture sets foreach(ResourceTextureSet ts in General.Map.Data.ResourceTextureSets) { item = texturesets.Items.Add(ts.Name); item.Tag = ts; item.ImageIndex = 2 + ts.LocationType; + item.UseItemStyleForSubItems = false; + item.SubItems.Add(ts.Textures.Count.ToString(), item.ForeColor, + item.BackColor, new Font(item.Font, FontStyle.Regular)); } // Select the last one that was selected diff --git a/Source/Windows/FlatBrowserForm.resx b/Source/Windows/FlatBrowserForm.resx index bb52cd13..447fa083 100644 --- a/Source/Windows/FlatBrowserForm.resx +++ b/Source/Windows/FlatBrowserForm.resx @@ -134,7 +134,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB+ - DAAAAk1TRnQBSQFMAgEBBQEAAQkBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DAAAAk1TRnQBSQFMAgEBBQEAAQwBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASwDAAEBAQABCAYAAQsYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -166,7 +166,7 @@ MwABDgENAWwBkAG7AgkB9wJsAWYCDjsAAQ4B6gFsAQ8BDjQAAW0HAAFDAW0BDjQAAW0B8QFtAQcBvAHw AfECAAERAQcB7DQAA20BBwK8AfACAAJtAQ40AAFtAfADBwK8AgABEQEHAew0AAFtAfAB7wMHAbwCAAJt AQ40AAFtAfAC7wMHAgABEQEHAew0AAFtAfAD7wIHAgACbQEONAABbQG8BO8BBwIAAREBBwHsNAAIbQEA - AQ8B+AEPNAAJDgHrAZEBDTQAAQ4BZQGQAbsFCQH3AWwCDj4AAQ7/AMMAAfcCrgFtAWwB6gJsBGY0AAH3 + AQ8B7AEPNAAJDgHrAZEBDTQAAQ4BZQGQAbsFCQH3AWwCDj4AAQ7/AMMAAfcCrgFtAWwB6gJsBGY0AAH3 Bf8C9AMZAWYJAAgOEwAB9wKuAW0BbAHqAmwEZgQAAbUC/wKTAZkBBwG7AbQCGQNmBgABDgEABe8B9wEO AwACcwHrAW4BbQFKARMBFQFDAREBDwEOAQ8DAAH3Bf8C9AMZAWYEAAG1Av8BkwGaAXoBnwGeAbsB9AHz AWYBGQFmBQABDgHvAQAB8ALxAvIBvAEOAwABcwIcBzECSwFEAe0CAAG1Av8CkwGZAQcBuwG0AhkDZgIA diff --git a/Source/Windows/TextureBrowserForm.Designer.cs b/Source/Windows/TextureBrowserForm.Designer.cs index b8c13279..308ec6a7 100644 --- a/Source/Windows/TextureBrowserForm.Designer.cs +++ b/Source/Windows/TextureBrowserForm.Designer.cs @@ -33,7 +33,8 @@ namespace CodeImp.DoomBuilder.Windows this.cancel = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button(); this.texturesets = new System.Windows.Forms.ListView(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.namecolumn = new System.Windows.Forms.ColumnHeader(); + this.countcolumn = new System.Windows.Forms.ColumnHeader(); this.smallimages = new System.Windows.Forms.ImageList(this.components); this.browser = new CodeImp.DoomBuilder.Controls.ImageBrowserControl(); this.SuspendLayout(); @@ -66,7 +67,8 @@ namespace CodeImp.DoomBuilder.Windows this.texturesets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.texturesets.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1}); + this.namecolumn, + this.countcolumn}); this.texturesets.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.texturesets.FullRowSelect = true; this.texturesets.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; @@ -74,17 +76,23 @@ namespace CodeImp.DoomBuilder.Windows this.texturesets.Location = new System.Drawing.Point(12, 9); this.texturesets.MultiSelect = false; this.texturesets.Name = "texturesets"; - this.texturesets.Size = new System.Drawing.Size(176, 576); + this.texturesets.Size = new System.Drawing.Size(200, 576); this.texturesets.SmallImageList = this.smallimages; this.texturesets.TabIndex = 23; this.texturesets.UseCompatibleStateImageBehavior = false; this.texturesets.View = System.Windows.Forms.View.Details; this.texturesets.SelectedIndexChanged += new System.EventHandler(this.texturesets_SelectedIndexChanged); // - // columnHeader1 + // namecolumn // - this.columnHeader1.Text = "Name"; - this.columnHeader1.Width = 152; + this.namecolumn.Text = "Name"; + this.namecolumn.Width = 109; + // + // countcolumn + // + this.countcolumn.Text = "Count"; + this.countcolumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.countcolumn.Width = 51; // // smallimages // @@ -104,10 +112,10 @@ namespace CodeImp.DoomBuilder.Windows this.browser.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.browser.HideInputBox = false; this.browser.LabelText = "Select or enter a texture name:"; - this.browser.Location = new System.Drawing.Point(197, 9); + this.browser.Location = new System.Drawing.Point(218, 9); this.browser.Name = "browser"; this.browser.PreventSelection = false; - this.browser.Size = new System.Drawing.Size(684, 610); + this.browser.Size = new System.Drawing.Size(663, 610); this.browser.TabIndex = 0; this.browser.SelectedItemDoubleClicked += new CodeImp.DoomBuilder.Controls.ImageBrowserControl.SelectedItemDoubleClickDelegate(this.browser_SelectedItemDoubleClicked); this.browser.SelectedItemChanged += new CodeImp.DoomBuilder.Controls.ImageBrowserControl.SelectedItemChangedDelegate(this.browser_SelectedItemChanged); @@ -145,7 +153,8 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.Button cancel; private System.Windows.Forms.Button apply; private System.Windows.Forms.ListView texturesets; - private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader namecolumn; private System.Windows.Forms.ImageList smallimages; + private System.Windows.Forms.ColumnHeader countcolumn; } } \ No newline at end of file diff --git a/Source/Windows/TextureBrowserForm.cs b/Source/Windows/TextureBrowserForm.cs index f407e046..c9b15d84 100644 --- a/Source/Windows/TextureBrowserForm.cs +++ b/Source/Windows/TextureBrowserForm.cs @@ -37,6 +37,9 @@ namespace CodeImp.DoomBuilder.Windows { internal partial class TextureBrowserForm : Form { + // Constants + private const int COLUMN_WIDTH_COUNT = 52; + // Variables private string selectedname; private Point lastposition; @@ -61,18 +64,28 @@ namespace CodeImp.DoomBuilder.Windows // Update the used textures General.Map.Data.UpdateUsedTextures(); + // Resize columns to maximize available width + countcolumn.Width = COLUMN_WIDTH_COUNT; + namecolumn.Width = texturesets.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth - countcolumn.Width - 2; + // Fill texture sets list with normal texture sets foreach(IFilledTextureSet ts in General.Map.Data.TextureSets) { item = texturesets.Items.Add(ts.Name); item.Tag = ts; item.ImageIndex = 0; + item.UseItemStyleForSubItems = false; + item.SubItems.Add(ts.Textures.Count.ToString(), item.ForeColor, + item.BackColor, new Font(item.Font, FontStyle.Regular)); } // Add special textures sets item = texturesets.Items.Add(General.Map.Data.AllTextureSet.Name); item.Tag = General.Map.Data.AllTextureSet; item.ImageIndex = 1; + item.UseItemStyleForSubItems = false; + item.SubItems.Add(General.Map.Data.AllTextureSet.Textures.Count.ToString(), + item.ForeColor, item.BackColor, new Font(item.Font, FontStyle.Regular)); // Add container-specific texture sets foreach(ResourceTextureSet ts in General.Map.Data.ResourceTextureSets) @@ -80,6 +93,9 @@ namespace CodeImp.DoomBuilder.Windows item = texturesets.Items.Add(ts.Name); item.Tag = ts; item.ImageIndex = 2 + ts.LocationType; + item.UseItemStyleForSubItems = false; + item.SubItems.Add(ts.Textures.Count.ToString(), item.ForeColor, + item.BackColor, new Font(item.Font, FontStyle.Regular)); } // Select the last one that was selected diff --git a/Source/Windows/TextureBrowserForm.resx b/Source/Windows/TextureBrowserForm.resx index e002c096..447fa083 100644 --- a/Source/Windows/TextureBrowserForm.resx +++ b/Source/Windows/TextureBrowserForm.resx @@ -134,7 +134,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB+ - DAAAAk1TRnQBSQFMAgEBBQEAAQkBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DAAAAk1TRnQBSQFMAgEBBQEAAQwBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASwDAAEBAQABCAYAAQsYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -166,7 +166,7 @@ MwABDgENAWwBkAG7AgkB9wJsAWYCDjsAAQ4B6gFsAQ8BDjQAAW0HAAFDAW0BDjQAAW0B8QFtAQcBvAHw AfECAAERAQcB7DQAA20BBwK8AfACAAJtAQ40AAFtAfADBwK8AgABEQEHAew0AAFtAfAB7wMHAbwCAAJt AQ40AAFtAfAC7wMHAgABEQEHAew0AAFtAfAD7wIHAgACbQEONAABbQG8BO8BBwIAAREBBwHsNAAIbQEA - AQ8B+AEPNAAJDgHrAZEBDTQAAQ4BZQGQAbsFCQH3AWwCDj4AAQ7/AMMAAfcCrgFtAWwB6gJsBGY0AAH3 + AQ8B7AEPNAAJDgHrAZEBDTQAAQ4BZQGQAbsFCQH3AWwCDj4AAQ7/AMMAAfcCrgFtAWwB6gJsBGY0AAH3 Bf8C9AMZAWYJAAgOEwAB9wKuAW0BbAHqAmwEZgQAAbUC/wKTAZkBBwG7AbQCGQNmBgABDgEABe8B9wEO AwACcwHrAW4BbQFKARMBFQFDAREBDwEOAQ8DAAH3Bf8C9AMZAWYEAAG1Av8BkwGaAXoBnwGeAbsB9AHz AWYBGQFmBQABDgHvAQAB8ALxAvIBvAEOAwABcwIcBzECSwFEAe0CAAG1Av8CkwGZAQcBuwG0AhkDZgIA @@ -193,4 +193,7 @@ True + + True + \ No newline at end of file