debugged and fixed many issues in the property pages

This commit is contained in:
2010-06-04 19:23:22 +00:00
parent 19a58f7409
commit d0c1b9d2b2
11 changed files with 1795 additions and 1074 deletions

View File

@@ -17,6 +17,9 @@ namespace VEPROMS
{
public partial class frmVersionsProperties : DevComponents.DotNetBar.Office2007Form
{
private bool _Initializing = false;
private DocVersionConfig _DocVersionConfig;
// Default values
private string _DefaultFormatName = null;
private string _DefaultROPrefix = null;
@@ -29,6 +32,7 @@ namespace VEPROMS
private string _DefaultChgBarUsrMsg1 = null;
private string _DefaultChgBarUsrMsg2 = null;
private bool _DefaultDisableDuplex = false;
// For the initial release, we are assuming there will be only one rofst for a docversion. Changes
// will be needed here if more than 1.
private ROFstInfo _SelectedROFst;
@@ -46,8 +50,6 @@ namespace VEPROMS
set { _SelectedROFst = value; }
}
//
private bool _Initializing;
private DocVersionConfig _DocVersionConfig;
public frmVersionsProperties(DocVersionConfig docVersionConfig)
{
@@ -157,6 +159,7 @@ namespace VEPROMS
private void frmVersionsProperties_Load(object sender, EventArgs e)
{
_Initializing = true;
docVersionConfigBindingSource.DataSource = _DocVersionConfig;
//formatInfoListBindingSource.DataSource = FormatInfoList.Get();
@@ -220,6 +223,8 @@ namespace VEPROMS
ppBtnRoDbBrowse.Visible = cmbRoDb.Visible = _DocVersionConfig.MyDocVersion.DocVersionAssociationCount == 0;
btnRoDbProperties.Visible = tbRoDb.Visible = !(_DocVersionConfig.MyDocVersion.DocVersionAssociationCount == 0);
ppBtnUpRoVals.Enabled = !(_DocVersionConfig.MyDocVersion.DocVersionAssociationCount == 0); // only allow update if association
_Initializing = false;
}
#region General tab
@@ -291,6 +296,7 @@ namespace VEPROMS
if (pgtn != _DocVersionConfig.Print_Pagination)
_DocVersionConfig.Print_Pagination = pgtn; // this will force a database update (write)
ppCmbxPagination.SelectedIndex = -1;
//tcpOutputSettings.Focus();
}
/// <summary>
@@ -322,6 +328,7 @@ namespace VEPROMS
if (wtr != _DocVersionConfig.Print_Watermark)
_DocVersionConfig.Print_Watermark = wtr; // this will force a database update (write)
ppCmbxWatermark.SelectedIndex = -1;
//tcpOutputSettings.Focus();
}
#endregion
@@ -341,6 +348,7 @@ namespace VEPROMS
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
{
ppCmbxFormat.SelectedIndex = -1;
//tcpFormatSettings.Focus();
}
/// <summary>
@@ -352,6 +360,7 @@ namespace VEPROMS
{
if (!_Initializing)
{
_DocVersionConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked;
ppBtnDeftDisAutoDuplx.Visible = (_DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked);
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
}
@@ -374,13 +383,18 @@ namespace VEPROMS
/// </summary>
private void setEnabledUserSpecifiedChgBarCombos(DocVersionConfig.PrintChangeBar pcb)
{
ppGpbxUserSpecCB.Enabled =
ppCmbxChgBarPos.Enabled =
ppCmbxChgBarTxtType.Enabled =
ppBtnDefaultCbPos.Enabled =
ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
//ppGpbxUserSpecCB.Enabled =
//ppCmbxChgBarPos.Enabled =
//ppCmbxChgBarTxtType.Enabled =
//ppBtnDefaultCbPos.Enabled =
//ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
//ppCmbxChangeBarType.SelectedValue.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)) ||
//(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified));
ppGpbxUserSpecCB.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
ppCmbxChangeBarType.SelectedValue.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)) ||
(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified));
}
/// <summary>
@@ -413,6 +427,7 @@ namespace VEPROMS
if (pcb != _DocVersionConfig.Print_ChangeBar)
_DocVersionConfig.Print_ChangeBar = pcb; // this will force a database update (write)
ppCmbxChangeBarType.SelectedIndex = -1; //reset combo box to the default Change Bar setting
//tcpFormatSettings.Focus();
}
/// <summary>
@@ -444,6 +459,7 @@ namespace VEPROMS
if (cbl != _DocVersionConfig.Print_ChangeBarLoc)
_DocVersionConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write)
ppCmbxChgBarPos.SelectedIndex = -1;
//tcpFormatSettings.Focus();
}
/// <summary>
@@ -452,12 +468,22 @@ namespace VEPROMS
/// </summary>
private void setEnabledUserSpecifiedChgBarText()
{
ppGpbxUserSpecTxt.Enabled =
ppTxbxChangeBarUserMsgOne.Enabled =
ppTxbxChangeBarUserMsgTwo.Enabled =
ppBtnDefCbTxt1.Enabled =
ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
ppCmbxChgBarTxtType.SelectedValue.Equals(DocVersionConfig.PrintChangeBarText.UserDef));
//ppGpbxUserSpecTxt.Enabled =
//ppTxbxChangeBarUserMsgOne.Enabled =
//ppTxbxChangeBarUserMsgTwo.Enabled =
//ppBtnDefCbTxt1.Enabled =
//ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
//ppCmbxChgBarTxtType.SelectedValue.Equals(DocVersionConfig.PrintChangeBarText.UserDef));
//string decUserDef = EnumDescConverter.GetEnumDescription(DocVersionConfig.PrintChangeBarText.UserDef);
// This string is used to check against our default setting to see if User Defined Changebar Text is active
string decUserDef = DocVersionConfig.PrintChangeBarText.UserDef.ToString();
ppGpbxUserSpecTxt.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
ppCmbxChgBarTxtType.SelectedValue.Equals(DocVersionConfig.PrintChangeBarText.UserDef)) ||
(ppCmbxChgBarTxtType.SelectedIndex == -1 && _DefaultChgBarText.Equals(decUserDef));
}
/// <summary>
@@ -490,6 +516,7 @@ namespace VEPROMS
if (cbt != _DocVersionConfig.Print_ChangeBarText)
_DocVersionConfig.Print_ChangeBarText = cbt; // this will force a database update (write)
ppCmbxChgBarTxtType.SelectedIndex = -1;
//tcpFormatSettings.Focus();
}
/// <summary>
@@ -499,8 +526,8 @@ namespace VEPROMS
/// <param name="e">EventArgs</param>
private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e)
{
if (!_Initializing)
ppBtnDefCbTxt1.Visible = (ppTxbxChangeBarUserMsgOne.Text != null);
ppBtnDefCbTxt1.Visible = ((ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1));
ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible;
}
/// <summary>
@@ -510,8 +537,8 @@ namespace VEPROMS
/// <param name="e">EventArgs</param>
private void ppTxbxChangeBarUserMsgTwo_TextChanged(object sender, EventArgs e)
{
if (!_Initializing)
ppBtnDefCbTxt2.Visible = (ppTxbxChangeBarUserMsgTwo.Text != null);
ppBtnDefCbTxt2.Visible = ((ppTxbxChangeBarUserMsgTwo.Text != null) && !ppTxbxChangeBarUserMsgTwo.Text.Equals(_DefaultChgBarUsrMsg2));
ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible;
}
#endregion
@@ -542,7 +569,7 @@ namespace VEPROMS
private void tabpage_Enter(object sender, EventArgs e)
{
// Show or hide the labels containing the default values
if (!_Initializing)
//if (!_Initializing)
defaultSettingsVisiblity();
}
@@ -551,10 +578,11 @@ namespace VEPROMS
/// </summary>
private void defaultSettingsVisiblity()
{
ppLblChgBarUserMsgOneDefault.Visible =
ppLblChgBarUserMsgTwoDefault.Visible =
ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked;
ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible;
ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible;
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible;
ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible;
@@ -603,8 +631,12 @@ namespace VEPROMS
if ((cmbx.SelectedIndex != -1) &&
cmbx.SelectedValue.Equals(enumval))
{
_Initializing = true;
button.Visible = true;
button.Focus();
button.PerformClick();
cmbx.SelectedIndex = -1; // This will hide the Default button
_Initializing = false;
}
button.Visible = (cmbx.SelectedValue != null);
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
@@ -621,6 +653,7 @@ namespace VEPROMS
{
if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue))
{
button.Visible = true;
button.Focus();
button.PerformClick();
}
@@ -637,8 +670,9 @@ namespace VEPROMS
{
if (defaultText != null && !(defaultText.Equals("")))
{
lbl.Text = string.Format("({0})", defaultText);
cmbo.WatermarkText = string.Format("{0}", defaultText);
string deftext = string.Format("{0}", defaultText);
lbl.Text = deftext;
cmbo.WatermarkText = deftext;
}
}
@@ -751,6 +785,41 @@ namespace VEPROMS
ppTxtBxPDFLoc.Text = PDFLocationBrowserDialog.SelectedPath;
}
private void ppBtnDefCbTxt1_Click(object sender, EventArgs e)
{
// Compare default setting with current setting
// Reset with the default and hide the default button and label
if (_DefaultChgBarUsrMsg1 != _DocVersionConfig.Print_UserCBMess1)
{
_DocVersionConfig.Print_UserCBMess1 = _DefaultChgBarUsrMsg1;
ppLblChgBarUserMsgOneDefault.Visible = false;
ppBtnDefCbTxt1.Visible = false;
//tcpFormatSettings.Focus();
}
}
private void ppBtnDefCbTxt2_Click(object sender, EventArgs e)
{
// Compare default setting with current setting
// Reset with the default and hide the default button and label
if (_DefaultChgBarUsrMsg2 != _DocVersionConfig.Print_UserCBMess2)
{
_DocVersionConfig.Print_UserCBMess2 = _DefaultChgBarUsrMsg2;
ppLblChgBarUserMsgTwoDefault.Visible = false;
ppBtnDefCbTxt2.Visible = false;
//tcpFormatSettings.Focus();
}
}
private void ppBtnDeftDisAutoDuplx_Click(object sender, EventArgs e)
{
ppChbxDisAutoDuplex.Checked = _DefaultDisableDuplex;
_DocVersionConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked;
ppBtnDeftDisAutoDuplx.Visible = false;
ppLblAutoDuplexDefault.Visible = false;
//tcpOutputSettings.Focus();
}
}
}