public override bool MouseUp(MouseButtonEventArgs e) { if (disposing || !IsVisible()) { return(false); } if (scrollbarH.MouseUp(e)) { return(true); } if (scrollbarV.MouseUp(e)) { return(true); } if (ClientArea.Contains(e.X, e.Y)) { MouseButtonEvent mbe = new MouseButtonEvent(); mbe.X = e.X - (Position.X + (int)scrollbarH.Value); mbe.Y = e.Y - (Position.Y + (int)scrollbarV.Value); mbe.Button = e.Button; MouseButtonEventArgs modArgs = new MouseButtonEventArgs(mbe); foreach (GuiComponent component in components) { component.MouseUp(modArgs); } } return(false); }
private static void OnMouseClick(Screen w, MouseButtonEvent e) { if (e.State == ButtonState.Pressed) { if (e.Position.Y < 30 && e.Position.X < _window.Size.Width - 40) { _windowStart = _window.Position; _dragStart = _windowStart + e.Position; _isMoveWindow = true; } // var cardBounds = new Rectangle(_cardPos - (Vector)_card.Size / 2F, _card.Size); if (cardBounds.Contains(e.Position - (8, 30))) // minus viewport { _isMoveCard = true; _dragStart = e.Position; } } else if (e.State == ButtonState.Released) { if (_isHoverClose) { // Bye! _window.Close(); } _isMoveWindow = false; _isMoveCard = false; } }
protected internal override void OnMouseDown(MouseButtonEvent e) { // Handle non interactive state. if (!IsInteractive) { e.IsHandled = true; return; } // We only care about left ButtonBase presses if (e.Button != MouseButton.Left) { return; } // Mark the event as handled so it does not propegate further e.IsHandled = true; // Set the button as focused // TODO: Focus //if (IsFocusable) Focus(); // Set the capture to this node to ensure all future events are routed to it. Capture(); OnPress(); // Fire click event if click mode is press if (ClickMode == ClickMode.Press) { OnClick(); } }
private void OnClick(MouseButtonEvent e) { var button = ServerInput.ToServerButton(e.Button); var mods = ServerInput.ToServerModifiers(e.Modifiers); SendMessage("click", e.Position, button, mods); }
/// <summary> /// Finishes the current blueprint selection. /// </summary> /// <param name="e">The mouse event which triggered end of selection.</param> /// <returns>Whether a click selection was active.</returns> private bool endClickSelection(MouseButtonEvent e) { if (!clickSelectionBegan && !isDraggingBlueprint) { // if a selection didn't occur, we may want to trigger a deselection. if (e.ControlPressed && e.Button == MouseButton.Left) { // Iterate from the top of the input stack (blueprints closest to the front of the screen first). // Priority is given to already-selected blueprints. foreach (SelectionBlueprint <T> blueprint in SelectionBlueprints.AliveChildren.Reverse().OrderByDescending(b => b.IsSelected)) { if (!blueprint.IsHovered) { continue; } return(clickSelectionBegan = SelectionHandler.MouseUpSelectionRequested(blueprint, e)); } } return(false); } return(true); }
private void HandleMouseButtonEvent(IntPtr window, int button, int action, int mods) { if (this.MouseButtonPressedHandler.HasSubscribers || this.MouseButtonReleasedHandler.HasSubscribers) { var commonButton = MouseButton.Other; if (button == GLFW_MOUSE_BUTTON_LEFT) { commonButton = MouseButton.Left; } else if (button == GLFW_MOUSE_BUTTON_RIGHT) { commonButton = MouseButton.Right; } else if (button == GLFW_MOUSE_BUTTON_MIDDLE) { commonButton = MouseButton.Middle; } var mbe = new MouseButtonEvent(button, commonButton); if (action == GLFW_PRESS) { this.MouseButtonPressedHandler.Notify(mbe); } else if (action == GLFW_RELEASE) { this.MouseButtonReleasedHandler.Notify(mbe); } } }
private void OnButtonClick(object sender, MouseButtonEvent e) { if (sender == back) { Current = Current.Parent; } else if (sender == next) { currentOffset += (PageRows * PageColumns) - 2; UpdateButtons(); } else { var button = (MenuButton)sender; if (button.Node != null) { if (button.Node.Children.Any()) { Current = button.Node; } else { button.Node.Activate(); } } } }
private void ProcessMouseDownEvent(MouseButtonEvent pMouseDownEvent) { if (_processMouseDown != null) { _processMouseDown(new Point(pMouseDownEvent.X, pMouseDownEvent.Y)); } }
protected override void OnMouseButtonDown(MouseButtonEvent e) { if (e.Button == MouseButton.Left) { Click.Raise(this, EventArgs.Empty); } }
protected override void OnMouseButtonDown(MouseButtonEvent e) { if (e.Button == MouseButton.Left) { IsChecked = !IsChecked; } }
protected override void OnMouseButtonDown(MouseButtonEvent e) { if (Session == null) { return; } camera.OnMouseButtonDown(e); if (e.Handled) { return; } var sc = ToAbsolute(e.Position); var mc = Geometry.ScreenToMap(sc); var gob = Session.Scene.GetObjectAt(sc); if (placeGob != null) { Placed.Raise(new MapPlaceEvent(e, placeGob.Position)); Session.Objects.RemoveLocal(placeGob); placeGob = null; } else { MapClick.Raise(new MapClickEvent(e, mc, e.Position, gob)); } e.Handled = true; }
private void OnMouseDown(MouseButtonEvent e) { if (e.Down) { mousePos = new Vector2(e.MouseState.X, e.MouseState.Y); } }
public void HandleMouseButtonUp(MouseButtonEvent e) { OnMouseButtonUp(e); if (!e.Handled && Parent != null) { Parent.OnMouseButtonUp(e); } }
private void SendMouseButtonMessage(MouseButtonEvent buttonEvent, int button, Vector2 mousePosition) { MouseButtonMessage message = m_messageDispatcher.AddMessage <MouseButtonMessage>(); message.buttonEvent = buttonEvent; message.button = button; message.mousePosition = mousePosition; }
private void OnAvatarClick(AvatarView sender, MouseButtonEvent e) { var pair = avatars.FirstOrDefault(x => x.Value == sender); if (pair.Value != null) { PartyMemberClick.Raise(new PartyMemberClickEvent(pair.Key, e.Button)); } }
protected override void OnMouseButtonDown(MouseButtonEvent e) { if (e.Button == MouseButton.Left) { isPressed = true; dragPosition = e.Position; Host.GrabMouse(this); } }
private void OnSlotClick(object sender, MouseButtonEvent e) { int index = slots.IndexOf((BeltSlot)sender); if (index != -1) { Click.Raise(new BeltClickEvent(index, e.Button, e.Modifiers)); } }
protected override void OnMouseButtonDown(MouseButtonEvent e) { if (e.Button == MouseButton.Left) { dragging = true; Host.GrabMouse(this); } e.Handled = true; }
protected override void OnMouseButtonUp(MouseButtonEvent e) { if (e.Button == MouseButton.Left) { dragging = false; Host.ReleaseMouse(); } e.Handled = true; }
public void AddMouse(MouseButton newMouse, MouseButtonEvent newMouseEvent) { var index = InputComponentsLookup.Mouse; var component = (MouseComponent)CreateComponent(index, typeof(MouseComponent)); component.mouse = newMouse; component.MouseEvent = newMouseEvent; AddComponent(index, component); }
public void ReplaceInterActionMouse(MouseButton newMouse, MouseButtonEvent newMouseEvent) { var index = InputComponentsLookup.InterActionMouse; var component = (InterAction.MouseComponent)CreateComponent(index, typeof(InterAction.MouseComponent)); component.mouse = newMouse; component.MouseEvent = newMouseEvent; ReplaceComponent(index, component); }
public override void OnMouseButtonUp(MouseButtonEvent e) { if (e.Button == MouseButton.Middle) { mv.Host.ReleaseMouse(); dragging = false; e.Handled = true; } }
public virtual bool mouseReleased(MouseButtonEvent evt) { bool ret = (SwigDerivedClassHasMethod("mouseReleased", swigMethodTypes9) ? BitesPINVOKE.InputListener_mouseReleasedSwigExplicitInputListener(swigCPtr, MouseButtonEvent.getCPtr(evt)) : BitesPINVOKE.InputListener_mouseReleased(swigCPtr, MouseButtonEvent.getCPtr(evt))); if (BitesPINVOKE.SWIGPendingException.Pending) { throw BitesPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
/// <summary> /// Handle a blueprint requesting selection. /// </summary> /// <param name="blueprint">The blueprint.</param> /// <param name="e">The mouse event responsible for deselection.</param> /// <returns>Whether a deselection was performed.</returns> internal bool MouseUpSelectionRequested(SelectionBlueprint <T> blueprint, MouseButtonEvent e) { if (blueprint.IsSelected) { blueprint.ToggleSelection(); return(true); } return(false); }
public override bool mousePressed(MouseButtonEvent evt) { bool ret = BitesPINVOKE.InputListenerChain_mousePressed(swigCPtr, MouseButtonEvent.getCPtr(evt)); if (BitesPINVOKE.SWIGPendingException.Pending) { throw BitesPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public override bool mouseReleased(MouseButtonEvent evt) { bool ret = BitesPINVOKE.CameraMan_mouseReleased(swigCPtr, MouseButtonEvent.getCPtr(evt)); if (BitesPINVOKE.SWIGPendingException.Pending) { throw BitesPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
protected override void OnMouseButtonDown(MouseButtonEvent e) { if (e.Button != MouseButton.Left) { return; } Host.GrabMouse(this); isPressed = true; e.Handled = true; }
public override void OnMouseButtonDown(MouseButtonEvent e) { if (e.Button == MouseButton.Middle) { mv.Host.GrabMouse(mv); dragging = true; dragPosition = e.Position; dragCameraOffset = Position; e.Handled = true; } }
private void selectionRequested(PathControlPointPiece piece, MouseButtonEvent e) { if (e.Button == MouseButton.Left && inputManager.CurrentState.Keyboard.ControlPressed) { piece.IsSelected.Toggle(); } else { SetSelectionTo(piece.ControlPoint); } }
public InputEntity SetInterActionMouse(MouseButton newMouse, MouseButtonEvent newMouseEvent) { if (hasInterActionMouse) { throw new Entitas.EntitasException("Could not set InterActionMouse!\n" + this + " already has an entity with InterAction.MouseComponent!", "You should check if the context already has a interActionMouseEntity before setting it or use context.ReplaceInterActionMouse()."); } var entity = CreateEntity(); entity.AddInterActionMouse(newMouse, newMouseEvent); return(entity); }
void ProcessMouseButtonReleased(MouseButtonEvent mouseButtonEvent) { canvas.Input_MouseButton((int) mouseButtonEvent.Button, false); }
void ProcessMouseButtonPressed(MouseButtonEvent mouseButtonEvent) { canvas.Input_MouseButton((int) mouseButtonEvent.Button, true); }
//////////////////////////////////////////////////////////// /// <summary> /// Construct the mouse button arguments from a mouse button event /// </summary> /// <param name="e">Mouse button event</param> //////////////////////////////////////////////////////////// public MouseButtonEventArgs(MouseButtonEvent e) { Button = e.Button; X = e.X; Y = e.Y; }
public MouseButtonEventArgs(Point point, MouseButton button, MouseButtonEvent buttonEvent) { _point = point; _button = button; _buttonEvent = buttonEvent; }