idTech4.UI.idWindow.HandleMouseEnter C# (CSharp) Method

HandleMouseEnter() private method

private HandleMouseEnter ( ) : void
return void
		private void HandleMouseEnter()
		{
			this.Hover = true;

			if(_noEvents == false)
			{
				RunScript(ScriptName.MouseEnter);
			}
		}

Usage Example

示例#1
0
		protected virtual string RouteMouseCoordinates(float x, float y)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			if(this.CaptureChild != null)
			{
				//FIXME: unkludge this whole mechanism
				return this.CaptureChild.RouteMouseCoordinates(x, y);
			}

			if((x == -2000) || (y == -2000))
			{
				return string.Empty;
			}
	
			int c = _children.Count;
			string str = string.Empty;

			while(c > 0)
			{
				idWindow child = _children[--c];

				if((child.IsVisible == true)
					&& (child.NoEvents == false)
					&& (child.Contains(child.DrawRectangle, this.UserInterface.CursorX, this.UserInterface.CursorY) == true))
				{
					this.DeviceContext.Cursor = child.Cursor;

					if(_overChild != child)
					{
						if(_overChild != null)
						{
							_overChild.HandleMouseExit();

							str = _overChild.Command;

							if(str != string.Empty)
							{
								this.UserInterface.Desktop.AddCommand(str);
								_overChild.Command = string.Empty;
							}
						}

						_overChild = child;
						_overChild.HandleMouseEnter();

						str = _overChild.Command;

						if(str != string.Empty)
						{
							this.UserInterface.Desktop.AddCommand(str);
							_overChild.Command = string.Empty;
						}
					} 
					else 
					{
						if((child.Flags & WindowFlags.HoldCapture) == 0)
						{
							child.RouteMouseCoordinates(x, y);
						}
					}

					return string.Empty;
				}
			}

			if(_overChild != null)
			{
				_overChild.HandleMouseExit();

				str = _overChild.Command;

				if(str != string.Empty)
				{
					this.UserInterface.Desktop.AddCommand(str);
					_overChild.Command = string.Empty;
				}

				_overChild = null;
			}

			return string.Empty;
		}