This commit is contained in:
759
PROMS/VEPROMS_UI/frmFolderProperties.cs
Normal file
759
PROMS/VEPROMS_UI/frmFolderProperties.cs
Normal file
@@ -0,0 +1,759 @@
|
||||
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 DevComponents;
|
||||
using DevComponents.DotNetBar.Controls;
|
||||
using System.Drawing.Imaging;
|
||||
using VEPROMS.Properties;
|
||||
using DataLoader;
|
||||
using DescriptiveEnum;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class frmFolderProperties : DevComponents.DotNetBar.Office2007Form
|
||||
{
|
||||
private string _DefaultFormatName = null;
|
||||
private string _DefaultChgBarType = null;
|
||||
private string _DefaultChgBarLoc = null;
|
||||
private string _DefaultChgBarText = null;
|
||||
private string _DefaultChgBarUsrMsg1 = null;
|
||||
private string _DefaultChgBarUsrMsg2 = null;
|
||||
private string _DefaultROGraficFileExtension = null;
|
||||
private string _DefaultImagePrefix = null;
|
||||
private string _DefaultROPrefix = null;
|
||||
private string _DefaultPagination = null;
|
||||
private string _DefaultWatermark = null;
|
||||
private bool _DefaultDisableDuplex = false;
|
||||
private string _DefaultFormatColumns = null;
|
||||
private bool _Initializing = false;
|
||||
private FolderConfig _FolderConfig;
|
||||
private string _ROcolor;
|
||||
private string _TransColor;
|
||||
private string _EditBckgndColor;
|
||||
private string _ViewBckgndColor;
|
||||
|
||||
public frmFolderProperties(FolderConfig folderConfig)
|
||||
{
|
||||
_FolderConfig = folderConfig;
|
||||
_Initializing = true;
|
||||
InitializeComponent();
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
_Initializing = false;
|
||||
// Build window caption
|
||||
this.Text = string.Format("{0} Properties",folderConfig.Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert the given System.Drawing.Color to a string containing either the color's name or the Argb.
|
||||
/// </summary>
|
||||
/// <param name="c">System.Drawing.Color</param>
|
||||
/// <returns></returns>
|
||||
private string strMakeColorName(Color c)
|
||||
{
|
||||
string rtnstring = "";
|
||||
if (c.IsNamedColor)
|
||||
rtnstring = c.Name;
|
||||
else
|
||||
rtnstring = string.Format("[A={0},R={1},G={2},B={3}]", c.A, c.R, c.G, c.B);
|
||||
return rtnstring;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a System.Drawing.Color from an Argb or color name
|
||||
/// </summary>
|
||||
/// <param name="strColor">Color Name or "[(alpha,)red,green,blue]"</param>
|
||||
/// <returns></returns>
|
||||
// a copy of this function was put in frmVEPROMS.CS
|
||||
private static Color cGetColor(string strColor)
|
||||
{
|
||||
Color rtnColor; // = new Color();
|
||||
if (strColor == null || strColor.Equals(""))
|
||||
rtnColor = Color.White;
|
||||
else
|
||||
{
|
||||
if (strColor[0] == '[')
|
||||
{
|
||||
string[] parts = strColor.Substring(1, strColor.Length - 2).Split(",".ToCharArray());
|
||||
int parts_cnt = 0;
|
||||
foreach (string s in parts)
|
||||
{
|
||||
parts[parts_cnt] = parts[parts_cnt].TrimStart(' '); // remove preceeding blanks
|
||||
parts_cnt++;
|
||||
}
|
||||
if (parts_cnt == 3)
|
||||
rtnColor = Color.FromArgb(Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2]));
|
||||
else
|
||||
rtnColor = Color.FromArgb(Int32.Parse(parts[0].Substring(2)), Int32.Parse(parts[1].Substring(2)), Int32.Parse(parts[2].Substring(2)), Int32.Parse(parts[3].Substring(2)));
|
||||
}
|
||||
else rtnColor = Color.FromName(strColor);
|
||||
}
|
||||
return rtnColor;
|
||||
}
|
||||
|
||||
/// <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()
|
||||
{
|
||||
_FolderConfig.ParentLookup = true;
|
||||
// Get the default format name
|
||||
_DefaultFormatName = _FolderConfig.DefaultFormatSelection;
|
||||
SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat);
|
||||
|
||||
// Get the default Change Bar Type
|
||||
_DefaultChgBarType = _FolderConfig.Print_ChangeBar.ToString();
|
||||
SetupDefault(_DefaultChgBarType, ppLblChangeBarTypeDefault, ppCmbxChangeBarType);
|
||||
|
||||
// Get the default Change Bar Location
|
||||
_DefaultChgBarLoc = _FolderConfig.Print_ChangeBarLoc.ToString();
|
||||
SetupDefault(_DefaultChgBarLoc, ppLblChgBarPosDefault, ppCmbxChgBarPos);
|
||||
|
||||
// Get the default Change Bar text
|
||||
_DefaultChgBarText = _FolderConfig.Print_ChangeBarText.ToString();
|
||||
SetupDefault(_DefaultChgBarText, ppLblChgBarTxtTypeDefault, ppCmbxChgBarTxtType);
|
||||
|
||||
// Get the default User Change Bar Message 1
|
||||
_DefaultChgBarUsrMsg1 = _FolderConfig.Print_UserCBMess1;
|
||||
if (!(_DefaultChgBarUsrMsg1.Equals("")))
|
||||
ppLblChgBarUserMsgOneDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg1);
|
||||
|
||||
// Get the default User Change Bar Message 2
|
||||
_DefaultChgBarUsrMsg2 = _FolderConfig.Print_UserCBMess2;
|
||||
if (!(_DefaultChgBarUsrMsg2.Equals("")))
|
||||
ppLblChgBarUserMsgTwoDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg2);
|
||||
|
||||
// Get the default RO Graphic file extension
|
||||
_DefaultROGraficFileExtension = _FolderConfig.Graphics_defaultext;
|
||||
SetupDefault(_DefaultROGraficFileExtension, ppLblGraphicFileExtDefault, ppCmbxGrphFileExt);
|
||||
|
||||
// Get the default Referenced Objects prefix
|
||||
_DefaultROPrefix = _FolderConfig.Default_SPPrefix;
|
||||
SetupDefault(_DefaultROPrefix, ppLblROPrefixDefault, ppCmbxDefROPrefix);
|
||||
|
||||
// Get the default RO Graphics prefix
|
||||
_DefaultImagePrefix = _FolderConfig.Default_IMPrefix;
|
||||
SetupDefault(_DefaultImagePrefix, ppLblImagePrefixDefault, ppCmbxDefImgPrefix);
|
||||
|
||||
// Get the default Print Pagination
|
||||
_DefaultPagination = _FolderConfig.Print_Pagination.ToString();
|
||||
SetupDefault(_DefaultPagination, ppLblPaginationDefault, ppCmbxPagination);
|
||||
|
||||
// Get the default Watermark
|
||||
_DefaultWatermark = _FolderConfig.Print_Watermark.ToString();
|
||||
SetupDefault(_DefaultWatermark, ppLblWatermarkDefault, ppCmbxWatermark);
|
||||
|
||||
// Get the default Disable Duplex
|
||||
_DefaultDisableDuplex = _FolderConfig.Print_DisableDuplex;
|
||||
ppLblAutoDuplexDefault.Text = string.Format("(Duplex {0})", (_DefaultDisableDuplex) ? "OFF" : "ON");
|
||||
|
||||
// Get the default Format Columns
|
||||
_DefaultFormatColumns = _FolderConfig.Format_Columns.ToString();
|
||||
SetupDefault(_DefaultFormatColumns, ppLblStpEditorColsDefault, ppCmbxStpEditorCols);
|
||||
|
||||
_FolderConfig.ParentLookup = false;
|
||||
}
|
||||
|
||||
/// <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 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>
|
||||
/// Set the text and background colors for the sample text for the Step Editor Text Colors
|
||||
/// on the Editor Settings property page
|
||||
/// </summary>
|
||||
private void SetupSampleTextBoxes()
|
||||
{
|
||||
ppPanelViewSample.BackColor = cGetColor(_ViewBckgndColor);
|
||||
ppLblViewRO.ForeColor = cGetColor(_ROcolor);
|
||||
ppLblViewTrans.ForeColor = cGetColor(_TransColor);
|
||||
ppPanelEditSample.BackColor = cGetColor(_EditBckgndColor);
|
||||
ppLblEditRO.ForeColor = cGetColor(_ROcolor);
|
||||
ppLblEditTrans.ForeColor = cGetColor(_TransColor);
|
||||
}
|
||||
|
||||
private void frmFolderProperties_Load(object sender, EventArgs e)
|
||||
{
|
||||
_Initializing = true;
|
||||
// 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);
|
||||
// //string st = string.Format("{0}", info.FormatDescription);
|
||||
// comboBoxEx1.Items.Add(st);
|
||||
//// comboBoxEx1.Items.Add(info.FormatDescription);
|
||||
// }
|
||||
|
||||
imageCodecInfoBindingSource.DataSource = ImageCodecInfo.GetImageDecoders();
|
||||
formatInfoListBindingSource.DataSource = FormatInfoList.Get();
|
||||
folderConfigBindingSource.DataSource = _FolderConfig;
|
||||
|
||||
// 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["ShowDefaultFolderProp"] != null)? Settings.Default.ShowDefaultFolderProp : 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"] == 2)
|
||||
{
|
||||
tcFolder.TabsVisible = true;
|
||||
panButtons.Visible = false;
|
||||
this.Width -= panButtons.Width;
|
||||
}
|
||||
|
||||
// Get the default values for the property page information
|
||||
FindDefaultValues();
|
||||
|
||||
if (_FolderConfig.Name.Equals("VEPROMS"))
|
||||
{
|
||||
// if we are at the top node of the tree, remove the Folder Property page tabs
|
||||
// that do not pertain to this level (top of tree)
|
||||
this.tcFolder.Tabs.Remove(tiFmtSettings);
|
||||
this.tcFolder.Tabs.Remove(tiOutputSettings);
|
||||
this.tcFolder.Tabs.Remove(tiEditSettings);
|
||||
this.btnFormatSettings.Visible = false;
|
||||
this.btnOutputSettings.Visible = false;
|
||||
this.btnEdSettings.Visible = false;
|
||||
ppCbShwDefSettings.Visible = false; // hide check box for showing default values for top node
|
||||
}
|
||||
else
|
||||
{
|
||||
// don't show Start Message tab if not at top level
|
||||
this.tcFolder.Tabs.Remove(tiStMsg);
|
||||
this.btnStMsg.Visible = false;
|
||||
|
||||
// this was coded for demo purposes... setup the text colors for the sample text
|
||||
// of the Step Editor Text Colors property
|
||||
_ROcolor = _FolderConfig.Color_ro;
|
||||
if (_ROcolor == string.Empty) _ROcolor = "Orange";
|
||||
_EditBckgndColor = _FolderConfig.Color_editbackground;
|
||||
if (_EditBckgndColor == string.Empty) _EditBckgndColor = "LightGray";
|
||||
_ViewBckgndColor = _FolderConfig.Default_BkColor.Name;
|
||||
if (_ViewBckgndColor == string.Empty) _ViewBckgndColor = "White";
|
||||
_TransColor = _FolderConfig.Color_transition;
|
||||
if (_TransColor == string.Empty) _TransColor = "Orange";
|
||||
SetupSampleTextBoxes();
|
||||
|
||||
ppCmbxChangeBarType.DataSource = EnumDetail<FolderConfig.PrintChangeBar>.Details();
|
||||
ppCmbxChangeBarType.DisplayMember = "Name";
|
||||
ppCmbxChangeBarType.ValueMember = "EValue";
|
||||
|
||||
ppCmbxChgBarPos.DataSource = EnumDetail<FolderConfig.PrintChangeBarLoc>.Details();
|
||||
ppCmbxChgBarPos.DisplayMember = "Name";
|
||||
ppCmbxChgBarPos.ValueMember = "EValue";
|
||||
|
||||
ppCmbxChgBarTxtType.DataSource = EnumDetail<FolderConfig.PrintChangeBarText>.Details();
|
||||
ppCmbxChgBarTxtType.DisplayMember = "Name";
|
||||
ppCmbxChgBarTxtType.ValueMember = "EValue";
|
||||
|
||||
ppCmbxPagination.DataSource = EnumDetail<FolderConfig.PrintPagination>.Details();
|
||||
ppCmbxPagination.DisplayMember = "Name";
|
||||
ppCmbxPagination.ValueMember = "EValue";
|
||||
|
||||
ppCmbxWatermark.DataSource = EnumDetail<FolderConfig.PrintWatermark>.Details();
|
||||
ppCmbxWatermark.DisplayMember = "Name";
|
||||
ppCmbxWatermark.ValueMember = "EValue";
|
||||
|
||||
ppCmbxStpEditorCols.DataSource = EnumDetail<FolderConfig.FormatColumns>.Details();
|
||||
ppCmbxStpEditorCols.DisplayMember = "Name";
|
||||
ppCmbxStpEditorCols.ValueMember = "EValue";
|
||||
|
||||
ppCbShwDefSettings.Visible = true; // display check box for showing default values
|
||||
}
|
||||
_Initializing = false;
|
||||
}
|
||||
|
||||
private void ppBtnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
folderConfigBindingSource.EndEdit();
|
||||
DialogResult = DialogResult.OK;
|
||||
// Save Default settings for User
|
||||
//
|
||||
// Save whether we should display the default values on this property page
|
||||
Settings.Default.ShowDefaultFolderProp = ppCbShwDefSettings.Checked;
|
||||
Settings.Default.Save();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ppBtnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
folderConfigBindingSource.CancelEdit();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ppColorPickerViewModebckgnd_SelectedColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
_ViewBckgndColor = strMakeColorName(ppColorPickerViewModebckgnd.SelectedColor);
|
||||
SetupSampleTextBoxes();
|
||||
}
|
||||
|
||||
private void ppColorPickerEditModeBckGnd_SelectedColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
_EditBckgndColor = strMakeColorName(ppColorPickerEditModeBckGnd.SelectedColor);
|
||||
_FolderConfig.Color_editbackground = _EditBckgndColor;
|
||||
SetupSampleTextBoxes();
|
||||
}
|
||||
|
||||
private void ppColorPickerTransition_SelectedColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
_TransColor = strMakeColorName(ppColorPickerTransition.SelectedColor);
|
||||
SetupSampleTextBoxes();
|
||||
}
|
||||
|
||||
private void ppColorPickerRO_SelectedColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
_ROcolor = strMakeColorName(ppColorPickerRO.SelectedColor);
|
||||
SetupSampleTextBoxes();
|
||||
}
|
||||
|
||||
|
||||
private void ppColorPickerViewModebckgnd_ColorPreview(object sender, DevComponents.DotNetBar.ColorPreviewEventArgs e)
|
||||
{
|
||||
ppPanelViewSample.BackColor = e.Color;
|
||||
}
|
||||
|
||||
private void ppColorPickerViewModebckgnd_PopupFinalized(object sender, EventArgs e)
|
||||
{
|
||||
ppPanelViewSample.BackColor = cGetColor(_ViewBckgndColor);
|
||||
}
|
||||
|
||||
private void ppColorPickerEditModeBckGnd_ColorPreview(object sender, DevComponents.DotNetBar.ColorPreviewEventArgs e)
|
||||
{
|
||||
ppPanelEditSample.BackColor = e.Color;
|
||||
}
|
||||
|
||||
private void ppColorPickerEditModeBckGnd_PopupFinalized(object sender, EventArgs e)
|
||||
{
|
||||
ppPanelEditSample.BackColor = cGetColor(_EditBckgndColor);
|
||||
}
|
||||
|
||||
private void ppColorPickerTransition_ColorPreview(object sender, DevComponents.DotNetBar.ColorPreviewEventArgs e)
|
||||
{
|
||||
ppLblViewTrans.ForeColor = e.Color;
|
||||
ppLblEditTrans.ForeColor = e.Color;
|
||||
}
|
||||
|
||||
private void ppColorPickerTransition_PopupFinalized(object sender, EventArgs e)
|
||||
{
|
||||
ppLblViewTrans.ForeColor = cGetColor(_TransColor);
|
||||
ppLblEditTrans.ForeColor = cGetColor(_TransColor);
|
||||
}
|
||||
|
||||
private void ppColorPickerRO_ColorPreview(object sender, DevComponents.DotNetBar.ColorPreviewEventArgs e)
|
||||
{
|
||||
ppLblViewRO.ForeColor = e.Color;
|
||||
ppLblEditRO.ForeColor = e.Color;
|
||||
}
|
||||
|
||||
private void ppColorPickerRO_PopupFinalized(object sender, EventArgs e)
|
||||
{
|
||||
ppLblViewRO.ForeColor = cGetColor(_ROcolor);
|
||||
ppLblEditRO.ForeColor = cGetColor(_ROcolor);
|
||||
}
|
||||
|
||||
private void ppBtnDefaultGrfExt_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxGrphFileExt.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefaultROPrefix_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxDefROPrefix.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefaultImgPrefix_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxDefImgPrefix.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppCmbxDefROPrefix_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxDefROPrefix.SelectedIndex != -1) &&
|
||||
_DefaultROPrefix.Equals(ppCmbxDefROPrefix.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultROPrefix.Focus();
|
||||
ppBtnDefaultROPrefix.PerformClick();
|
||||
}
|
||||
ppBtnDefaultROPrefix.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxDefROPrefix.SelectedValue != null);
|
||||
ppLblROPrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultROPrefix.Visible;
|
||||
}
|
||||
|
||||
private void ppCmbxDefImgPrefix_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxDefImgPrefix.SelectedIndex != -1) &&
|
||||
_DefaultImagePrefix.Equals(ppCmbxDefImgPrefix.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultImgPrefix.Focus();
|
||||
ppBtnDefaultImgPrefix.PerformClick();
|
||||
}
|
||||
ppBtnDefaultImgPrefix.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxDefImgPrefix.SelectedValue != null);
|
||||
ppLblImagePrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultImgPrefix.Visible;
|
||||
}
|
||||
|
||||
private void ppCmbxGrphFileExt_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxGrphFileExt.SelectedIndex != -1) && _DefaultROGraficFileExtension.Equals(ppCmbxGrphFileExt.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultGrfExt.Focus();
|
||||
ppBtnDefaultGrfExt.PerformClick();
|
||||
}
|
||||
ppBtnDefaultGrfExt.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxGrphFileExt.SelectedValue != null);
|
||||
}
|
||||
|
||||
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 = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxDefROPrefix.SelectedItem != null);
|
||||
}
|
||||
|
||||
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 = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxDefImgPrefix.SelectedItem != null);
|
||||
|
||||
}
|
||||
|
||||
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 = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxFormat.SelectedValue != null);
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
}
|
||||
|
||||
private void setEnabledUserSpecifiedChgBarCombos(FolderConfig.PrintChangeBar pcb)
|
||||
{
|
||||
ppGpbxUserSpecCB.Enabled =
|
||||
ppCmbxChgBarPos.Enabled =
|
||||
ppCmbxChgBarTxtType.Enabled =
|
||||
ppBtnDefaultCbPos.Enabled =
|
||||
ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(FolderConfig.PrintChangeBar.WithUserSpecified)) ||
|
||||
(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(FolderConfig.PrintChangeBar.WithUserSpecified));
|
||||
}
|
||||
|
||||
private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
FolderConfig.PrintChangeBar pcb = (FolderConfig.PrintChangeBar)Enum.Parse(typeof(FolderConfig.PrintChangeBar), _DefaultChgBarType);
|
||||
if ((ppCmbxChangeBarType.SelectedIndex != -1) &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(pcb))
|
||||
{
|
||||
ppBtnDefaultChgBar.Focus();
|
||||
ppBtnDefaultChgBar.PerformClick();
|
||||
}
|
||||
ppBtnDefaultChgBar.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxChangeBarType.SelectedValue != null);
|
||||
ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible;
|
||||
setEnabledUserSpecifiedChgBarCombos(pcb);
|
||||
}
|
||||
|
||||
private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
FolderConfig.PrintChangeBarLoc cbl = (FolderConfig.PrintChangeBarLoc)Enum.Parse(typeof(FolderConfig.PrintChangeBarLoc), _DefaultChgBarLoc);
|
||||
if ((ppCmbxChgBarPos.SelectedIndex != -1) &&
|
||||
ppCmbxChgBarPos.SelectedValue.Equals(cbl))
|
||||
{
|
||||
ppBtnDefaultCbPos.Focus();
|
||||
ppBtnDefaultCbPos.PerformClick();
|
||||
}
|
||||
ppBtnDefaultCbPos.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxChgBarPos.SelectedValue != null);
|
||||
ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible;
|
||||
}
|
||||
|
||||
private void setEnabledUserSpecifiedChgBarText()
|
||||
{
|
||||
ppGpbxUserSpecTxt.Enabled =
|
||||
ppTxbxChangeBarUserMsgOne.Enabled =
|
||||
ppTxbxChgBarUserMsgTwo.Enabled =
|
||||
ppBtnDefCbTxt1.Enabled =
|
||||
ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
ppCmbxChgBarTxtType.SelectedValue.Equals(FolderConfig.PrintChangeBarText.UserDef));
|
||||
}
|
||||
|
||||
private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
FolderConfig.PrintChangeBarText cbt = (FolderConfig.PrintChangeBarText)Enum.Parse(typeof(FolderConfig.PrintChangeBarText), _DefaultChgBarText);
|
||||
if ((ppCmbxChgBarTxtType.SelectedIndex != -1) &&
|
||||
ppCmbxChgBarTxtType.SelectedValue.Equals(cbt))
|
||||
{
|
||||
ppBtnDefCbTxtTyp.Focus();
|
||||
ppBtnDefCbTxtTyp.PerformClick();
|
||||
}
|
||||
ppBtnDefCbTxtTyp.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxChgBarTxtType.SelectedValue != null);
|
||||
ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible;
|
||||
setEnabledUserSpecifiedChgBarText();
|
||||
}
|
||||
|
||||
private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDefCbTxt1.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppTxbxChangeBarUserMsgOne.Text != null);
|
||||
}
|
||||
|
||||
private void ppTxbxChangeBarUserMsgTwo_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDefCbTxt2.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppTxbxChgBarUserMsgTwo.Text != null);
|
||||
}
|
||||
|
||||
private void ppCmbxStpEditorCols_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
FolderConfig.FormatColumns fcl = (FolderConfig.FormatColumns)Enum.Parse(typeof(FolderConfig.FormatColumns), _DefaultFormatColumns);
|
||||
if ((ppCmbxStpEditorCols.SelectedIndex != -1) &&
|
||||
ppCmbxStpEditorCols.SelectedValue.Equals(fcl))
|
||||
{
|
||||
ppBtnDefEdCols.Focus();
|
||||
ppBtnDefEdCols.PerformClick();
|
||||
}
|
||||
ppBtnDefEdCols.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxStpEditorCols.SelectedValue != null);
|
||||
ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible;
|
||||
}
|
||||
|
||||
private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
FolderConfig.PrintPagination pgtn = (FolderConfig.PrintPagination)Enum.Parse(typeof(FolderConfig.PrintPagination), _DefaultPagination);
|
||||
if ((ppCmbxPagination.SelectedIndex != -1) &&
|
||||
ppCmbxPagination.SelectedValue.Equals(pgtn))
|
||||
{
|
||||
ppBtnDefPagination.Focus();
|
||||
ppBtnDefPagination.PerformClick();
|
||||
}
|
||||
ppBtnDefPagination.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxPagination.SelectedValue != null);
|
||||
ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible;
|
||||
}
|
||||
|
||||
private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
FolderConfig.PrintWatermark wtr = (FolderConfig.PrintWatermark)Enum.Parse(typeof(FolderConfig.PrintWatermark), _DefaultWatermark);
|
||||
if ((ppCmbxWatermark.SelectedIndex != -1) &&
|
||||
ppCmbxWatermark.SelectedValue.Equals(wtr))
|
||||
{
|
||||
ppBtnDefWatermark.Focus();
|
||||
ppBtnDefWatermark.PerformClick();
|
||||
}
|
||||
ppBtnDefWatermark.Visible = !(_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxWatermark.SelectedValue != null);
|
||||
ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible;
|
||||
}
|
||||
|
||||
private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDeftDisAutoDuplx.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (_DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked);
|
||||
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
|
||||
}
|
||||
|
||||
/// <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;
|
||||
|
||||
ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible;
|
||||
ppLblROPrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultROPrefix.Visible;
|
||||
ppLblImagePrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultImgPrefix.Visible;
|
||||
ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible;
|
||||
ppLblGraphicFileExtDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultGrfExt.Visible;
|
||||
ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible;
|
||||
ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible;
|
||||
ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible;
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible;
|
||||
ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible;
|
||||
}
|
||||
|
||||
private void ppCbShwDefSettings_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
private void ppBtnDefaultChgBar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChangeBarType.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppCmbxChgBarPos_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChgBarPos.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxChgBarTxtType.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefPagination_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxPagination.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefWatermark_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxWatermark.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
private void ppBtnDefEdCols_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxStpEditorCols.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
|
||||
private void ppTxbxRoFoldLoc_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
string tpath = ppTxbxRoFoldLoc.Text + "\\RO.FST";
|
||||
if (File.Exists(tpath))
|
||||
{
|
||||
// build a list of available RO Accessory Page ID's
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ppCmbxDefROPrefix_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxDefROPrefix.SelectedIndex != -1) && _DefaultROPrefix.Equals(ppCmbxDefROPrefix.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultROPrefix.Focus();
|
||||
ppBtnDefaultROPrefix.PerformClick();
|
||||
}
|
||||
ppBtnDefaultROPrefix.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxDefROPrefix.SelectedValue != null);
|
||||
ppLblROPrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultROPrefix.Visible;
|
||||
}
|
||||
|
||||
private void ppCmbxDefImgPrefix_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if ((ppCmbxDefImgPrefix.SelectedIndex != -1) && _DefaultImagePrefix.Equals(ppCmbxDefImgPrefix.SelectedValue))
|
||||
{
|
||||
ppBtnDefaultImgPrefix.Focus();
|
||||
ppBtnDefaultImgPrefix.PerformClick();
|
||||
}
|
||||
ppBtnDefaultImgPrefix.Visible = (!_FolderConfig.Name.Equals("VEPROMS")) && (ppCmbxDefImgPrefix.SelectedValue != null);
|
||||
ppLblImagePrefixDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultImgPrefix.Visible;
|
||||
}
|
||||
|
||||
private void ppBtnFldrDlg_Click(object sender, EventArgs e)
|
||||
{
|
||||
dlgROFolder = new FolderBrowserDialog();
|
||||
if (dlgROFolder.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
ppTxbxRoFoldLoc.Text = dlgROFolder.SelectedPath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcFolder.SelectedTab = tiGeneral;
|
||||
btnGeneral.Checked = true;
|
||||
}
|
||||
|
||||
private void btnRefObjs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcFolder.SelectedTab = tiRefObj;
|
||||
btnRefObjs.Checked = true;
|
||||
}
|
||||
|
||||
private void btnPrintSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcFolder.SelectedTab = tiOutputSettings;
|
||||
btnOutputSettings.Checked = true;
|
||||
}
|
||||
|
||||
private void btnStMsg_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcFolder.SelectedTab = tiStMsg;
|
||||
btnStMsg.Checked = true;
|
||||
}
|
||||
|
||||
private void btnFormatSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcFolder.SelectedTab = tiFmtSettings;
|
||||
btnFormatSettings.Checked = true;
|
||||
}
|
||||
|
||||
private void btnEdSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcFolder.SelectedTab = tiEditSettings;
|
||||
btnEdSettings.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;
|
||||
btnEdSettings.Checked = false;
|
||||
btnFormatSettings.Checked = false;
|
||||
btnOutputSettings.Checked = false;
|
||||
btnRefObjs.Checked = false;
|
||||
btnStMsg.Checked = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user