changeset 13:372f921c20fc

Mock up of the stat line tab Select a stat line to view Make Default changes default stat line
author Tsudico
date Sat, 18 Dec 2010 13:20:18 -0600
parents 6284c091b132
children 26f7f6d2b4f8
files FrmSystem.Designer.cs FrmSystem.cs IBBoard.WarFoundry.Forge.WinForms.csproj
diffstat 3 files changed, 276 insertions(+), 23 deletions(-) [+]
line diff
     1.1 --- a/FrmSystem.Designer.cs	Fri Dec 17 22:14:43 2010 -0600
     1.2 +++ b/FrmSystem.Designer.cs	Sat Dec 18 13:20:18 2010 -0600
     1.3 @@ -71,10 +71,24 @@
     1.4  			this.btnCategoryRemove = new System.Windows.Forms.Button();
     1.5  			this.btnCategoryApply = new System.Windows.Forms.Button();
     1.6  			this.tabStats = new System.Windows.Forms.TabPage();
     1.7 +			this.btnMoveStatDown = new System.Windows.Forms.Button();
     1.8 +			this.btnMoveStatUp = new System.Windows.Forms.Button();
     1.9 +			this.btnRemoveStat = new System.Windows.Forms.Button();
    1.10 +			this.btnAddStat = new System.Windows.Forms.Button();
    1.11 +			this.gbStats = new System.Windows.Forms.GroupBox();
    1.12 +			this.listStatNames = new System.Windows.Forms.ListBox();
    1.13 +			this.txtStatName = new System.Windows.Forms.TextBox();
    1.14 +			this.label1 = new System.Windows.Forms.Label();
    1.15 +			this.txtStatLineID = new System.Windows.Forms.TextBox();
    1.16 +			this.lblStatLineID = new System.Windows.Forms.Label();
    1.17 +			this.lviewStatPreview = new System.Windows.Forms.ListView();
    1.18 +			this.btnStatLineApply = new System.Windows.Forms.Button();
    1.19 +			this.lblStatLinePreview = new System.Windows.Forms.Label();
    1.20  			this.btnStatsDefault = new System.Windows.Forms.Button();
    1.21 -			this.lvStats = new System.Windows.Forms.ListView();
    1.22 +			this.lviewStats = new System.Windows.Forms.ListView();
    1.23 +			this.chStatsID = new System.Windows.Forms.ColumnHeader();
    1.24 +			this.chStatsDefault = new System.Windows.Forms.ColumnHeader();
    1.25  			this.btnStatsRemove = new System.Windows.Forms.Button();
    1.26 -			this.btnStatsEdit = new System.Windows.Forms.Button();
    1.27  			this.btnStatsAdd = new System.Windows.Forms.Button();
    1.28  			this.tabSystem.SuspendLayout();
    1.29  			this.tabInfo.SuspendLayout();
    1.30 @@ -88,6 +102,7 @@
    1.31  			((System.ComponentModel.ISupportInitialize)(this.numPointMax)).BeginInit();
    1.32  			((System.ComponentModel.ISupportInitialize)(this.numPointMin)).BeginInit();
    1.33  			this.tabStats.SuspendLayout();
    1.34 +			this.gbStats.SuspendLayout();
    1.35  			this.SuspendLayout();
    1.36  			// 
    1.37  			// btnSystemSave
    1.38 @@ -573,10 +588,21 @@
    1.39  			// 
    1.40  			// tabStats
    1.41  			// 
    1.42 +			this.tabStats.Controls.Add(this.btnMoveStatDown);
    1.43 +			this.tabStats.Controls.Add(this.btnMoveStatUp);
    1.44 +			this.tabStats.Controls.Add(this.btnRemoveStat);
    1.45 +			this.tabStats.Controls.Add(this.btnAddStat);
    1.46 +			this.tabStats.Controls.Add(this.gbStats);
    1.47 +			this.tabStats.Controls.Add(this.txtStatName);
    1.48 +			this.tabStats.Controls.Add(this.label1);
    1.49 +			this.tabStats.Controls.Add(this.txtStatLineID);
    1.50 +			this.tabStats.Controls.Add(this.lblStatLineID);
    1.51 +			this.tabStats.Controls.Add(this.lviewStatPreview);
    1.52 +			this.tabStats.Controls.Add(this.btnStatLineApply);
    1.53 +			this.tabStats.Controls.Add(this.lblStatLinePreview);
    1.54  			this.tabStats.Controls.Add(this.btnStatsDefault);
    1.55 -			this.tabStats.Controls.Add(this.lvStats);
    1.56 +			this.tabStats.Controls.Add(this.lviewStats);
    1.57  			this.tabStats.Controls.Add(this.btnStatsRemove);
    1.58 -			this.tabStats.Controls.Add(this.btnStatsEdit);
    1.59  			this.tabStats.Controls.Add(this.btnStatsAdd);
    1.60  			this.tabStats.Location = new System.Drawing.Point(4, 22);
    1.61  			this.tabStats.Name = "tabStats";
    1.62 @@ -586,41 +612,175 @@
    1.63  			this.tabStats.Text = "Stat Lines";
    1.64  			this.tabStats.UseVisualStyleBackColor = true;
    1.65  			// 
    1.66 +			// btnMoveStatDown
    1.67 +			// 
    1.68 +			this.btnMoveStatDown.Enabled = false;
    1.69 +			this.btnMoveStatDown.Location = new System.Drawing.Point(500, 205);
    1.70 +			this.btnMoveStatDown.Name = "btnMoveStatDown";
    1.71 +			this.btnMoveStatDown.Size = new System.Drawing.Size(76, 23);
    1.72 +			this.btnMoveStatDown.TabIndex = 25;
    1.73 +			this.btnMoveStatDown.Text = "Down";
    1.74 +			this.btnMoveStatDown.UseVisualStyleBackColor = true;
    1.75 +			// 
    1.76 +			// btnMoveStatUp
    1.77 +			// 
    1.78 +			this.btnMoveStatUp.Enabled = false;
    1.79 +			this.btnMoveStatUp.Location = new System.Drawing.Point(500, 176);
    1.80 +			this.btnMoveStatUp.Name = "btnMoveStatUp";
    1.81 +			this.btnMoveStatUp.Size = new System.Drawing.Size(76, 23);
    1.82 +			this.btnMoveStatUp.TabIndex = 24;
    1.83 +			this.btnMoveStatUp.Text = "Up";
    1.84 +			this.btnMoveStatUp.UseVisualStyleBackColor = true;
    1.85 +			// 
    1.86 +			// btnRemoveStat
    1.87 +			// 
    1.88 +			this.btnRemoveStat.Enabled = false;
    1.89 +			this.btnRemoveStat.Location = new System.Drawing.Point(500, 147);
    1.90 +			this.btnRemoveStat.Name = "btnRemoveStat";
    1.91 +			this.btnRemoveStat.Size = new System.Drawing.Size(76, 23);
    1.92 +			this.btnRemoveStat.TabIndex = 23;
    1.93 +			this.btnRemoveStat.Text = "Remove";
    1.94 +			this.btnRemoveStat.UseVisualStyleBackColor = true;
    1.95 +			// 
    1.96 +			// btnAddStat
    1.97 +			// 
    1.98 +			this.btnAddStat.Enabled = false;
    1.99 +			this.btnAddStat.Location = new System.Drawing.Point(500, 118);
   1.100 +			this.btnAddStat.Name = "btnAddStat";
   1.101 +			this.btnAddStat.Size = new System.Drawing.Size(76, 23);
   1.102 +			this.btnAddStat.TabIndex = 22;
   1.103 +			this.btnAddStat.Text = "Add";
   1.104 +			this.btnAddStat.UseVisualStyleBackColor = true;
   1.105 +			// 
   1.106 +			// gbStats
   1.107 +			// 
   1.108 +			this.gbStats.Controls.Add(this.listStatNames);
   1.109 +			this.gbStats.Location = new System.Drawing.Point(290, 146);
   1.110 +			this.gbStats.Name = "gbStats";
   1.111 +			this.gbStats.Size = new System.Drawing.Size(204, 103);
   1.112 +			this.gbStats.TabIndex = 21;
   1.113 +			this.gbStats.TabStop = false;
   1.114 +			this.gbStats.Text = "Stat List";
   1.115 +			// 
   1.116 +			// listStatNames
   1.117 +			// 
   1.118 +			this.listStatNames.FormattingEnabled = true;
   1.119 +			this.listStatNames.Location = new System.Drawing.Point(7, 20);
   1.120 +			this.listStatNames.Name = "listStatNames";
   1.121 +			this.listStatNames.Size = new System.Drawing.Size(191, 69);
   1.122 +			this.listStatNames.TabIndex = 0;
   1.123 +			// 
   1.124 +			// txtStatName
   1.125 +			// 
   1.126 +			this.txtStatName.Location = new System.Drawing.Point(368, 120);
   1.127 +			this.txtStatName.Name = "txtStatName";
   1.128 +			this.txtStatName.Size = new System.Drawing.Size(126, 20);
   1.129 +			this.txtStatName.TabIndex = 20;
   1.130 +			// 
   1.131 +			// label1
   1.132 +			// 
   1.133 +			this.label1.AutoSize = true;
   1.134 +			this.label1.Location = new System.Drawing.Point(290, 123);
   1.135 +			this.label1.Name = "label1";
   1.136 +			this.label1.Size = new System.Drawing.Size(60, 13);
   1.137 +			this.label1.TabIndex = 19;
   1.138 +			this.label1.Text = "Stat Name:";
   1.139 +			// 
   1.140 +			// txtStatLineID
   1.141 +			// 
   1.142 +			this.txtStatLineID.Location = new System.Drawing.Point(368, 93);
   1.143 +			this.txtStatLineID.Name = "txtStatLineID";
   1.144 +			this.txtStatLineID.Size = new System.Drawing.Size(126, 20);
   1.145 +			this.txtStatLineID.TabIndex = 18;
   1.146 +			// 
   1.147 +			// lblStatLineID
   1.148 +			// 
   1.149 +			this.lblStatLineID.AutoSize = true;
   1.150 +			this.lblStatLineID.Location = new System.Drawing.Point(290, 96);
   1.151 +			this.lblStatLineID.Name = "lblStatLineID";
   1.152 +			this.lblStatLineID.Size = new System.Drawing.Size(66, 13);
   1.153 +			this.lblStatLineID.TabIndex = 17;
   1.154 +			this.lblStatLineID.Text = "Stat Line ID:";
   1.155 +			// 
   1.156 +			// lviewStatPreview
   1.157 +			// 
   1.158 +			this.lviewStatPreview.GridLines = true;
   1.159 +			this.lviewStatPreview.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
   1.160 +			this.lviewStatPreview.Location = new System.Drawing.Point(290, 27);
   1.161 +			this.lviewStatPreview.MultiSelect = false;
   1.162 +			this.lviewStatPreview.Name = "lviewStatPreview";
   1.163 +			this.lviewStatPreview.Size = new System.Drawing.Size(286, 60);
   1.164 +			this.lviewStatPreview.TabIndex = 16;
   1.165 +			this.lviewStatPreview.UseCompatibleStateImageBehavior = false;
   1.166 +			this.lviewStatPreview.View = System.Windows.Forms.View.Details;
   1.167 +			// 
   1.168 +			// btnStatLineApply
   1.169 +			// 
   1.170 +			this.btnStatLineApply.Enabled = false;
   1.171 +			this.btnStatLineApply.Location = new System.Drawing.Point(500, 255);
   1.172 +			this.btnStatLineApply.Name = "btnStatLineApply";
   1.173 +			this.btnStatLineApply.Size = new System.Drawing.Size(76, 23);
   1.174 +			this.btnStatLineApply.TabIndex = 15;
   1.175 +			this.btnStatLineApply.Text = "Apply";
   1.176 +			this.btnStatLineApply.UseVisualStyleBackColor = true;
   1.177 +			// 
   1.178 +			// lblStatLinePreview
   1.179 +			// 
   1.180 +			this.lblStatLinePreview.AutoSize = true;
   1.181 +			this.lblStatLinePreview.Location = new System.Drawing.Point(290, 11);
   1.182 +			this.lblStatLinePreview.Name = "lblStatLinePreview";
   1.183 +			this.lblStatLinePreview.Size = new System.Drawing.Size(93, 13);
   1.184 +			this.lblStatLinePreview.TabIndex = 12;
   1.185 +			this.lblStatLinePreview.Text = "Stat Line Preview:";
   1.186 +			// 
   1.187  			// btnStatsDefault
   1.188  			// 
   1.189 -			this.btnStatsDefault.Location = new System.Drawing.Point(203, 122);
   1.190 +			this.btnStatsDefault.Location = new System.Drawing.Point(203, 64);
   1.191  			this.btnStatsDefault.Name = "btnStatsDefault";
   1.192  			this.btnStatsDefault.Size = new System.Drawing.Size(81, 23);
   1.193  			this.btnStatsDefault.TabIndex = 11;
   1.194  			this.btnStatsDefault.Text = "Make Default";
   1.195  			this.btnStatsDefault.UseVisualStyleBackColor = true;
   1.196 +			this.btnStatsDefault.Click += new System.EventHandler(this.btnStatsDefault_Click);
   1.197  			// 
   1.198 -			// lvStats
   1.199 +			// lviewStats
   1.200  			// 
   1.201 -			this.lvStats.Location = new System.Drawing.Point(6, 6);
   1.202 -			this.lvStats.Name = "lvStats";
   1.203 -			this.lvStats.Size = new System.Drawing.Size(188, 204);
   1.204 -			this.lvStats.TabIndex = 10;
   1.205 -			this.lvStats.UseCompatibleStateImageBehavior = false;
   1.206 +			this.lviewStats.AutoArrange = false;
   1.207 +			this.lviewStats.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
   1.208 +            this.chStatsID,
   1.209 +            this.chStatsDefault});
   1.210 +			this.lviewStats.FullRowSelect = true;
   1.211 +			this.lviewStats.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
   1.212 +			this.lviewStats.HideSelection = false;
   1.213 +			this.lviewStats.Location = new System.Drawing.Point(6, 6);
   1.214 +			this.lviewStats.MultiSelect = false;
   1.215 +			this.lviewStats.Name = "lviewStats";
   1.216 +			this.lviewStats.Size = new System.Drawing.Size(188, 272);
   1.217 +			this.lviewStats.TabIndex = 10;
   1.218 +			this.lviewStats.UseCompatibleStateImageBehavior = false;
   1.219 +			this.lviewStats.View = System.Windows.Forms.View.Details;
   1.220 +			this.lviewStats.SelectedIndexChanged += new System.EventHandler(this.lviewStats_SelectedIndexChanged);
   1.221 +			// 
   1.222 +			// chStatsID
   1.223 +			// 
   1.224 +			this.chStatsID.Text = "ID";
   1.225 +			this.chStatsID.Width = 134;
   1.226 +			// 
   1.227 +			// chStatsDefault
   1.228 +			// 
   1.229 +			this.chStatsDefault.Text = "Default";
   1.230 +			this.chStatsDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
   1.231 +			this.chStatsDefault.Width = 50;
   1.232  			// 
   1.233  			// btnStatsRemove
   1.234  			// 
   1.235 -			this.btnStatsRemove.Location = new System.Drawing.Point(203, 64);
   1.236 +			this.btnStatsRemove.Location = new System.Drawing.Point(203, 35);
   1.237  			this.btnStatsRemove.Name = "btnStatsRemove";
   1.238  			this.btnStatsRemove.Size = new System.Drawing.Size(81, 23);
   1.239  			this.btnStatsRemove.TabIndex = 9;
   1.240  			this.btnStatsRemove.Text = "Remove";
   1.241  			this.btnStatsRemove.UseVisualStyleBackColor = true;
   1.242  			// 
   1.243 -			// btnStatsEdit
   1.244 -			// 
   1.245 -			this.btnStatsEdit.Location = new System.Drawing.Point(203, 35);
   1.246 -			this.btnStatsEdit.Name = "btnStatsEdit";
   1.247 -			this.btnStatsEdit.Size = new System.Drawing.Size(81, 23);
   1.248 -			this.btnStatsEdit.TabIndex = 8;
   1.249 -			this.btnStatsEdit.Text = "Edit";
   1.250 -			this.btnStatsEdit.UseVisualStyleBackColor = true;
   1.251 -			// 
   1.252  			// btnStatsAdd
   1.253  			// 
   1.254  			this.btnStatsAdd.Location = new System.Drawing.Point(203, 6);
   1.255 @@ -655,6 +815,8 @@
   1.256  			((System.ComponentModel.ISupportInitialize)(this.numPointMax)).EndInit();
   1.257  			((System.ComponentModel.ISupportInitialize)(this.numPointMin)).EndInit();
   1.258  			this.tabStats.ResumeLayout(false);
   1.259 +			this.tabStats.PerformLayout();
   1.260 +			this.gbStats.ResumeLayout(false);
   1.261  			this.ResumeLayout(false);
   1.262  
   1.263  		}
   1.264 @@ -687,9 +849,8 @@
   1.265  		private System.Windows.Forms.Button btnCategoryApply;
   1.266  		private System.Windows.Forms.TabPage tabStats;
   1.267  		private System.Windows.Forms.Button btnStatsDefault;
   1.268 -		private System.Windows.Forms.ListView lvStats;
   1.269 +		private System.Windows.Forms.ListView lviewStats;
   1.270  		private System.Windows.Forms.Button btnStatsRemove;
   1.271 -		private System.Windows.Forms.Button btnStatsEdit;
   1.272  		private System.Windows.Forms.Button btnStatsAdd;
   1.273  		private System.Windows.Forms.NumericUpDown numDefaultSize;
   1.274  		private System.Windows.Forms.Label lblDefaultSize;
   1.275 @@ -709,6 +870,21 @@
   1.276  		private System.Windows.Forms.CheckBox cbPercentMin;
   1.277  		private System.Windows.Forms.NumericUpDown numPercentMin;
   1.278  		private System.Windows.Forms.Label lblPercentLimit;
   1.279 +		private System.Windows.Forms.ColumnHeader chStatsID;
   1.280 +		private System.Windows.Forms.ColumnHeader chStatsDefault;
   1.281 +		private System.Windows.Forms.Label lblStatLinePreview;
   1.282 +		private System.Windows.Forms.ListView lviewStatPreview;
   1.283 +		private System.Windows.Forms.Button btnStatLineApply;
   1.284 +		private System.Windows.Forms.TextBox txtStatName;
   1.285 +		private System.Windows.Forms.Label label1;
   1.286 +		private System.Windows.Forms.TextBox txtStatLineID;
   1.287 +		private System.Windows.Forms.Label lblStatLineID;
   1.288 +		private System.Windows.Forms.Button btnRemoveStat;
   1.289 +		private System.Windows.Forms.Button btnAddStat;
   1.290 +		private System.Windows.Forms.GroupBox gbStats;
   1.291 +		private System.Windows.Forms.Button btnMoveStatDown;
   1.292 +		private System.Windows.Forms.Button btnMoveStatUp;
   1.293 +		private System.Windows.Forms.ListBox listStatNames;
   1.294  
   1.295  	}
   1.296  }
     2.1 --- a/FrmSystem.cs	Fri Dec 17 22:14:43 2010 -0600
     2.2 +++ b/FrmSystem.cs	Sat Dec 18 13:20:18 2010 -0600
     2.3 @@ -98,6 +98,7 @@
     2.4  				this.radSystemWarnNo.Checked = true;
     2.5  			}
     2.6  			updateCategoryList();
     2.7 +			updateSystemStatsList();
     2.8  		}
     2.9  		
    2.10  		private string generateID(string name)
    2.11 @@ -147,6 +148,58 @@
    2.12  				}
    2.13  			}
    2.14  		}
    2.15 +		
    2.16 +		private void updateSystemStatsList()
    2.17 +		{
    2.18 +			this.lviewStats.Items.Clear();
    2.19 +			if (system.SystemStats.Length > 0)
    2.20 +			{
    2.21 +				for(int i = 0; i < system.SystemStats.Length; i++)
    2.22 +				{
    2.23 +					ListViewItem item = new ListViewItem();
    2.24 +					item.Text = system.SystemStats[i].ID;
    2.25 +					if(system.SystemStats[i].Equals(system.StandardSystemStats))
    2.26 +					{
    2.27 +						item.SubItems.Add('\u2713'+"");
    2.28 +					}
    2.29 +					this.lviewStats.Items.Add(item);
    2.30 +				}
    2.31 +			}
    2.32 +		}
    2.33 +		
    2.34 +		private void updateStatLinePreview(IBBoard.WarFoundry.API.Objects.SystemStats stats)
    2.35 +		{
    2.36 +			if(stats.SlotCount > 0)
    2.37 +			{
    2.38 +				this.lviewStatPreview.Items.Clear();
    2.39 +				this.lviewStatPreview.Columns.Clear();
    2.40 +				for(int i = 0; i < stats.SlotCount; i++)
    2.41 +				{
    2.42 +					System.Windows.Forms.ColumnHeader column = new ColumnHeader();
    2.43 +					column.Name = generateID(stats.StatSlots[i].Name);
    2.44 +					column.Text = stats.StatSlots[i].Name;
    2.45 +					column.TextAlign = HorizontalAlignment.Center;
    2.46 +					this.lviewStatPreview.Columns.Add(column);
    2.47 +				}
    2.48 +				for(int i = 0; i < this.lviewStatPreview.Columns.Count; i++)
    2.49 +				{
    2.50 +					this.lviewStatPreview.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
    2.51 +				}
    2.52 +				this.lviewStatPreview.Items.Add(" ");
    2.53 +			}
    2.54 +		}
    2.55 +		
    2.56 +		private void updateStatNames(IBBoard.WarFoundry.API.Objects.SystemStats stats)
    2.57 +		{
    2.58 +			if (stats.SlotCount > 0)
    2.59 +			{
    2.60 +				this.listStatNames.Items.Clear();
    2.61 +				for (int i = 0; i < stats.SlotCount; i++)
    2.62 +				{
    2.63 +					this.listStatNames.Items.Add(stats.StatSlots[i].Name);
    2.64 +				}
    2.65 +			}
    2.66 +		}
    2.67  
    2.68  		private void btnSystemClose_Click(object sender, EventArgs e)
    2.69  		{
    2.70 @@ -480,5 +533,28 @@
    2.71  				this.btnCategoryApply.Enabled = false;
    2.72  			}
    2.73  		}
    2.74 +
    2.75 +		void lviewStats_SelectedIndexChanged(object sender, System.EventArgs e)
    2.76 +		{
    2.77 +			foreach(IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats)
    2.78 +			{
    2.79 +				ListView.SelectedListViewItemCollection items = this.lviewStats.SelectedItems;
    2.80 +				foreach(ListViewItem item in items)
    2.81 +				{
    2.82 +					if(stat.ID == item.Text)
    2.83 +					{
    2.84 +						this.txtStatLineID.Text = stat.ID;
    2.85 +						updateStatNames(stat);
    2.86 +						updateStatLinePreview(stat);
    2.87 +					}
    2.88 +				}
    2.89 +			}
    2.90 +		}
    2.91 +
    2.92 +		private void btnStatsDefault_Click(object sender, EventArgs e)
    2.93 +		{
    2.94 +			system.StandardSystemStatsID = this.lviewStats.SelectedItems[0].Text;
    2.95 +			updateSystemStatsList();
    2.96 +		}
    2.97  	}
    2.98  }
     3.1 --- a/IBBoard.WarFoundry.Forge.WinForms.csproj	Fri Dec 17 22:14:43 2010 -0600
     3.2 +++ b/IBBoard.WarFoundry.Forge.WinForms.csproj	Sat Dec 18 13:20:18 2010 -0600
     3.3 @@ -93,6 +93,7 @@
     3.4      <Compile Include="Properties\Resources.Designer.cs">
     3.5        <AutoGen>True</AutoGen>
     3.6        <DependentUpon>Resources.resx</DependentUpon>
     3.7 +      <DesignTime>True</DesignTime>
     3.8      </Compile>
     3.9      <None Include="Properties\Settings.settings">
    3.10        <Generator>SettingsSingleFileGenerator</Generator>