private void UpdatePage3()
{
if (currentSection == null) // || !(currentSection is Rectangular || currentSection is Circle))
wizardControl.SelectTab(0);
else
{
currentMaterial = currentSection.Material;
if (currentMaterial.DesignProperties is ConcreteDesignProps)
{
columnRadioButton.Visible = true;
beamRadioButton.Visible = true;
if (currentSection.ConcreteProperties is ConcreteBeamSectionProps)
beamRadioButton.Checked = true;
else if (currentSection.ConcreteProperties is ConcreteColumnSectionProps)
columnRadioButton.Checked = true;
if (currentSection is Rectangular)
beamRadioButton.Enabled = true;
else
beamRadioButton.Enabled = false;
nextButton3.Text = Culture.Get("next") + " >>";
}
else if (currentMaterial.DesignProperties is SteelDesignProps)
{
columnRadioButton.Visible = false;
beamRadioButton.Visible = false;
nextButton3.Text = Culture.Get("apply");
}
else
wizardControl.SelectTab(3);
t3TextBox.Text = currentSection.T3.ToString();
t2TextBox.Text = currentSection.T2.ToString();
tfTextBox.Text = currentSection.Tf.ToString();
twTextBox.Text = currentSection.Tw.ToString();
disTextBox.Text = currentSection.Dis.ToString();
if (currentSection is Rectangular)
{
t3Label.Text = "H (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
t3TextBox.Text = currentSection.T3.ToString();
t2Label.Text = "B (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
t2TextBox.Text = currentSection.T2.ToString();
t2Label.Visible = true;
t2TextBox.Visible = true;
tfLabel.Visible = false;
tfTextBox.Visible = false;
twLabel.Visible = false;
twTextBox.Visible = false;
disLabel.Visible = false;
disTextBox.Visible = false;
sectionPictureBox.Image = Properties.Resources.RectangularSectionImg;
}
else if (currentSection is Circle)
{
t3Label.Text = "D (" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
t3TextBox.Text = currentSection.T3.ToString();
t2Label.Visible = false;
t2TextBox.Visible = false;
tfLabel.Visible = false;
tfTextBox.Visible = false;
twLabel.Visible = false;
twTextBox.Visible = false;
disLabel.Visible = false;
disTextBox.Visible = false;
sectionPictureBox.Image = Properties.Resources.CircleSectionImg;
}
else if (currentSection is General)
{
wizardControl.SelectTab(4);
}
else
{
string unit = "(" + model.UnitSystem.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance) + ")";
t3Label.Text = "h " + unit;
t2Label.Text = "b " + unit;
tfLabel.Text = "Tf " + unit;
twLabel.Text = "Tw " + unit;
disLabel.Text = "Dis " + unit;
t2Label.Visible = true;
t2TextBox.Visible = true;
tfLabel.Visible = true;
tfTextBox.Visible = true;
twLabel.Visible = true;
twTextBox.Visible = true;
disLabel.Visible = false;
disTextBox.Visible = false;
columnRadioButton.Visible = false;
beamRadioButton.Visible = false;
columnRadioButton.Checked = false;
beamRadioButton.Checked = false;
if (currentSection is IWideFlange)
sectionPictureBox.Image = Properties.Resources.ISectionImg;
else if (currentSection is BoxTube)
sectionPictureBox.Image = Properties.Resources.TubeSectionImg;
else if (currentSection is Angle)
sectionPictureBox.Image = Properties.Resources.AngleSectionImg;
else if (currentSection is Channel)
sectionPictureBox.Image = Properties.Resources.ChannelSectionImg;
else if (currentSection is Tee)
sectionPictureBox.Image = Properties.Resources.TeeSectionImg;
else if (currentSection is Pipe)
{
t3Label.Text = "r " + unit;
t2Label.Text = "t " + unit;
t2TextBox.Text = currentSection.Tw.ToString();
t2Label.Visible = true;
t2TextBox.Visible = true;
tfLabel.Visible = false;
tfTextBox.Visible = false;
twLabel.Visible = false;
twTextBox.Visible = false;
sectionPictureBox.Image = Properties.Resources.PipeSectionImg;
}
}
}
}