Replaced Columns property with ColumnMode
Reset parts on close
This commit is contained in:
		@@ -57,6 +57,7 @@ namespace Volian.Controls.Library
 | 
			
		||||
		private Color _TabColor = Color.White;
 | 
			
		||||
		private Color _PanelColor = Color.White;
 | 
			
		||||
#endif
 | 
			
		||||
		internal string _LastAdjust="";
 | 
			
		||||
		private bool _ShowLines = true;
 | 
			
		||||
		private Graphics _MyGraphics = null;
 | 
			
		||||
		private int _DPI = 0;
 | 
			
		||||
@@ -293,7 +294,8 @@ namespace Volian.Controls.Library
 | 
			
		||||
			get { return _SelectedStepRTB; }
 | 
			
		||||
			set 
 | 
			
		||||
			{
 | 
			
		||||
				value.BackColor = ActiveColor; // Set the active color
 | 
			
		||||
				if(value != null)
 | 
			
		||||
					value.BackColor = ActiveColor; // Set the active color
 | 
			
		||||
				if (_SelectedStepRTB == value) return; // Same - No Change
 | 
			
		||||
				if (_SelectedStepRTB != null)
 | 
			
		||||
				{
 | 
			
		||||
@@ -302,7 +304,7 @@ namespace Volian.Controls.Library
 | 
			
		||||
					_SelectedStepRTB.SaveConfig();		// This may be redundant 
 | 
			
		||||
				}
 | 
			
		||||
				_SelectedStepRTB = value;
 | 
			
		||||
				if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID) 
 | 
			
		||||
				if (value != null && _SelectedItemInfo.ItemID != value.MyItemInfo.ItemID) 
 | 
			
		||||
					SelectedItemInfo = value.MyItemInfo;
 | 
			
		||||
				//vlnStackTrace.ShowStack("_DisplayRTB = {0}", _DisplayRTB.MyItem.ItemID);// Show StackTrace
 | 
			
		||||
			}
 | 
			
		||||
@@ -378,22 +380,6 @@ namespace Volian.Controls.Library
 | 
			
		||||
		}
 | 
			
		||||
		set { _MyStepPanelSettings = value;}
 | 
			
		||||
	}
 | 
			
		||||
		// TODO: This needs to move to StepItem and use the format for the current section
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// Gets the MaxRNO from the StepSectionLayoutData
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public int MaxRNO
 | 
			
		||||
		{
 | 
			
		||||
			get 
 | 
			
		||||
			{
 | 
			
		||||
				if(_MaxRNO == -1)
 | 
			
		||||
				{
 | 
			
		||||
					int pmode = Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1;
 | 
			
		||||
					_MaxRNO = Convert.ToInt32( _MyStepSectionLayoutData.MaxRNOTable.Split(",".ToCharArray())[pmode]);
 | 
			
		||||
				}
 | 
			
		||||
				return _MaxRNO; 
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// Gets or Sets the font for the Panel
 | 
			
		||||
		/// </summary>
 | 
			
		||||
@@ -608,7 +594,7 @@ namespace Volian.Controls.Library
 | 
			
		||||
		private ItemInfo BottomPart(ItemInfo ii)
 | 
			
		||||
		{
 | 
			
		||||
			ExpandAsNeeded(ii);
 | 
			
		||||
			if (ii.RNOs != null && ii.RNOLevel >= ii.Columns - 1) return BottomPart(ii.RNOs[0]);
 | 
			
		||||
			if (ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.RNOs[0]);
 | 
			
		||||
			if (ii.Sections != null) return BottomPart(ii.Sections[0].LastSibling);
 | 
			
		||||
			if (ii.Steps != null) return BottomPart(ii.Steps[0].LastSibling);
 | 
			
		||||
			return ii;
 | 
			
		||||
@@ -653,7 +639,7 @@ namespace Volian.Controls.Library
 | 
			
		||||
		{
 | 
			
		||||
			// if on RNO, check display mode (1 column/2 column, etc) and how deep RNO is before going to
 | 
			
		||||
			// parents substeps.
 | 
			
		||||
			if (ii.IsRNO && ii.MyParent.Steps != null && ii.RNOLevel >= ii.Columns) return BottomPart(ii.MyParent.Steps[0].LastSibling);
 | 
			
		||||
			if (ii.IsRNO && ii.MyParent.Steps != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.MyParent.Steps[0].LastSibling);
 | 
			
		||||
 | 
			
		||||
			// If on top note and parent has cautions - go to bottom caution
 | 
			
		||||
			if (ii.IsNoteStructure && ii.MyParent != null && ii.MyParent.Cautions != null) return BottomPart(ii.MyParent.Cautions[0].LastSibling);
 | 
			
		||||
@@ -691,7 +677,7 @@ namespace Volian.Controls.Library
 | 
			
		||||
				// (the lookAtSub prevented looping within a substep group at same level)
 | 
			
		||||
				if (lookAtSub && ii.Steps != null) return TopPart(ii.Steps[0]);
 | 
			
		||||
				// RNOs: Use PMode (column)
 | 
			
		||||
				if (lookAtRNO && ii.RNOs != null && ii.RNOLevel >= ii.Columns - 1) return TopPart(ii.RNOs[0]);
 | 
			
		||||
				if (lookAtRNO && ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return TopPart(ii.RNOs[0]);
 | 
			
		||||
				// Nextsibling - go to top part of sibling
 | 
			
		||||
				if (ii.NextItems != null) return TopPart(ii.NextItems[0]);
 | 
			
		||||
				// If on caution, if parent has note - go to note
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,12 @@ namespace Volian.Controls.Library
 | 
			
		||||
		{
 | 
			
		||||
			if (disposing && (components != null))
 | 
			
		||||
			{
 | 
			
		||||
				//if (_DisplayRTB != null) _DisplayRTB.SaveText();
 | 
			
		||||
				SelectedStepRTB = null; // Save Changes
 | 
			
		||||
				foreach (StepItem stepItem in _LookupStepItems.Values)
 | 
			
		||||
				{
 | 
			
		||||
					stepItem.MyItemInfo.ResetParts();
 | 
			
		||||
					stepItem.MyItemInfo.MyContent.RefreshContentParts();
 | 
			
		||||
				}
 | 
			
		||||
				components.Dispose();
 | 
			
		||||
			}
 | 
			
		||||
			base.Dispose(disposing);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user