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

InsertChild() public method

Inserts the given window as a child into the given location in the zorder.
public InsertChild ( idWindow window, idWindow before ) : bool
window idWindow
before idWindow
return bool
		public bool InsertChild(idWindow window, idWindow before)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			AddChild(window);

			window.Parent = this;

			DrawWindow drawWindow = new DrawWindow(window);

			// if not inserting before anything then just add it at the end
			if(before != null)
			{
				int index = GetChildIndex(before);

				if(index != -1)
				{
					_drawWindows.Insert(index, drawWindow);
					return true;
				}
			}

			_drawWindows.Add(drawWindow);

			return true;
		}