public NExpandCollapseCheck()
        {
            // base
            Primitives.AddChild(new NRectanglePath(-1, -1, 2, 2));

            // plus
            GraphicsPath path = new GraphicsPath();

            path.AddLine(new PointF(-1, 0), new PointF(1, 0));
            path.StartFigure();
            path.AddLine(new PointF(0, 1), new PointF(0, -1));
            Primitives.AddChild(new NCustomPath(path, PathType.OpenFigure));

            // minus
            Primitives.AddChild(new NLinePath(-1, 0, 1, 0));

            // update the model bounds to fit the primitives
            UpdateModelBounds();

            // destory all optional shape elements
            DestroyShapeElements(ShapeElementsMask.All);

            // add tooltip
            Style.InteractivityStyle = new NInteractivityStyle("Click to expand/collapse subtree", CursorType.Hand);
        }
Beispiel #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public NCustomShape()
        {
            Primitives.AddChild(new NRectanglePath(new NRectangleF(0, 0, 1, 1)));
            UpdateModelBounds();

            Style.FillStyle = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal,
                                                     GradientVariant.Variant1,
                                                     Color.FromArgb(0xff, 0x55, 0x55),
                                                     Color.FromArgb(0x66, 0x00, 0x00));

            Text = "Custom serializable shape";

            m_boolProperty = false;
        }
            public NExpandCollapseCheck()
            {
                // base
                Primitives.AddChild(new NRectanglePath(-1, -1, 2, 2));

                // plus
                GraphicsPath path = new GraphicsPath();

                path.AddLine(new PointF(-0.5f, 0), new PointF(0.5f, 0));
                path.StartFigure();
                path.AddLine(new PointF(0, 0.5f), new PointF(0, -0.5f));

                NCustomPath customPath = new NCustomPath(path, PathType.OpenFigure);

                customPath.Visible = false;

                Primitives.AddChild(customPath);

                // minus
                NLinePath linePath = new NLinePath(-0.5f, 0, 0.5f, 0);

                Primitives.AddChild(linePath);

                // update the model bounds to fit the primitives
                UpdateModelBounds();

                // destory all optional shape elements
                DestroyShapeElements(ShapeElementsMask.All);

                // add interactivity
                Style.InteractivityStyle            = new NInteractivityStyle(true, string.Empty, "Click to expand/collapse subtree", CursorType.Hand);
                linePath.Style                      = linePath.ComposeStyle();
                linePath.Style.InteractivityStyle   = new NInteractivityStyle(true, string.Empty, "Click to expand/collapse subtree", CursorType.Hand);
                customPath.Style                    = customPath.ComposeStyle();
                customPath.Style.InteractivityStyle = new NInteractivityStyle(true, string.Empty, "Click to expand/collapse subtree", CursorType.Hand);
            }