示例#1
0
        void ScaleAllPolygons(Window callingWindow)
        {
            Window polyScaleWindow = GuiManager.AddWindow();

            polyScaleWindow.Name           = "Scale All Polygons";
            polyScaleWindow.ScaleX         = 10f;
            polyScaleWindow.ScaleY         = 4f;
            polyScaleWindow.HasMoveBar     = true;
            polyScaleWindow.HasCloseButton = true;

            UpDown scaleBox = new UpDown(mCursor);

            polyScaleWindow.AddWindow(scaleBox);
            scaleBox.Name         = "scale";
            scaleBox.CurrentValue = 1f;
            scaleBox.ScaleX       = 9f;
            scaleBox.X            = 10f;
            scaleBox.Y            = Window.MoveBarHeight;

            Button okButton = new Button(mCursor);

            polyScaleWindow.AddWindow(okButton);
            okButton.Text   = "Set Scale";
            okButton.ScaleX = 9f;
            okButton.X      = 10f;
            okButton.Y      = scaleBox.Y + scaleBox.ScaleY * 2f;
            okButton.Click += ScalePolygonsOK;
        }
示例#2
0
        private static void CreatePropertyGrids()
        {
            #region Camera PropertyGrid
            mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mCameraPropertyGrid);
            mCameraPropertyGrid.SelectedObject = SpriteManager.Camera;
            mCameraPropertyGrid.X = mCameraPropertyGrid.ScaleX;
            mCameraPropertyGrid.Y = 40;
            mCameraPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mCameraPropertyGrid.Name             = "Camera";
            mCameraPropertyGrid.Visible          = false;
            #endregion

            #region Scene Camera PropertyGrid
            mSceneCameraPropertyGrid = new CameraBoundsPropertyGrid(EditorData.BoundsCamera);
            // This doesn't get added to the GuiManager because it was created before the pattern was established that PropertyGrids don't add themselves.
            mSceneCameraPropertyGrid.Visible          = false;
            mSceneCameraPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mSceneCameraPropertyGrid.Name             = "Camera Bounds";
            #endregion

            #region EditorPropertiesGrid
            mEditorPropertiesGrid         = new EditorPropertiesGrid();
            mEditorPropertiesGrid.Visible = false;
            #endregion

            #region LineGrid PropertyGrid
            mLineGridPropertyGrid         = new LineGridPropertyGrid(EditorData.LineGrid);
            mLineGridPropertyGrid.Visible = false;

            #endregion
        }
示例#3
0
        private static PropertyGrid CreatePropertyGridForObject(object objectToCreateGridFor)
        {
            object[] arguments = new object[] {
                GuiManager.Cursor,
                objectToCreateGridFor
            };

            Type   t   = typeof(PropertyGrid <>).MakeGenericType(mTypeOfObjectToSerialize);
            object obj = Activator.CreateInstance(t, arguments);

            PropertyGrid propertyGrid = obj as PropertyGrid;

            GuiManager.AddWindow(propertyGrid);
            propertyGrid.HasCloseButton = true;
            propertyGrid.Closing       += GuiManager.RemoveWindow;

            Button saveButton = new Button(GuiManager.Cursor);

            saveButton.Text   = "Save Object as XML";
            saveButton.ScaleX = 9f;
            saveButton.Click += XmlSeralizeObject;
            propertyGrid.AddWindow(saveButton);

            Button loadButton = new Button(GuiManager.Cursor);

            loadButton.Text   = "Load Object from XML";
            loadButton.ScaleX = 9f;
            loadButton.Click += XmlDeserializeObject;
            propertyGrid.AddWindow(loadButton);

            return(propertyGrid);
        }
示例#4
0
        public ComboBoxWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            ScaleX        = 12;
            ScaleY        = 9;
            this.Closing += GuiManager.RemoveWindow;

            mTextField = new TextField();
            mTextField.SetDimensions(-2, -8, 1, 23, 0);
            mTextField.Z            = 100;
            mTextField.WindowParent = this;

            mComboBox = new ComboBox(mCursor);
            AddWindow(mComboBox);
            mComboBox.ScaleX = ScaleX - 2;
            mComboBox.ScaleY = 1.4f;
            mComboBox.SetPositionTL(ScaleX, 2 * ScaleY - 5);

            mCancelButton = new Button(mCursor);
            AddWindow(mCancelButton);
            mCancelButton.ScaleY = 1.5f;
            mCancelButton.Text   = "Cancel";
            mCancelButton.SetPositionTL(2 * ScaleX - 5.2f, 2 * ScaleY - 2);
            mCancelButton.Click += GuiManager.RemoveWindow;

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
            mOkButton.ScaleY = 1.5f;
            mOkButton.Text   = "Ok";
            mOkButton.SetPositionTL(5.2f, 2 * ScaleY - 2);
        }
示例#5
0
 partial void CustomAddToManagers()
 {
     if (IsComponentOrInstanceOfComponent())
     {
         GuiManager.AddWindow(this);
     }
 }
        private void SetUpGui()
        {
            guiManager = new GuiManager(gui, new Vector2(level.WidthInPixels, 0), arial, infoFont);
            float left      = level.WidthInPixels + 20;
            float middle    = level.WidthInPixels + (gui.Width / 2) - (spikeButton.Width / 2);
            float right     = level.WidthInPixels + gui.Width - 20 - spikeButton.Width;
            float bottom    = level.HeightInPixels - 20 - waveButton.Height;
            float onebottom = level.HeightInPixels - 360 - waveButton.Height;

            float y = 150;

            guiManager.AddButton(arrowButton, arrowButtonPressed, new Vector2(left, y), "arrow");
            guiManager.AddButton(spikeButton, spikeButtonPressed, new Vector2(middle, y), "spike");
            guiManager.AddButton(bombButton, bombButtonPressed, new Vector2(right, y), "bomb");
            guiManager.AddButton(waveButton, waveButtonPressed, new Vector2(left, bottom), "wave");
            guiManager.AddButton(oneandOneButton, oneandOneButtonPressed, new Vector2(left, onebottom), "oneandone");
            guiManager.AddButton(ofLoveButton, ofLoveButtonPressed, new Vector2(middle, onebottom), "oflove");
            guiManager.AddButton(nuclearButton, nuclearButton, new Vector2(right, onebottom), "nuclear");

            foreach (Button button in guiManager.ButtonList)
            {
                button.OnLeftMouseClick += new Button.FiredEvent(ButtonPressed);

                if (button.Name != "wave")
                {
                    guiManager.AddWindow(window, new Vector2(left, 202), button.Name);
                }
            }
        }
示例#7
0
        /// <summary>
        /// Shows a ListDisplayWindow with the undos in the UndoManager.  This is provided as a convenience function so it
        /// can be used in MenuStrips.
        /// </summary>
        /// <param name="callingWindow">This property will not be used - it's here to match the GuiMessage delegate.</param>
        public static void ShowListDisplayWindow(Window callingWindow)
        {
            #region If the ListDisplayWindow hasn't been created yet, create it

            if (mInstructionListDisplayWindow == null)
            {
                mInstructionListDisplayWindow = new ListDisplayWindow(GuiManager.Cursor);

                mInstructionListDisplayWindow.ListShowing    = mInstructions;
                mInstructionListDisplayWindow.HasMoveBar     = true;
                mInstructionListDisplayWindow.HasCloseButton = true;
                mInstructionListDisplayWindow.Resizable      = true;
                mInstructionListDisplayWindow.ScaleX         = 9;
                mInstructionListDisplayWindow.X    = SpriteManager.Camera.XEdge * 2 - mInstructionListDisplayWindow.ScaleX;
                mInstructionListDisplayWindow.Name = "Undos";

                GuiManager.AddWindow(mInstructionListDisplayWindow);
            }

            #endregion

            #region Show and bring the ListDisplayWindow to the top

            mInstructionListDisplayWindow.Visible = true;
            GuiManager.BringToFront(mInstructionListDisplayWindow);

            #endregion
        }
        public EditorPropertiesGrid()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            SelectedObject = EditorData.EditorProperties;
            HasCloseButton = true;

            IncludeMember("BackgroundColor", "General Options");
            IncludeMember("AxisAlignedCubeColor", "Axis Aligned Cube");
            IncludeMember("AxisAlignedRectangleColor", "Axis Aligned Rectangle");
            IncludeMember("Capsule2DColor", "Capsule2D");
            IncludeMember("CircleColor", "Circle");
            IncludeMember("SphereColor", "Sphere");

            IncludeMember("PolygonColor", "Polygon");
            IncludeMember("SelectedCornerColor", "Polygon");
            IncludeMember("NewPointPolygonColor", "Polygon");

            ExcludeMember("SnapToGrid");
            ExcludeMember("SnappingGridSize");
            ExcludeMember("PixelSize");
            ExcludeMember("SortYSecondary");
            ExcludeMember("ConstrainDimensions");
            ExcludeMember("CullSpriteGrids");
            ExcludeMember("AdditionalFade");
            ExcludeMember("FilteringOn");

            RemoveCategory("Uncategorized");

            Name = "Editor Properties";
        }
示例#9
0
        private static void CreateListDisplayWindows()
        {
            mAssembliesListDisplayWindow = new ListDisplayWindow(GuiManager.Cursor);
            GuiManager.AddWindow(mAssembliesListDisplayWindow);
            mAssembliesListDisplayWindow.ScaleX     = 10;
            mAssembliesListDisplayWindow.ScaleY     = 12;
            mAssembliesListDisplayWindow.HasMoveBar = true;
            mAssembliesListDisplayWindow.X          = mAssembliesListDisplayWindow.ScaleX;
            mAssembliesListDisplayWindow.Y          = mAssembliesListDisplayWindow.ScaleY + 6;
            mAssembliesListDisplayWindow.Resizable  = true;
            mAssembliesListDisplayWindow.ShowPropertyGridOnStrongSelect = true;
            mAssembliesListDisplayWindow.ListBox.Highlight += HighlightNewAssembly;
            mAssembliesListDisplayWindow.ListShowing        = EditorData.Assemblies;


            mAssemblyTypeListDisplayWindow         = new ListDisplayWindow(GuiManager.Cursor);
            mAssemblyTypeListDisplayWindow.Visible = false;
            GuiManager.AddWindow(mAssemblyTypeListDisplayWindow);
            mAssemblyTypeListDisplayWindow.ScaleX                = 10;
            mAssemblyTypeListDisplayWindow.ScaleY                = 12;
            mAssemblyTypeListDisplayWindow.HasMoveBar            = true;
            mAssemblyTypeListDisplayWindow.X                     = mAssembliesListDisplayWindow.ScaleX;
            mAssemblyTypeListDisplayWindow.Y                     = 26;
            mAssemblyTypeListDisplayWindow.Resizable             = true;
            mAssemblyTypeListDisplayWindow.ListBox.StrongSelect += CreateObjectOfSelectedType;
            mAssemblyTypeListDisplayWindow.HasCloseButton        = true;
        }
示例#10
0
        private static ListDisplayWindow CreateListDisplayWindowForObject(object objectToCreateWindowFor)
        {
            ListDisplayWindow listDisplayWindow = new ListDisplayWindow(GuiManager.Cursor);

            GuiManager.AddWindow(listDisplayWindow);
            listDisplayWindow.HasMoveBar     = true;
            listDisplayWindow.HasCloseButton = true;
            listDisplayWindow.Resizable      = true;
            listDisplayWindow.ListShowing    = mObjectToSerialize as IEnumerable;
            listDisplayWindow.Closing       += GuiManager.RemoveWindow;

//            listDisplayWindow.EnableAddingToList();

            Button saveButton = new Button(GuiManager.Cursor);

            saveButton.Text   = "Save Object as XML";
            saveButton.ScaleX = 9f;
            saveButton.Click += XmlSeralizeObject;
            listDisplayWindow.AddWindow(saveButton);

            Button loadButton = new Button(GuiManager.Cursor);

            loadButton.Text   = "Load Object from XML";
            loadButton.ScaleX = 9f;
            loadButton.Click += XmlDeserializeObject;
            listDisplayWindow.AddWindow(loadButton);



            listDisplayWindow.MinimumScaleX = 10;

            return(listDisplayWindow);
        }
示例#11
0
        public ListBoxWindow() :
            base(GuiManager.Cursor)
        {
            #region Set "this" properties.
            GuiManager.AddWindow(this);
            SetPositionTL(97.3f, 25.2f);
            ScaleX   = 13.1f;
            ScaleY   = 19.505f;
            mName    = "Keyframes";
            mMoveBar = true;

            MinimumScaleX = ScaleX;
            MinimumScaleY = 7;

            this.Resizable = true;

            this.Resizing += AdjustPositionsAndScales;


            #endregion

            #region List Box

            mInstructionSetListBox            = AddCollapseListBox();
            mInstructionSetListBox.Highlight += new GuiMessage(UpdateAddButtonVisibility);
            mInstructionSetListBox.Highlight += HighlightInstructionSetListBox;

            mInstructionSetListBox.FocusUpdate += InstructionListHotkeyUpdate;
            #endregion

            #region AnimationSequence ListDisplayWindow

            mAnimationSequenceListBox = new ListDisplayWindow(mCursor);
            this.AddWindow(mAnimationSequenceListBox);
            mAnimationSequenceListBox.ListBox.Highlight    += HighlightAnimationSequenceListBox;
            mAnimationSequenceListBox.ListBox.StrongSelect += DoubleClickAnimationSequenceListBox;
            mAnimationSequenceListBox.ListBox.FocusUpdate  += new FocusUpdateDelegate(AnimationSequenceFocusUpdate);
            ListDisplayWindow.SetStringRepresentationMethod(typeof(TimedKeyframeList), GetTimedKeyframeListStringRepresentation);

            #endregion

            #region Add Keyframe List Button

            mAddKeyframeListButton        = AddButton();
            mAddKeyframeListButton.Text   = "Add Animation";
            mAddKeyframeListButton.Click += AddKeyframeListClick; // this will call UpdateVisibleWindows

            #endregion

            #region Add Keyframe Button

            mAddKeyframeButton        = AddButton();
            mAddKeyframeButton.Text   = "Add Keyframe";
            mAddKeyframeButton.Click += AddKeyframe;

            #endregion

            AdjustPositionsAndScales(null);
        }
示例#12
0
        private static void CreatePropertyGrids()
        {
            #region CamerPropertyGrid
            mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mCameraPropertyGrid);
            mCameraPropertyGrid.SelectedObject = SpriteManager.Camera;
            mCameraPropertyGrid.X = mCameraPropertyGrid.ScaleX;
            mCameraPropertyGrid.Y = 40;
            mCameraPropertyGrid.HasCloseButton   = true;
            mCameraPropertyGrid.UndoInstructions =
                UndoManager.Instructions;
            #endregion

            #region NodeNetwork PropertyGrid

            mNodeNetworkPropertyGrid = new NodeNetworkPropertyGrid();
            mNodeNetworkPropertyGrid.SelectedObject = EditorData.NodeNetwork;
            mNodeNetworkPropertyGrid.X = mNodeNetworkPropertyGrid.ScaleX;
            mNodeNetworkPropertyGrid.Y = 61;
            mNodeNetworkPropertyGrid.HasCloseButton   = true;
            mNodeNetworkPropertyGrid.UndoInstructions =
                UndoManager.Instructions;

            #endregion

            #region ScenePropertyGrid

            mScenePropertyGrid = new ScenePropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mScenePropertyGrid);
            mScenePropertyGrid.X = mScenePropertyGrid.ScaleX;
            mScenePropertyGrid.Y = 75.7f;
            mScenePropertyGrid.ShowPropertyGridOnStrongSelect = true;
            mScenePropertyGrid.HasCloseButton   = true;
            mScenePropertyGrid.Visible          = false;
            mScenePropertyGrid.UndoInstructions = UndoManager.Instructions;
            #endregion

            #region ShapeCollectionPropertyGrid

            mShapeCollectionPropertyGrid = new ShapeCollectionPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mShapeCollectionPropertyGrid);
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectAxisAlignedCube      = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectAxisAlignedRectangle = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectCircle  = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectPolygon = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectSphere  = true;
            mShapeCollectionPropertyGrid.HasCloseButton   = true;
            mShapeCollectionPropertyGrid.Visible          = false;
            mShapeCollectionPropertyGrid.UndoInstructions = UndoManager.Instructions;
            #endregion

            PropertyGrid.SetNewWindowEvent <FlatRedBall.AI.Pathfinding.PositionedNode>(CreatePositionedNodePropertyGrid);
            PropertyGrid.SetNewWindowEvent <Color>(CreateColorPropertyGrid);

            #region EditorPropertiesGrid
            mEditorPropertiesGrid         = new EditorPropertiesGrid();
            mEditorPropertiesGrid.Visible = false;
            #endregion
        }
示例#13
0
        private void ShiftSceneClick(Window callingWindow)
        {
            Vector3OkWindow v3ok = new Vector3OkWindow(GuiManager.Cursor);

            GuiManager.AddWindow(v3ok);

            v3ok.OkClick += ShiftSceneOk;
        }
示例#14
0
        void ShiftAllPolygons(Window callingWindow)
        {
            Vector3OkWindow v3ok = new Vector3OkWindow(GuiManager.Cursor);

            GuiManager.AddWindow(v3ok);

            v3ok.OkClick += ShiftAllPolygonsOk;
        }
示例#15
0
        static void AdvancedClick(Window callingWindow)
        {
            mTypesToLoad = new TypesToLoad();
            mLastAsclw   = new AdvancedShapeCollectionLoadingWindow(
                GuiManager.Cursor, CreateMbmb(mFileNameToLoad), mTypesToLoad);

            GuiManager.AddWindow(mLastAsclw);
        }
 partial void CustomAddToManagers()
 {
     // need to add even regular components to the GuiManager since they may contain components
     //if (IsComponentOrInstanceOfComponent() && this.Parent == null)
     if (this.Parent == null)
     {
         GuiManager.AddWindow(this);
     }
 }
示例#17
0
        public static void LoadShapeCollectionAskReplaceOrInsert(string fileName)
        {
            mFileNameToLoad = fileName;

            MultiButtonMessageBox newMbmb = CreateMbmb(fileName);

            mLastMbmb = newMbmb;
            GuiManager.AddWindow(mLastMbmb);
        }
示例#18
0
        /// <summary>
        /// Creates a new ToolsWindow and adds it to the GuiManager.
        /// </summary>
        #endregion
        public ToolsWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            base.mName = "Tools";
            UpdateDimensions();

            this.X = SpriteManager.Camera.XEdge * 2 - this.ScaleX;
        }
示例#19
0
        private void AddKeyframe(Window callingWindow)
        {
            #region See if adding is allowed (Are there objects to record).  If not, show a message

            if (EditorData.CurrentSpriteMembersWatching.Count == 0 &&
                EditorData.CurrentSpriteFrameMembersWatching.Count == 0 &&
                EditorData.CurrentPositionedModelMembersWatching.Count == 0 &&
                EditorData.CurrentTextMembersWatching.Count == 0)
            {
                GuiManager.ShowMessageBox("There are no members being recorded.  Try opening the " +
                                          "\"used members\" window through Window->Used Members menu item.", "No members");
                return;
            }

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current)
            {
                if (EditorData.EditorLogic.CurrentKeyframeList == null)
                {
                    GuiManager.ShowMessageBox("There is no Keyframe List currently selected", "Error");
                    return;
                }

                if (EditorData.EditorLogic.CurrentSprites.Count == 0 &&
                    EditorData.EditorLogic.CurrentSpriteFrames.Count == 0 &&
                    EditorData.EditorLogic.CurrentPositionedModels.Count == 0 &&
                    EditorData.EditorLogic.CurrentTexts.Count == 0)
                {
                    GuiManager.ShowMessageBox("No object is selected.  Select an object to record.", "No selected object.");
                    return;
                }
            }
            else if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                if (EditorData.EditorLogic.CurrentAnimationSequence == null)
                {
                    GuiManager.ShowMessageBox("There is no Animation currently selected", "Error");
                    return;
                }
            }
            #endregion

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                KeyframeListSelectionWindow klsw = new KeyframeListSelectionWindow(GuiManager.Cursor);
                GuiManager.AddWindow(klsw);
                klsw.PopulateComboBoxes(EditorData.BlockingScene, EditorData.ObjectInstructionSets);

                klsw.OkClick += AddKeyframeToGlobalInstrutionSet;
            }
            else
            {
                TextInputWindow tiw = GuiManager.ShowTextInputWindow("Enter a name for the new keyframe:", "Enter name");
                tiw.Text = "Keyframe " + EditorData.EditorLogic.CurrentKeyframeList.Count;

                tiw.OkClick += new GuiMessage(AddKeyframeOk);
            }
        }
示例#20
0
        void ScaleNodeNetwork(Window callingWindow)
        {
            Vector3OkWindow okWindow = new Vector3OkWindow(GuiManager.Cursor);

            GuiManager.AddWindow(okWindow);

            okWindow.Vector3Value = new Vector3(1, 1, 1);

            okWindow.OkClick += new GuiMessage(ScaleOkClick);
        }
示例#21
0
        void ScalePositionOnly(Window callingWindow)
        {
            Vector3OkWindow v3ok = new Vector3OkWindow(GuiManager.Cursor);

            GuiManager.AddWindow(v3ok);

            v3ok.Vector3Value = new Vector3(1, 1, 1);

            v3ok.OkClick += ScalePositionsOnlyOk;
        }
示例#22
0
        public Menu()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);

            #region File

            MenuItem item = AddItem("File");

            item.AddItem("New").Click += PromptNew;
            item.AddItem("---------------");
            item.AddItem("Load Polygon List").Click     += OpenFileWindowLoadPolygonList;
            item.AddItem("Load Shape Collection").Click += OpenFileWindowLoadShapeList;
            item.AddItem("Load Scene").Click            += OpenFileWindowLoadScene;
            item.AddItem("---------------");
            item.AddItem("Save Polygon List").Click     += OpenFileWindowSavePolygonList;
            item.AddItem("Save Shape Collection").Click += OpenFileWindowSaveShapeList;
            item.AddItem("Save Scene").Click            += SaveSceneClick;
            #endregion

            #region Add
            item = AddItem("Add");

            item.AddItem("AxisAlignedRectangle").Click += AddAxisAlignedRectangle;
            item.AddItem("AxisAlignedCube").Click      += AddAxisAlignedCube;
            item.AddItem("Capsule2D").Click            += AddCapsule2D;
            item.AddItem("Circle").Click += AddCircle;
            item.AddItem("Polygon (Rectangle)").Click += AddRectanglePolygon;
            item.AddItem("Sphere").Click += AddSphere;
            #endregion

            #region Action
            item = AddItem("Action");
            item.AddItem("Scale All Polygons").Click += ScaleAllPolygons;

            mFlipHorizontally        = item.AddItem("Flip Polygon Horizontally");
            mFlipHorizontally.Click += FlipHorizontallyClick;

            mFlipVertically        = item.AddItem("Flip Polygon Vertically");
            mFlipVertically.Click += FlipVerticallyClick;

            item.AddItem("Unload Scene").Click += UnloadScene;
            #endregion

            #region Window
            item = AddItem("Window");
            item.AddItem("Editor Properties").Click               += ShowEditorPropertiesWindow;
            item.AddItem("Line Grid Properties").Click            += ShowLineGridProperties;
            item.AddItem("Bounds Properties").Click               += ShowSceneCameraProperties;
            item.AddItem("Camera Properties").Click               += ShowEditorCameraProperties;
            item.AddItem("Show Scene Properties").Click           += ShowSceneProperties;
            item.AddItem("Show ShapeCollection Properties").Click += ShowShapeCollectionProperties;

            #endregion
        }
示例#23
0
文件: Button.cs 项目: KallDrexx/FrbUi
        public void AddToManagers(Layer layer)
        {
            CurrentSelectableState = SelectableState.NotSelected;

            SpriteManager.AddSpriteFrame(_backgroundSprite);
            GuiManager.AddWindow(this);
            TextManager.AddText(_label);
            TextManager.AddToLayer(_label, layer);

            Layer = layer;
        }
        public EditorPropertiesGrid()
            : base(GuiManager.Cursor)
        {
            #region "this" properties

            GuiManager.AddWindow(this);
            SelectedObject = GameData.EditorProperties;
            HasCloseButton = true;

            #endregion

            #region Exclude members

            ExcludeMember("ConstrainDimensions");
            ExcludeMember("CullSpriteGrids");

            #endregion

            UpDown additionalFadeUpDown = GetUIElementForMember("AdditionalFade") as UpDown;
            additionalFadeUpDown.MaxValue    = 255;
            additionalFadeUpDown.MinValue    = 0;
            additionalFadeUpDown.Sensitivity = 1f;

            UpDown pixelSizeUpDown = GetUIElementForMember("PixelSize") as UpDown;
            pixelSizeUpDown.MinValue    = 0;
            pixelSizeUpDown.Sensitivity = .01f;

            Name = "Editor Properties";

            #region Axes

            IncludeMember("WorldAxesDisplayVisible", "Axes");
            SetMemberDisplayName("WorldAxesDisplayVisible", "Visible");

            IncludeMember("WorldAxesColor", "Axes");
            SetMemberDisplayName("WorldAxesColor", "Color");
            #endregion

            #region LineGrid  Properties

            PropertyGrid <LineGrid> lineGridPropertyGrid = new PropertyGrid <LineGrid>(mCursor);
            lineGridPropertyGrid.HasMoveBar     = false;
            lineGridPropertyGrid.HasCloseButton = false;
            lineGridPropertyGrid.ExcludeMember("Layer");

            ReplaceMemberUIElement("LineGrid", lineGridPropertyGrid);

            IncludeMember("LineGrid", "LineGrid");
            SetMemberDisplayName("LineGrid", "");

            #endregion
        }
示例#25
0
        public ActivityWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            ScaleX         = 10;
            ScaleY         = 6.5f;
            HasCloseButton = true;
            HasMoveBar     = true;
            SetPositionTL(10, 52f);

            emitCurrent = new Button(mCursor);
            AddWindow(emitCurrent);
            emitCurrent.ScaleX = 4.8f;
            emitCurrent.SetPositionTL(ScaleX - 4.6f, 2);
            emitCurrent.ScaleY = 1f;
            emitCurrent.Text   = "Emit Current";
            emitCurrent.Click += new GuiMessage(emitCurrentClick);

            emitAll = new Button(mCursor);
            AddWindow(emitAll);
            emitAll.ScaleX = 4.5f;
            emitAll.SetPositionTL(ScaleX + 5, 2);
            emitAll.ScaleY = 1f;
            emitAll.Text   = "Emit All";
            emitAll.Click += new GuiMessage(emitAllClick);


            startStopCurrent = new ToggleButton(mCursor);
            AddWindow(startStopCurrent);
            startStopCurrent.ScaleX = 4.8f;
            startStopCurrent.SetText("Start Current", "Stop Current");
            startStopCurrent.SetPositionTL(ScaleX - 4.6f, 5);

            startStopAll = new ToggleButton(mCursor);
            AddWindow(startStopAll);
            startStopAll.ScaleX = 4.5f;
            startStopAll.SetText("Start All", "Stop All");
            startStopAll.SetPositionTL(ScaleX + 5, 5);

            clearAllButton = new Button(mCursor);
            AddWindow(clearAllButton);
            clearAllButton.ScaleX = 8.5f;
            clearAllButton.ScaleY = 1.5f;
            clearAllButton.SetPositionTL(ScaleX, 8);
            clearAllButton.Text   = ("Clear All");
            clearAllButton.Click += new GuiMessage(clearAllButtonClick);

            numberOfSpritesDisplay = new TextDisplay(mCursor);
            AddWindow(numberOfSpritesDisplay);
            numberOfSpritesDisplay.Text = "Number of Sprites: 0";
            numberOfSpritesDisplay.SetPositionTL(ScaleX - 10, 11);
        }
示例#26
0
        public static void Initialize()
        {
            _cameraAndScreenControlWindow = new CameraAndScreenControlWindow(GuiManager.Cursor);
            GuiManager.AddWindow(_cameraAndScreenControlWindow);

            // Vic asks:  Why is this here?!?  Should be moved to EditorLogic.cs I think.
            FlatRedBall.SpriteManager.AutoIncrementParticleCountValue = 500;

            LocalizationWindow = new LocalizationWindow(GuiManager.Cursor);
            GuiManager.AddWindow(LocalizationWindow);
            LocalizationWindow.X = LocalizationWindow.ScaleX + _cameraAndScreenControlWindow.ScaleX * 2;
            LocalizationWindow.Y = LocalizationWindow.ScaleY + Window.MoveBarHeight;
        }
示例#27
0
        public Menu()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);

            #region File
            MenuItem item = AddItem("File");

            item.AddItem("New").Click += NewClicked;
            item.AddItem("-------------------");
            item.AddItem("Load NodeNetwork").Click      += OpenFileWindowLoadNodeNetwork;
            item.AddItem("Load Scene").Click            += OpenFileWindowLoadScene;
            item.AddItem("Load PolygonList").Click      += OpenFileWindowLoadPolygonList;
            item.AddItem("Load Shape Collection").Click += OpenFileWindowLoadShapeCollection;
            item.AddItem("-------------------");
            item.AddItem("Save NodeNetwork").Click += OpenFileWindowSaveNodeNetwork;
            item.AddItem("Save Scene").Click       += WarnAboutSavingScene;
            item.AddItem("-------------------");
            item.AddItem("Close Scene").Click += new GuiMessage(CloseScene);

            #endregion

            #region Edit

            item = AddItem("Edit");
            item.AddItem("Scale NodeNetwork").Click += new GuiMessage(ScaleNodeNetwork);

            #endregion

            #region Add

            item = AddItem("Add");

            item.AddItem("New Sprite").Click += AddSprite;
            item.AddItem("New Node").Click   += AddNode;

            #endregion

            #region Window
            item = AddItem("Window");
            item.AddItem("Camera Properties").Click           += ShowCameraPropertiesWindow;
            item.AddItem("Editor Properties").Click           += ShowEditorPropertiesWindow;
            item.AddItem("Node Network Properties").Click     += ShowNodeNetworkPropertiesWindow;
            item.AddItem("Scene Properties").Click            += ShowScenePropertiesWindow;
            item.AddItem("Shape Collection Properties").Click += ShowShapeCollectionPropertiesWindow;
            #endregion
        }
示例#28
0
        public void TestEvents()
        {
            IWindowImplementation iwi = new IWindowImplementation();

            GuiManager.AddWindow(iwi);
            GuiManager.Cursor.UsingMouse = false;

            Microsoft.Xna.Framework.GameTime gameTime = new Microsoft.Xna.Framework.GameTime(
                new TimeSpan(0, 0, 0, 0, 1), new TimeSpan(0, 0, 0, 0, 1));

            FlatRedBallServices.Update(gameTime);

            if (GuiManager.Cursor.WindowOver != iwi)
            {
                throw new Exception("The cursor should be over the window");
            }
        }
        public EditorPropertiesGrid()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            SelectedObject = EditorData.EditorProperties;
            HasCloseButton = true;

            ExcludeMember("SnapToGrid");
            ExcludeMember("SnappingGridSize");
            ExcludeMember("PixelSize");
            ExcludeMember("SortYSecondary");
            ExcludeMember("ConstrainDimensions");
            ExcludeMember("CullSpriteGrids");
            ExcludeMember("AdditionalFade");
            ExcludeMember("FilteringOn");

            Name = "Editor Properties";
        }
        public InstructionEditorMenuStrip() :
            base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);

            #region File

            MenuItem fileMenuItem = AddItem("File");

            fileMenuItem.AddItem("New Set").Click += new GuiMessage(FileMenuMessages.NewSet);
            fileMenuItem.AddItem("---------------");
            fileMenuItem.AddItem("Load Set").Click            += new GuiMessage(FileMenuMessages.LoadSetClick);
            fileMenuItem.AddItem("Load Active .scnx").Click   += new GuiMessage(FileMenuMessages.LoadActiveSceneClick);
            fileMenuItem.AddItem("Load Inactive .scnx").Click += new GuiMessage(FileMenuMessages.LoadInactiveSceneClick);
            fileMenuItem.AddItem("---------------");
            fileMenuItem.AddItem("Save Set").Click               += new GuiMessage(FileMenuMessages.SaveSetClick);
            fileMenuItem.AddItem("Save Active .scnx").Click      += SaveActiveScene;
            fileMenuItem.AddItem("Save Instructions Code").Click += SaveInstructionCodeClick;

            #endregion

            #region Add

            MenuItem addMenuItem = AddItem("Add");
            addMenuItem.AddItem("Sprite").Click += AddSpriteClick;
            addMenuItem.AddItem("Text").Click   += AddTextClick;

            #endregion

            #region Window

            MenuItem windowMenuItem = AddItem("Window");

            windowMenuItem.AddItem("Editor Camera").Click += ShowEditorCameraWindow;
            windowMenuItem.AddItem("Camera Bounds").Click += ShowSceneCameraWindow;

            windowMenuItem.AddItem("Editor Options").Click += ShowEditorOptionsWindow;
            windowMenuItem.AddItem("Used Members").Click   += ShowUsedMembersWindow;

            windowMenuItem.AddItem("Scene Objects").Click += ShowScenePropertyGrid;
            windowMenuItem.AddItem("Tools").Click         += ShowToolsWindow;

            #endregion
        }
        private void SetUpGui()
        {
            guiManager = new GuiManager(gui, new Vector2(level.WidthInPixels, 0), arial, infoFont);
            float left = level.WidthInPixels + 20;
            float middle = level.WidthInPixels + (gui.Width / 2) - (spikeButton.Width / 2);
            float right = level.WidthInPixels + gui.Width - 20 - spikeButton.Width;
            float bottom = level.HeightInPixels - 20 - waveButton.Height;
            float onebottom = level.HeightInPixels - 360 - waveButton.Height;

            float y = 150;

            guiManager.AddButton(arrowButton, arrowButtonPressed, new Vector2(left, y), "arrow");
            guiManager.AddButton(spikeButton, spikeButtonPressed, new Vector2(middle, y), "spike");
            guiManager.AddButton(bombButton, bombButtonPressed, new Vector2(right, y), "bomb");
            guiManager.AddButton(waveButton, waveButtonPressed, new Vector2(left, bottom), "wave");
            guiManager.AddButton(oneandOneButton, oneandOneButtonPressed, new Vector2(left, onebottom), "oneandone");
            guiManager.AddButton(ofLoveButton, ofLoveButtonPressed, new Vector2(middle, onebottom), "oflove");
            guiManager.AddButton(nuclearButton, nuclearButton, new Vector2(right, onebottom), "nuclear");

            foreach (Button button in guiManager.ButtonList)
            {
                button.OnLeftMouseClick += new Button.FiredEvent(ButtonPressed);

                if (button.Name != "wave")
                {
                    guiManager.AddWindow(window, new Vector2(left, 202), button.Name);
                }
            }
        }