This commit is contained in:
@@ -8,6 +8,8 @@ using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using VEPROMS.Properties;
|
||||
using DescriptiveEnum;
|
||||
using DevComponents.DotNetBar;
|
||||
using DevComponents.DotNetBar.Controls;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -32,7 +34,7 @@ namespace VEPROMS
|
||||
InitializeComponent();
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
_Initializing = false;
|
||||
// build the caption
|
||||
// build the title bar caption
|
||||
this.Text = string.Format("{0} {1} Properties", procedureConfig.Number, procedureConfig.Title);
|
||||
}
|
||||
|
||||
@@ -54,43 +56,30 @@ namespace VEPROMS
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void FindDefaultValues()
|
||||
/// <summary>
|
||||
/// Use the ParentLookup to grab the default values
|
||||
/// - set the watermark property (where applicable) of the control with that value
|
||||
/// - set the default setting labels with that value
|
||||
/// ** the default setting labels appear when the Show Default Values checkbox is checked by the user.
|
||||
/// </summary>
|
||||
private void FindDefaultValues()
|
||||
{
|
||||
_ProcedureConfig.ParentLookup = true;
|
||||
// Get the default format name
|
||||
_DefaultFormatName = _ProcedureConfig.DefaultFormatSelection;
|
||||
if (_DefaultFormatName != null && !(_DefaultFormatName.Equals("")))
|
||||
{
|
||||
ppLblFormatDefault.Text = string.Format("({0})", _DefaultFormatName);
|
||||
ppCmbxFormat.WatermarkText = string.Format("{0}", _DefaultFormatName);
|
||||
}
|
||||
SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat);
|
||||
|
||||
// Get the default Change Bar Type
|
||||
_DefaultChgBarType = _ProcedureConfig.Print_ChangeBar.ToString();
|
||||
if (!(_DefaultChgBarType.Equals("")))
|
||||
{
|
||||
string tstr = EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBar);
|
||||
ppLblChangeBarTypeDefault.Text = string.Format("({0})", tstr);
|
||||
ppCmbxChangeBarType.WatermarkText = string.Format("{0}", tstr);
|
||||
}
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBar), ppLblChangeBarTypeDefault, ppCmbxChangeBarType);
|
||||
|
||||
// Get the default Change Bar Location
|
||||
_DefaultChgBarLoc = _ProcedureConfig.Print_ChangeBarLoc.ToString();
|
||||
if (!(_DefaultChgBarLoc.Equals("")))
|
||||
{
|
||||
string tstr = EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarLoc);
|
||||
ppLblChgBarPosDefault.Text = string.Format("({0})", tstr);
|
||||
ppCmbxChgBarPos.WatermarkText = string.Format("{0}", tstr);
|
||||
}
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarLoc), ppLblChgBarPosDefault, ppCmbxChgBarPos);
|
||||
|
||||
// Get the default Change Bar text
|
||||
_DefaultChgBarText = _ProcedureConfig.Print_ChangeBarText.ToString();
|
||||
if (!(_DefaultChgBarText.Equals("")))
|
||||
{
|
||||
string tstr = EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarText);
|
||||
ppLblChgBarTxtTypeDefault.Text = string.Format("({0})", tstr);
|
||||
ppCmbxChgBarTxtType.WatermarkText = string.Format("{0}", tstr);
|
||||
}
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_ChangeBarText), ppLblChgBarTxtTypeDefault, ppCmbxChgBarTxtType);
|
||||
|
||||
// Get the default User Change Bar Message 1
|
||||
_DefaultChgBarUsrMsg1 = _ProcedureConfig.Print_UserCBMess1;
|
||||
@@ -102,52 +91,21 @@ namespace VEPROMS
|
||||
if (!(_DefaultChgBarUsrMsg2.Equals("")))
|
||||
ppLblChgBarUserMsgTwoDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg2);
|
||||
|
||||
// Get the default RO Graphic file extension
|
||||
//_DefaultROGraficFileExtension = _FolderConfig.Graphics_defaultext;
|
||||
//if (!(_DefaultROGraficFileExtension.Equals("")))
|
||||
// folderPropGraphicFileExtDefault.Text = string.Format("({0})", _DefaultROGraficFileExtension);
|
||||
|
||||
// Get the default Referenced Objects prefix
|
||||
//_DefaultROPrefix = _FolderConfig.Default_SPPrefix;
|
||||
//if (!(_DefaultROPrefix.Equals("")))
|
||||
// folderPropROPrefixDefault.Text = string.Format("({0})", _DefaultROPrefix);
|
||||
|
||||
// Get the default RO Graphics prefix
|
||||
//_DefaultImagePrefix = _FolderConfig.Default_IMPrefix;
|
||||
//if (!(_DefaultImagePrefix.Equals("")))
|
||||
// folderProptImagePrefixDefault.Text = string.Format("({0})", _DefaultImagePrefix);
|
||||
|
||||
// Get the default Print Pagination
|
||||
_DefaultPagination = _ProcedureConfig.Print_Pagination.ToString();
|
||||
if (!(_DefaultPagination.Equals("")))
|
||||
{
|
||||
string tstr = EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Pagination);
|
||||
ppLblPaginationDefault.Text = string.Format("({0})", tstr);
|
||||
ppCmbxPagination.WatermarkText = string.Format("{0}", tstr);
|
||||
}
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Pagination), ppLblPaginationDefault, ppCmbxPagination);
|
||||
|
||||
// Get the default Watermark
|
||||
_DefaultWatermark = _ProcedureConfig.Print_Watermark.ToString();
|
||||
if (!(_DefaultWatermark.Equals("")))
|
||||
{
|
||||
string tstr = EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Watermark);
|
||||
ppLblWatermarkDefault.Text = string.Format("({0})", tstr);
|
||||
ppCmbxWatermark.WatermarkText = string.Format("{0}", tstr);
|
||||
}
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Watermark), ppLblWatermarkDefault, ppCmbxWatermark);
|
||||
|
||||
// Get the default Format Columns
|
||||
_DefaultFormatColumns = _ProcedureConfig.Format_Columns.ToString();
|
||||
if (!(_DefaultFormatColumns.Equals("")))
|
||||
{
|
||||
string tstr = EnumDescConverter.GetEnumDescription(_ProcedureConfig.Format_Columns);
|
||||
ppLblStpEditorColsDefault.Text = string.Format("({0})", tstr);
|
||||
ppCmbxStpEditorCols.WatermarkText = string.Format("{0}", tstr);
|
||||
}
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Format_Columns), ppLblStpEditorColsDefault, ppCmbxStpEditorCols);
|
||||
|
||||
_ProcedureConfig.ParentLookup = false;
|
||||
}
|
||||
|
||||
|
||||
private void frmProcedureProperties_Load(object sender, EventArgs e)
|
||||
{
|
||||
_Initializing = true;
|
||||
@@ -157,7 +115,7 @@ namespace VEPROMS
|
||||
|
||||
// Get the saved settings for this user
|
||||
//
|
||||
// Get setting telling us whether to display the default values on this property page
|
||||
// This setting tells us if we should display the default values on this property page
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultProcedureProp"] != null) ? Settings.Default.ShowDefaultProcedureProp : false;
|
||||
|
||||
// Get the User's property page style "PropPageStyle"
|
||||
@@ -170,10 +128,10 @@ namespace VEPROMS
|
||||
this.Width -= panProcBtns.Width;
|
||||
}
|
||||
|
||||
|
||||
// Get the default values for the property page information
|
||||
FindDefaultValues();
|
||||
|
||||
// Assign the data sources to the combo boxes
|
||||
ppCmbxChgBarPos.DataSource = EnumDetail<ProcedureConfig.PrintChangeBarLoc>.Details();
|
||||
ppCmbxChgBarPos.DisplayMember = "Description";
|
||||
ppCmbxChgBarPos.ValueMember = "EValue";
|
||||
@@ -201,6 +159,202 @@ namespace VEPROMS
|
||||
_Initializing = false;
|
||||
}
|
||||
|
||||
#region General tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the General button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnGeneral_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiGeneral, btnGeneral);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Default Column Mode combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <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;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Format Settings tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the Format Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnFmtStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiFmtStngs, btnFmtStngs);
|
||||
}
|
||||
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Format combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable or disable the user specified change bar options base on the type
|
||||
/// of change bar selected.
|
||||
/// </summary>
|
||||
private void setEnabledUserSpecifiedChgBarCombos()
|
||||
{
|
||||
ppGpbxUserSpecCB.Enabled =
|
||||
ppCmbxChgBarPos.Enabled =
|
||||
ppCmbxChgBarTxtType.Enabled =
|
||||
ppBtnDefaultCbPos.Enabled =
|
||||
ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Change Bar combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcessCmbxSelectedValueChange(ppCmbxChangeBarType, _DefaultChgBarType, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault);
|
||||
setEnabledUserSpecifiedChgBarCombos();
|
||||
}
|
||||
|
||||
private void ppBtnDefaultChgBar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChangeBarType.SelectedIndex = -1; //reset to the default Change Bar setting
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Change Bar Position combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcessCmbxSelectedValueChange(ppCmbxChgBarPos, _DefaultChgBarLoc, ppBtnDefaultCbPos, ppLblChgBarPosDefault);
|
||||
}
|
||||
|
||||
private void ppBtnDefaultCbPos_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChgBarPos.SelectedIndex = -1; //reset to the default Change Bar Position setting
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Change Bar Text Type combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcessCmbxSelectedValueChange(ppCmbxChgBarTxtType, _DefaultChgBarText, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault);
|
||||
setEnabledUserSpecifiedChgBarText();
|
||||
}
|
||||
|
||||
private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChgBarTxtType.SelectedIndex = -1; //reset to the default Change Bar Text Type setting
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable or disable the user specified change bar text based on the selected
|
||||
/// change bar text type (selected in the user specific change bar grouping)
|
||||
/// </summary>
|
||||
private void setEnabledUserSpecifiedChgBarText()
|
||||
{
|
||||
ppGpbxUserSpecTxt.Enabled =
|
||||
ppTxbxChangeBarUserMsgOne.Enabled =
|
||||
ppTxbxChgBarUserMsgTwo.Enabled =
|
||||
ppBtnDefCbTxt1.Enabled =
|
||||
ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Output Settings tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the Output Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnOutputStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiOutputStngs, btnOutputStngs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Pagination combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcessCmbxSelectedValueChange(ppCmbxPagination, _DefaultPagination, ppBtnDefPagination, ppLblPaginationDefault);
|
||||
}
|
||||
|
||||
private void ppBtnDefPagination_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxPagination.SelectedIndex = -1; //reset to the default Pagination setting
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Watermark combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ProcessCmbxSelectedValueChange(ppCmbxWatermark, _DefaultWatermark, ppBtnDefWatermark, ppLblWatermarkDefault);
|
||||
}
|
||||
|
||||
private void ppBtnDefWatermark_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxWatermark.SelectedIndex = -1; //reset to the default Watermark setting
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#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);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
|
||||
/// <summary>
|
||||
/// Determines what labels (showing default values) are visable on the property pages
|
||||
/// </summary>
|
||||
private void defaultSettingsVisiblity()
|
||||
{
|
||||
ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked;
|
||||
@@ -216,176 +370,24 @@ namespace VEPROMS
|
||||
ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible;
|
||||
}
|
||||
|
||||
private void ckbxShowDefSettings_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxFormat.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxFormat.SelectedIndex != -1) && _DefaultFormatName.Equals(ppCmbxFormat.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultFmt.Focus();
|
||||
ppBtnDefaultFmt.PerformClick();
|
||||
}
|
||||
ppBtnDefaultFmt.Visible = (ppCmbxFormat.SelectedValue != null);
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
}
|
||||
|
||||
private void setEnabledUserSpecifiedChgBarCombos()
|
||||
{
|
||||
ppGpbxUserSpecCB.Enabled =
|
||||
ppCmbxChgBarPos.Enabled =
|
||||
ppCmbxChgBarTxtType.Enabled =
|
||||
ppBtnDefaultCbPos.Enabled =
|
||||
ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified));
|
||||
}
|
||||
|
||||
private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxChgBarPos.SelectedIndex != -1) && _DefaultChgBarType.Equals(ppCmbxChangeBarType.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultChgBar.Focus();
|
||||
ppBtnDefaultChgBar.PerformClick();
|
||||
}
|
||||
ppBtnDefaultChgBar.Visible = (ppCmbxChangeBarType.SelectedValue != null);
|
||||
ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible;
|
||||
setEnabledUserSpecifiedChgBarCombos();
|
||||
}
|
||||
|
||||
private void ppBtnDefaultChgBar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChangeBarType.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxChgBarPos.SelectedIndex != -1) && _DefaultChgBarLoc.Equals(ppCmbxChgBarPos.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultCbPos.Focus();
|
||||
ppBtnDefaultCbPos.PerformClick();
|
||||
}
|
||||
ppBtnDefaultCbPos.Visible = (ppCmbxChgBarPos.SelectedValue != null);
|
||||
ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible;
|
||||
}
|
||||
|
||||
private void ppBtnDefaultCbPos_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChgBarPos.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChgBarTxtType.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void setEnabledUserSpecifiedChgBarText()
|
||||
{
|
||||
ppGpbxUserSpecTxt.Enabled =
|
||||
ppTxbxChangeBarUserMsgOne.Enabled =
|
||||
ppTxbxChgBarUserMsgTwo.Enabled =
|
||||
ppBtnDefCbTxt1.Enabled =
|
||||
ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef));
|
||||
}
|
||||
|
||||
private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxChgBarTxtType.SelectedIndex != -1) && _DefaultChgBarText.Equals(ppCmbxChgBarTxtType.SelectedValue))
|
||||
{
|
||||
ppBtnDefCbTxtTyp.Focus();
|
||||
ppBtnDefCbTxtTyp.PerformClick();
|
||||
}
|
||||
ppBtnDefCbTxtTyp.Visible = (ppCmbxChgBarTxtType.SelectedValue != null);
|
||||
ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible;
|
||||
setEnabledUserSpecifiedChgBarText();
|
||||
}
|
||||
|
||||
private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxPagination.SelectedIndex != -1) && _DefaultPagination.Equals(ppCmbxPagination.SelectedValue))
|
||||
{
|
||||
ppBtnDefPagination.Focus();
|
||||
ppBtnDefPagination.PerformClick();
|
||||
}
|
||||
ppBtnDefPagination.Visible = ppCmbxPagination.SelectedValue != null;
|
||||
ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible;
|
||||
}
|
||||
|
||||
private void ppBtnDefPagination_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxPagination.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxWatermark.SelectedIndex != -1) && _DefaultWatermark.Equals(ppCmbxWatermark.SelectedValue))
|
||||
{
|
||||
ppBtnDefWatermark.Focus();
|
||||
ppBtnDefWatermark.PerformClick();
|
||||
}
|
||||
ppBtnDefWatermark.Visible = ppCmbxWatermark.SelectedValue != null;
|
||||
ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible;
|
||||
}
|
||||
|
||||
private void ppBtnDefWatermark_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxWatermark.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private void tabGeneral_Layout(object sender, LayoutEventArgs e)
|
||||
{
|
||||
// Note this is called for all the tabs
|
||||
if (!_Initializing)
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
private void btnGeneral_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// Select the corresponding tab and set the button's state to checked
|
||||
/// </summary>
|
||||
/// <param name="tab">Property Page Tab</param>
|
||||
/// <param name="button">Corresponding Property Page Button</param>
|
||||
private void ProcessButtonClick(TabItem tab, ButtonX button)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcProcProp.SelectedTab = tiGeneral;
|
||||
btnGeneral.Checked = true;
|
||||
}
|
||||
|
||||
private void btnFmtStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcProcProp.SelectedTab = tiFmtStngs;
|
||||
btnFmtStngs.Checked = true;
|
||||
}
|
||||
|
||||
private void btnOutputStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcProcProp.SelectedTab = tiOutputStngs;
|
||||
btnOutputStngs.Checked = true;
|
||||
}
|
||||
|
||||
private void btnVwStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcProcProp.SelectedTab = tiViewStngs;
|
||||
btnVwStngs.Checked = true;
|
||||
tcProcProp.SelectedTab = tab;
|
||||
button.Checked = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For the Button Interface property page style, when a button is selected (pressed),
|
||||
/// it will remain in the checked state even when a different button is selected. Thus
|
||||
/// we must clear the checked state of the buttons when a button is selected, then set
|
||||
/// the newly selected button's state to checked.
|
||||
/// </summary>
|
||||
private void ClearAllCheckedButtons()
|
||||
{
|
||||
btnGeneral.Checked = false;
|
||||
@@ -393,5 +395,53 @@ namespace VEPROMS
|
||||
btnOutputStngs.Checked = false;
|
||||
btnVwStngs.Checked = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is a generic Enter Event function for use with all of the property page tabs.
|
||||
/// Found that the visiblity value of buttons is not recorded until the property page in which it resides is diplayed.
|
||||
/// Thus we need to call defaultSettingVisiblity() to check and set visiblity states.
|
||||
/// </summary>
|
||||
/// <param name="sender"> type object</param>
|
||||
/// <param name="e">type EventArgs</param>
|
||||
private void tabpage_Enter(object sender, EventArgs e)
|
||||
{
|
||||
// Show or hide the labels containing the default values
|
||||
if (!_Initializing)
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the watermark and default label
|
||||
/// </summary>
|
||||
/// <param name="defaultText">The default text</param>
|
||||
/// <param name="lbl">Label that displays the current default when view defaults is set</param>
|
||||
/// <param name="cmboEx">Combo box with a watermark property</param>
|
||||
private static void SetupDefault(string defaultText, Label lbl, ComboBoxEx cmbo)
|
||||
{
|
||||
if (defaultText != null && !(defaultText.Equals("")))
|
||||
{
|
||||
lbl.Text = string.Format("({0})", defaultText);
|
||||
cmbo.WatermarkText = string.Format("{0}", defaultText);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process a change in the combo box selection
|
||||
/// </summary>
|
||||
/// <param name="cmbx">Combo Box Name</param>
|
||||
/// <param name="defstr">string containing default text</param>
|
||||
/// <param name="button">button to reset to default value</param>
|
||||
/// <param name="deflabel">label containing the default</param>
|
||||
private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel)
|
||||
{
|
||||
if ((cmbx.SelectedIndex != -1) && defstr.Equals(cmbx.SelectedValue))
|
||||
{
|
||||
button.Focus();
|
||||
button.PerformClick();
|
||||
}
|
||||
button.Visible = cmbx.SelectedValue != null;
|
||||
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user