public override void ChangeCursorType(IHistoryCursor thc) { UserControlCommonBase uccb = tabStrip.CurrentControl as UserControlCommonBase; if (uccb != null) // if we get a change cursor, must tell our tab child { uccb.ChangeCursorType(uctg); } }
public override void ChangeCursorType(IHistoryCursor thc) // a grid below changed its travel grid, update our history one { bool changedinuse = Object.ReferenceEquals(ucursor_inuse, ucursor_history); // if we are using the history as the current tg //System.Diagnostics.Debug.WriteLine("Splitter CTG " + ucursor_history.GetHashCode() + " IU " + ucursor_inuse.GetHashCode() + " New " + thc.GetHashCode()); ucursor_history = thc; // underlying one has changed. if (changedinuse) // inform the boys { ucursor_inuse = ucursor_history; (panelPlayfield.Controls[0] as SplitContainer).RunActionOnSplitterTree((p, c) => // runs on each split panel node exactly.. { UserControlCommonBase uccb = ((c is ExtendedControls.TabStrip) ? ((c as ExtendedControls.TabStrip).CurrentControl) : c) as UserControlCommonBase; if (uccb != null) // tab strip may not have a control set.. { uccb.ChangeCursorType(ucursor_inuse); //System.Diagnostics.Debug.WriteLine("Change cursor call to " + c.Name + " " + uccb.Name); } }); } }
private void AssignTHC() { IHistoryCursor uctgfound = FindTHC(); if ((uctgfound != null && !Object.ReferenceEquals(uctgfound, ucursor_inuse)) || // if got one but its not the one currently in use (uctgfound == null && !Object.ReferenceEquals(ucursor_history, ucursor_inuse)) // or not found, but we are not on the history one ) { ucursor_inuse = (uctgfound != null) ? uctgfound : ucursor_history; // select //System.Diagnostics.Debug.WriteLine("Children of " + this.GetHashCode() + " Change to " + ucursor_inuse.GetHashCode()); (panelPlayfield.Controls[0] as SplitContainer).RunActionOnSplitterTree((p, c) => // runs on each split panel node exactly.. { UserControlCommonBase uccb = ((c is ExtendedControls.TabStrip) ? ((c as ExtendedControls.TabStrip).CurrentControl) : c) as UserControlCommonBase; if (uccb != null) // tab strip may not have a control set.. { uccb.ChangeCursorType(ucursor_inuse); //System.Diagnostics.Debug.WriteLine("Change cursor call to " + c.Name + " " + uccb.Name); } }); ucursor_inuse.FireChangeSelection(); // let the uctg tell the children a change event, so they can refresh } else { //System.Diagnostics.Debug.WriteLine("Children of " + this.GetHashCode() + " Stay on " + ucursor_inuse.GetHashCode()); } UserControlTravelGrid tg = GetTravelGrid; // this is called whenever deployment changes.. so see if TG is there.. if (tg != null) { tg.OnKeyDownInCell -= Tg_OnKeyDownInCell; tg.OnKeyDownInCell += Tg_OnKeyDownInCell; } }