annotate FrmSystem.cs @ 12:6284c091b132

Merge local with IBBoard
author Tsudico
date Fri, 17 Dec 2010 22:14:43 -0600
parents 43d88f50c712
children 372f921c20fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
1 using System;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
2 using System.Collections.Generic;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
3 using System.ComponentModel;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
4 using System.Data;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
5 using System.Drawing;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
6 using System.Text;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
7 using System.Text.RegularExpressions;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
8 using System.Windows.Forms;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
9 using IBBoard.Lang;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
10 using IBBoard.Windows.Forms;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
11 using IBBoard.Windows.Forms.I18N;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
12
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
13 namespace IBBoard.WarFoundry.Forge.WinForms
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
14 {
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
15 public partial class FrmSystem : IBBoard.Windows.Forms.IBBForm
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
16 {
4
866d0093bb11 WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents: 0
diff changeset
17 private IBBoard.WarFoundry.API.Objects.GameSystem system;
866d0093bb11 WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents: 0
diff changeset
18
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
19 private bool UpdateCategory
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
20 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
21 get
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
22 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
23 if(this.listCategories.SelectedIndex >= 0)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
24 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
25 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
26 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
27 if(cat.Name == this.listCategories.SelectedItem)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
28 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
29 if(cat.Name != this.txtCategoryName.Text)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
30 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
31 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
32 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
33 if(cat.ID != this.txtCategoryID.Text)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
34 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
35 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
36 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
37 if(cat.MinimumPoints > 0 && !this.cbPointMin.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
38 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
39 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
40 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
41 else if(cat.MinimumPoints != this.numPointMin.Value)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
42 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
43 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
44 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
45 if(cat.MaximumPoints < this.numPointMax.Maximum && !this.cbPointMax.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
46 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
47 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
48 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
49 else if(cat.MaximumPoints != this.numPointMax.Value)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
50 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
51 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
52 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
53 if(cat.MinimumPercentage > 0 && !this.cbPercentMin.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
54 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
55 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
56 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
57 else if(cat.MinimumPercentage != this.numPercentMin.Value)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
58 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
59 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
60 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
61 if(cat.MaximumPercentage < this.numPercentMax.Maximum && !this.cbPercentMax.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
62 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
63 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
64 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
65 else if(cat.MaximumPercentage != this.numPercentMax.Value)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
66 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
67 return true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
68 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
69 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
70 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
71 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
72 return false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
73 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
74 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
75
4
866d0093bb11 WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents: 0
diff changeset
76 public FrmSystem(IBBoard.WarFoundry.API.Objects.GameSystem loadSystem)
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
77 {
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
78 InitializeComponent();
4
866d0093bb11 WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents: 0
diff changeset
79 system = loadSystem;
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
80 this.txtSystemName.Text = system.Name;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
81 this.txtSystemId.Text = system.ID;
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
82 this.numDefaultSize.Value = system.SystemArmyDefaultSize;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
83 this.numPointMax.Value = this.numDefaultSize.Value;
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
84 if(system.AllowAllies)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
85 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
86 this.radSystemAlliesYes.Checked = true;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
87 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
88 else
4
866d0093bb11 WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents: 0
diff changeset
89 {
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
90 this.radSystemAlliesNo.Checked = true;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
91 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
92 if (system.WarnOnError)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
93 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
94 this.radSystemWarnYes.Checked = true;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
95 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
96 else
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
97 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
98 this.radSystemWarnNo.Checked = true;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
99 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
100 updateCategoryList();
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
101 }
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
102
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
103 private string generateID(string name)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
104 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
105 string newId = String.Empty;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
106
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
107 MatchCollection id_parts = Regex.Matches(name, @"[A-Z\d]");
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
108 foreach (Match part in id_parts)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
109 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
110 newId += part.ToString();
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
111 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
112
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
113 if (newId.Length < 3)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
114 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
115 newId = name.ToLower().Replace(" ", "");
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
116 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
117
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
118 return newId.ToLower();
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
119 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
120
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
121 private void clearCategory()
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
122 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
123 this.txtCategoryName.Text = string.Empty;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
124 this.txtCategoryID.Text = string.Empty;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
125 this.cbPointMin.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
126 this.cbPointMax.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
127 this.cbPercentMin.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
128 this.cbPercentMax.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
129 this.numPointMin.Value = 0;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
130 this.numPointMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
131 this.numPointMax.Value = this.numDefaultSize.Value;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
132 this.numPointMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
133 this.numPercentMin.Value = 0;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
134 this.numPercentMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
135 this.numPercentMax.Value = 100;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
136 this.numPercentMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
137 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
138
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
139 private void updateCategoryList()
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
140 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
141 if (system.Categories.Length > 0)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
142 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
143 this.listCategories.Items.Clear();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
144 for (int i = 0; i < system.Categories.Length; i++)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
145 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
146 this.listCategories.Items.Add(system.Categories[i].Name);
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
147 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
148 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
149 }
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
150
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
151 private void btnSystemClose_Click(object sender, EventArgs e)
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
152 {
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
153 this.Close();
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
154 }
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
155
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
156 private void btnGenerateSysId_Click(object sender, EventArgs e)
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
157 {
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
158 this.txtSystemId.Text = generateID(this.txtSystemName.Text);
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
159 }
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
160
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
161 private void listCategories_SelectedIndexChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
162 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
163 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
164 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
165 if (cat.Name == this.listCategories.SelectedItem)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
166 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
167 this.txtCategoryName.Text = cat.Name;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
168 this.txtCategoryID.Text = cat.ID;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
169 if (cat.MinimumPoints > 0)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
170 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
171 this.numPointMin.Value = cat.MinimumPoints;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
172 this.cbPointMin.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
173 this.numPointMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
174 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
175 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
176 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
177 this.numPointMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
178 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
179 if (cat.MaximumPoints > 0 && cat.MaximumPoints < this.numPercentMax.Maximum)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
180 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
181 this.numPointMax.Value = cat.MaximumPoints;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
182 this.cbPointMax.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
183 this.numPointMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
184 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
185 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
186 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
187 this.numPointMax.Value = this.numDefaultSize.Value;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
188 this.numPointMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
189 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
190 if (cat.MinimumPercentage > 0)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
191 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
192 this.numPercentMin.Value = cat.MinimumPercentage;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
193 this.cbPercentMin.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
194 this.numPercentMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
195 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
196 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
197 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
198 this.numPercentMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
199 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
200 if (cat.MaximumPercentage < 100)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
201 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
202 this.numPercentMax.Value = cat.MaximumPercentage;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
203 this.cbPercentMax.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
204 this.numPercentMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
205 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
206 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
207 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
208 this.numPercentMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
209 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
210 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
211 break;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
212 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
213 }
10
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
214 if(this.listCategories.SelectedIndex == 0)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
215 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
216 this.btnCategoryUp.Enabled = false;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
217 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
218 else
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
219 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
220 this.btnCategoryUp.Enabled = true;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
221 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
222 if (this.listCategories.SelectedIndex == this.listCategories.Items.Count - 1)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
223 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
224 this.btnCategoryDown.Enabled = false;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
225 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
226 else
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
227 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
228 this.btnCategoryDown.Enabled = true;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
229 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
230 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
231
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
232 private void btnCategoryAdd_Click(object sender, EventArgs e)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
233 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
234 if(this.txtCategoryName.Text == string.Empty)
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
235 {
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
236 MessageBox.Show("Category must have a name", "Category Error");
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
237 return;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
238 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
239 if (this.txtCategoryID.Text == string.Empty)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
240 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
241 MessageBox.Show("Category must have an ID", "Category Error");
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
242 return;
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
243 }
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
244 IBBoard.WarFoundry.API.Objects.Category cat = new IBBoard.WarFoundry.API.Objects.Category(
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
245 this.txtCategoryID.Text,
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
246 this.txtCategoryName.Text
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
247 );
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
248
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
249 cat.MinimumPoints = (int)this.numPointMin.Value;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
250 cat.MaximumPoints = (int)this.numPointMax.Value;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
251 cat.MinimumPercentage = (int)this.numPercentMin.Value;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
252 cat.MaximumPercentage = (int)this.numPercentMax.Value;
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
253
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
254 system.AddCategory(cat);
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
255 updateCategoryList();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
256 clearCategory();
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
257 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
258
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
259 private void btnCategoryRemove_Click(object sender, EventArgs e)
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
260 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
261 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
262 {
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
263 if(cat.Name == this.listCategories.SelectedItem)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
264 {
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
265 system.RemoveCategory(cat.ID);
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
266 this.listCategories.ClearSelected();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
267 break;
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
268 }
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
269 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
270 updateCategoryList();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
271 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
272
10
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
273 private void btnCategoryUp_Click(object sender, EventArgs e)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
274 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
275 int index = this.listCategories.SelectedIndex;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
276 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
277
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
278 for(int i = 0; i < system.Categories.Length; i++)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
279 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
280 catList[i] = system.Categories[i];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
281 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
282 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
283 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
284 system.RemoveCategory(cat.ID);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
285 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
286
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
287 IBBoard.WarFoundry.API.Objects.Category temp = catList[index];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
288 catList[index] = catList[index - 1];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
289 catList[index - 1] = temp;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
290
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
291 for(int i = catList.Length - 1; i >= 0; i--)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
292 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
293 system.AddCategory(catList[i]);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
294 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
295
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
296 updateCategoryList();
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
297 this.listCategories.SelectedIndex = index - 1;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
298 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
299
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
300 private void btnCategoryDown_Click(object sender, EventArgs e)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
301 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
302 int index = this.listCategories.SelectedIndex;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
303 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
304
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
305 for (int i = 0; i < system.Categories.Length; i++)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
306 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
307 catList[i] = system.Categories[i];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
308 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
309 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
310 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
311 system.RemoveCategory(cat.ID);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
312 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
313
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
314 IBBoard.WarFoundry.API.Objects.Category temp = catList[index];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
315 catList[index] = catList[index + 1];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
316 catList[index + 1] = temp;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
317
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
318 for (int i = catList.Length - 1; i >= 0; i--)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
319 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
320 system.AddCategory(catList[i]);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
321 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
322
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
323 updateCategoryList();
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
324 this.listCategories.SelectedIndex = index + 1;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
325 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
326
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
327 private void txtCategoryName_TextChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
328 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
329 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
330 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
331 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
332 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
333 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
334 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
335 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
336 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
337 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
338
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
339 private void txtCategoryID_TextChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
340 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
341 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
342 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
343 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
344 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
345 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
346 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
347 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
348 }
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
349 }
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
350
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
351 private void btnGenerateCatID_Click(object sender, EventArgs e)
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
352 {
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
353 this.txtCategoryID.Text = generateID(this.txtCategoryName.Text);
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
354 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
355
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
356 private void cbPointMin_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
357 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
358 if(this.cbPointMin.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
359 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
360 this.numPointMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
361 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
362 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
363 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
364 this.numPointMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
365 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
366 if(this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
367 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
368 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
369 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
370 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
371 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
372 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
373 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
374 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
375
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
376 private void cbPointMax_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
377 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
378 if (this.cbPointMax.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
379 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
380 this.numPointMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
381 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
382 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
383 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
384 this.numPointMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
385 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
386 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
387 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
388 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
389 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
390 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
391 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
392 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
393 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
394 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
395
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
396 private void cbPercentMin_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
397 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
398 if (this.cbPercentMin.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
399 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
400 this.numPercentMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
401 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
402 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
403 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
404 this.numPercentMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
405 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
406 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
407 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
408 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
409 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
410 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
411 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
412 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
413 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
414 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
415
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
416 private void cbPercentMax_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
417 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
418 if (this.cbPercentMax.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
419 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
420 this.numPercentMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
421 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
422 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
423 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
424 this.numPercentMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
425 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
426 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
427 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
428 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
429 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
430 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
431 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
432 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
433 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
434 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
435
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
436 private void numPointMin_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
437 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
438 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
439 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
440 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
441 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
442 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
443 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
444 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
445 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
446 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
447
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
448 private void numPointMax_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
449 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
450 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
451 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
452 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
453 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
454 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
455 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
456 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
457 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
458 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
459
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
460 private void numPercentMin_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
461 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
462 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
463 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
464 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
465 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
466 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
467 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
468 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
469 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
470 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
471
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
472 private void numPercentMax_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
473 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
474 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
475 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
476 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
477 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
478 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
479 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
480 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
481 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
482 }
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
483 }
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
484 }