This commit is contained in:
@@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using VEPROMS.Properties;
|
||||
using DevComponents.DotNetBar;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -45,7 +46,13 @@ 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()
|
||||
{
|
||||
_SectionConfig.ParentLookup = true;
|
||||
// Get the default format name
|
||||
@@ -95,12 +102,37 @@ namespace VEPROMS
|
||||
_Initializing = false;
|
||||
}
|
||||
|
||||
#region General tab
|
||||
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
||||
/// <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)
|
||||
{
|
||||
ppCmbxFormat.SelectedIndex = -1;
|
||||
ProcessButtonClick(tiGeneral, btnGeneral);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Format tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the Format button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnFormat_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiFormat, btnFormat);
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
if ((ppCmbxFormat.SelectedIndex != -1) && _DefaultFormatName.Equals(ppCmbxFormat.SelectedValue))
|
||||
@@ -112,51 +144,58 @@ namespace VEPROMS
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
}
|
||||
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Library Document tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the Library Document button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiLibDoc, btnLibDocs);
|
||||
}
|
||||
|
||||
#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 btnViewStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiViewStnns, btnViewStngs);
|
||||
}
|
||||
|
||||
#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;
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
}
|
||||
|
||||
private void ppCbShwDefSettings_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
private void tabGeneral_Layout(object sender, LayoutEventArgs e)
|
||||
{
|
||||
if (!_Initializing)
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
private void btnGeneral_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcSectionProp.SelectedTab = tiGeneral;
|
||||
btnGeneral.Checked = true;
|
||||
}
|
||||
|
||||
private void btnFormat_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcSectionProp.SelectedTab = tiFormat;
|
||||
btnFormat.Checked = true;
|
||||
}
|
||||
|
||||
private void btnLibDocs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcSectionProp.SelectedTab = tiLibDoc;
|
||||
btnLibDocs.Checked = true;
|
||||
}
|
||||
|
||||
private void btnViewStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcSectionProp.SelectedTab = tiViewStnns;
|
||||
btnViewStngs.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;
|
||||
@@ -164,5 +203,33 @@ namespace VEPROMS
|
||||
btnLibDocs.Checked = false;
|
||||
btnViewStngs.Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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();
|
||||
tcSectionProp.SelectedTab = tab;
|
||||
button.Checked = true;
|
||||
}
|
||||
|
||||
/// <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();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user