164 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			164 lines
		
	
	
		
			4.0 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 DescriptiveEnum;
 | |
| 
 | |
| namespace VEPROMS
 | |
| {
 | |
| 	public partial class frmSysOptions : DevComponents.DotNetBar.Office2007Form
 | |
| 	{
 | |
| 		bool _initializing;
 | |
| 		public frmSysOptions()
 | |
| 		{
 | |
| 			_initializing = true;
 | |
| 			InitializeComponent();
 | |
| 			CurrentSettings();
 | |
| 			
 | |
| 			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;
 | |
| 		}
 | |
| 
 | |
| 
 | |
| 		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.Close();
 | |
| 		}
 | |
| 
 | |
| 
 | |
| 		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;
 | |
| 		}
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 	}
 | |
| } | 
