Exemplo n.º 1
0
            public void SetButtons(MouseButtons mouseButtons)
            {
                MouseButtonsDg btns = MouseButtonsDg.None;

                if ((mouseButtons & MouseButtons.Left) > 0)
                {
                    btns |= MouseButtonsDg.Left;
                }
                if ((mouseButtons & MouseButtons.Middle) > 0)
                {
                    btns |= MouseButtonsDg.Middle;
                }
                if ((mouseButtons & MouseButtons.Right) > 0)
                {
                    btns |= MouseButtonsDg.Right;
                }
                if ((mouseButtons & MouseButtons.XButton1) > 0)
                {
                    btns |= MouseButtonsDg.ExtraButton1;
                }
                if ((mouseButtons & MouseButtons.XButton2) > 0)
                {
                    btns |= MouseButtonsDg.ExtraButton2;
                }
                this.buttons = btns;
            }
Exemplo n.º 2
0
 /// <ToBeCompleted></ToBeCompleted>
 public LayerMouseEventArgs(Layer layer, LayerItem item,
                            MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta,
                            Point position, KeysDg modifiers)
     : base(eventType, buttons, clickCount, wheelDelta, position, modifiers)
 {
     this.layer = layer;
     this.item  = item;
 }
Exemplo n.º 3
0
 /// <ToBeCompleted></ToBeCompleted>
 public LayerMouseEventArgs(Layer layer, LayerItem item, IEnumerable <Layer> selectedlayers,
                            MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta, Point position, KeysDg modifiers)
     : base(eventType, buttons, clickCount, wheelDelta, position, modifiers)
 {
     this._layer          = layer;
     this._item           = item;
     this._selectedLayers = new List <Layer>(selectedlayers);
 }
Exemplo n.º 4
0
 /// <ToBeCompleted></ToBeCompleted>
 protected internal void SetMouseEvent(MouseEventType eventType, MouseButtonsDg buttons,
                                       int clickCount, int wheelDelta, Point position, KeysDg modifiers)
 {
     this.eventType  = eventType;
     this.buttons    = buttons;
     this.clicks     = clickCount;
     this.modifiers  = modifiers;
     this.position   = position;
     this.wheelDelta = wheelDelta;
 }
Exemplo n.º 5
0
 /// <ToBeCompleted></ToBeCompleted>
 protected internal void SetMouseEvent(MouseEventType eventType, MouseButtonsDg buttons,
                                       int clickCount, int wheelDelta, Point position, KeysDg modifiers)
 {
     EventType  = eventType;
     Buttons    = buttons;
     Clicks     = clickCount;
     Modifiers  = modifiers;
     Position   = position;
     WheelDelta = wheelDelta;
 }
Exemplo n.º 6
0
		/// <ToBeCompleted></ToBeCompleted>
		public ShapeMouseEventArgs(IEnumerable<Shape> shapes, Diagram diagram, MouseEventType eventType,
		                           MouseButtonsDg buttons, int clicks, int delta, Point location, KeysDg modifiers)
			: base(eventType, buttons, clicks, delta, location, modifiers)
		{
			if (shapes == null) throw new ArgumentNullException("shapes");
			this.shapes.AddRange(shapes);
			this.diagram = diagram;
		}
Exemplo n.º 7
0
		/// <summary>
		/// Initializing a new instance of <see cref="T:Dataweb.NShape.Controllers.MouseEventArgsDg" />.
		/// </summary>
		public MouseEventArgsDg(MouseEventType eventType, MouseButtonsDg buttons, int clicks, int delta, Point location,
		                        KeysDg modifiers)
		{
			this.buttons = buttons;
			this.clicks = clicks;
			this.wheelDelta = delta;
			this.eventType = eventType;
			this.position = location;
			this.modifiers = modifiers;
		}
Exemplo n.º 8
0
 public LayerListViewMouseEventArgs(Layer layer, LayerItem item,
                                    MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta,
                                    Point position, KeysDg modifiers)
     : base(layer, item, eventType, buttons, clickCount, wheelDelta, position, modifiers)
 {
 }
Exemplo n.º 9
0
        /// <ToBeCompleted></ToBeCompleted>
        protected internal void SetMouseEvent(MouseEventType eventType, MouseButtonsDg buttons, 
			int clickCount, int wheelDelta, Point position, KeysDg modifiers)
        {
            this.eventType = eventType;
            this.buttons = buttons;
            this.clicks = clickCount;
            this.modifiers = modifiers;
            this.position = position;
            this.wheelDelta = wheelDelta;
        }
Exemplo n.º 10
0
        /// <ToBeCompleted></ToBeCompleted>
        public LayerMouseEventArgs(Layer layer, LayerItem item, 
			MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta, 
			Point position, KeysDg modifiers)
            : base(eventType, buttons, clickCount, wheelDelta, position, modifiers)
        {
            this.layer = layer;
            this.item = item;
        }
Exemplo n.º 11
0
			public LayerListViewMouseEventArgs(Layer layer, LayerItem item,
				MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta,
				Point position, KeysDg modifiers)
				: base(layer, item, eventType, buttons, clickCount, wheelDelta, position, modifiers) {
			}
Exemplo n.º 12
0
 /// <summary>
 /// Initializes an new empty instance of <see cref="T:Dataweb.NShape.Controllers.MouseEventArgsDg" />.
 /// </summary>
 protected internal MouseEventArgsDg()
 {
     this.buttons = MouseButtonsDg.None;
     this.clicks = 0;
     this.wheelDelta = 0;
     this.eventType = MouseEventType.MouseMove;
     this.position = Point.Empty;
 }
Exemplo n.º 13
0
 public LayerMouseEventArgs(Layer layer, LayerItem item,
                            MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta,
                            Point position, KeysDg modifiers)
     : this(layer, item, EnumerationHelper.Enumerate(layer), eventType, buttons, clickCount, wheelDelta, position, modifiers)
 {
 }
Exemplo n.º 14
0
		private bool IsDragActionFeasible(MouseState mouseState, MouseButtonsDg button) {
			int dx = 0, dy = 0;
			if (mouseState.IsButtonDown(button) && IsToolActionPending) {
				// Check the minimum drag distance before switching to a drag action
				dx = Math.Abs(mouseState.X - ActionStartMouseState.X);
				dy = Math.Abs(mouseState.Y - ActionStartMouseState.Y);
			}
			return (dx >= MinimumDragDistance.Width || dy >= MinimumDragDistance.Height);
		}
Exemplo n.º 15
0
			/// <ToBeCompleted></ToBeCompleted>
			public bool IsButtonDown(MouseButtonsDg button) {
				return (Buttons & button) != 0;
			}