void OnMouseDown(object sender, MouseEventArgs args) { if (args.Button != MouseButton.Left || !Resizable) { return; } args.Consume(); IsDragging = true; var hitPoint = args.Position; switch (Direction) { case Direction.Left: dragOffset = SplitterOffset - hitPoint.X; break; case Direction.Right: dragOffset = SplitterOffset + hitPoint.X; break; case Direction.Up: dragOffset = SplitterOffset - hitPoint.Y; break; case Direction.Down: dragOffset = SplitterOffset + hitPoint.Y; break; } }
void OnMouseDragged(object sender, MouseEventArgs args) { if (!Resizable) { IsDragging = false; return; } if (IsDragging) { args.Consume(); var hitPoint = args.Position; switch (Direction) { case Direction.Left: SplitterOffset = dragOffset + hitPoint.X; break; case Direction.Right: SplitterOffset = dragOffset - hitPoint.X; break; case Direction.Up: SplitterOffset = dragOffset + hitPoint.Y; break; case Direction.Down: SplitterOffset = dragOffset - hitPoint.Y; break; } } }
void OnMouseClick(object sender, MouseEventArgs args) { if (args.Button == MouseButton.Left) { args.Consume(); ActivateTab(); } }
void OnMouseClick(object sender, MouseEventArgs args) { args.Consume(); if (Collapsable && Resizable) { ToggleCollapse(); } }
void OnMouseUp(object source, MouseEventArgs args) { if (args.Button != MouseButton.Left) { return; } args.Consume(); pressed = false; }
void OnMouseUp(object source, MouseEventArgs args) { if (args.Button != MouseButton.Left) { return; } args.Consume(); OnActivateUp(); }
void OnMouseDragged(object source, MouseEventArgs args) { if (isDragging) { args.Consume(); int offset; Bias bias; if (Content.ViewToModel(args.Position, out offset, out bias)) { NavigateTo(offset, true); } } }
void OnMouseDragged(object source, MouseEventArgs args) { if (pressed) { args.Consume(); var progress = MousePositionToValue(args.Position.X); var newValue = MinValue + (int)Math.Floor(progress * (MaxValue - MinValue) / Step + 0.5f) * Step; if (Math.Abs(newValue - Value) > 0.005) { Value = newValue; } } }
void OnMouseWheel(object source, MouseEventArgs args) { args.Consume(); var scrollWheelDelta = args.ScrollWheelDelta; if ((scrollWheelDelta < 0 && Offset >= MaximumVisibleOffset) || (scrollWheelDelta > 0 && Offset <= 0)) { return; } var delta = (int)(-scrollWheelDelta * Math.Max(0, ScrollUnit)); Scroll(delta); }
void OnMouseDragged(object source, MouseEventArgs args) { if (isDragging) { args.Consume(); var mouseDragPoint = args.Position; var mouseDragDelta = mouseDragPoint.Y - lastMouseDragPoint.Y; var borderRect = BorderRect; mouseOffset += (float)mouseDragDelta * borderRect.Height / ScrollbarThumbHeight; lastMouseDragPoint = mouseDragPoint; ScrollTo(mouseOffset, true); } }
void OnMouseDown(object source, MouseEventArgs args) { if (args.Button != MouseButton.Left) { return; } args.Consume(); pressed = true; Tooltip?.DisplayNow(); var progress = MousePositionToValue(args.Position.X); Value = MinValue + (int)Math.Floor(progress * (MaxValue - MinValue) / Step + 0.5f) * Step; }
void OnMouseDragged(object sender, MouseEventArgs args) { if (DraggedTab != null) { var deltaX = args.Position.X - DraggedTabEventOrigin; if (Math.Abs(deltaX) > 5) { DragActive = true; } DraggedTabOffset = DraggedTabOffsetOrigin + deltaX; parent.InvalidateLayout(); args.Consume(); } }
void OnMouseDown(object sender, MouseEventArgs args) { if (args.Button != MouseButton.Left || parent.AllowDragReorder == false) { return; } DraggedTab = sender as NotebookTab; if (DraggedTab != null) { DraggedTabOffsetOrigin = DraggedTab.LayoutRect.X; DraggedTabEventOrigin = args.Position.X; DraggedTabOffset = DraggedTab.LayoutRect.X; } args.Consume(); }
void OnMouseClick(object source, MouseEventArgs args) { args.Consume(); var borderRect = BorderRect; var scrollBarTop = borderRect.Top + ScrollbarThumbOffset; var scrollbarBottom = borderRect.Top + ScrollbarThumbOffset + ScrollbarThumbHeight; if (args.Position.Y < scrollBarTop) { var x = Math.Max(1, borderRect.Height - ScrollbarThumbHeight) / 2; Scroll(-TranslateMouseOffsetToScrollOffset(x)); } else if (args.Position.Y > scrollbarBottom) { var x = Math.Max(1, borderRect.Height - ScrollbarThumbHeight) / 2; Scroll(TranslateMouseOffsetToScrollOffset(x)); } }
void OnMouseDown(object source, MouseEventArgs args) { if (args.Button != MouseButton.Left) { return; } args.Consume(); isDragging = true; int offset; Bias bias; if (Content.ViewToModel(args.Position, out offset, out bias)) { NavigateTo(offset, args.Flags.IsShiftDown()); } }
void OnMouseUp(object sender, MouseEventArgs args) { if (DraggedTab == null || DragActive == false) { return; } args.Consume(); var idx = parent.IndexOf(DraggedTab); if (idx == -1) { DraggedTab = null; return; } var insertIdx = FindInsertIndex(); if (insertIdx != idx) { var focused = parent.Screen?.FocusManager?.FocusedWidget; var activeTab = parent.ActiveTab; parent.Remove(DraggedTab); var newIndex = FindInsertIndex(); parent.Add(DraggedTab, newIndex); if (focused != null) { parent.Screen.FocusManager.FocusedWidget = focused; } parent.ActiveTab = activeTab; parent.InvalidateLayout(); } DragActive = false; DraggedTab = null; DraggedTabOffset = 0; DraggedTabOffsetOrigin = 0; DraggedTabEventOrigin = 0; }
void OnMouseDown(object source, MouseEventArgs args) { if (args.Button != MouseButton.Left) { return; } args.Consume(); var borderRect = BorderRect; var scrollBarTop = borderRect.Top + ScrollbarThumbOffset; var scrollbarBottom = borderRect.Top + ScrollbarThumbOffset + ScrollbarThumbHeight; var inside = borderRect.Contains(args.Position); if ((inside && args.Position.Y >= scrollBarTop && args.Position.Y <= scrollbarBottom) || !inside) { isDragging = true; lastMouseDragPoint = args.Position; mouseOffset = Offset; } }
void OnMouseDown(object sender, MouseEventArgs e) { this.RequestFocus(); e.Consume(); }
void OnMouseClick(object source, MouseEventArgs args) { Click(); args.Consume(); }
void OnMouseClick(object source, MouseEventArgs args) { selectionChangedSupport.Raise(this, ListSelectionEventArgs.Confirmed); args.Consume(); }
void OnMouseUp(object sender, MouseEventArgs args) { args.Consume(); IsDragging = false; }