Added the number of textures next to the Texture Sets

This commit is contained in:
codeimp 2009-03-17 12:40:10 +00:00
parent ae46253e4a
commit 1587e5a10a
6 changed files with 76 additions and 23 deletions

View file

@ -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;
}
}

View file

@ -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

View file

@ -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

View file

@ -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;
}
}

View file

@ -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

View file

@ -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 @@
<metadata name="browser.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>