Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
0
		/// <inheritdoc/>
		protected internal override void OnQueryCursor(QueryCursorEventArgs e)
		{
			if (LinkIsClickable()) {
				e.Handled = true;
				e.Cursor = Cursors.Hand;
			}
		}
Exemplo n.º 3
0
        protected override IScriptCommand executeInner(ParameterDic pm, UIElement sender, RoutedEventArgs evnt, IUIInput input, IList <IUIInputProcessor> inpProcs)
        {
            if (evnt is GiveFeedbackEventArgs)
            {
                GiveFeedbackEventArgs gevnt = evnt as GiveFeedbackEventArgs;
                if (CursorType != null)
                {
                    gevnt.UseDefaultCursors = false;
                    Mouse.SetCursor(CursorType);
                    gevnt.Handled = true;
                }
                else
                {
                    gevnt.UseDefaultCursors = true;
                }
            }
            else if (evnt is QueryCursorEventArgs)
            {
                QueryCursorEventArgs qevnt = evnt as QueryCursorEventArgs;
                if (CursorType != null)
                {
                    qevnt.Cursor  = CursorType;
                    qevnt.Handled = true;
                }
            }

            return(NextCommand);
        }
 // provide the IBeam Cursor for the text area
 void textArea_QueryCursor(object sender, QueryCursorEventArgs e)
 {
     if (!e.Handled)
     {
         if (mode != SelectionMode.None || !enableTextDragDrop)
         {
             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;
                 int offset = GetOffsetFromMousePosition(e, out visualColumn);
                 if (textArea.Selection.Contains(offset))
                 {
                     e.Cursor = Cursors.Arrow;
                 }
                 else
                 {
                     e.Cursor = Cursors.IBeam;
                 }
                 e.Handled = true;
             }
         }
     }
 }
        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;
            }
        }
        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;
        }
 private void Note_QueryCursor(object sender, QueryCursorEventArgs e)
 {
     if (noteIsDragging)
     {
         e.Cursor = Cursors.SizeAll;
     }
 }
        private void DragSourceManager_DragOutsideQueryCursor(object sender, QueryCursorEventArgs e)
        {
            HierarchicalGroupByControlNode hierarchicalGroupByControlNode = HierarchicalGroupByItem.GetParentHierarchicalGroupByControlNode(this);

            if ((hierarchicalGroupByControlNode == null) ||
                (!hierarchicalGroupByControlNode.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;
            }
        }
Exemplo n.º 9
0
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     if (Keyboard.Modifiers.Has(ModifierKeys.Control))
     {
         e.Handled = true;
         e.Cursor  = Cursors.Hand;
     }
 }
Exemplo n.º 10
0
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     if (Cursor != null && (ForceCursor || !e.Handled))
     {
         e.Cursor  = Cursor;
         e.Handled = true;
     }
 }
Exemplo n.º 11
0
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     base.OnQueryCursor(e);
     if (!e.Handled && (pan || isMouseDown))
     {
         e.Handled = true;
         e.Cursor  = isMouseDown ? PanToolCursorMouseDown : PanToolCursor;
     }
 }
Exemplo n.º 12
0
 // Token: 0x06005340 RID: 21312 RVA: 0x00172631 File Offset: 0x00170831
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     base.OnQueryCursor(e);
     if (e.Handled)
     {
         return;
     }
     this._textEditor.OnQueryCursor(e);
 }
Exemplo n.º 13
0
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     if (!GamePathIsClickable())
     {
         return;
     }
     e.Handled = true;
     e.Cursor  = Cursors.Hand;
 }
Exemplo n.º 14
0
        private void ColumnResizerThumbLeft_QueryCursor(object sender, QueryCursorEventArgs e)
        {
            var previousColumnManagerCell = this.GetPreviousVisibleColumnManagerCell();

            if (previousColumnManagerCell != null)
            {
                previousColumnManagerCell.ColumnResizerThumb_QueryCursor(previousColumnManagerCell, e);
            }
        }
Exemplo n.º 15
0
            protected override void OnQueryCursor(QueryCursorEventArgs e)
            {
                base.OnQueryCursor(e);

                if ((Keyboard.Modifiers & ModifierKeys.Control) != 0)
                {
                    e.Handled = true;
                    e.Cursor  = Cursors.Hand;
                }
            }
Exemplo n.º 16
0
        /// <inheritdoc/>
        protected override void OnQueryCursor(QueryCursorEventArgs e)
        {
            if (!CanClick)
            {
                return;
            }

            e.Handled = true;
            e.Cursor  = referenceSegment.IsLocal ? Cursors.Arrow : Cursors.Hand;
        }
        // Token: 0x0600304A RID: 12362 RVA: 0x000D8EC0 File Offset: 0x000D70C0
        private static void OnQueryCursor(object sender, QueryCursorEventArgs e)
        {
            Hyperlink hyperlink = (Hyperlink)sender;

            if (hyperlink.IsEnabled && hyperlink.IsEditable && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.None)
            {
                e.Cursor  = hyperlink.TextContainer.TextSelection.TextEditor._cursor;
                e.Handled = true;
            }
        }
Exemplo n.º 18
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);
         }
     }
 }
Exemplo n.º 19
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;
        }
 private void HandlePipetteQueryCursor(BlockViewModel block, QueryCursorEventArgs e)
 {
     if (block is ColorBlockViewModel || block is RampBlockViewModel)
     {
         e.Cursor = Cursors.Cross;
     }
     else
     {
         e.Cursor = Cursors.No;
     }
 }
        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;
        }
Exemplo n.º 22
0
        protected override void OnQueryCursor(QueryCursorEventArgs e)
        {
            var tool = Tools.Values.LastOrDefault(v => v.IsEnabled && v.Cursor != null);

            if (tool != null)
            {
                e.Cursor  = tool.Cursor;
                e.Handled = true;
            }

            base.OnQueryCursor(e);
        }
Exemplo n.º 23
0
 protected override void OnQueryCursor(QueryCursorEventArgs e)
 {
     if (FindNextInsertionPoint(e.GetPosition(this)) >= 0)
     {
         e.Cursor = Cursors.UpArrow;
     }
     else
     {
         e.Cursor = Cursors.Arrow;
     }
     e.Handled = true;
 }
Exemplo n.º 24
0
        public static void SetCurrentMouseOffset(QueryCursorEventArgs e)
        {
            var pos = TextEditor.GetPositionFromPoint(e.GetPosition(TextEditor));

            if (pos == null)
            {
                return;
            }

            LineNumber    = pos.Value.Line;
            CurrentColumn = pos.Value.Column;
        }
Exemplo n.º 25
0
 // Token: 0x06003515 RID: 13589 RVA: 0x000F0A91 File Offset: 0x000EEC91
 private void OnQueryCursor(object sender, QueryCursorEventArgs e)
 {
     if (this._isSelecting || this.GetFixedPanelDocumentPage(e.GetPosition(this._scope)) != null)
     {
         e.Cursor = Cursors.Cross;
     }
     else
     {
         e.Cursor = Cursors.Arrow;
     }
     e.Handled = true;
 }
Exemplo n.º 26
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;
         }
     }
 }
Exemplo n.º 27
0
        private void HostQueryCursor(object sender, QueryCursorEventArgs e)
        {
            if (!IsContentHostPart(e.OriginalSource))
            {
                return;
            }

            if (AllowMouseDrag && !IsFocused && DragCursor != null)
            {
                e.Cursor  = DragCursor;
                e.Handled = true;
            }
        }
Exemplo n.º 28
0
        protected override void OnQueryCursor(QueryCursorEventArgs e)
        {
            if (!LinkIsClickable())
            {
                return;
            }

            e.Handled = true;
            e.Cursor  = Cursors.Hand;

            EnvDteHelper.TextEditor = TextEditor;
            EnvDteHelper.SetCurrentMouseOffset(e);

            (e.Source as TextView).Redraw();
        }
Exemplo n.º 29
0
        private void HostQueryCursor(object sender, QueryCursorEventArgs e)
        {
            if (!IsContentHostPart(e.OriginalSource))
            {
                return;
            }

            if (!AssociatedObject.AllowMouseDrag || AssociatedObject.IsFocused || DragCursor == null)
            {
                return;
            }

            e.Cursor  = DragCursor;
            e.Handled = true;
        }
Exemplo n.º 30
0
            /// <summary>
            /// This is called as the cursor moves to change the visual representation on the screen.
            /// We display the W/E cursor or the IBeam.
            /// </summary>
            /// <param name="e"></param>
            protected override void OnQueryCursor(QueryCursorEventArgs e)
            {
                TextBox textBox = (TextBox)AdornedElement;

                Debug.Assert(textBox != null);

                if (!textBox.IsKeyboardFocused && !textBox.IsFocused)
                {
                    e.Cursor = Cursors.ScrollWE;
                }
                else
                {
                    e.Cursor = Cursors.IBeam;
                }

                e.Handled = true;
            }
Exemplo n.º 31
0
 private void chartControl_QueryCursor(object sender, QueryCursorEventArgs e)
 {
     if (e.CursorType == CursorType.Hand || e.CursorType == CursorType.Grab)
     {
         e.Cursor = Cursors.Default;
     }
 }