/// <summary>
		/// Finds a potential slot to dock in based on the mouse event.
		/// </summary>
		/// <remarks>This method traverses the entire scene tree in reverse to determine
		/// which container has the most appropriate slot.</remarks>
		public DockSlot FindSlot(MouseEvent evt)
		{
			foreach (var child in Children)
			{
				if (child is DockContainer)
				{
					var slot = (child as DockContainer).SlotTest(evt);
					if (slot != null)
						return slot;
				}
			}

			return SlotTest(evt);
		}
		/// <summary>
		/// This will get called whenever the mouse enters the region of the control.
		/// </summary>
		protected virtual void OnEnter(MouseEvent evt)
		{
			MakeDirty();
		
		public override void OnMouseMotion(MouseEvent evt)
		{
			if (!IsEnabled)
				return;
			
			if (_isHoverable && !evt.IsHandled)
			{
				if (HitTest(evt.Pos)) // it's hovering now
				{
					if (!IsHovering) // it wasn't hovering already
						OnEnter(evt);
					IsHovering = true;
					evt.Handle(this);
					QueuePaneRender();
				}
				else if (IsHovering) // it's not hovering now
				{
					OnLeave(evt);
					IsHovering = false;
					QueuePaneRender();
				}
			}
			else
				IsHovering = false;
			//QueuePaneRender(); // this makes it refresh all the time, but it doesn't seem right
			
		public override void OnMouseMotion (MouseEvent evt)
		{
			base.OnMouseMotion (evt);
			
			foreach (var anchor in anchors.Values)
				anchor.OnMouseMotion(evt);
		}
		protected override void OnEnter(MouseEvent evt)
		{
			base.OnEnter(evt);
			
			evt.Scene.SetCursor(CursorType.Normal);
		}
Exemple #6
0
		public virtual void OnMouseMotion(MouseEvent evt)
		{
			LastMousePosition = evt.Pos;

			evt.HitLine = Camera.ScreenToWorld(evt.Pos);
			var parentScene = evt.Scene;
			evt.Scene = this;
			
			OverlayInteractor.OnMouseMotion(evt);
			if (evt.IsHandled)
			{
				evt.Scene = parentScene;
				return;
			}
			
			if (PrimaryInteractor != null)
			{
				PrimaryInteractor.OnMouseMotion(evt);
				if (evt.IsHandled)
				{
					evt.Scene = parentScene;
					return;
				}
			}
						
			if (EnableViewInteractor)
				ViewInteractor.OnMouseMotion(evt);
			evt.Scene = parentScene;

			if (_tooltipFollowCursor)
				MoveTooltip(evt.Pos);
		}
Exemple #7
0
		public override void OnMouseMotion(MouseEvent evt)
		{
			base.OnMouseMotion(evt);
			
			if (!evt.IsHandled)
				_textBox.OnMouseMotion(evt);
			if (!evt.IsHandled)
				_upButton.OnMouseMotion(evt);
			if (!evt.IsHandled)
				_downButton.OnMouseMotion(evt);
		}
Exemple #8
0
		/// <summary>
		/// Traverses the dock container tree to find a slot that fits the given mouse event.
		/// </summary>
		public DockSlot FindSlot(MouseEvent evt)
		{
			if (Root != null && Root is DockContainer)
				return (Root as DockContainer).FindSlot(evt);
			return null;
		}
Exemple #9
0
		protected override void OnEnter(MouseEvent evt)
		{
			base.OnEnter(evt);
		}
Exemple #10
0
		protected override void OnLeave(MouseEvent evt)
		{
			base.OnLeave(evt);
		}
Exemple #11
0
		protected override void OnEnter(MouseEvent evt)
		{
			base.OnEnter(evt);

			if (IsHoverable && ToolTip != null)
				evt.Scene.SetToolTip(ToolTip, false);
		}
Exemple #12
0
		public override void OnMouseMotion(MouseEvent evt)
		{
			base.OnMouseMotion(evt);
			
			if (Control != null)
			{
				var controlEvt = evt.Copy();
				controlEvt.Pos = GetControlPoint(evt.Pos);
				if (evt.IsHandled)
					controlEvt.Handle(this);
				Control.OnMouseMotion(controlEvt);
				if (controlEvt.IsHandled)
					evt.Handle(controlEvt.LastHandler);
			}
		}
Exemple #13
0
		/// <summary>
		/// Performs a hit test on the pane.
		/// </summary>
		public bool HitTest(MouseEvent evt)
		{
			var origin = RenderOrigin;
			return origin.X <= evt.Pos.X && origin.X + RenderWidth >= evt.Pos.X &&
				origin.Y <= evt.Pos.Y && origin.Y + RenderHeight >= evt.Pos.Y;
		}
Exemple #14
0
		/// <summary>
		/// This will get called whenever the mouse leaves the region of the control.
		/// </summary>
		protected virtual void OnLeave(MouseEvent evt)
		{
			MakeDirty();
Exemple #15
0
		protected override DockSlot SlotTest(MouseEvent evt)
		{
			return null;
		}
Exemple #16
0
		public void OnMouseMotion(MouseEvent evt)
		{
			RootScene.OnMouseMotion(evt);
		}
Exemple #17
0
		public override void OnMouseMotion(MouseEvent evt)
		{
			base.OnMouseMotion(evt);
			CloseButton.OnMouseMotion(evt);
		}
Exemple #18
0
		public override void OnMouseMotion(MouseEvent evt)
		{
			base.OnMouseMotion(evt);

			if (_dragButton != null) // begin dragging
			{
				if (PreSceneUndocked != null)
					PreSceneUndocked(_dragButton.Scene);
				_dragButton = null;
			}
			else // normal
			{
				if (Root != null)
					Root.OnMouseMotion(evt);
			}
		}
		protected override void OnMouseMove(MouseEventArgs args)
		{
			base.OnMouseMove(args);

			var evt = new MouseEvent(Viewport.RootScene, MouseToViewport(args.Location),
			                         Extensions.GetModifier(ModifierKeys));
			Viewport.OnMouseMotion(evt);

			PaintGL();
		}
		public override void OnMouseMotion(MouseEvent evt)
		{
			base.OnMouseMotion(evt);
			
			_lastMouseEvent = evt;
		}
Exemple #21
0
		public override void OnMouseMotion(MouseEvent evt)
		{
			base.OnMouseMotion(evt);
			
			if (!_isDragging)
				return;
			
			SetClosestValue(evt.Pos);
		}
Exemple #22
0
		/// <summary>
		/// Performs a hit test on the scene.
		/// </summary>
		public bool HitTest(MouseEvent evt)
		{
			return this.ViewportOffset.X <= evt.ViewportPos.X && ViewportOffset.X + Width >= evt.ViewportPos.X &&
				this.ViewportOffset.Y <= evt.ViewportPos.Y && ViewportOffset.Y + Height >= evt.ViewportPos.Y;
		}
Exemple #23
0
		public virtual void OnMouseMotion(MouseEvent evt) { }
		protected virtual void OnMotionNotify(object sender, gtk.MotionNotifyEventArgs args)
		{
			MouseEvent evt = new MouseEvent(Viewport.RootScene, new Coord(args.Event.X, HeightGL - args.Event.Y), GetModifier(args.Event.State));			
			Viewport.OnMouseMotion(evt);
			
			PaintGL();
		}
		/// <summary>
		/// Must be implemented by subclasses to determine if the given mouse event is over a potential dock slot.
		/// </summary>
		protected abstract DockSlot SlotTest(MouseEvent evt);