예제 #1
0
 static public void RemoveWindow(WindowArray windowsToRemove)
 {
     for (int i = windowsToRemove.Count - 1; i > -1; i--)
     {
         RemoveWindow(windowsToRemove[i]);
     }
 }
예제 #2
0
 public void AddUnique(WindowArray wa)
 {
     foreach (IWindow w in wa)
     {
         AddUnique(w);
     }
 }
예제 #3
0
        // made public for unit tests
        public static void Initialize(Texture2D guiTextureToUse, Cursor cursor)
#endif
        {
#if FRB_MDX || XNA3_1
            RemoveInvisibleDominantWindows = true;
#else
            RemoveInvisibleDominantWindows = false;
#endif
            mPerishableArrayReadOnly = new ReadOnlyCollection <IWindow>(mPerishableArray);
            // Currently make the FRB XNA default to not using the UI, but the FRB MDX to true
            TextHeight  = 2;
            TextSpacing = 1;

            mUIEnabled = true;



            //		sr.WriteLine("Inside the GuiManager constructor");
            //		sr.Close();
            mCursors = new List <Cursor>();

            mCursors.Add(cursor);

            mWindowArray         = new WindowArray();
            mReadOnlyWindowArray = new ReadOnlyCollection <IWindow>(mWindowArray);

            mDominantWindows = new List <IWindow>();

#if !MONOGAME && !UNIT_TESTS && !XNA4
            RenderingBasedInitializize();
#endif

            BringsClickedWindowsToFront = true;

            try
            {
                nfi = new System.Globalization.NumberFormatInfo();
                //replaced the above line with the one below to used streamed images.


                ShowingCursorTextBox = true;

                renderingNotes = new List <String>();
            }
            catch (Exception e)
            {
                throw e;
            }


            // Let's do some updates because we want to make sure our "last" values are set to the current value
            // so we don't have any movement on the cursor initially:
            cursor.Update(TimeManager.CurrentTime);
        }
예제 #4
0
        public ToggleButton(Cursor cursor) : base(cursor)
        {
            //pressed = false;
            radioGroup = new WindowArray();
            //pressedText = "";

            ButtonPushedState = ButtonPushedState.Up;

            this.RollingOff += RestoreToStateBefore;
            this.RollingOn  += UndoRestoreToStateBefore;
        }
예제 #5
0
        public MultiButtonMessageBox(Cursor cursor) :
            base(cursor)
        {
            buttonArray            = new WindowArray();
            this.HasMoveBar        = true;
            textField              = new TextField();
            textField.WindowParent = this;

            textField.TextHeight = GuiManager.TextHeight;

            this.ScaleX = 5;

            GuiManagerDrawn = true;
//			this.ScaleY = 5;

            this.Dragging += Move;
        }
        public bool IsWindowInCategory(IWindow windowToCheck, string category)
        {
            WindowArray windowArray = ((WindowArray)GetObject(category));

            return(windowArray != null && ((WindowArray)GetObject(category)).Contains(windowToCheck));
        }
 public void AddWindowArray(string windowName, WindowArray windowArray)
 {
     AddWindowArray(windowName, windowArray, float.NaN, float.NaN);
 }
 public void AddWindowArray(string windowName, WindowArray windowArray, float ScaleX, float ScaleY)
 {
     base.AddItem(windowName, windowArray);
     windowScls.Add(new Vector2(ScaleX, ScaleY));
 }
예제 #9
0
        // made public for unit tests
        public static void Initialize(Texture2D guiTextureToUse, Cursor cursor)
#endif
        {
#if FRB_MDX || XNA3_1
            RemoveInvisibleDominantWindows = true;
#else
            RemoveInvisibleDominantWindows = false;
#endif
            mPerishableArrayReadOnly = new ReadOnlyCollection <IWindow>(mPerishableArray);
            // Currently make the FRB XNA default to not using the UI, but the FRB MDX to true
            TextHeight  = 2;
            TextSpacing = 1;

            mUIEnabled = true;



            //		sr.WriteLine("Inside the GuiManager constructor");
            //		sr.Close();
            mCursors = new List <Cursor>();

            mCursors.Add(cursor);

            mWindowArray         = new WindowArray();
            mReadOnlyWindowArray = new ReadOnlyCollection <IWindow>(mWindowArray);

            mDominantWindows = new List <IWindow>();

#if !MONOGAME && !SILVERLIGHT && !UNIT_TESTS && !XNA4
            RenderingBasedInitializize();
#endif

            BringsClickedWindowsToFront = true;


            try
            {
#if FRB_MDX
                if (System.IO.File.Exists(FlatRedBall.IO.FileManager.RelativeDirectory + "Assets/Textures/upDirectory.bmp"))
                {
                    mUpDirectory = FlatRedBallServices.Load <Texture2D>(
                        FlatRedBall.IO.FileManager.RelativeDirectory + "Assets/Textures/upDirectory.bmp",
                        InternalGuiContentManagerName);
                }
                if (System.IO.File.Exists(FlatRedBall.IO.FileManager.RelativeDirectory + "Assets/Textures/cursorTextBox.bmp"))
                {
                    mCursorTextBox = FlatRedBallServices.Load <Texture2D>(
                        FlatRedBall.IO.FileManager.RelativeDirectory + "Assets/Textures/cursorTextBox.bmp",
                        InternalGuiContentManagerName);
                }



                if (guiTextureToUse != null && guiTextureToUse != "")
                {
                    guiTexture = FlatRedBallServices.Load <Texture2D>(
                        guiTextureToUse, InternalGuiContentManagerName);

                    RefreshTextSize();
                }
#elif SUPPORTS_FRB_DRAWN_GUI
                guiTexture = guiTextureToUse;

                RefreshTextSize();
#endif
            }
            catch (Exception e)
            {
                throw e;
            }
            try
            {
                nfi = new System.Globalization.NumberFormatInfo();
                //replaced the above line with the one below to used streamed images.


                ShowingCursorTextBox = true;

                renderingNotes = new List <String>();
            }
            catch (Exception e)
            {
                throw e;
            }

#if SUPPORTS_FRB_DRAWN_GUI
            SetPropertyGridTypeAssociations();
#endif

            // Let's do some updates because we want to make sure our "last" values are set to the current value
            // so we don't have any movement on the cursor initially:
            cursor.Update(TimeManager.CurrentTime);
            cursor.Update(TimeManager.CurrentTime);
        }