Пример #1
0
		/// <inheritdoc/>
		protected internal override void OnQueryCursor(QueryCursorEventArgs e)
		{
			if (LinkIsClickable()) {
				e.Handled = true;
				e.Cursor = Cursors.Hand;
			}
		}
Пример #2
0
 protected override void OnQueryCursor(System.Windows.Input.QueryCursorEventArgs e)
 {
     base.OnQueryCursor(e);
     if (mOccurrenceYPositions != null)
     {
         double mouseY = Math.Floor(e.GetPosition(this).Y);
         int    closestOccurrenceIndex = GetIndexOfClosestOccurrence(mouseY);
         if (closestOccurrenceIndex >= 0)
         {
             e.Cursor  = Cursors.Hand;
             e.Handled = true;
         }
     }
 }
Пример #3
0
        private Cursor QueryCursor(int timestamp)
        {
            if (Target == null)
            {
                return(Cursors.Arrow);
            }

            QueryCursorEventArgs e = new QueryCursorEventArgs(Mouse.QueryCursorEvent, Target, this, timestamp, Position);

            e.Cursor = Cursors.Arrow;
            Target.RaiseEvent(e);

            return(e.Handled ? e.Cursor : Cursors.Arrow);
        }
Пример #4
0
 private bool UpdateCursorPrivate()
 {
     int timeStamp = Environment.TickCount;
     QueryCursorEventArgs queryCursor = new QueryCursorEventArgs(this, timeStamp);
     queryCursor.Cursor = Cursors.Arrow;
     queryCursor.RoutedEvent=Mouse.QueryCursorEvent;
     //ProcessInput has a linkdemand
     _inputManager.Value.ProcessInput(queryCursor);
     return queryCursor.Handled;
 }
Пример #5
0
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     base.OnQueryCursor(e);
     if (_context != null) {
         Cursor cursor = _context.Services.Tool.CurrentTool.Cursor;
         if (cursor != null) {
             e.Cursor = cursor;
             e.Handled = true;
         }
     }
 }
Пример #6
0
		protected override void OnQueryCursor(QueryCursorEventArgs e)
		{
			base.OnQueryCursor(e);
			if (!e.Handled && (pan || isMouseDown)) {
				e.Handled = true;
				e.Cursor = isMouseDown ? PanToolCursorMouseDown : PanToolCursor;
			}
		}
Пример #7
0
        private static void OnQueryCursorThunk(object sender, QueryCursorEventArgs e)
        {
            Invariant.Assert(!e.Handled, "Unexpected: Event has already been handled.");

            UIElement uie = sender as UIElement;

            if (uie != null)
            {
                uie.OnQueryCursor(e);
            }
            else
            {
                ContentElement ce = sender as ContentElement;

                if (ce != null)
                {
                    ce.OnQueryCursor(e);
                }
                else
                {
                    ((UIElement3D)sender).OnQueryCursor(e);
                }
            }
        }
		void textArea_QueryCursor(object sender, QueryCursorEventArgs e)
		{
			throw new NotImplementedException();
		}
Пример #9
0
        private static void OnQueryCursor(object sender, QueryCursorEventArgs e)
        { 
            FrameworkContentElement fce = (FrameworkContentElement) sender;
 
            // We respond to querying the cursor by specifying the cursor set 
            // as a property on this element.
            Cursor cursor = fce.Cursor; 

            if(cursor != null)
            {
                // We specify the cursor if the QueryCursor event is not 
                // handled by the time it gets to us, or if we are configured
                // to force our cursor anyways.  Since the QueryCursor event 
                // bubbles, this has the effect of overriding whatever cursor 
                // a child of ours specified.
                if(!e.Handled || fce.ForceCursor) 
                {
                    e.Cursor = cursor;
                    e.Handled = true;
                } 
            }
        } 
Пример #10
0
        // QueryCursorEvent handler
        internal static void OnQueryCursor(object sender, QueryCursorEventArgs e)
        {
            TextEditor This = TextEditor._GetTextEditor(sender);

            if (This == null)
            {
                return;
            }

            if (This.TextView == null)
            {
                return;
            }

            // Determine whether the cursor is over our render scope.  In particular, we want to distinguish between
            // being directly over our RenderScope (including content of that scope), and being over visual chrome
            // between our UiScope and our RenderScope (such as scroll bars)
            if (IsPointWithinInteractiveArea(This, Mouse.GetPosition(This.UiScope)))
            {
                // Mouse is moving over our render scope, so we apply one of
                // editing cursors - IBeam when outside of selection, Arrow when within selection,
                // Resize - when over table borders, etc.

                // Otherwise (when we are not over the render scope) we do not
                // respond to QueryCursor request, thus leaving it for other
                // elements to decide.
                e.Cursor = This._cursor;
                e.Handled = true;
            }
        }
Пример #11
0
		protected virtual void OnQueryCursor(QueryCursorEventArgs e)
		{
			throw new NotImplementedException ();
		}
Пример #12
0
        private void OnQueryCursor(object sender, QueryCursorEventArgs e)
        {
            if (_isSelecting || GetFixedPanelDocumentPage(e.GetPosition(_scope)) != null)
            { 
                e.Cursor = Cursors.Cross;
            } 
            else 
            {
                e.Cursor = Cursors.Arrow; 
            }

            e.Handled = true;
        } 
Пример #13
0
		/// <inheritdoc/>
		protected override void OnQueryCursor(QueryCursorEventArgs e) {
			if (!CanClick)
				return;

			e.Handled = true;
			e.Cursor = referenceSegment.IsLocal ? Cursors.Arrow : Cursors.Hand;
		}
Пример #14
0
    private void m_rowResizerThumb_QueryCursor( object sender, QueryCursorEventArgs e )
    {
      FrameworkElement rowItem = ( FrameworkElement )this.DataContext;

      if( rowItem == null )
        return;

      if( this.CanBeResized( this.Orientation ) )
      {
        DataGridContext dataGridContext = DataGridControl.GetDataGridContext( this );

        if( dataGridContext != null )
        {
          TableView tableView = dataGridContext.DataGridControl.GetView() as TableView;

          e.Cursor = ( ( tableView != null ) && ( this.Orientation == Orientation.Vertical ) )
            ? tableView.RowSelectorResizeNorthSouthCursor
            : tableView.RowSelectorResizeWestEastCursor;
        }

        if( e.Cursor == null )
        {
          e.Cursor = ( this.Orientation == Orientation.Vertical )
            ? TableView.DefaultRowSelectorResizeNorthSouthCursor
            : TableView.DefaultRowSelectorResizeWestEastCursor;
        }
      }

      e.Handled = true;
    }
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     e.Handled = true;
     e.Cursor = Cursors.Hand;
 }
Пример #16
0
    private void ColumnResizerThumb_QueryCursor( object sender, QueryCursorEventArgs e )
    {
      ColumnBase parentColumn = this.ParentColumn;

      if( parentColumn == null )
        return;

      DataGridContext dataGridContext = this.DataGridContext;

      bool showResizeCursor = !parentColumn.HasFixedWidth;

      if( !showResizeCursor )
      {
        // Don't disable resizing if ColumnStretching can be disabled by an end-user resize.
        showResizeCursor = ( dataGridContext != null ) && ( TableView.GetRemoveColumnStretchingOnResize( dataGridContext ) );
      }

      if( showResizeCursor )
      {
        if( dataGridContext != null )
        {
          UIViewBase uiViewBase = dataGridContext.DataGridControl.GetView() as UIViewBase;

          e.Cursor = ( uiViewBase != null )
            ? uiViewBase.ColumnResizeWestEastCursor
            : UIViewBase.DefaultColumnResizeWestEastCursor;
        }
        else
        {
          e.Cursor = UIViewBase.DefaultColumnResizeWestEastCursor;
        }

        e.Handled = true;
      }
    }
Пример #17
0
        //------------------------------------------------------------------- 
        //
        // Private Methods 
        // 
        //----------------------------------------------------------------------
 
        #region Private Methods

        // QueryCursorEvent callback.
        // If this Hyperlink is editable, use the editor cursor unless 
        // the control key is down.
        private static void OnQueryCursor(object sender, QueryCursorEventArgs e) 
        { 
            Hyperlink link = (Hyperlink)sender;
 
            if (link.IsEnabled && link.IsEditable)
            {
                if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
                { 
                    e.Cursor = link.TextContainer.TextSelection.TextEditor._cursor;
                    e.Handled = true; 
                } 
            }
        } 
 protected virtual void OnQueryCursor(QueryCursorEventArgs e);
Пример #19
0
    protected virtual void NotifyDragOutsideQueryCursor( object sender, QueryCursorEventArgs e )
    {
      e.Cursor = ( this.DropOutsideCursor != null )
        ? this.DropOutsideCursor
        : Cursors.No;

      if( this.DragOutsideQueryCursor != null )
      {
        this.DragOutsideQueryCursor( sender, e );
      }

      e.Handled = true;
    }
		protected override void OnQueryCursor(QueryCursorEventArgs e)
		{
			if (FindNextInsertionPoint(e.GetPosition(this)) >= 0)
				e.Cursor = Cursors.UpArrow;
			else
				e.Cursor = Cursors.Arrow;
			e.Handled = true;
		}
Пример #21
0
 private void OnDraggedElement_QueryCursor( object sender, QueryCursorEventArgs e )
 {
   if( this.IsDragging )
   {
     if( ( this.CurrentDropTarget == null ) || ( !this.CurrentDropTarget.CanDropElement( this.DraggedElement ) ) )
     {
       this.NotifyDragOutsideQueryCursor( sender, e );
     }
   }
 }
Пример #22
0
    private void m_dragSourceManager_DragOutsideQueryCursor( object sender, QueryCursorEventArgs e )
    {
      GroupByControl parentGBC = this.GetParentGroupByControl();

      if( ( parentGBC == null ) || !parentGBC.IsGroupingModificationAllowed )
        return;

      DataGridContext dataGridContext = DataGridControl.GetDataGridContext( this );

      if( ( dataGridContext != null ) && ( dataGridContext.DataGridControl != null ) )
      {
        UIViewBase uiViewBase = dataGridContext.DataGridControl.GetView() as UIViewBase;

        e.Cursor = ( uiViewBase != null )
          ? uiViewBase.RemovingGroupCursor
          : UIViewBase.DefaultGroupDraggedOutsideCursor;
      }
      else
      {
        e.Cursor = UIViewBase.DefaultGroupDraggedOutsideCursor;
      }
    }
Пример #23
0
		protected internal virtual void OnQueryCursor(QueryCursorEventArgs e) 
		{ 
			//TODO: VisualLineElement.OnQueryCursor()
			throw new NotImplementedException();
		}
Пример #24
0
        /// <inheritdoc/>
        protected override void OnQueryCursor(QueryCursorEventArgs e)
        {
            // See comment in OnMouseDown()
            if (!(Keyboard.Modifiers == ModifierKeys.None || Keyboard.Modifiers == ModifierKeys.Control))
                return;

            e.Handled = true;
            e.Cursor = referenceSegment.IsLocal ? Cursors.Arrow : Cursors.Hand;
        }
Пример #25
0
 private static void OnQueryCursorOverride(object sender, QueryCursorEventArgs e)
 {
     FrameworkElement frameworkElement = (FrameworkElement) sender;
       Cursor cursor = frameworkElement.Cursor;
       if (cursor == null || e.Handled && !frameworkElement.ForceCursor)
     return;
       e.Cursor = cursor;
       e.Handled = true;
 }
Пример #26
0
 /// <summary>
 /// Queries the cursor over the visual line element.
 /// </summary>
 protected internal virtual void OnQueryCursor(QueryCursorEventArgs e)
 {
 }
    private void ColumnResizerThumb_QueryCursor( object sender, QueryCursorEventArgs e )
    {
      var parentColumn = this.ParentColumn;
      if( parentColumn == null )
        return;

      var dataGridContext = this.DataGridContext;

      bool showResizeCursor = false;
      if( this.AllowResize )
      {
        // Don't disable resizing if ColumnStretching can be disabled by an end-user resize.
        showResizeCursor = ( !parentColumn.HasFixedWidth )
                        || ( ( dataGridContext != null ) && TableView.GetRemoveColumnStretchingOnResize( dataGridContext ) );
      }

      this.ShowResizeCursor = showResizeCursor;
      if( this.ShowResizeCursor )
      {
        UIViewBase viewBase = ( dataGridContext != null ) ? dataGridContext.DataGridControl.GetView() as UIViewBase : null;

        e.Cursor = ( viewBase != null ) ? viewBase.ColumnResizeWestEastCursor : UIViewBase.DefaultColumnResizeWestEastCursor;
        e.Handled = true;
      }
    }
Пример #28
0
        private Cursor QueryCursor(int timestamp)
        {
            if (Target == null)
            {
                return Cursors.Arrow;
            }

            QueryCursorEventArgs e = new QueryCursorEventArgs(Mouse.QueryCursorEvent, Target, this, timestamp, Position);
            e.Cursor = Cursors.Arrow;
            Target.RaiseEvent(e);

            return e.Handled ? e.Cursor : Cursors.Arrow;
        }
    private void ColumnResizerThumbLeft_QueryCursor( object sender, QueryCursorEventArgs e )
    {
      var previousColumnManagerCell = this.GetPreviousVisibleColumnManagerCell();
      if( previousColumnManagerCell == null )
        return;

      previousColumnManagerCell.ColumnResizerThumb_QueryCursor( previousColumnManagerCell, e );
    }
Пример #30
0
        /// <summary>
        ///     Virtual method reporting the cursor to display was requested
        /// </summary>
        protected override void OnQueryCursor(QueryCursorEventArgs e)
        {
            base.OnQueryCursor(e);

            if (e.Handled)
            {
                return;
            }

            if (_textEditor != null)
            {
                _textEditor.OnQueryCursor(e);
            }
        }
Пример #31
0
        private void HostQueryCursor(object sender, QueryCursorEventArgs e)
        {
            if (!IsContentHostPart(e.OriginalSource))
                return;

            if (AllowMouseDrag && !IsFocused && DragCursor != null)
            {
                e.Cursor = DragCursor;
                e.Handled = true;
            }
        }
		// provide the IBeam Cursor for the text area
		void textArea_QueryCursor(object sender, QueryCursorEventArgs e)
		{
			if (!e.Handled) {
				if (mode != SelectionMode.None) {
					// during selection, use IBeam cursor even outside the text area
					e.Cursor = Cursors.IBeam;
					e.Handled = true;
				} else if (textArea.TextView.VisualLinesValid) {
					// Only query the cursor if the visual lines are valid.
					// If they are invalid, the cursor will get re-queried when the visual lines
					// get refreshed.
					Point p = e.GetPosition(textArea.TextView);
					if (p.X >= 0 && p.Y >= 0 && p.X <= textArea.TextView.ActualWidth && p.Y <= textArea.TextView.ActualHeight) {
						int visualColumn;
						bool isAtEndOfLine;
						int offset = GetOffsetFromMousePosition(e, out visualColumn, out isAtEndOfLine);
						if (enableTextDragDrop && textArea.Selection.Contains(offset))
							e.Cursor = Cursors.Arrow;
						else
							e.Cursor = Cursors.IBeam;
						e.Handled = true;
					}
				}
			}
		}
Пример #33
0
 private void friend_QueryCursor(object sender, System.Windows.Input.QueryCursorEventArgs e)
 {
     this.HorizontalOffset += +0.1;
     this.HorizontalOffset += -0.1;
 }