Exemplo n.º 1
0
        private void allowDownwardCheck_CheckedChanged(object sender, System.EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            // get the selected label
            NLogicalLineLabel label = labelsCombo.SelectedItem as NLogicalLineLabel;

            if (label == null)
            {
                return;
            }

            // specify whether the logical line can have downward orientation
            label.AllowDownwardOrientation = allowDownwardCheck.Checked;
            document.SmartRefreshAllViews();
        }
Exemplo n.º 2
0
        private void percentPositionNumeric_ValueChanged(object sender, System.EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            // get the selected label
            NLogicalLineLabel label = labelsCombo.SelectedItem as NLogicalLineLabel;

            if (label == null)
            {
                return;
            }

            // change the logical line label percent position
            label.PercentPosition = (float)percentPositionNumeric.Value;
            document.SmartRefreshAllViews();
        }
Exemplo n.º 3
0
        private void useLineOrientationCheck_CheckedChanged(object sender, System.EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            // get the selected label
            NLogicalLineLabel label = labelsCombo.SelectedItem as NLogicalLineLabel;

            if (label == null)
            {
                return;
            }

            // specify whether the logical line label should follow the line orientation
            label.UseLineOrientation = useLineOrientationCheck.Checked;
            document.SmartRefreshAllViews();
        }
Exemplo n.º 4
0
        private void InitDocument()
        {
            // create a rectangle shape with a 2 bounds label
            NShape shape = new NRectangleShape(base.GetGridCell(0, 0));

            shape.Style.FillStyle = new NColorFillStyle(Color.FromArgb(50, 0xcc, 0, 0));

            shape.Labels.RemoveAllChildren();

            NBoundsLabel boundsLabel = new NBoundsLabel("Label 1, Wrapped", shape.UniqueId, new Nevron.Diagram.NMargins(0, 0, 0, 50));

            shape.Labels.AddChild(boundsLabel);
            shape.Labels.DefaultLabelUniqueId = boundsLabel.UniqueId;

            boundsLabel      = new NBoundsLabel("Label 2, Stretched", shape.UniqueId, new Nevron.Diagram.NMargins(0, 0, 50, 0));
            boundsLabel.Mode = BoxTextMode.Stretch;
            shape.Labels.AddChild(boundsLabel);

            document.ActiveLayer.AddChild(shape);

            // create a rectangle shape with a 2 rotated bounds labels
            shape = new NRectangleShape(base.GetGridCell(0, 1));
            shape.Style.FillStyle = new NColorFillStyle(Color.FromArgb(50, 0, 0, 0xcc));

            shape.Labels.RemoveAllChildren();

            NRotatedBoundsLabel rotatedLabel = new NRotatedBoundsLabel("Rotated Label 1, Wrapped", shape.UniqueId, new Nevron.Diagram.NMargins(0, 0, 0, 50));

            shape.Labels.AddChild(rotatedLabel);
            shape.Labels.DefaultLabelUniqueId = rotatedLabel.UniqueId;

            rotatedLabel      = new NRotatedBoundsLabel("Rotated Label 2, Stretched", shape.UniqueId, new Nevron.Diagram.NMargins(0, 0, 50, 0));
            rotatedLabel.Mode = BoxTextMode.Stretch;
            shape.Labels.AddChild(rotatedLabel);

            document.ActiveLayer.AddChild(shape);

            // create a polyline shape with two logical line labels
            NRectangleF cell = base.GetGridCell(1, 0, 0, 1);

            shape = new NPolylineShape(new NPointF[] { cell.Location, cell.RightBottom });

            shape.Labels.RemoveAllChildren();

            NLogicalLineLabel lineLabel = new NLogicalLineLabel("Line label - start", shape.UniqueId, 0, true, true);

            shape.Labels.AddChild(lineLabel);
            shape.Labels.DefaultLabelUniqueId = lineLabel.UniqueId;

            // alter the start label text style
            NTextStyle textStyle = document.Style.TextStyle.Clone() as NTextStyle;

            textStyle.StringFormatStyle.HorzAlign = HorzAlign.Left;
            textStyle.Offset = new NPointL(0, -7);
            NStyle.SetTextStyle(lineLabel, textStyle);

            // add the end label
            lineLabel = new NLogicalLineLabel("Line label - end", shape.UniqueId, 100, true, true);
            shape.Labels.AddChild(lineLabel);

            // alter the end label text style
            textStyle = document.Style.TextStyle.Clone() as NTextStyle;
            textStyle.StringFormatStyle.HorzAlign = HorzAlign.Right;
            textStyle.Offset = new NPointL(0, -7);
            NStyle.SetTextStyle(lineLabel, textStyle);

            document.ActiveLayer.AddChild(shape);
        }