private void MakeControls()
{
foreach (Control c in this.Controls[0].Controls) c.Dispose();
this.Controls[0].Controls.Clear();
for (int counter = 0; counter < this.bitCount; counter++)
{
//Making the checkbox
CheckBox tempcheckBox1 = new CheckBox();
tempcheckBox1.AutoSize = true;
tempcheckBox1.Size = new System.Drawing.Size(80, 17);
tempcheckBox1.Text = "bit " + counter.ToString();
tempcheckBox1.Text.PadLeft(this.optionNamePadding);
tempcheckBox1.UseVisualStyleBackColor = true;
tempcheckBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged);
tempcheckBox1.Tag = counter.ToString();
this.visibleBits[counter] = false;
//Fill in names
if (this.Options != null)
{
for (int counter2 = 0; counter2 < this.Options.Length; counter2++)
{
if (this.Options[counter2].value == counter)
{
this.visibleBits[counter] = true;
tempcheckBox1.Text = this.Options[counter2].name;
break;
}
}
}
tempcheckBox1.Visible = false;
this.Controls[0].Controls.Add(tempcheckBox1);
}
//Place the check box in the right spot
int down = 19;
int over = 6;
int CounterForPlacementKeeping = 0;
for (int counter = 0; counter < this.bitCount; counter++)
{
if (this.visibleBits[counter] ==false)
if (MetaEditor.MetaEditor.ShowInvisibles == false)
continue;
this.Controls[0].Controls[counter].Location = new Point(over, down);
over += this.optionNamePadding;
this.Controls[0].Controls[counter].Visible = true;
if ((CounterForPlacementKeeping+1) % 3 == 0)
{
down += 23;
over = 6;
}
CounterForPlacementKeeping++;
}
}