Ejemplo n.º 1
0
        private static void CreateShapeCollectionPropertyGrid()
        {
            mShapeCollectionPropertyGrid = new ShapeCollectionPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mShapeCollectionPropertyGrid);

            mShapeCollectionPropertyGrid.HasCloseButton = true;
            mShapeCollectionPropertyGrid.Visible        = false;

            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectAxisAlignedRectangle = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectAxisAlignedCube      = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectCircle  = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectSphere  = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectPolygon = true;

            mShapeCollectionPropertyGrid.AxisAlignedCubeSelected      += SelectAxisAlignedCube;
            mShapeCollectionPropertyGrid.AxisAlignedRectangleSelected += SelectAxisAlignedRectangle;
            mShapeCollectionPropertyGrid.CircleSelected  += SelectCircle;
            mShapeCollectionPropertyGrid.SphereSelected  += SelectSphere;
            mShapeCollectionPropertyGrid.PolygonSelected += SelectPolygon;

            #region Add ignored keys so that keyboard shortcuts still work here

            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.Delete);
            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.M);
            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.X);
            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.R);


            #endregion

            mShapeCollectionPropertyGrid.UndoInstructions = UndoManager.Instructions;

            mShapeCollectionPropertyGrid.X = mShapeCollectionPropertyGrid.ScaleX;
            mShapeCollectionPropertyGrid.Y = mShapeCollectionPropertyGrid.ScaleY + Window.MoveBarHeight +
                                             MenuStrip.MenuStripHeight;
        }
Ejemplo n.º 2
0
        private static void CreateShapeCollectionPropertyGrid()
        {
            mShapeCollectionPropertyGrid = new ShapeCollectionPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mShapeCollectionPropertyGrid);

            mShapeCollectionPropertyGrid.HasCloseButton = true;
            mShapeCollectionPropertyGrid.Visible = false;

            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectAxisAlignedRectangle = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectAxisAlignedCube = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectCircle = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectSphere = true;
            mShapeCollectionPropertyGrid.ShowPropertyGridOnStrongSelectPolygon = true;

            mShapeCollectionPropertyGrid.AxisAlignedCubeSelected += SelectAxisAlignedCube;
            mShapeCollectionPropertyGrid.AxisAlignedRectangleSelected += SelectAxisAlignedRectangle;
            mShapeCollectionPropertyGrid.CircleSelected += SelectCircle;
            mShapeCollectionPropertyGrid.SphereSelected += SelectSphere;
            mShapeCollectionPropertyGrid.PolygonSelected += SelectPolygon;

            #region Add ignored keys so that keyboard shortcuts still work here

            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.Delete);
            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.M);
            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.X);
            mShapeCollectionPropertyGrid.AddIgnoredKey(Keys.R);


            #endregion

            mShapeCollectionPropertyGrid.UndoInstructions = UndoManager.Instructions;

            mShapeCollectionPropertyGrid.X = mShapeCollectionPropertyGrid.ScaleX;
            mShapeCollectionPropertyGrid.Y = mShapeCollectionPropertyGrid.ScaleY + Window.MoveBarHeight +
                MenuStrip.MenuStripHeight;

        }