633 lines
23 KiB
C#
633 lines
23 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.IO;
|
|
using VEPROMS.CSLA.Library;
|
|
using System.Drawing.Imaging;
|
|
using VEPROMS.Properties;
|
|
using DescriptiveEnum;
|
|
using DevComponents.DotNetBar;
|
|
using DevComponents.DotNetBar.Controls;
|
|
|
|
namespace VEPROMS
|
|
{
|
|
public partial class frmVersionsProperties : DevComponents.DotNetBar.Office2007Form
|
|
{
|
|
// Default values
|
|
private string _DefaultFormatName = null;
|
|
private string _DefaultROGraficFileExtension = null;
|
|
private string _DefaultROPrefix = null;
|
|
private string _DefaultImagePrefix = null;
|
|
private string _DefaultPagination = null;
|
|
private string _DefaultWatermark = null;
|
|
private string _DefaultChgBarType = null;
|
|
private string _DefaultChgBarLoc = null;
|
|
private string _DefaultChgBarText = null;
|
|
private string _DefaultChgBarUsrMsg1 = null;
|
|
private string _DefaultChgBarUsrMsg2 = null;
|
|
private bool _DefaultDisableDuplex = false;
|
|
//
|
|
private bool _Initializing;
|
|
private DocVersionConfig _DocVersionConfig;
|
|
|
|
public frmVersionsProperties(DocVersionConfig docVersionConfig)
|
|
{
|
|
_DocVersionConfig = docVersionConfig;
|
|
_Initializing = true;
|
|
InitializeComponent();
|
|
btnGeneral.PerformClick(); // always start with General tab or button
|
|
_Initializing = false;
|
|
//build the caption
|
|
this.Text = string.Format("{0} Properties",_DocVersionConfig.Name);
|
|
}
|
|
|
|
private void btnFlderPropOK_Click(object sender, EventArgs e)
|
|
{
|
|
docVersionConfigBindingSource.EndEdit();
|
|
// Save Default settings for User
|
|
//
|
|
// Save whether we should display the default values on this property page
|
|
Settings.Default.ShowDefaultVersionProp = ppCbShwDefSettings.Checked;
|
|
Settings.Default.Save();
|
|
DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
private void btnFldrPropCancel_Click(object sender, EventArgs e)
|
|
{
|
|
docVersionConfigBindingSource.CancelEdit();
|
|
this.Close();
|
|
}
|
|
|
|
/// <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()
|
|
{
|
|
_DocVersionConfig.ParentLookup = true;
|
|
|
|
// get default format
|
|
_DefaultFormatName = _DocVersionConfig.DefaultFormatSelection;
|
|
SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat);
|
|
|
|
// Get the default Change Bar Type
|
|
_DefaultChgBarType = _DocVersionConfig.Print_ChangeBar.ToString();
|
|
SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_ChangeBar), ppLblChangeBarTypeDefault, ppCmbxChangeBarType);
|
|
|
|
// Get the default Change Bar Location
|
|
_DefaultChgBarLoc = _DocVersionConfig.Print_ChangeBarLoc.ToString();
|
|
SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_ChangeBarLoc), ppLblChgBarPosDefault, ppCmbxChgBarPos);
|
|
|
|
// Get the default Change Bar text
|
|
_DefaultChgBarText = _DocVersionConfig.Print_ChangeBarText.ToString();
|
|
SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_ChangeBarText), ppLblChgBarTxtTypeDefault, ppCmbxChgBarTxtType);
|
|
|
|
// Get the default User Change Bar Message 1
|
|
_DefaultChgBarUsrMsg1 = _DocVersionConfig.Print_UserCBMess1;
|
|
if (!(_DefaultChgBarUsrMsg1.Equals("")))
|
|
{
|
|
ppLblChgBarUserMsgOneDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg1);
|
|
}
|
|
|
|
// Get the default User Change Bar Message 2
|
|
_DefaultChgBarUsrMsg2 = _DocVersionConfig.Print_UserCBMess2;
|
|
if (!(_DefaultChgBarUsrMsg2.Equals("")))
|
|
{
|
|
ppLblChgBarUserMsgTwoDefault.Text = string.Format("{0}", _DefaultChgBarUsrMsg2);
|
|
}
|
|
|
|
// Get the default RO Graphic file extension
|
|
_DefaultROGraficFileExtension = _DocVersionConfig.Graphics_defaultext;
|
|
SetupDefault(_DefaultROGraficFileExtension, ppLblGraphicFileExtDefault, ppCmbxGrphFileExt);
|
|
|
|
// Get the default Referenced Objects prefix
|
|
_DefaultROPrefix = _DocVersionConfig.RODefaults_setpointprefix;
|
|
SetupDefault(_DefaultROPrefix, ppLblROPrefixDefault, ppCmbxDefROPrefix);
|
|
|
|
// Get the default RO Graphics prefix
|
|
_DefaultImagePrefix = _DocVersionConfig.RODefaults_graphicsprefix;
|
|
SetupDefault(_DefaultImagePrefix, ppLblImagePrefixDefault, ppCmbxDefImgPrefix);
|
|
|
|
// Get the default Print Pagination
|
|
_DefaultPagination = _DocVersionConfig.Print_Pagination.ToString();
|
|
SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_Pagination), ppLblPaginationDefault, ppCmbxPagination);
|
|
|
|
|
|
// Get the default Watermark
|
|
_DefaultWatermark = _DocVersionConfig.Print_Watermark.ToString();
|
|
SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_Watermark), ppLblWatermarkDefault, ppCmbxWatermark);
|
|
|
|
// Get the default Disable Duplex
|
|
_DefaultDisableDuplex = _DocVersionConfig.Print_DisableDuplex;
|
|
ppLblAutoDuplexDefault.Text = string.Format("(Duplex {0})", (_DefaultDisableDuplex) ? "OFF" : "ON");
|
|
|
|
_DocVersionConfig.ParentLookup = false;
|
|
}
|
|
|
|
|
|
private void frmVersionsProperties_Load(object sender, EventArgs e)
|
|
{
|
|
// populate the a list box of possible graphic file types
|
|
// supported by .NET
|
|
//foreach (ImageCodecInfo info in ImageCodecInfo.GetImageDecoders())
|
|
//{
|
|
// string st = string.Format("{0} - ({1})", info.FormatDescription, info.FilenameExtension);
|
|
// comboBoxEx1.Items.Add(st);
|
|
//}
|
|
|
|
docVersionConfigBindingSource.DataSource = _DocVersionConfig;
|
|
|
|
formatInfoListBindingSource.DataSource = FormatInfoList.Get();
|
|
imageCodecInfoBindingSource.DataSource = ImageCodecInfo.GetImageDecoders();
|
|
|
|
// Get the saved settings for this user
|
|
//
|
|
// Get setting telling us whether to display the default values on this property page
|
|
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultVersionProp"] != null) ? Settings.Default.ShowDefaultVersionProp : false;
|
|
|
|
// Get the User's property page style "PropPageStyle" (this is a system wide user setting)
|
|
// 1 - Button Dialog (default)
|
|
// 2 - Tab Dialog
|
|
if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab)
|
|
{
|
|
tcVersions.TabsVisible = true;
|
|
panVerBtns.Visible = false;
|
|
this.Width -= panVerBtns.Width;
|
|
}
|
|
|
|
// Get the default values for the property page information
|
|
FindDefaultValues();
|
|
|
|
ppCmbxChangeBarType.DataSource = EnumDetail<DocVersionConfig.PrintChangeBar>.Details();
|
|
ppCmbxChangeBarType.DisplayMember = "Description";
|
|
ppCmbxChangeBarType.ValueMember = "EValue";
|
|
|
|
ppCmbxChgBarPos.DataSource = EnumDetail<DocVersionConfig.PrintChangeBarLoc>.Details();
|
|
ppCmbxChgBarPos.DisplayMember = "Description";
|
|
ppCmbxChgBarPos.ValueMember = "EValue";
|
|
|
|
ppCmbxChgBarTxtType.DataSource = EnumDetail<DocVersionConfig.PrintChangeBarText>.Details();
|
|
ppCmbxChgBarTxtType.DisplayMember = "Description";
|
|
ppCmbxChgBarTxtType.ValueMember = "EValue";
|
|
|
|
ppCmbxWatermark.DataSource = EnumDetail<DocVersionConfig.PrintWatermark>.Details();
|
|
ppCmbxWatermark.DisplayMember = "Description";
|
|
ppCmbxWatermark.ValueMember = "EValue";
|
|
|
|
ppCmbxPagination.DataSource = EnumDetail<DocVersionConfig.PrintPagination>.Details();
|
|
ppCmbxPagination.DisplayMember = "Description";
|
|
ppCmbxPagination.ValueMember = "EValue";
|
|
|
|
ppCmbxProcSetType.DataSource = EnumDetail<VersionTypeEnum>.Details();
|
|
ppCmbxProcSetType.DisplayMember = "Description";
|
|
ppCmbxProcSetType.ValueMember = "EValue";
|
|
|
|
}
|
|
|
|
#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);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Referenced Objects
|
|
|
|
/// <summary>
|
|
/// This is the Referenced Objects button used on the button interface design
|
|
/// </summary>
|
|
/// <param name="sender">object</param>
|
|
/// <param name="e">EventArgs</param>
|
|
private void btnRefObjs_Click(object sender, EventArgs e)
|
|
{
|
|
ProcessButtonClick(tiRefObjs, btnRefObjs);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is a temporary function for demo purposes...
|
|
/// Display the standard folder selection dialog to have the user select the location of the Referenced Objects folder.
|
|
/// From this, we will use the RO.FST to populate the RO and Image Accessory ID cobmo boxes.
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void ppBtnFldrDlg_Click(object sender, EventArgs e)
|
|
{
|
|
dlgROFolder = new FolderBrowserDialog();
|
|
if (dlgROFolder.ShowDialog() == DialogResult.OK)
|
|
{
|
|
ppTxbxRoFoldLoc.Text = dlgROFolder.SelectedPath;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// TEMPORARY - TO PROVIDE DEMO FUNCTIONALITY
|
|
/// An RO Folder was selected, find the RO.FST file and populate the RO and Image database combo boxes
|
|
/// </summary>
|
|
/// <param name="sender">object</param>
|
|
/// <param name="e">EventArgs</param>
|
|
private void ppTxbxRoFoldLoc_TextChanged(object sender, EventArgs e)
|
|
{
|
|
string tpath = ppTxbxRoFoldLoc.Text + "\\RO.FST";
|
|
if (File.Exists(tpath))
|
|
{
|
|
ROFST rofst = new ROFST(tpath);
|
|
ROFST.rodbi[] rodblist = rofst.GetRODatabaseList();
|
|
for (int i = 0; i < rodblist.Length; i++)
|
|
{
|
|
string mitem = string.Format("{0} - {1}", rodblist[i].dbiTitle, rodblist[i].dbiAP);
|
|
switch (rodblist[i].dbiType)
|
|
{
|
|
case 7: ppCmbxDefROPrefix.Items.Add(mitem); //cmbxROdbList.Items.Add(mitem); // setpoint
|
|
break;
|
|
case 8: ppCmbxDefImgPrefix.Items.Add(mitem); //cmbxIGdbList.Items.Add(mitem); // graphic
|
|
break;
|
|
default: // user defined
|
|
ppCmbxDefROPrefix.Items.Add(mitem); //cmbxROdbList.Items.Add(mitem);
|
|
ppCmbxDefImgPrefix.Items.Add(mitem);//cmbxIGdbList.Items.Add(mitem);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Selection in Graphic File Extension combo box changed.
|
|
/// </summary>
|
|
/// <param name="sender">object</param>
|
|
/// <param name="e">EventArgs</param>
|
|
private void ppCmbxGrphFileExt_SelectedValueChanged(object sender, EventArgs e)
|
|
{
|
|
ProcessCmbxSelectedValueChange(ppCmbxGrphFileExt, _DefaultROGraficFileExtension, ppBtnDefaultGrfExt, ppLblGraphicFileExtDefault);
|
|
}
|
|
|
|
private void ppBtnDefaultGrfExt_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxGrphFileExt.SelectedIndex = -1;
|
|
}
|
|
|
|
private void ppCmbxDefROPrefix_TextChanged(object sender, EventArgs e)
|
|
{
|
|
// TEMPORARY
|
|
// Just to simulate selection from the drop down list
|
|
// Once the DataSource is established, we can use the SelectedValueChanged()
|
|
//folderPropROPrefixDefault.Visible =
|
|
ppBtnDefaultROPrefix.Visible = (ppCmbxDefROPrefix.SelectedItem != null);
|
|
|
|
}
|
|
|
|
private void ppBtnDefaultROPrefix_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxDefROPrefix.SelectedIndex = -1;
|
|
}
|
|
|
|
private void ppCmbxDefImgPrefix_TextChanged(object sender, EventArgs e)
|
|
{
|
|
// TEMPORARY
|
|
// Just to simulate selection from the drop down list
|
|
// Once the DataSource is established, we can use the SelectedValueChanged()
|
|
//folderProptImagePrefixDefault.Visible =
|
|
ppBtnDefaultImgPrefix.Visible = (ppCmbxDefImgPrefix.SelectedItem != null);
|
|
}
|
|
|
|
private void ppBtnDefaultImgPrefix_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxDefImgPrefix.SelectedIndex = -1;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Output Settings
|
|
|
|
/// <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 btnOutputSettings_Click(object sender, EventArgs e)
|
|
{
|
|
ProcessButtonClick(tiOutputSettings, btnOutputSettings);
|
|
}
|
|
|
|
/// <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)
|
|
{
|
|
DocVersionConfig.PrintPagination pgtn = (DocVersionConfig.PrintPagination)Enum.Parse(typeof(DocVersionConfig.PrintPagination), _DefaultPagination);
|
|
ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault);
|
|
}
|
|
|
|
private void ppBtnDefPagination_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxPagination.SelectedIndex = -1;
|
|
}
|
|
|
|
/// <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)
|
|
{
|
|
DocVersionConfig.PrintWatermark wtr = (DocVersionConfig.PrintWatermark)Enum.Parse(typeof(DocVersionConfig.PrintWatermark), _DefaultWatermark);
|
|
ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault);
|
|
}
|
|
|
|
private void ppBtnDefWatermark_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxWatermark.SelectedIndex = -1;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Format Settings
|
|
|
|
/// <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 btnFmtSettings_Click(object sender, EventArgs e)
|
|
{
|
|
ProcessButtonClick(tiFmtSettings, btnFmtSettings);
|
|
}
|
|
|
|
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxFormat.SelectedIndex = -1;
|
|
}
|
|
|
|
/// <summary>
|
|
/// If checked, will disable automatic duplexing (ex Foldout Pages)
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
ppBtnDeftDisAutoDuplx.Visible = (_DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked);
|
|
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
|
|
|
|
}
|
|
|
|
/// <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(DocVersionConfig.PrintChangeBar pcb)
|
|
{
|
|
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));
|
|
}
|
|
|
|
/// <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)
|
|
{
|
|
DocVersionConfig.PrintChangeBar pcb = (DocVersionConfig.PrintChangeBar)Enum.Parse(typeof(DocVersionConfig.PrintChangeBar), _DefaultChgBarType);
|
|
ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault);
|
|
setEnabledUserSpecifiedChgBarCombos(pcb);
|
|
}
|
|
|
|
private void ppBtnDefaultChgBar_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxChangeBarType.SelectedIndex = -1;
|
|
}
|
|
|
|
/// <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)
|
|
{
|
|
DocVersionConfig.PrintChangeBarLoc cbl = (DocVersionConfig.PrintChangeBarLoc)Enum.Parse(typeof(DocVersionConfig.PrintChangeBarLoc), _DefaultChgBarLoc);
|
|
ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault);
|
|
}
|
|
|
|
private void ppBtnDefaultCbPos_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxChgBarPos.SelectedIndex = -1;
|
|
}
|
|
|
|
/// <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 =
|
|
ppTxbxChangeBarUserMsgTwo.Enabled =
|
|
ppBtnDefCbTxt1.Enabled =
|
|
ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
|
ppCmbxChgBarTxtType.SelectedValue.Equals(DocVersionConfig.PrintChangeBarText.UserDef));
|
|
}
|
|
|
|
/// <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)
|
|
{
|
|
DocVersionConfig.PrintChangeBarText cbt = (DocVersionConfig.PrintChangeBarText)Enum.Parse(typeof(DocVersionConfig.PrintChangeBarText), _DefaultChgBarText);
|
|
ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault);
|
|
setEnabledUserSpecifiedChgBarText();
|
|
}
|
|
|
|
private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e)
|
|
{
|
|
ppCmbxChgBarTxtType.SelectedIndex = -1;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Selection in Change Bar User Message One text changed.
|
|
/// </summary>
|
|
/// <param name="sender">object</param>
|
|
/// <param name="e">EventArgs</param>
|
|
private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e)
|
|
{
|
|
ppBtnDefCbTxt1.Visible = (ppTxbxChangeBarUserMsgOne.Text != null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Selection in Change Bar User Message Two text changed.
|
|
/// </summary>
|
|
/// <param name="sender">object</param>
|
|
/// <param name="e">EventArgs</param>
|
|
private void ppTxbxChangeBarUserMsgTwo_TextChanged(object sender, EventArgs e)
|
|
{
|
|
ppBtnDefCbTxt2.Visible = (ppTxbxChangeBarUserMsgTwo.Text != null);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Library Documents
|
|
|
|
/// <summary>
|
|
/// This is the Library Documents 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(tiLibDocs, btnLibDocs);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Generic functions used on this property page
|
|
|
|
/// <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>
|
|
/// Determines what labels (showing default values) are visable on the property pages
|
|
/// </summary>
|
|
private void defaultSettingsVisiblity()
|
|
{
|
|
ppLblChgBarUserMsgOneDefault.Visible =
|
|
ppLblChgBarUserMsgTwoDefault.Visible =
|
|
ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked;
|
|
|
|
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
|
ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible;
|
|
ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible;
|
|
ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible;
|
|
ppLblGraphicFileExtDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultGrfExt.Visible;
|
|
ppLblROPrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultROPrefix.Visible;
|
|
ppLblImagePrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultImgPrefix.Visible;
|
|
ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible;
|
|
ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible;
|
|
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
|
|
}
|
|
|
|
/// <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;
|
|
btnRefObjs.Checked = false;
|
|
btnOutputSettings.Checked = false;
|
|
btnFmtSettings.Checked = false;
|
|
btnLibDocs.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();
|
|
tcVersions.SelectedTab = tab;
|
|
button.Checked = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Process a change in the enum combo box selection
|
|
/// </summary>
|
|
/// <param name="cmbx">Combo Box Name</param>
|
|
/// <param name="defstr">the default enum value</param>
|
|
/// <param name="button">button to reset to default value</param>
|
|
/// <param name="deflabel">label containing the default</param>
|
|
private void ProcessCmbxSelectionEnumChanged(ComboBoxEx cmbx, object enumval, ButtonX button, Label deflabel)
|
|
{
|
|
if ((cmbx.SelectedIndex != -1) &&
|
|
cmbx.SelectedValue.Equals(enumval))
|
|
{
|
|
button.Focus();
|
|
button.PerformClick();
|
|
}
|
|
button.Visible = (cmbx.SelectedValue != null);
|
|
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
|
}
|
|
|
|
/// <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;
|
|
}
|
|
/// <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);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
} |