public ScrollingStrategyBase() { LastDirective = new ScrollingDirective( ActionType.MoveNext, ActionTime.NextTick ); Walker = new TreeWalker( this ); _highlightTicksCount = new Dictionary<IHighlightableElement, int>(); AutoPauseDefaultTick = 5; }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { if( beginScrollingInfo.PreviousElement != this ) IsHighlighting = true; return scrollingDirective; }
protected virtual void OnInternalBeat( object sender, EventArgs e ) { if( LastDirective == null ) LastDirective = new ScrollingDirective( ActionType.MoveNext, ActionTime.NextTick ); //Saving the currently highlighted element PreviousElement = Walker.Current; //Move the cursor to the next element MoveNext( LastDirective.NextActionType ); //update the auto pause tick when the next element is selected UpdateAutoPauseTicks( LastDirective.NextActionType ); //End highlight on the previous element (if different from the current one) if( PreviousElement != null ) FireEndHighlight( PreviousElement, Walker.Current ); //Begin highlight on the current element (even if the previous element is also the current element, we send the beginhighlight to give the component the beat) if( Walker.Current != null ) FireBeginHighlight(); //active the auto pause if CheckAutoPauseCondition return true ActiveAutoPause(); }
public virtual void GoToElement( HighlightModel.IHighlightableElement element ) { LastDirective = new ScrollingDirective( ActionType.MoveNext, ActionTime.Immediate ); Walker.Current.EndHighlight( new EndScrollingInfo( Timer.Interval.Ticks, PreviousElement, element ), LastDirective ); Walker.GoTo( element ); }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { ResetAutoPause(); return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { if( _highlightPrePostChildren ) { foreach( var p in _preChildren ) p.EndHighlight( endScrollingInfo, scrollingDirective ); foreach( var p in _postChildren ) p.EndHighlight( endScrollingInfo, scrollingDirective ); } return _element.EndHighlight( endScrollingInfo, scrollingDirective ); }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { return scrollingDirective; }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { foreach( var child in Children ) { child.BeginHighlight( beginScrollingInfo, scrollingDirective ); } return scrollingDirective; }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." ); scrollingDirective.NextActionType = ActionType.GoToRelativeRoot; //allows the repeat of the same key scrollingDirective.ActionTime = ActionTime.Delayed; if( KeyDownCommand.CanExecute( null ) ) { KeyDownCommand.Execute( null ); if( KeyUpCommand.CanExecute( null ) ) { KeyUpCommand.Execute( null ); } } return scrollingDirective; }
public ScrollingDirective SelectElement(ScrollingDirective scrollingDirective) { Execute(null); return scrollingDirective; }
private void ProcessTick( ScrollingDirective scrollingDirective ) { //if we have just entered the root, we need to highlight all the screens, except the one that has been entered. if( _hasJustBeenEntered ) { _hasJustBeenEntered = false; foreach( var node in ChildNodes ) { if( node.Index != CurrentIndex ) node.IsHighlighted = false; } } //And we move to the next node if( !CurrentNode.MoveNext() ) //if the node was at the end of its laps { if( CurrentNode.IsRoot || (CurrentNode.Parent.IsRoot && CurrentNode.Parent.ChildNodes.Count == 1) ) //we are getting out of the root level, so we release the scroller so that it can scroll on the other devices. { CurrentNode = null; _entered = false; scrollingDirective.NextActionType = ActionType.MoveNext; } else { //if the Node had finished its last lap during the last MoveNext, we go up one level CurrentNode = CurrentNode.Parent; CurrentNode.Entered(); CurrentNode.MoveNext(); } } }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { scrollingDirective.NextActionType = ActionType.StayOnTheSame; if( CurrentNode == null ) { if( ChildNodes.Count == 1 ) { CurrentNode = ChildNodes.Single(); CurrentNode.Entered(); } else { CurrentNode = this; } _hasJustBeenEntered = true; _entered = true; } else { if( CurrentNode.Level < ClickDepth - 1 ) { CurrentNode = CurrentNode.ChildNodes.ElementAt( CurrentNode.CurrentIndex ); CurrentNode.Entered(); } else { NodeViewModel selectedNode = CurrentNode.ChildNodes[CurrentNode.CurrentIndex]; CK.InputDriver.MouseProcessor.MoveMouseToAbsolutePosition( (int)(selectedNode.OffsetWidth + (selectedNode.Width / 2)), (int)(selectedNode.OffsetHeight + (selectedNode.Height / 2)) ); CurrentNode.ChildNodes.ElementAt( CurrentNode.CurrentIndex ).IsHighlighted = false; CurrentNode = null; _entered = false; ExitAll(); scrollingDirective.NextActionType = ActionType.GoToAbsoluteRoot; } } scrollingDirective.ActionTime = ActionTime.Immediate; return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { if( !_entered ) //we were scrolling the plugin itself (we hadn't entered yet), which had highlighted all the screens { foreach( var node in ChildNodes ) { node.IsHighlighted = false; } } else { CurrentNode.ChildNodes.ElementAt( CurrentNode.CurrentIndex ).IsHighlighted = false; } return scrollingDirective; }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { //If we haven't entered the children yet, we highlight all of the screens. //Once a first Select element has been triggered, we start scrolling the screens. if( CurrentNode == null ) { foreach( var node in ChildNodes ) { node.IsHighlighted = true; } } else { ProcessTick( scrollingDirective ); } return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { if( endScrollingInfo.ElementToBeHighlighted != this ) IsHighlighting = false; return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { _viewModel.IsWindowHighlighted = false; return scrollingDirective; }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { _editor.Activate(); return scrollingDirective; }
public ScrollingDirective BeginHighlight(BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective) { _selected = false; IsHighlighted = true; if(_textTemplate != null) _textTemplate.FocusOnElement(this); return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { foreach( var child in Children ) { child.EndHighlight( endScrollingInfo, scrollingDirective ); } return scrollingDirective; }
public ScrollingDirective EndHighlight(EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective) { IsHighlighted = false; if( !_selected ) _textTemplate.RemoveFocus( this ); //Keep the focus if the text is selected return scrollingDirective; }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { if( _highlightPrePostChildren ) { foreach( var p in _preChildren ) p.BeginHighlight( beginScrollingInfo, scrollingDirective ); foreach( var p in _postChildren ) p.BeginHighlight( beginScrollingInfo, scrollingDirective ); } return _element.BeginHighlight( beginScrollingInfo, scrollingDirective ); }
public ScrollingDirective SelectElement(ScrollingDirective scrollingDirective) { _selected = true; scrollingDirective.NextActionType = HighlightModel.ActionType.GoToAbsoluteRoot; _textTemplate.FocusOnElement( this ); return scrollingDirective; }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { return _element.SelectElement( scrollingDirective ); }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { IsHighlighted = true; return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { return scrollingDirective; }
public ScrollingDirective EndHighlight( EndScrollingInfo endScrollingInfo, ScrollingDirective scrollingDirective ) { IsHighlighted = false; return scrollingDirective; }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { return scrollingDirective; }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { scrollingDirective.NextActionType = ActionType.EnterChild; return scrollingDirective; }
public ScrollingDirective BeginHighlight( BeginScrollingInfo beginScrollingInfo, ScrollingDirective scrollingDirective ) { _viewModel.IsWindowHighlighted = true; return scrollingDirective; }
public ScrollingDirective SelectElement( ScrollingDirective scrollingDirective ) { _radar.ToNextStep(); //In any case, when we trigger the input when on the radar, we set the NextType as ActionType.StayOnTheSameLocked. scrollingDirective.NextActionType = ActionType = ActionType.StayOnTheSame; scrollingDirective.ActionTime = ActionTime.Immediate; return scrollingDirective; }