private void CreatePropertyGrid() { mRecordingDataPropertyGrid = new PropertyGrid <RecordingData>(mCursor); mRecordingDataPropertyGrid.ExcludeMember("LastBeatTime"); mRecordingDataPropertyGrid.GetUIElementForMember("ClosestFitBeatFrequency").ScaleX = 10; mRecordingDataPropertyGrid.SetMemberDisplayName("ClosestFitBeatFrequency", "Frequency"); mRecordingDataPropertyGrid.GetUIElementForMember("ClosestFitOffset").ScaleX = 10; mRecordingDataPropertyGrid.SetMemberDisplayName("ClosestFitOffset", "Offset"); this.AddWindow(mRecordingDataPropertyGrid); mRecordingDataPropertyGrid.X = mRecordingDataPropertyGrid.ScaleX + .5f; mRecordingDataPropertyGrid.Y = 23f; mRecordingDataPropertyGrid.SelectedObject = new RecordingData(); mRecordingDataPropertyGrid.HasMoveBar = false; }
private void CreatePropertyGrid() { mRecordingDataPropertyGrid = new PropertyGrid<RecordingData>(mCursor); mRecordingDataPropertyGrid.ExcludeMember("LastBeatTime"); mRecordingDataPropertyGrid.GetUIElementForMember("ClosestFitBeatFrequency").ScaleX = 10; mRecordingDataPropertyGrid.SetMemberDisplayName("ClosestFitBeatFrequency", "Frequency"); mRecordingDataPropertyGrid.GetUIElementForMember("ClosestFitOffset").ScaleX = 10; mRecordingDataPropertyGrid.SetMemberDisplayName("ClosestFitOffset", "Offset"); this.AddWindow(mRecordingDataPropertyGrid); mRecordingDataPropertyGrid.X = mRecordingDataPropertyGrid.ScaleX + .5f; mRecordingDataPropertyGrid.Y = 23f; mRecordingDataPropertyGrid.SelectedObject = new RecordingData(); mRecordingDataPropertyGrid.HasMoveBar = false; }
public AnimationChainPropertyGrid(Cursor cursor) : base(cursor) { #region Set "this" properties Name = "AnimationChain Properties"; Y = 22.8f; X = 82.75f; this.HasMoveBar = true; #endregion #region Create the "Name" UI TextDisplay nameDisplay = new TextDisplay(cursor); nameDisplay.Text = "Name:"; this.AddWindow(nameDisplay); nameDisplay.SetPositionTL(1, 1.5f); mNameTextBox = new TextBox(cursor); mNameTextBox.ScaleX = 10; this.AddWindow(mNameTextBox); mNameTextBox.X = 17; mNameTextBox.Y = nameDisplay.Y; mNameTextBox.TextChange += SetName; #endregion #region Create the PropertyGrid mPropertyGrid = new PropertyGrid <AnimationChain>(cursor); mPropertyGrid.HasMoveBar = false; AddWindow(mPropertyGrid); this.mPropertyGrid.AfterUpdateDisplayedProperties += EveryFrameActivity; mPropertyGrid.DrawBorders = false; #endregion #region ExcludeMember calls // We'll handle this property in "this" mPropertyGrid.ExcludeMember("Name"); mPropertyGrid.ExcludeMember("Capacity"); mPropertyGrid.ExcludeMember("Item"); mPropertyGrid.ExcludeMember("ColorKey"); mPropertyGrid.ExcludeMember("ParentFileName"); mPropertyGrid.ExcludeMember("LastFrame"); mPropertyGrid.ExcludeMember("IndexInLoadedAchx"); mPropertyGrid.ExcludeMember("ParentAchxFileName"); mPropertyGrid.ExcludeMember("ParentGifFileName"); #endregion #region mFlipHorizontally Creation mFlipHorizontally = new Button(mCursor); mFlipHorizontally.Text = "Flip All\nHorizontally"; mFlipHorizontally.ScaleX = 6; mFlipHorizontally.ScaleY = 2.2f; mFlipHorizontally.Click += FlipHorizontallyClick; mPropertyGrid.AddWindow(mFlipHorizontally, "Actions"); #endregion #region mFlipVertically Creation mFlipVertically = new Button(mCursor); mFlipVertically.Text = "Flip All\nVertically"; mFlipVertically.ScaleX = 6; mFlipVertically.ScaleY = 2.2f; mFlipVertically.Click += FlipVerticallyClick; mPropertyGrid.AddWindow(mFlipVertically, "Actions"); #endregion #region Categorize and modify Frames UI mPropertyGrid.IncludeMember("FrameTime", "Frames"); ((UpDown)mPropertyGrid.GetUIElementForMember("FrameTime")).MinValue = 0; ((UpDown)mPropertyGrid.GetUIElementForMember("FrameTime")).CurrentValue = .1f; mPropertyGrid.IncludeMember("TotalLength", "Frames"); mPropertyGrid.IncludeMember("Count", "Frames"); #endregion mPropertyGrid.RemoveCategory("Uncategorized"); // mPropertyGrid.ResizeEnd += UpdateThisScale; CreateUpDowns(); mPropertyGrid.SelectCategory("Actions"); UpdateContainedWindowPositions(null); }