Right and left arrow key fixes to hand RNOs
This commit is contained in:
		@@ -754,7 +754,7 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case E_ArrowKeys.Right:
 | 
									case E_ArrowKeys.Right:
 | 
				
			||||||
				case E_ArrowKeys.CtrlRight:
 | 
									case E_ArrowKeys.CtrlRight:
 | 
				
			||||||
					if (ei.MyItemInfo.RNOs != null)
 | 
										if (!ei.MyItemInfo.IsInRNO && ei.MyItemInfo.RNOs != null)
 | 
				
			||||||
						SelectedEditItem = _LookupEditItems[ei.MyItemInfo.RNOs[0].ItemID];
 | 
											SelectedEditItem = _LookupEditItems[ei.MyItemInfo.RNOs[0].ItemID];
 | 
				
			||||||
					else
 | 
										else
 | 
				
			||||||
						ii = MoveDown(ei, ii);
 | 
											ii = MoveDown(ei, ii);
 | 
				
			||||||
@@ -762,13 +762,41 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
				case E_ArrowKeys.Left:
 | 
									case E_ArrowKeys.Left:
 | 
				
			||||||
				case E_ArrowKeys.CtrlLeft:
 | 
									case E_ArrowKeys.CtrlLeft:
 | 
				
			||||||
					if (!ei.MyItemInfo.IsProcedure)
 | 
										if (!ei.MyItemInfo.IsProcedure)
 | 
				
			||||||
						SelectedEditItem = _LookupEditItems[ei.MyItemInfo.MyParent.ItemID];
 | 
										{
 | 
				
			||||||
 | 
											EditItem tmpEI =  null;
 | 
				
			||||||
 | 
											//SelectedEditItem = _LookupEditItems[ei.MyItemInfo.MyParent.ItemID];
 | 
				
			||||||
 | 
											ii = ArrowUp(ei.MyItemInfo);
 | 
				
			||||||
 | 
											if (ii != null)
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												ItemInfo tmpII = ii;
 | 
				
			||||||
 | 
												while (!ei.MyItemInfo.IsInRNO && tmpII.RNOs != null)
 | 
				
			||||||
 | 
													tmpII = GetLowestRNOEditItem(tmpII, ei.MyItemInfo);
 | 
				
			||||||
 | 
												if (tmpII != ei.MyItemInfo)
 | 
				
			||||||
 | 
													ii = tmpII;
 | 
				
			||||||
 | 
												SelectedEditItem = _LookupEditItems[ii.ItemID];
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// This is used for the Left Arrow key when we move off the current edit window
 | 
				
			||||||
 | 
							private ItemInfo GetLowestRNOEditItem(ItemInfo newII, ItemInfo startII)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								EditItem tmpEI = _LookupEditItems[newII.RNOs[newII.RNOs.Count - 1].ItemID];
 | 
				
			||||||
 | 
								ItemInfo tmpII = tmpEI.MyItemInfo;
 | 
				
			||||||
 | 
								while (tmpII != startII && tmpII.RNOs != null)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									tmpEI = _LookupEditItems[tmpII.RNOs[tmpII.RNOs.Count - 1].ItemID];
 | 
				
			||||||
 | 
									tmpII = tmpEI.MyItemInfo;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (tmpII != startII && tmpEI.MyAfterEditItems != null)
 | 
				
			||||||
 | 
									tmpEI = tmpEI.MyAfterEditItems[tmpEI.MyAfterEditItems.Count - 1];
 | 
				
			||||||
 | 
								return tmpEI.MyItemInfo;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		private ItemInfo MoveDown(EditItem ei, ItemInfo ii)
 | 
							private ItemInfo MoveDown(EditItem ei, ItemInfo ii)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			ii = ArrowDown(ei.MyItemInfo);
 | 
								ii = ArrowDown(ei.MyItemInfo);
 | 
				
			||||||
@@ -781,7 +809,7 @@ namespace Volian.Controls.Library
 | 
				
			|||||||
		private ItemInfo ArrowUp(ItemInfo ii)
 | 
							private ItemInfo ArrowUp(ItemInfo ii)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			// Arrow-Up from a Substep should look for a Table.
 | 
								// Arrow-Up from a Substep should look for a Table.
 | 
				
			||||||
			if (ii.IsStepPart && (ii.ActiveParent as ItemInfo).Tables != null)
 | 
								if (ii.IsStepPart && (ii.MyPrevious == null) && (ii.ActiveParent as ItemInfo).Tables != null)
 | 
				
			||||||
				return BottomPart((ii.ActiveParent as ItemInfo).Tables[0]);
 | 
									return BottomPart((ii.ActiveParent as ItemInfo).Tables[0]);
 | 
				
			||||||
			// if on RNO, check display mode (1 column/2 column, etc) and how deep RNO is before going to
 | 
								// if on RNO, check display mode (1 column/2 column, etc) and how deep RNO is before going to
 | 
				
			||||||
			// parents substeps.
 | 
								// parents substeps.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user