debugged and fixed many issues in the property pages
This commit is contained in:
@@ -25,14 +25,15 @@ namespace VEPROMS
|
||||
private string _DefaultChgBarUsrMsg1 = null;
|
||||
private string _DefaultChgBarUsrMsg2 = null;
|
||||
private string _DefaultFormatColumns = null;
|
||||
private bool _Initializing;
|
||||
private bool _DefaultDisableDuplex = false;
|
||||
private bool _Initializing = false;
|
||||
private ProcedureConfig _ProcedureConfig;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
|
||||
public frmProcedureProperties(ProcedureConfig procedureConfig)
|
||||
{
|
||||
_ProcedureConfig = procedureConfig;
|
||||
_Initializing = true;
|
||||
_Initializing = true;
|
||||
InitializeComponent();
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
_Initializing = false;
|
||||
@@ -122,8 +123,14 @@ namespace VEPROMS
|
||||
|
||||
// Get the default Format Columns
|
||||
_DefaultFormatColumns = _ProcedureConfig.Format_Columns.ToString();
|
||||
Console.WriteLine("_DefaultFormatColumns {0}", _DefaultFormatColumns);
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Format_Columns), ppLblStpEditorColsDefault, ppCmbxStpEditorCols);
|
||||
|
||||
// Get the default Disable Duplex
|
||||
_DefaultDisableDuplex = _ProcedureConfig.Print_DisableDuplex;
|
||||
ppLblAutoDuplexDefault.Text = string.Format("(Duplex {0})", (_DefaultDisableDuplex) ? "OFF" : "ON");
|
||||
|
||||
|
||||
_ProcedureConfig.ParentLookup = false;
|
||||
}
|
||||
|
||||
@@ -210,14 +217,19 @@ namespace VEPROMS
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxStpEditorCols_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcedureConfig.FormatColumns fc = (ProcedureConfig.FormatColumns)Enum.Parse(typeof(ProcedureConfig.FormatColumns), _DefaultFormatColumns);
|
||||
if ((ppCmbxStpEditorCols.SelectedIndex != -1) && ppCmbxStpEditorCols.SelectedValue.Equals(fc))
|
||||
{
|
||||
ppBtnDefEdCols.Focus();
|
||||
ppBtnDefEdCols.PerformClick();
|
||||
}
|
||||
ppBtnDefEdCols.Visible = ppCmbxStpEditorCols.SelectedValue != null;
|
||||
ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible;
|
||||
//if (!_Initializing)
|
||||
//{
|
||||
ProcedureConfig.FormatColumns fc = (ProcedureConfig.FormatColumns)Enum.Parse(typeof(ProcedureConfig.FormatColumns), _DefaultFormatColumns);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxStpEditorCols, fc, ppBtnDefEdCols, ppLblStpEditorColsDefault);
|
||||
//if ((ppCmbxStpEditorCols.SelectedIndex != -1) && ppCmbxStpEditorCols.SelectedValue.Equals(fc))
|
||||
//{
|
||||
// ppBtnDefEdCols.Focus();
|
||||
// ppBtnDefEdCols.PerformClick();
|
||||
//}
|
||||
//ppBtnDefEdCols.Visible = ppCmbxStpEditorCols.SelectedValue != null;
|
||||
//ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible;
|
||||
tcpGeneral.Focus();
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -236,6 +248,7 @@ namespace VEPROMS
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -254,14 +267,18 @@ namespace VEPROMS
|
||||
/// </summary>
|
||||
private void setEnabledUserSpecifiedChgBarCombos(ProcedureConfig.PrintChangeBar pcb)
|
||||
{
|
||||
ppGpbxUserSpecCB.Enabled =
|
||||
ppCmbxChgBarPos.Enabled =
|
||||
ppCmbxChgBarTxtType.Enabled =
|
||||
ppBtnDefaultCbPos.Enabled =
|
||||
ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) ||
|
||||
(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified));
|
||||
}
|
||||
//ppGpbxUserSpecCB.Enabled =
|
||||
//ppCmbxChgBarPos.Enabled =
|
||||
//ppCmbxChgBarTxtType.Enabled =
|
||||
//ppBtnDefaultCbPos.Enabled =
|
||||
//ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
// ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) ||
|
||||
// (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified));
|
||||
|
||||
ppGpbxUserSpecCB.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) ||
|
||||
(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Change Bar combo box changed.
|
||||
@@ -270,11 +287,13 @@ namespace VEPROMS
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
//Console.WriteLine("### SelectedValueChanged");
|
||||
if (!_Initializing)
|
||||
{
|
||||
ProcedureConfig.PrintChangeBar pcb = (ProcedureConfig.PrintChangeBar)Enum.Parse(typeof(ProcedureConfig.PrintChangeBar), _DefaultChgBarType);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault);
|
||||
setEnabledUserSpecifiedChgBarCombos(pcb);
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,9 +309,12 @@ namespace VEPROMS
|
||||
// Get the parent setting
|
||||
ProcedureConfig.PrintChangeBar pcb = (ProcedureConfig.PrintChangeBar)Enum.Parse(typeof(ProcedureConfig.PrintChangeBar), _DefaultChgBarType);
|
||||
// Compare parent setting with current setting
|
||||
_Initializing = true;
|
||||
if (pcb != _ProcedureConfig.Print_ChangeBar)
|
||||
_ProcedureConfig.Print_ChangeBar = pcb; // this will force a database update (write)
|
||||
ppCmbxChangeBarType.SelectedIndex = -1; //reset to the default Change Bar setting
|
||||
_Initializing = false;
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -306,6 +328,7 @@ namespace VEPROMS
|
||||
{
|
||||
ProcedureConfig.PrintChangeBarLoc cbl = (ProcedureConfig.PrintChangeBarLoc)Enum.Parse(typeof(ProcedureConfig.PrintChangeBarLoc), _DefaultChgBarLoc);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault);
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,6 +347,7 @@ namespace VEPROMS
|
||||
if (cbl != _ProcedureConfig.Print_ChangeBarLoc)
|
||||
_ProcedureConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write)
|
||||
ppCmbxChgBarPos.SelectedIndex = -1; //reset to the default Change Bar Position setting
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -338,6 +362,7 @@ namespace VEPROMS
|
||||
ProcedureConfig.PrintChangeBarText cbt = (ProcedureConfig.PrintChangeBarText)Enum.Parse(typeof(ProcedureConfig.PrintChangeBarText), _DefaultChgBarText);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault);
|
||||
setEnabledUserSpecifiedChgBarText();
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,6 +381,7 @@ namespace VEPROMS
|
||||
if (cbt != _ProcedureConfig.Print_ChangeBarText)
|
||||
_ProcedureConfig.Print_ChangeBarText = cbt; // this will force a database update (write)
|
||||
ppCmbxChgBarTxtType.SelectedIndex = -1; //reset to the default Change Bar Text Type setting
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -364,12 +390,20 @@ namespace VEPROMS
|
||||
/// </summary>
|
||||
private void setEnabledUserSpecifiedChgBarText()
|
||||
{
|
||||
ppGpbxUserSpecTxt.Enabled =
|
||||
ppTxbxChangeBarUserMsgOne.Enabled =
|
||||
ppTxbxChgBarUserMsgTwo.Enabled =
|
||||
ppBtnDefCbTxt1.Enabled =
|
||||
ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef));
|
||||
//ppGpbxUserSpecTxt.Enabled =
|
||||
//ppTxbxChangeBarUserMsgOne.Enabled =
|
||||
//ppTxbxChgBarUserMsgTwo.Enabled =
|
||||
//ppBtnDefCbTxt1.Enabled =
|
||||
//ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
//ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef));
|
||||
|
||||
// This string is used to check against our default setting to see if User Defined Changebar Text is active
|
||||
string decUserDef = ProcedureConfig.PrintChangeBarText.UserDef.ToString();
|
||||
|
||||
ppGpbxUserSpecTxt.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef)) ||
|
||||
(ppCmbxChgBarTxtType.SelectedIndex == -1 && _DefaultChgBarText.Equals(decUserDef));
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -397,6 +431,7 @@ namespace VEPROMS
|
||||
{
|
||||
ProcedureConfig.PrintPagination pgtn = (ProcedureConfig.PrintPagination)Enum.Parse(typeof(ProcedureConfig.PrintPagination), _DefaultPagination);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault);
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,6 +450,7 @@ namespace VEPROMS
|
||||
if (pgtn != _ProcedureConfig.Print_Pagination)
|
||||
_ProcedureConfig.Print_Pagination = pgtn; // this will force a database update (write)
|
||||
ppCmbxPagination.SelectedIndex = -1; //reset to the default Pagination setting
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -428,6 +464,7 @@ namespace VEPROMS
|
||||
{
|
||||
ProcedureConfig.PrintWatermark wtr = (ProcedureConfig.PrintWatermark)Enum.Parse(typeof(ProcedureConfig.PrintWatermark), _DefaultWatermark);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault);
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,15 +489,15 @@ namespace VEPROMS
|
||||
|
||||
#region View Settings tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the View Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnVwStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiViewStngs, btnVwStngs);
|
||||
}
|
||||
///// <summary>
|
||||
///// This is the View Settings button used on the button interface design
|
||||
///// </summary>
|
||||
///// <param name="sender">object</param>
|
||||
///// <param name="e">EventArgs</param>
|
||||
//private void btnVwStngs_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// ProcessButtonClick(tiViewStngs, btnVwStngs);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
@@ -481,6 +518,7 @@ namespace VEPROMS
|
||||
ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible;
|
||||
ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible;
|
||||
ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible;
|
||||
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -506,7 +544,7 @@ namespace VEPROMS
|
||||
btnGeneral.Checked = false;
|
||||
btnFmtStngs.Checked = false;
|
||||
btnOutputStngs.Checked = false;
|
||||
btnVwStngs.Checked = false;
|
||||
//btnVwStngs.Checked = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -519,7 +557,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();
|
||||
}
|
||||
|
||||
@@ -533,8 +571,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,8 +589,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;
|
||||
@@ -567,6 +610,7 @@ namespace VEPROMS
|
||||
{
|
||||
if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue))
|
||||
{
|
||||
button.Visible = true;
|
||||
button.Focus();
|
||||
button.PerformClick();
|
||||
}
|
||||
@@ -584,5 +628,89 @@ namespace VEPROMS
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppProcNumStpRTB;
|
||||
}
|
||||
|
||||
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 != _ProcedureConfig.Print_UserCBMess1)
|
||||
{
|
||||
_ProcedureConfig.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 != _ProcedureConfig.Print_UserCBMess2)
|
||||
{
|
||||
_ProcedureConfig.Print_UserCBMess2 = _DefaultChgBarUsrMsg2;
|
||||
ppLblChgBarUserMsgTwoDefault.Visible = false;
|
||||
ppBtnDefCbTxt2.Visible = false;
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private void ppBtnDefEdCols_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Get the parent setting
|
||||
ProcedureConfig.FormatColumns fc = (ProcedureConfig.FormatColumns)Enum.Parse(typeof(ProcedureConfig.FormatColumns), _DefaultFormatColumns);
|
||||
if (fc != _ProcedureConfig.Format_Columns)
|
||||
_ProcedureConfig.Format_Columns = fc; // this will force a database update (write)
|
||||
ppCmbxStpEditorCols.SelectedIndex = -1; //reset to the default
|
||||
//tcpGeneral.Focus();
|
||||
}
|
||||
|
||||
private void ppBtnDefWatermark_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
// Get the parent setting
|
||||
ProcedureConfig.PrintWatermark wtr = (ProcedureConfig.PrintWatermark)Enum.Parse(typeof(ProcedureConfig.PrintWatermark), _DefaultWatermark);
|
||||
// Compare parent setting with current setting
|
||||
if (wtr != _ProcedureConfig.Print_Watermark)
|
||||
_ProcedureConfig.Print_Watermark = wtr; // this will force a database update (write)
|
||||
ppCmbxWatermark.SelectedIndex = -1;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
private void ppBtnDeftDisAutoDuplx_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppChbxDisAutoDuplex.Checked = _DefaultDisableDuplex;
|
||||
_ProcedureConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked;
|
||||
ppBtnDeftDisAutoDuplx.Visible = false;
|
||||
ppLblAutoDuplexDefault.Visible = false;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDefCbTxt1.Visible = ((ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1));
|
||||
ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
private void ppTxbxChgBarUserMsgTwo_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDefCbTxt2.Visible = ((ppTxbxChgBarUserMsgTwo.Text != null) && !ppTxbxChgBarUserMsgTwo.Text.Equals(_DefaultChgBarUsrMsg2));
|
||||
ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (!_Initializing)
|
||||
{
|
||||
_ProcedureConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked;
|
||||
ppBtnDeftDisAutoDuplx.Visible = _DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked;
|
||||
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user