328 lines
9.4 KiB
C#
328 lines
9.4 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 DevComponents;
|
|
using DevComponents.DotNetBar.Rendering;
|
|
using DevComponents.DotNetBar;
|
|
using VEPROMS.Properties;
|
|
using Volian.Base.Library;
|
|
using DescriptiveEnum;
|
|
|
|
namespace VEPROMS
|
|
{
|
|
public partial class frmSysOptions : DevComponents.DotNetBar.Office2007Form
|
|
{
|
|
bool _initializing;
|
|
private bool _CanChangeSeparateWindowsSetting = true;
|
|
|
|
public bool CanChangeSeparateWindowsSetting
|
|
{
|
|
get { return _CanChangeSeparateWindowsSetting; }
|
|
set { _CanChangeSeparateWindowsSetting = value; }
|
|
}
|
|
public frmSysOptions()
|
|
{
|
|
_initializing = true;
|
|
InitializeComponent();
|
|
CurrentSettings();
|
|
SaveStartingSettings();
|
|
cbPropGrid.Visible = VlnSettings.DebugMode;
|
|
btnGeneral.PerformClick();
|
|
_initializing = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Check the proper buttons with respect to the current settings
|
|
/// </summary>
|
|
private void CurrentSettings()
|
|
{
|
|
switch (Settings.Default.PropPageStyle)
|
|
{
|
|
case 1: cbButtonIntrFace.Checked = true;
|
|
break;
|
|
case 2: cbTabbedIntrFace.Checked = true;
|
|
break;
|
|
case 3: cbPropGrid.Checked = true;
|
|
break;
|
|
}
|
|
switch (Settings.Default.SystemColor)
|
|
{
|
|
case (int)eOffice2007ColorScheme.Black:
|
|
cbRibonBlack.Checked = true;
|
|
break;
|
|
case (int)eOffice2007ColorScheme.Blue:
|
|
cbRibonBlue.Checked = true;
|
|
break;
|
|
case (int)eOffice2007ColorScheme.Silver:
|
|
cbRibonSilver.Checked = true;
|
|
break;
|
|
}
|
|
colorPickerButton1.SelectedColor = Settings.Default.TransitionRangeColor;
|
|
cbAnnotationPopup.Checked = Settings.Default.AutoPopUpAnnotations;
|
|
cbStepTypeToolTip.Checked = Settings.Default.StepTypeToolTip;
|
|
cbTVExpand.Checked = Settings.Default.SaveTreeviewExpanded;
|
|
cbPasteNoReturns.Checked = Settings.Default.PasteNoReturns;
|
|
cbPastePlainText.Checked = Settings.Default.PastePlainText;
|
|
cbEnhancedDocumentSync.Checked = Settings.Default.SyncEnhancedDocuments;
|
|
cbSeparateWindows.Checked = Settings.Default.SeparateWindows;
|
|
txbxVisioPath.Text = Settings.Default.VisioPath;
|
|
switch (Settings.Default.UCFImportOpt) // see dlgExportImport for descripton of these options.
|
|
{
|
|
case 0:
|
|
cbUCFIgnore.Checked = true;
|
|
break;
|
|
case 1:
|
|
cbUCFLNotUsed.Checked = true;
|
|
break;
|
|
case 2:
|
|
cbUCFLOnlyImport.Checked = true;
|
|
break;
|
|
case 3:
|
|
cbUCFLUseAll.Checked = true;
|
|
break;
|
|
case 4:
|
|
cbUCFLForSetOnly.Checked = true;
|
|
break;
|
|
}
|
|
|
|
}
|
|
private void cbEnhancedDocumentSync_CheckedChanged(object sender, System.EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.SyncEnhancedDocuments = cbEnhancedDocumentSync.Checked;
|
|
}
|
|
}
|
|
private void cbPastePlainText_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.PastePlainText = cbPastePlainText.Checked;
|
|
}
|
|
}
|
|
private void cbPasteNoReturns_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.PasteNoReturns = cbPasteNoReturns.Checked;
|
|
}
|
|
}
|
|
private void cbRibonBlue_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(eOffice2007ColorScheme.Blue);
|
|
Settings.Default.SystemColor = (int)eOffice2007ColorScheme.Blue;
|
|
}
|
|
}
|
|
|
|
private void cbRibonSilver_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(eOffice2007ColorScheme.Silver);
|
|
Settings.Default.SystemColor = (int)eOffice2007ColorScheme.Silver;
|
|
}
|
|
}
|
|
|
|
private void cbRibonBlack_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(eOffice2007ColorScheme.Black);
|
|
Settings.Default.SystemColor = (int)eOffice2007ColorScheme.Black;
|
|
}
|
|
}
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
{
|
|
// Save Default settings for User
|
|
|
|
// Property Page style
|
|
if (cbButtonIntrFace.Checked)
|
|
Settings.Default.PropPageStyle = 1;
|
|
else if (cbTabbedIntrFace.Checked)
|
|
Settings.Default.PropPageStyle = 2;
|
|
else if (cbPropGrid.Checked)
|
|
Settings.Default.PropPageStyle = 3;
|
|
|
|
Settings.Default.Save();
|
|
this.DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
private int ss_propPageStyle;
|
|
private int ss_SystemColor;
|
|
private Color ss_TransRangeColor;
|
|
private bool ss_PopUPAnnotations;
|
|
private bool ss_StepTypeToolTip;
|
|
private bool ss_SaveTreeviewExpanded;
|
|
private bool ss_PasteNoReturns;
|
|
private bool ss_PastePlainText;
|
|
private bool ss_SyncEnhancedDocuments;
|
|
private bool ss_SeparateWindows;
|
|
private string ss_VisioPath;
|
|
private int ss_UCFImportOpt;
|
|
|
|
private void SaveStartingSettings()
|
|
{
|
|
ss_propPageStyle = Settings.Default.PropPageStyle;
|
|
ss_SystemColor = Settings.Default.SystemColor;
|
|
ss_TransRangeColor = Settings.Default.TransitionRangeColor;
|
|
ss_PopUPAnnotations = Settings.Default.AutoPopUpAnnotations;
|
|
ss_StepTypeToolTip = Settings.Default.StepTypeToolTip;
|
|
ss_SaveTreeviewExpanded = Settings.Default.SaveTreeviewExpanded;
|
|
ss_PasteNoReturns = Settings.Default.PasteNoReturns;
|
|
ss_PastePlainText = Settings.Default.PastePlainText;
|
|
ss_SyncEnhancedDocuments = Settings.Default.SyncEnhancedDocuments;
|
|
ss_SeparateWindows = Settings.Default.SeparateWindows;
|
|
ss_VisioPath = Settings.Default.VisioPath;
|
|
ss_UCFImportOpt = Settings.Default.UCFImportOpt;
|
|
}
|
|
|
|
private void RestoreStartingSettings() // used with the cancel button
|
|
{
|
|
Settings.Default.PropPageStyle = ss_propPageStyle;
|
|
Settings.Default.SystemColor = ss_SystemColor;
|
|
Settings.Default.TransitionRangeColor = ss_TransRangeColor;
|
|
Settings.Default.AutoPopUpAnnotations = ss_PopUPAnnotations;
|
|
Settings.Default.StepTypeToolTip = ss_StepTypeToolTip;
|
|
Settings.Default.SaveTreeviewExpanded = ss_SaveTreeviewExpanded;
|
|
Settings.Default.PasteNoReturns = ss_PasteNoReturns;
|
|
Settings.Default.PastePlainText = ss_PastePlainText;
|
|
Settings.Default.SyncEnhancedDocuments = ss_SyncEnhancedDocuments;
|
|
Settings.Default.SeparateWindows = ss_SeparateWindows;
|
|
Settings.Default.VisioPath = ss_VisioPath;
|
|
Settings.Default.UCFImportOpt = ss_UCFImportOpt;
|
|
}
|
|
|
|
|
|
private void btnIntrFaceStngs_Click(object sender, EventArgs e)
|
|
{
|
|
ClearAllCheckedButtons();
|
|
tcSysOpts.SelectedTab = tiIntrFaceStngs;
|
|
btnIntrFaceStngs.Checked = true;
|
|
}
|
|
|
|
private void btnStartMsg_Click(object sender, EventArgs e)
|
|
{
|
|
ClearAllCheckedButtons();
|
|
tcSysOpts.SelectedTab = tiStUpMsg;
|
|
btnStartMsg.Checked = true;
|
|
}
|
|
|
|
private void btnGeneral_Click(object sender, EventArgs e)
|
|
{
|
|
ClearAllCheckedButtons();
|
|
tcSysOpts.SelectedTab = tiGeneral;
|
|
btnGeneral.Checked = true;
|
|
}
|
|
|
|
private void ClearAllCheckedButtons()
|
|
{
|
|
btnGeneral.Checked = false;
|
|
btnStartMsg.Checked = false;
|
|
btnIntrFaceStngs.Checked = false;
|
|
}
|
|
|
|
private void btnReset_Click(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.Reset();// .Reload();
|
|
CurrentSettings();
|
|
// show the resetted color scheme
|
|
RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable((eOffice2007ColorScheme)Settings.Default.SystemColor);
|
|
}
|
|
|
|
private void colorPickerButton1_SelectedColorChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.TransitionRangeColor = colorPickerButton1.SelectedColor;
|
|
}
|
|
}
|
|
|
|
private void cbAnnotationPopup_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.AutoPopUpAnnotations = cbAnnotationPopup.Checked;
|
|
}
|
|
|
|
private void frmSysOptions_Load(object sender, EventArgs e)
|
|
{
|
|
ClearAllCheckedButtons();
|
|
tcSysOpts.SelectedTab = tiIntrFaceStngs;
|
|
btnIntrFaceStngs.Checked = true;
|
|
gpSeparateWindows.Enabled = CanChangeSeparateWindowsSetting; //Separate Windows only if one or less procedure sets open
|
|
}
|
|
private void cbStepTypeToolTip_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.StepTypeToolTip = cbStepTypeToolTip.Checked;
|
|
VlnSettings.StepTypeToolType = cbStepTypeToolTip.Checked;
|
|
}
|
|
private void cbTVExpand_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.SaveTreeviewExpanded = cbTVExpand.Checked;
|
|
}
|
|
private void cbSeparateWindows_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.SeparateWindows = cbSeparateWindows.Checked;
|
|
}
|
|
private void txbxVisioPath_Leave(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.VisioPath = txbxVisioPath.Text;
|
|
}
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
{
|
|
RestoreStartingSettings();
|
|
}
|
|
|
|
private void txbxVisioPath_Leave_1(object sender, EventArgs e)
|
|
{
|
|
Settings.Default.VisioPath = txbxVisioPath.Text;
|
|
}
|
|
|
|
private void cbUCFIgnore_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.UCFImportOpt = 0;
|
|
}
|
|
}
|
|
|
|
private void cbUCFLNotUsed_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.UCFImportOpt = 1;
|
|
}
|
|
}
|
|
|
|
private void cbUCFLOnlyImport_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.UCFImportOpt = 2;
|
|
}
|
|
}
|
|
|
|
private void cbUCFLUseAll_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.UCFImportOpt = 3;
|
|
}
|
|
}
|
|
|
|
private void cbUCFLForSetOnly_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (!_initializing)
|
|
{
|
|
Settings.Default.UCFImportOpt = 4;
|
|
}
|
|
}
|
|
}
|
|
} |