public static void AddWindow(IWindow windowToAdd) { #if DEBUG if (windowToAdd == null) { throw new ArgumentException("Argument Window can't be null"); } if (mWindowArray.Contains(windowToAdd)) { int index = mWindowArray.IndexOf(windowToAdd); throw new ArgumentException("This window has already been added to the GuiManager. It is at index " + index); } if (!FlatRedBallServices.IsThreadPrimary()) { throw new InvalidOperationException("Windows can only be added on the primary thread"); } #endif mWindowArray.Add(windowToAdd); if (BringsClickedWindowsToFront == false) { InsertionSort(mWindowArray, WindowComparisonForSorting); } }
public void AddButton(Button buttonToAdd) { buttonToAdd.ScaleX = TextManager.GetWidth(buttonToAdd.Text, GuiManager.TextSpacing) / 2.0f + .5f; buttonToAdd.ScaleY = 1.5f; buttonArray.Add(buttonToAdd); ResizeBox(); }