static void CreatePropertyGrids() { PropertyGrid.SetPropertyGridTypeAssociation(typeof(FlatRedBall.Instructions.InstructionBlueprint), typeof(InstructionBlueprintPropertyGrid <Sprite>)); #region EmitterPropertyGrid mEmitterPropertyGrid = new EmitterPropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mEmitterPropertyGrid); EmitterPropertyGrid.ContentManagerName = AppState.Self.PermanentContentManager; EmitterPropertyGrid.UndoInstructions = UndoManager.Instructions; #region Reset EmissionSettings Button Button settingsButton = EmitterPropertyGrid.GetUIElementForMember("EmissionSettings") as Button; Type t = typeof(Window); FieldInfo f = t.GetField("Click", BindingFlags.Default | BindingFlags.SetField | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic); f.SetValue(settingsButton, null); settingsButton.Click += ShowEmissionSettingsPropertyGrid; #endregion #endregion #region Editor CameraPropertyGrid mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mCameraPropertyGrid); mCameraPropertyGrid.SelectedObject = SpriteManager.Camera; mCameraPropertyGrid.MakeFieldOfViewAndAspectRatioReadOnly(); mCameraPropertyGrid.Visible = false; #endregion #region Bounds CameraPropertyGrid mCameraBoundsPropertyGrid = new CameraBoundsPropertyGrid( new Camera(AppState.Self.PermanentContentManager)); mCameraBoundsPropertyGrid.Visible = false; #endregion #region EditorPropertiesGrid mEditorPropertiesGrid = new EditorPropertiesGrid(); mEditorPropertiesGrid.Visible = false; #endregion #region ScenePropertyGrid mScenePropertyGrid = new ScenePropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mScenePropertyGrid); mScenePropertyGrid.HasCloseButton = true; mScenePropertyGrid.Visible = false; mScenePropertyGrid.ShowPropertyGridOnStrongSelect = true; #endregion #region EmissionSettingsPropertyGrid List <String> filterList = new List <String>(); filterList.Add("ordered"); filterList.Add("JustCycled"); filterList.Add("TimeUntilNextFrame"); filterList.Add("TimeCreated"); filterList.Add("state"); filterList.Add("Name"); InstructionBlueprintPropertyGrid <Sprite> .MemberFilter.Add(typeof(Sprite), filterList); mEmissionSettingsPropertyGrid = new EmissionSettingsPropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mEmissionSettingsPropertyGrid); mEmissionSettingsPropertyGrid.HasCloseButton = true; mEmissionSettingsPropertyGrid.Visible = false; mEmissionSettingsPropertyGrid.ContentManagerName = AppState.Self.PermanentContentManager; mEmissionSettingsPropertyGrid.UndoInstructions = UndoManager.Instructions; mEmissionSettingsPropertyGrid.InstructionDisplayWindow.ListDisplayWindow.ListBox.CursorOver += MouseOverEmissionSettingsGrid; #endregion }
static void CreatePropertyGrids() { PropertyGrid.SetPropertyGridTypeAssociation(typeof(FlatRedBall.Instructions.InstructionBlueprint), typeof(InstructionBlueprintPropertyGrid<Sprite>)); #region EmitterPropertyGrid mEmitterPropertyGrid = new EmitterPropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mEmitterPropertyGrid); EmitterPropertyGrid.ContentManagerName = AppState.Self.PermanentContentManager; EmitterPropertyGrid.UndoInstructions = UndoManager.Instructions; #region Reset EmissionSettings Button Button settingsButton = EmitterPropertyGrid.GetUIElementForMember("EmissionSettings") as Button; Type t = typeof(Window); FieldInfo f = t.GetField("Click", BindingFlags.Default | BindingFlags.SetField | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic); f.SetValue(settingsButton, null); settingsButton.Click += ShowEmissionSettingsPropertyGrid; #endregion #endregion #region Editor CameraPropertyGrid mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mCameraPropertyGrid); mCameraPropertyGrid.SelectedObject = SpriteManager.Camera; mCameraPropertyGrid.MakeFieldOfViewAndAspectRatioReadOnly(); mCameraPropertyGrid.Visible = false; #endregion #region Bounds CameraPropertyGrid mCameraBoundsPropertyGrid = new CameraBoundsPropertyGrid( new Camera(AppState.Self.PermanentContentManager)); mCameraBoundsPropertyGrid.Visible = false; #endregion #region EditorPropertiesGrid mEditorPropertiesGrid = new EditorPropertiesGrid(); mEditorPropertiesGrid.Visible = false; #endregion #region ScenePropertyGrid mScenePropertyGrid = new ScenePropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mScenePropertyGrid); mScenePropertyGrid.HasCloseButton = true; mScenePropertyGrid.Visible = false; mScenePropertyGrid.ShowPropertyGridOnStrongSelect = true; #endregion #region EmissionSettingsPropertyGrid List<String> filterList = new List<String>(); filterList.Add("ordered"); filterList.Add("JustCycled"); filterList.Add("TimeUntilNextFrame"); filterList.Add("TimeCreated"); filterList.Add("state"); filterList.Add("Name"); InstructionBlueprintPropertyGrid<Sprite>.MemberFilter.Add(typeof(Sprite), filterList); mEmissionSettingsPropertyGrid = new EmissionSettingsPropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mEmissionSettingsPropertyGrid); mEmissionSettingsPropertyGrid.HasCloseButton = true; mEmissionSettingsPropertyGrid.Visible = false; mEmissionSettingsPropertyGrid.ContentManagerName = AppState.Self.PermanentContentManager; mEmissionSettingsPropertyGrid.UndoInstructions = UndoManager.Instructions; mEmissionSettingsPropertyGrid.InstructionDisplayWindow.ListDisplayWindow.ListBox.CursorOver += MouseOverEmissionSettingsGrid; #endregion }