public override void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { if (!Visible) { return; } base.HandleMouseMovingEvent(sender, e); if (iconScroller.IsClicked) { // allow scrolling under three conditions // 1) mouse is between min/max scroller positions (don't scroll if mouse is outside the bounds) // 2) mouse is outside bounds, but scroller isn't at the minimum and should be // 3) mouse is outside bounds, but scroller isn't at the maximum and should be if (IsMouseBetweenMinAndMax(e) || IsScrollerNotAtMinimumButShouldBe(e) || IsScrollerNotAtMaximumButShouldBe(e)) { int scrollDistance = GetScrollDistance(e); Vector iconScrollerPosition = GetNewScrollerPosition(scrollDistance); ScrollItemsAndScroller(iconScrollerPosition, scrollDistance); } } HandleMouseMovingEventForItems(sender, e); }
void _MouseMotion(object source, MouseMotionEventArgs e) { if (MouseMotion != null) { MouseMotion(source, e); } }
/// <summary> /// Raises the mouse motion event. /// </summary> /// <param name='ergs'> /// Ergs. /// </param> private static void OnMouseMotion(MouseMotionEventArgs ergs) { if (MouseMotion != null) { MouseMotion(__instance, ergs); } }
static void OnMouseMotion(MouseMotionEventArgs e) { if (MouseMotion != null) { MouseMotion(instance, e); } }
public virtual void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { if (Visible) { IsHovered = GetHovered(e.RelativeToWindowX, e.RelativeToWindowY); } }
public override void PointerMotion(MouseMotionEventArgs args) { /* if the dropdown is visible, see if we're inside it */ if (!dropdown_visible) { return; } if ( /* * starcraft doesn't include this check.. should we? * args.X >= X1 && args.X < X1 + dropdownSurface.Width && */ args.Y >= Y1 + Height && args.Y < Y1 + Height + dropdownSurface.Height) { int new_selected_item = (args.Y - (Y1 + Height)) / Font.LineSize; if (selected_item != new_selected_item) { selected_item = new_selected_item; CreateDropdownSurface(); Painter.Invalidate(new Rectangle(new Point(X1, Y1 + Height), dropdownSurface.Size)); } } }
/// <summary> /// Processes a mouse motion event. This event is triggered by /// SDL. Only /// sprites that are MouseSensitive are processed. /// </summary> /// <param name="sender">Object that sent event</param> /// <param name="e">Event arguments</param> private void Update(object sender, MouseMotionEventArgs e) { foreach (Sprite s in this) { s.Update(e); } }
public void HandlePointerMotion (MouseMotionEventArgs args) { if (dialog != null) dialog.HandlePointerMotion (args); else PointerMotion (args); }
public bool doEvent(object caller, MouseMotionEventArgs mmData, Point offset) { if (SubMenu != null && SubMenu.doEvent(this, mmData)) { return(true); } Point p = mmData.Position; selected = -1; if (p.X < offset.X || p.Y < offset.Y || p.X >= displaySize.Width + offset.X || p.Y >= displaySize.Height + offset.Y) { // Out of focus, brute force clear Clear(); return(false); } int scanX = Compound.IconSize.Width + Compound.Padding * 2 + offset.X; int index = 0; foreach (MenuItem mi in menuEntries) { if (!(mi is MenuSeperator)) { DisplayCaption caption = mi.Caption; caption.SizeWithIcon = false; int newX = scanX + Compound.Padding * 3 + caption.Width; if (newX > p.X) { selected = index; if (mi.IsPopup()) { if (SubMenu != null) { SubMenu.Clear(); } SubMenu = (PopupMenu)mi; SubMenu.Position = new Point(scanX + Compound.Padding * 3, displaySize.Height - Compound.Padding + offset.Y); SubMenu.Show(); } return(true); } scanX = newX; } index++; } return(true); }
private void MouseMotion(object sender, MouseMotionEventArgs e) { if (down) { Gl.glRotatef(lastX - e.X, 0, 1, 0); lastX = e.X; } }
private void MouseMotion(object sender, MouseMotionEventArgs e) { // Fix the emitter and the vortex manipulator to the mouse. emit.X = e.X; emit.Y = e.Y; vort.X = e.X; vort.Y = e.Y; }
public void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { int x = e.RelativeToLastMotionEventX; if (player.Position.X >= 0 && player.Position.X <= MainGame.SCREEN_WIDTH_LOGICAL) { player.AdjustPosition(new Vector(x, 0)); } }
void renderer_MouseMotion(object sender, MouseMotionEventArgs e) { _mousex = e.X; _mousey = e.Y; if (MouseMove != null) { MouseMove(); } }
void MouseMotion(object source, MouseMotionEventArgs e) { if (e.Button == MouseButton.PrimaryButton) { zRot += (e.X - mousex); yRot += (e.Y - mousey); mousex = e.X; mousey = e.Y; } }
private void MouseMotion(object sender, MouseMotionEventArgs e) { _Player.NewRotationLeft -= e.RelativeX * Configuration.Input.MouseSensitivity; _Player.NewRotationUp += e.RelativeY * Configuration.Input.MouseSensitivity; if (_MouseGrab) { CenterMouseCursor(); } }
public override void PointerMotion (MouseMotionEventArgs args) { if (!selecting) return; int index = (args.Y - Y1) / Font.LineSize + first_visible; if (index < items.Count) { selectionIndex = index; Invalidate (); } }
private void UpdateMousePositionDiagnostics(MouseMotionEventArgs e) { var mousePositionAbsolute = new Vector(e.RelativeToWindowX, e.RelativeToWindowY); var mousePositionIsometric = CoordinateHelper.ScreenSpaceToWorldSpace(e.RelativeToWindowX, e.RelativeToWindowY, CoordinateHelper.ScreenOffset, CoordinateHelper.ScreenProjectionType.Orthogonal); labelMousePositionAbsolute.Text = String.Format("Mouse Position (Absolute): ({0}, {1})", mousePositionAbsolute.X, mousePositionAbsolute.Y); labelMousePositionIsometric.Text = String.Format("Mouse Position (Isometric): ({0}, {1})", mousePositionIsometric.X, mousePositionIsometric.Y); }
/// <summary> /// Mouse movement event arguments passed to the active popup or screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public virtual void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { if (IsActivePopupAvailable) { ActivePopup.HandleMouseMovingEvent(sender, e); } else if (IsActiveScreenAvailable) { ActiveScreen.HandleMouseMovingEvent(sender, e); } }
// private void Resize (object sender, VideoResizeEventArgs e) // { // Video.SetVideoMode(e.Width, e.Height, true); // if (screen.Width != e.Width || screen.Height != e.Height) // { // //this.Init(); // this.RedBook t = new RedBook(); t.Reshape(); // } // } private void MouseMotion(object sender, MouseMotionEventArgs e) { if (e.ButtonPressed) { Gl.glRasterPos2i(100, 100); Gl.glPixelZoom((float)zoomFactor, (float)zoomFactor); Gl.glCopyPixels(0, 0, CHECKWIDTH, CHECKHEIGHT, Gl.GL_COLOR); Gl.glPixelZoom(1.0f, 1.0f); Gl.glFlush(); } }
public override void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { // get the map cell that the user's mouse is hovering over if (userInterfaceManager.CurrentState == UserInterfaceState.PlaceEquipmentActive || userInterfaceManager.CurrentState == UserInterfaceState.PlaceRoomActive) { IPurchasable selectedPurchasable = userInterfaceManager.SelectedPurchasableItem; hoveredMapCells = GetHoveredMapCellAndNeighbors(e.RelativeToWindowX, e.RelativeToWindowY, selectedPurchasable.HorizontalMapCellCount, selectedPurchasable.VerticalMapCellCount); userInterfaceManager.SetHoveredMapCells(hoveredMapCells); } userInterfaceManager.HandleMouseMovingEvent(sender, e); }
private void OnMouseMotion(object sender, MouseMotionEventArgs mouseEventArgs) { short relativeX = mouseEventArgs.RelativeX; short relativeY = mouseEventArgs.RelativeY; inputState.MouseMotionX = (short)(relativeX - inputState.RecenterOffsetX); inputState.MouseMotionY = (short)(relativeY - inputState.RecenterOffsetY); Mouse.MousePosition = this.screenCenterPosition; inputState.RecenterOffsetX = (Mouse.MousePosition.X - this.screenCenterPosition.X); inputState.RecenterOffsetY = (Mouse.MousePosition.Y - this.screenCenterPosition.Y); }
public override void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { if (Visible) { foreach (var control in controls) { if (control != null) { control.HandleMouseMovingEvent(sender, e); } } } }
public override void HandleMouseMovingEvent(object sender, MouseMotionEventArgs e) { if (!Visible) { return; } base.HandleMouseMovingEvent(sender, e); foreach (var tab in tabs) { tab.HandleMouseMovingEvent(sender, e); } }
public override bool doEvent(object caller, MouseMotionEventArgs e) { if (e.X < 0 || e.X > Width || e.Y < 0 || e.Y > Height) { selectedAtom = null; decompressedSize = 0; return(false); } Point p = new Point(0, 0); foreach (Atom a in docked) { DisplayCaption dc; if (a == null) { dc = DisplaySettings.defaultCaption; } else { dc = a.Caption; dc.UseDefaultIcon = true; } if (selectedAtom != a) { p.X += dc.Icon.Width + Compound.Padding; } else { p.X += dc.Width + Compound.Padding; } if (e.X < p.X) { if (selectedAtom != a) { selectedAtom = a; decompressedSize = a.Caption.Icon.Width; } return(true); } } selectedAtom = null; decompressedSize = 0; return(true); }
private void MouseMotionEvent(object sender, MouseMotionEventArgs move) { if (!ButtonPressed) { return; } if (PressedButton == MouseButton.PrimaryButton) { board.clickedX = (move.X / board.squareSize); board.clickedY = (move.Y / board.squareSize); gEngine.DrawScreen(board, surfaceControl1); } }
void PointerMotion(object o, MouseMotionEventArgs args) { cached_cursor_x = args.X; cached_cursor_y = args.Y; if (cursor != null) { cursor.SetPosition(cached_cursor_x, cached_cursor_y); } if (currentScreen != null) { currentScreen.HandlePointerMotion(args); } }
/// <summary> /// Determines the distance that the listbox and the scroller image should scroll based on the mouse movement. The distance at which we scroll is limited /// to within the bounds of the minimum and maximum scroll positions. /// </summary> /// <param name="e"></param> /// <returns></returns> private int GetScrollDistance(MouseMotionEventArgs e) { int scrollDistance = e.RelativeToLastMotionEventY; if (iconScroller.Position.Y + scrollDistance < iconScrollerMinPosition.Y) { scrollDistance = (int)(iconScrollerMinPosition.Y - iconScroller.Position.Y); } else if (iconScroller.Position.Y + scrollDistance > iconScrollerMaxPosition.Y) { scrollDistance = (int)(iconScrollerMaxPosition.Y - iconScroller.Position.Y); } return(scrollDistance); }
private void Events_MouseMotion(object sender, MouseMotionEventArgs e) { if (gEngine.highScores.IntersectsWith(new Point(e.X, e.Y)) || gEngine.newGame.IntersectsWith(new Point(e.X, e.Y)) || gEngine.quitGame.IntersectsWith(new Point(e.X, e.Y)) || gEngine.exitButton.IntersectsWith(new Point(e.X, e.Y)) || gEngine.switchMode.IntersectsWith(new Point(e.X, e.Y))) { Cursor.Current = Cursors.Hand; } else { Cursor.Current = Cursors.Default; } }
// private void Resize (object sender, VideoResizeEventArgs e) // { // Video.SetVideoMode(e.Width, e.Height, true); // if (screen.Width != e.Width || screen.Height != e.Height) // { // //this.Init(); // this.RedBook t = new RedBook(); t.Reshape(); // } // } private void MouseButtonPressed(object sender, MouseMotionEventArgs e) { if (e.ButtonPressed) { switch (e.Button) { case MouseButton.PrimaryButton: spinning = true; break; case MouseButton.SecondaryButton: spinning = false; break; } } }
private void MouseMotion(object sender, MouseMotionEventArgs e) { if (dragMode) { ScrollByDrag(new Point(e.X, e.Y)); } else { if (controller != null) { Point ab = qView.fromClientToAB(e.X + ScrollPosition.X, e.Y + ScrollPosition.Y); controller.OnMouseMove(null, qView.fromABToXYZ(ab, controller), ab); } oldX = e.X; oldY = e.Y; } }
public override void PointerMotion (MouseMotionEventArgs args) { if (buttonDownInMinimap) { RecenterFromMinimap (args.X, args.Y); } else { base.PointerMotion (args); // if the mouse is over one of the // normal UIElements in the HUD, deal // with it if (mouseOverElement != null) { // XXX for now, just return. return; } // if the mouse is over the hud area, return int hudIndex = (args.X + args.Y * hudElement.Pcx.Width) * 4; if (hudElement.Pcx.RgbaData [hudIndex] == 0xff) { Game.Instance.Cursor = Cursor; return; } if (args.X < MOUSE_MOVE_BORDER) { horiz_delta = -SCROLL_DELTA; } else if (args.X + MOUSE_MOVE_BORDER > Painter.SCREEN_RES_X) { horiz_delta = SCROLL_DELTA; } else { horiz_delta = 0; } if (args.Y < MOUSE_MOVE_BORDER) { vert_delta = -SCROLL_DELTA; } else if (args.Y + MOUSE_MOVE_BORDER > Painter.SCREEN_RES_Y) { vert_delta = SCROLL_DELTA; } else { vert_delta = 0; } // we update the cursor to show the // scrolling animations here, since it // only happens on pointer motion. if (horiz_delta < 0) if (vert_delta < 0) Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_UL]; else if (vert_delta > 0) Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_DL]; else Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_L]; else if (horiz_delta > 0) if (vert_delta < 0) Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_UR]; else if (vert_delta > 0) Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_DR]; else Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_R]; else if (vert_delta < 0) Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_U]; else if (vert_delta > 0) Game.Instance.Cursor = ScrollCursors[SCROLL_CURSOR_D]; else Game.Instance.Cursor = Cursor; UpdateCursor (); } }
public override void PointerMotion(MouseMotionEventArgs args) { /* if the dropdown is visible, see if we're inside it */ if (!dropdown_visible) return; if (/* starcraft doesn't include this check.. should we? args.X >= X1 && args.X < X1 + dropdownSurface.Width && */ args.Y >= Y1 + Height && args.Y < Y1 + Height + dropdownSurface.Height) { int new_selected_item = (args.Y - (Y1 + Height)) / Font.LineSize; if (selected_item != new_selected_item) { selected_item = new_selected_item; CreateDropdownSurface (); Painter.Invalidate (new Rectangle (new Point (X1, Y1 + Height), dropdownSurface.Size)); } } }
public virtual void PointerMotion(MouseMotionEventArgs args) { }
public override void PointerMotion(MouseMotionEventArgs args) { if (!selecting) return; int index = (args.Y - Y1) / Font.LineSize + first_visible; if (index < items.Count) { selectionIndex = index; Invalidate (); } }
void PointerMotion(object o, MouseMotionEventArgs args) { cached_cursor_x = args.X; cached_cursor_y = args.Y; if (cursor != null) cursor.SetPosition (cached_cursor_x, cached_cursor_y); if (currentScreen != null) currentScreen.HandlePointerMotion (args); }
void MouseMotion( object source, MouseMotionEventArgs e ) { if( e.Button == MouseButton.PrimaryButton ) { zRot += (e.X - mousex); yRot += (e.Y - mousey); mousex = e.X; mousey = e.Y; } }
void renderer_MouseMotion(object sender, MouseMotionEventArgs e) { _mousex = e.X; _mousey = e.Y; if( MouseMove != null ) { MouseMove(); } }
public virtual void PointerMotion(MouseMotionEventArgs args) { if (mouseDownElement != null) { mouseDownElement.PointerMotion (args); } else { UIElement newMouseOverElement = XYToElement (args.X, args.Y, true); if (newMouseOverElement != mouseOverElement) { if (mouseOverElement != null) MouseLeaveElement (mouseOverElement); if (newMouseOverElement != null) MouseEnterElement (newMouseOverElement); } mouseOverElement = newMouseOverElement; } }
public void HandlePointerMotion(MouseMotionEventArgs args) { if (dialog != null) dialog.HandlePointerMotion (args); else PointerMotion (args); }