diff --git a/PROMS/VEPROMS USER INTERFACE/App.config b/PROMS/VEPROMS USER INTERFACE/App.config index f31ce50c..565627b8 100644 --- a/PROMS/VEPROMS USER INTERFACE/App.config +++ b/PROMS/VEPROMS USER INTERFACE/App.config @@ -3,6 +3,7 @@
+
@@ -90,6 +91,17 @@ providerName="System.Data.SqlClient" />--> + + + False + + + 1 + + + 2 + + False diff --git a/PROMS/VEPROMS USER INTERFACE/Properties/AssemblyInfo.cs b/PROMS/VEPROMS USER INTERFACE/Properties/AssemblyInfo.cs index 9c2acc20..acb8a0aa 100644 --- a/PROMS/VEPROMS USER INTERFACE/Properties/AssemblyInfo.cs +++ b/PROMS/VEPROMS USER INTERFACE/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("VE-PROMS")] -[assembly: AssemblyDescription("Sample User Interface for VE-PROMS .NET")] +[assembly: AssemblyDescription("User Interface for VE-PROMS .NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Volian Enterprises, Inc.")] [assembly: AssemblyProduct("VE-PROMS .NET Beta Release")] diff --git a/PROMS/VEPROMS USER INTERFACE/Properties/Settings.Designer.cs b/PROMS/VEPROMS USER INTERFACE/Properties/Settings.Designer.cs index b2428f2e..771facfe 100644 --- a/PROMS/VEPROMS USER INTERFACE/Properties/Settings.Designer.cs +++ b/PROMS/VEPROMS USER INTERFACE/Properties/Settings.Designer.cs @@ -104,6 +104,7 @@ namespace VEPROMS.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] public int SystemColor { get { return ((int)(this["SystemColor"])); diff --git a/PROMS/VEPROMS USER INTERFACE/Properties/Settings.settings b/PROMS/VEPROMS USER INTERFACE/Properties/Settings.settings index 83e83f09..5f6c87a7 100644 --- a/PROMS/VEPROMS USER INTERFACE/Properties/Settings.settings +++ b/PROMS/VEPROMS USER INTERFACE/Properties/Settings.settings @@ -1,5 +1,5 @@  - + @@ -24,7 +24,7 @@ 1 - + 2 \ No newline at end of file diff --git a/PROMS/VEPROMS USER INTERFACE/frmFolderProperties.cs b/PROMS/VEPROMS USER INTERFACE/frmFolderProperties.cs index 2462d72b..e3e79fa0 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmFolderProperties.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmFolderProperties.cs @@ -125,7 +125,6 @@ namespace VEPROMS // 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(); @@ -140,7 +139,7 @@ namespace VEPROMS // 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) + if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) { tcFolder.TabsVisible = true; panButtons.Visible = false; diff --git a/PROMS/VEPROMS USER INTERFACE/frmProcedureProperties.cs b/PROMS/VEPROMS USER INTERFACE/frmProcedureProperties.cs index 75b4627d..4749b4ac 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmProcedureProperties.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmProcedureProperties.cs @@ -118,10 +118,10 @@ namespace VEPROMS // This setting tells us if we should display the default values on this property page ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultProcedureProp"] != null) ? Settings.Default.ShowDefaultProcedureProp : false; - // Get the User's property page style "PropPageStyle" + // 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) // tabbed interface + if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) { tcProcProp.TabsVisible = true; panProcBtns.Visible = false; diff --git a/PROMS/VEPROMS USER INTERFACE/frmSectionProperties.cs b/PROMS/VEPROMS USER INTERFACE/frmSectionProperties.cs index 3f4a56a2..c7b9e484 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmSectionProperties.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmSectionProperties.cs @@ -77,10 +77,10 @@ namespace VEPROMS // Get setting telling us whether to display the default values on this property page ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultSectionProp"] != null) ? Settings.Default.ShowDefaultSectionProp : false; - // Get the User's property page style "PropPageStyle" + // 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) // tabbed interface + if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) { tcSectionProp.TabsVisible = true; panSectBtns.Visible = false; diff --git a/PROMS/VEPROMS USER INTERFACE/frmSysOptions.Designer.cs b/PROMS/VEPROMS USER INTERFACE/frmSysOptions.Designer.cs index 6ba917e2..5c043026 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmSysOptions.Designer.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmSysOptions.Designer.cs @@ -51,6 +51,8 @@ namespace VEPROMS this.tiIntrFaceStngs = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel2 = new DevComponents.DotNetBar.TabControlPanel(); this.tiStUpMsg = new DevComponents.DotNetBar.TabItem(this.components); + this.btnReset = new DevComponents.DotNetBar.ButtonX(); + this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.groupPanel1.SuspendLayout(); this.panButtons.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tcSysOpts)).BeginInit(); @@ -352,6 +354,23 @@ namespace VEPROMS this.tiStUpMsg.Name = "tiStUpMsg"; this.tiStUpMsg.Text = "Startup Message"; // + // btnReset + // + this.btnReset.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnReset.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnReset.Location = new System.Drawing.Point(259, 605); + this.btnReset.Name = "btnReset"; + this.btnReset.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.btnReset.Size = new System.Drawing.Size(105, 23); + this.superTooltip1.SetSuperTooltip(this.btnReset, new DevComponents.DotNetBar.SuperTooltipInfo("Default Settings", "", "This will reset saved user settings back to the VE-PROMS system default.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(140, 95))); + this.btnReset.TabIndex = 3; + this.btnReset.Text = "Default Settings"; + this.btnReset.Click += new System.EventHandler(this.btnReset_Click); + // + // superTooltip1 + // + this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; + // // frmSysOptions // this.AcceptButton = this.btnOK; @@ -359,6 +378,7 @@ namespace VEPROMS this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; this.ClientSize = new System.Drawing.Size(932, 640); + this.Controls.Add(this.btnReset); this.Controls.Add(this.tcSysOpts); this.Controls.Add(this.panButtons); this.Controls.Add(this.btnOK); @@ -399,6 +419,8 @@ namespace VEPROMS private DevComponents.DotNetBar.Controls.CheckBoxX cbPropGrid; private DevComponents.DotNetBar.Controls.CheckBoxX cbTabbedIntrFace; private DevComponents.DotNetBar.Controls.CheckBoxX cbButtonIntrFace; + private DevComponents.DotNetBar.ButtonX btnReset; + private DevComponents.DotNetBar.SuperTooltip superTooltip1; diff --git a/PROMS/VEPROMS USER INTERFACE/frmSysOptions.cs b/PROMS/VEPROMS USER INTERFACE/frmSysOptions.cs index d58639f2..6b711328 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmSysOptions.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmSysOptions.cs @@ -6,15 +6,31 @@ 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; + } + + /// + /// Check the proper buttons with respect to the current settings + /// + private void CurrentSettings() + { switch (Settings.Default.PropPageStyle) { case 1: cbButtonIntrFace.Checked = true; @@ -24,24 +40,46 @@ namespace VEPROMS case 3: cbPropGrid.Checked = true; break; } - - btnGeneral.PerformClick(); + 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; + } } private void cbRibonBlue_CheckedChanged(object sender, EventArgs e) { - DevComponents.DotNetBar.RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.Blue); + if (!_initializing) + { + RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(eOffice2007ColorScheme.Blue); + Settings.Default.SystemColor = (int)eOffice2007ColorScheme.Blue; + } } private void cbRibonSilver_CheckedChanged(object sender, EventArgs e) { - DevComponents.DotNetBar.RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.Silver); + if (!_initializing) + { + RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(eOffice2007ColorScheme.Silver); + Settings.Default.SystemColor = (int)eOffice2007ColorScheme.Silver; + } } private void cbRibonBlack_CheckedChanged(object sender, EventArgs e) { - DevComponents.DotNetBar.RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.Black); + if (!_initializing) + { + RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(eOffice2007ColorScheme.Black); + Settings.Default.SystemColor = (int)eOffice2007ColorScheme.Black; + } } private void btnOK_Click(object sender, EventArgs e) @@ -89,6 +127,14 @@ namespace VEPROMS 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); + } + diff --git a/PROMS/VEPROMS USER INTERFACE/frmSysOptions.resx b/PROMS/VEPROMS USER INTERFACE/frmSysOptions.resx index 83ec3240..1ddae904 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmSysOptions.resx +++ b/PROMS/VEPROMS USER INTERFACE/frmSysOptions.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + diff --git a/PROMS/VEPROMS USER INTERFACE/frmVEPROMS.cs b/PROMS/VEPROMS USER INTERFACE/frmVEPROMS.cs index 3fc6f27f..7f0d99eb 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmVEPROMS.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmVEPROMS.cs @@ -10,14 +10,19 @@ using System.Windows.Forms; using VEPROMS.CSLA.Library; using Csla; using DevComponents; +using DevComponents.DotNetBar; +using DevComponents.DotNetBar.Rendering; using Csla.Validation; using VEPROMS.Properties; using Volian.Controls.Library; +using DescriptiveEnum; [assembly: log4net.Config.XmlConfigurator(Watch = true)] namespace VEPROMS { + enum PropPgStyle { Button = 1, Tab = 2, Grid = 3 }; + public partial class frmVEPROMS : DevComponents.DotNetBar.Office2007RibbonForm { #region Log4Net @@ -43,9 +48,7 @@ namespace VEPROMS InitializeComponent(); // set the color of the ribbon - // - get the color selected by user if available - // TO DO: set and read from Settings.settings - //DevComponents.DotNetBar.RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable((Settings.Default["SystemColor"] != null) ? Settings.Default.SystemColor : (int)DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.Black); + RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable((eOffice2007ColorScheme)Settings.Default.SystemColor); VETreeNode tn = VETreeNode.GetFolder(1); tv.Nodes.Add(tn); @@ -305,7 +308,7 @@ namespace VEPROMS // 2 - Tab dialog interface // 3 - Property Grid interface this.Cursor = Cursors.WaitCursor; - if ((int)Settings.Default["PropPageStyle"] == 3) + if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid) DoPropertyGrid(); // Will display a Property Grid interface else DoPropertyPages(); // Will display either a Button or a Tab dialog @@ -386,7 +389,7 @@ namespace VEPROMS /// private void DoPropertyPages() { - // Display a property page. (this does either a tabbed or button interface) + // Display a property page. (the ppStyle selects either a tabbed or button interface) VETreeNode tn = (VETreeNode)(tv.SelectedNode); switch (tn.VEObject.GetType().Name) { @@ -766,10 +769,7 @@ namespace VEPROMS private void OpenItem(ItemInfo item) { - DisplayPanel vlnCSLAPanel1; - ItemInfo tmp = item; - while (tmp.MyContent.Type >= 10000) tmp = (ItemInfo)tmp.ActiveParent; - vlnCSLAPanel1 = AddProcedureTab(tmp); + DisplayPanel vlnCSLAPanel1 = AddProcedureTab(item.MyProcedure); vlnCSLAPanel1.ItemSelect(item); } diff --git a/PROMS/VEPROMS USER INTERFACE/frmVersionsProperties.cs b/PROMS/VEPROMS USER INTERFACE/frmVersionsProperties.cs index c60266d5..8034a848 100644 --- a/PROMS/VEPROMS USER INTERFACE/frmVersionsProperties.cs +++ b/PROMS/VEPROMS USER INTERFACE/frmVersionsProperties.cs @@ -140,7 +140,6 @@ namespace VEPROMS //{ // string st = string.Format("{0} - ({1})", info.FormatDescription, info.FilenameExtension); // comboBoxEx1.Items.Add(st); - // // comboBoxEx1.Items.Add(info.FormatDescription); //} docVersionConfigBindingSource.DataSource = _DocVersionConfig; @@ -153,10 +152,10 @@ namespace VEPROMS // 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" + // 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) // tabbed interface + if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) { tcVersions.TabsVisible = true; panVerBtns.Visible = false; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 77986496..4c8bddae 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -26,7 +26,16 @@ namespace VEPROMS.CSLA.Library { get { return this.MyContent.ContentPartCount > 0; } } - private IVEDrillDown _ActiveParent=null; + public Item MyProcedure + { + get + { + // Walk up active parents until the parent is not an item + Item tmp = this; + while (tmp.ActiveParent.GetType().Name != "DocVersion") tmp = (Item)tmp.ActiveParent; + return tmp; + } + } private IVEDrillDown _ActiveParent = null; public IVEDrillDown ActiveParent { get @@ -420,6 +429,16 @@ namespace VEPROMS.CSLA.Library { get { return this.MyContent.ContentPartCount > 0; } } + public ItemInfo MyProcedure + { + get + { + // Walk up active parents until the parent is not an item + ItemInfo tmp = this; + while (tmp.ActiveParent.GetType().Name != "DocVersionInfo") tmp = (ItemInfo)tmp.ActiveParent; + return tmp; + } + } private IVEDrillDownReadOnly _ActiveParent = null; public IVEDrillDownReadOnly ActiveParent { diff --git a/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj b/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj index 71e8deff..a8428de4 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj +++ b/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj @@ -69,6 +69,7 @@ +