This commit is contained in:
2008-08-12 11:46:26 +00:00
parent 869ff724d9
commit 5bedb853c5
11 changed files with 3826 additions and 3467 deletions

View File

@@ -26,9 +26,25 @@ namespace VEPROMS
this.Text = string.Format("{0} {1} Properties", sectionConfig.Number, sectionConfig.Title);
else
this.Text = string.Format("{0} Properties", sectionConfig.Title);
// set up some of the format tab:
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
cbIsStepSection.Enabled = !(ii.HasWordContent || ii.HasStepContent);
// check type of section from document styles to determine if the stepsection checkbox should
// be checked.
int secindx = (int)sectionConfig.SectionType;
// find the index for the document style to determine whether this is a step or word section.
PlantFormat pf = _SectionConfig.MyDefaultFormat.PlantFormat;
for (int i = 0; i < pf.DocStyles.DocStyleList.Count; i++)
{
if (pf.DocStyles.DocStyleList[i].Index == secindx)
{
cbIsStepSection.Checked = pf.DocStyles.DocStyleList[i].IsStepSection;
}
}
}
private void btnFlderPropOK_Click(object sender, EventArgs e)
private void btnSectPropOK_Click(object sender, EventArgs e)
{
sectionConfigBindingSource.EndEdit();
// Save Default settings for User
@@ -40,9 +56,10 @@ namespace VEPROMS
this.Close();
}
private void btnFldrPropCancel_Click(object sender, EventArgs e)
private void btnSectPropCancel_Click(object sender, EventArgs e)
{
sectionConfigBindingSource.CancelEdit();
DialogResult = DialogResult.Cancel;
this.Close();
}
@@ -70,7 +87,11 @@ namespace VEPROMS
_Initializing = true;
sectionConfigBindingSource.DataSource = _SectionConfig;
formatInfoListBindingSource.DataSource = FormatInfoList.Get();
//formatInfoListBindingSource.DataSource = FormatInfoList.Get();
ppCmbxFormat.DataSource = null;
ppCmbxFormat.DisplayMember = "FullName";
ppCmbxFormat.ValueMember = "FullName";
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
// Get the saved settings for this user
//
@@ -128,6 +149,7 @@ namespace VEPROMS
private void btnFormat_Click(object sender, EventArgs e)
{
ProcessButtonClick(tiFormat, btnFormat);
}
/// <summary>
@@ -144,6 +166,41 @@ namespace VEPROMS
}
ppBtnDefaultFmt.Visible = (ppCmbxFormat.SelectedValue != null);
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
SetupPpCmbxSectionType();
}
private void SetupPpCmbxSectionType()
{
bool myInit = _Initializing;
_Initializing = true;
PlantFormat pf = _SectionConfig.MyDefaultFormat.PlantFormat;
if (ppCmbxFormat.SelectedIndex >= 0)
pf = FormatInfoList.SortedFormatInfoList[ppCmbxFormat.SelectedIndex].PlantFormat;
ppCmbxStyleSectionType.DisplayMember = "Name";
ppCmbxStyleSectionType.ValueMember = "Index";
// if this has been defined as a step section, only list step section document styles, if
// a word section, only list word section styles. If neither content types has been defined,
// list both.
DocStyleList locDocStyles = new DocStyleList(null);
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
int selindx = -1;
for (int i = 0; i < pf.DocStyles.DocStyleList.Count; i++)
{
if (cbIsStepSection.Checked && pf.DocStyles.DocStyleList[i].IsStepSection) locDocStyles.Add(pf.DocStyles.DocStyleList[i]);
else if (!cbIsStepSection.Checked && !pf.DocStyles.DocStyleList[i].IsStepSection) locDocStyles.Add(pf.DocStyles.DocStyleList[i]);
if (_SectionConfig.SectionType == pf.DocStyles.DocStyleList[i].Index) selindx = locDocStyles.Count - 1;
}
ppCmbxStyleSectionType.DataSource = locDocStyles;
ppCmbxStyleSectionType.SelectedIndex = selindx;
//if (_SectionConfig.SectionType < pf.DocStyles.DocStyleList.Count)
//{
// //Volian.Controls.Library.vlnStackTrace.ShowStack("Before - SelectedValue {0} SectionType {1}", ppCmbxStyleSectionType.SelectedValue, _SectionConfig.SectionType);
// ppCmbxStyleSectionType.SelectedValue = (int)_SectionConfig.SectionType;
// //Volian.Controls.Library.vlnStackTrace.ShowStack("After - SelectedValue {0} SectionType {1}", ppCmbxStyleSectionType.SelectedValue, _SectionConfig.SectionType);
//}
_Initializing = myInit;
}
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
@@ -233,5 +290,31 @@ namespace VEPROMS
}
#endregion
private void ppCmbxStyleSectionType_SelectedValueChanged(object sender, EventArgs e)
{
if (_Initializing) return;
if (ppCmbxStyleSectionType.SelectedValue != null)
_SectionConfig.SectionType = (int)(ppCmbxStyleSectionType.SelectedValue);
}
private void ppCmbxFormat_SelectedIndexChanged(object sender, EventArgs e)
{
if (_Initializing) return;
if ((ppCmbxFormat.SelectedIndex != -1) && _DefaultFormatName != null && _DefaultFormatName.Equals(ppCmbxFormat.SelectedValue))
{
ppBtnDefaultFmt.Focus();
ppBtnDefaultFmt.PerformClick();
}
ppBtnDefaultFmt.Visible = (ppCmbxFormat.SelectedValue != null);
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
SetupPpCmbxSectionType();
}
private void cbIsStepSection_CheckedChanged(object sender, EventArgs e)
{
if (_Initializing) return;
SetupPpCmbxSectionType();
}
}
}