public static ListDisplayWindow CreateListDisplayWindowForObject(object displayedObject, Cursor cursor)
        {
            ListDisplayWindow listDisplayWindow = new ListDisplayWindow(cursor);

            listDisplayWindow.HasMoveBar     = true;
            listDisplayWindow.HasCloseButton = true;
            listDisplayWindow.Resizable      = true;
            listDisplayWindow.ShowPropertyGridOnStrongSelect = true;
            listDisplayWindow.PrependIndex = true;

            listDisplayWindow.ListShowing = displayedObject as IEnumerable;

            // try to enable adding and removing - this is so common we're going to make it the default
            listDisplayWindow.EnableAddingToList();
            listDisplayWindow.EnableRemovingFromList();
            return(listDisplayWindow);
        }
Пример #2
0
        public static ListDisplayWindow CreateListDisplayWindowForObject(object displayedObject, Cursor cursor)
        {
            ListDisplayWindow listDisplayWindow = new ListDisplayWindow(cursor);
            listDisplayWindow.HasMoveBar = true;
            listDisplayWindow.HasCloseButton = true;
            listDisplayWindow.Resizable = true;
            listDisplayWindow.ShowPropertyGridOnStrongSelect = true;
            listDisplayWindow.PrependIndex = true;

            listDisplayWindow.ListShowing = displayedObject as IEnumerable;

            // try to enable adding and removing - this is so common we're going to make it the default
            listDisplayWindow.EnableAddingToList();
            listDisplayWindow.EnableRemovingFromList();
            return listDisplayWindow;
        }
        public SplinePropertyGrid(Cursor cursor)
            : base(cursor)
        {
            #region Exclude Members

            ExcludeMember("Visible");
            ExcludeMember("IsReadOnly");
            ExcludeMember("SplinePointVisibleRadius");
            ExcludeMember("PathColor");
            ExcludeMember("PointColor");
            ExcludeMember("Length");

            #endregion

            #region Create the ListDisplayWindow for this

            mListDisplayWindow        = new ListDisplayWindow(cursor);
            mListDisplayWindow.ScaleX = 10;
            mListDisplayWindow.ScaleY = 20;

            Button button = mListDisplayWindow.EnableAddingToList(typeof(SplinePoint));
            button.Text    = "Add Point";
            button.X      += 1;
            button.ScaleX += 1;

            button         = mListDisplayWindow.EnableRemovingFromList();
            button.Text    = "Remove Point";
            button.X      += 1;
            button.ScaleX += 1;

            mListDisplayWindow.ShowPropertyGridOnStrongSelect = true;
            mListDisplayWindow.AfterAddItem += AdjustNewSplinePoint;
            mListDisplayWindow.ListBox.StrongSelectOnHighlight = true;
            mListDisplayWindow.ListBox.Highlight += NewPointHighlighted;

            if (mSelectedObject != null)
            {
                mListDisplayWindow.ObjectDisplaying = this.ObjectDisplaying;
            }

            if (this.mUndoInstructions != null)
            {
                mListDisplayWindow.UndoInstructions = mUndoInstructions;
            }

            this.AddWindow(mListDisplayWindow, "Points");

            this.AfterUpdateDisplayedProperties += UpdateListDisplayWindow;

            #endregion

            #region Create the Scale Point Time Button

            Button scalePointTime = new Button(mCursor);
            scalePointTime.Text   = "Scale Point Time";
            scalePointTime.ScaleX = 10;
            scalePointTime.ScaleY = 1.3f;
            this.AddWindow(scalePointTime, "Points");

            scalePointTime.Click += ScalePointTimeClick;

            #endregion

            #region Create the Scale Point Position Button

            Button scalePointPosition = new Button(mCursor);
            scalePointPosition.Text   = "Scale Point Position";
            scalePointPosition.ScaleX = 10;
            scalePointPosition.ScaleY = 1.3f;
            this.AddWindow(scalePointPosition, "Points");

            scalePointPosition.Click += ScalePointPositionClick;

            #endregion

            #region Create the "Set Spline Start to 0" Button

            Button setSplineStartTo0 = new Button(mCursor);
            setSplineStartTo0.Text   = "Set Spline Start to 0";
            setSplineStartTo0.ScaleX = 10;
            setSplineStartTo0.ScaleY = 1.3f;
            this.AddWindow(setSplineStartTo0, "Points");
            setSplineStartTo0.Click += SetSplineStartTo0Click;

            #endregion

            SelectCategory("Uncategorized");
        }