/// <summary>
        /// Method triggered when MouseUp event is fired on the TreeListView. Raises MouseUp event.</summary>
        /// <param name="e">Mouse event arguments</param>
        protected virtual void OnMouseUp(MouseEventArgs e)
        {
            MouseUp.Raise(this, e);

            if (e.Button != MouseButtons.Right)
            {
                return;
            }

            if (CommandService == null)
            {
                return;
            }

            if (ContextMenuCommandProviders == null)
            {
                return;
            }

            IEnumerable <object> commands =
                ContextMenuCommandProviders.GetCommands(
                    View,
                    m_treeListViewAdapter.LastHit);

            Point screenPoint = TreeListView.Control.PointToScreen(new Point(e.X, e.Y));

            CommandService.RunContextMenu(commands, screenPoint);
        }
        private void CheckButtonReleased(Func <MouseState, ButtonState> getButtonState, MouseButton button)
        {
            if (getButtonState(_currentState) == ButtonState.Released &&
                getButtonState(_previousState) == ButtonState.Pressed)
            {
                var args = new MouseEventArgs(_gameTime.TotalGameTime, _previousState, _currentState, button);

                if (_mouseDownArgs.Button == args.Button)
                {
                    var clickMovement = DistanceBetween(args.Position, _mouseDownArgs.Position);

                    // If the mouse hasn't moved much between mouse down and mouse up
                    if (clickMovement < DragThreshold)
                    {
                        if (!_hasDoubleClicked)
                        {
                            MouseClicked.Raise(this, args);
                        }
                    }
                    else // If the mouse has moved between mouse down and mouse up
                    {
                        MouseDragged.Raise(this, args);
                    }
                }

                MouseUp.Raise(this, args);

                _hasDoubleClicked  = false;
                _previousClickArgs = args;
            }
        }
Beispiel #3
0
		public virtual void onMouseUp(object sender, MouseButtonEventArgs e){
			//bubble event to the top
			GraphicObject p = Parent as GraphicObject;
			if (p != null)
				p.onMouseUp(sender,e);

			MouseUp.Raise (this, e);

			if (MouseIsIn (e.Position) && IsActive) {
				if (CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
					CurrentInterface.eligibleForDoubleClick = this;
				onMouseClick (this, e);
			}
		}
Beispiel #4
0
 /// <summary>
 /// Method triggered when MouseUp event is fired on the TreeListView. Raises MouseUp event.</summary>
 /// <param name="e">Mouse event arguments</param>
 protected virtual void OnMouseUp(MouseEventArgs e)
 {
     MouseUp.Raise(this, e);
 }