示例#1
0
        private void InitSubEntries()
        {
            ArrayList gp = new ArrayList();

            // wenn der Pfad zu viele Eckpunkte hat, gibts Probleme mit der WindowHandles
            for (int i = 0; i <= path.CurveCount; ++i) // mit Endpunkt
            {
                GeoPointProperty vertex = new GeoPointProperty("Path.Vertex", Frame, true);
                vertex.UserData.Add("Index", i);
                vertex.GetGeoPointEvent               += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetVertexPoint);
                vertex.SetGeoPointEvent               += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetVertexPoint);
                vertex.ModifyWithMouseEvent           += new ModifyWithMouseDelegate(ModifyVertexWithMouse);
                vertex.PropertyEntryChangedStateEvent += new PropertyEntryChangedStateDelegate(OnVertexStateChanged);
                vertex.GeoPointChanged();
                if (path.IsClosed)
                {
                    vertex.PrependContextMenu = MenuResource.LoadMenuDefinition("MenuId.Path.Vertex", false, new VertexCommandHandler(this, i));
                }

                gp.Add(vertex);
            }
            area                 = new DoubleProperty("Path.Area", Frame);
            area.ReadOnly        = true;
            area.GetDoubleEvent += new CADability.UserInterface.DoubleProperty.GetDoubleDelegate(OnGetArea);
            area.Refresh();
            gp.Add(area);
            length                 = new DoubleProperty("Path.Length", Frame);
            length.ReadOnly        = true;
            length.GetDoubleEvent += new CADability.UserInterface.DoubleProperty.GetDoubleDelegate(OnGetLength);
            length.Refresh();
            gp.Add(length);
            subEntries          = (IPropertyEntry[])gp.ToArray(typeof(IPropertyEntry));
            attributeProperties = path.GetAttributeProperties(Frame);
        }
示例#2
0
 private void OnGeoObjectDidChange(IGeoObject Sender, GeoObjectChange Change)
 {
     centerProperty.GeoPointChanged();
     majorRadiusProperty.LengthChanged();
     majorRadiusHotSpot[0].Position = ellipse.Center + 2.0 / 3.0 * ellipse.MajorAxis;
     majorRadiusHotSpot[1].Position = ellipse.Center - 2.0 / 3.0 * ellipse.MajorAxis;
     minorRadiusProperty.LengthChanged();
     minorRadiusHotSpot[0].Position = ellipse.Center + 2.0 / 3.0 * ellipse.MinorAxis;
     minorRadiusHotSpot[1].Position = ellipse.Center - 2.0 / 3.0 * ellipse.MinorAxis;
     majorAxisProperty.GeoVectorChanged();
     majorAxisHotSpot[0].Position = ellipse.Center + ellipse.MajorAxis;
     majorAxisHotSpot[1].Position = ellipse.Center - ellipse.MajorAxis;
     minorAxisProperty.GeoVectorChanged();
     minorAxisHotSpot[0].Position = ellipse.Center + ellipse.MinorAxis;
     minorAxisHotSpot[1].Position = ellipse.Center - ellipse.MinorAxis;
     if (startAngleProperty != null)
     {
         startAngleProperty.AngleChanged();
         startAngleHotSpot.Position = ellipse.StartPoint;
         startPointProperty.Refresh();
         if (endAngleProperty != null)
         {
             endAngleProperty.AngleChanged();
             endAngleHotSpot.Position = ellipse.EndPoint;
             endPointProperty.Refresh();
         }
     }
     if (directionProperty != null)
     {
         directionProperty.Refresh();
     }
 }
示例#3
0
 private void OnGeoObjectDidChange(IGeoObject Sender, GeoObjectChange Change)
 {
     centerProperty.GeoPointChanged();
     radiusProperty.LengthChanged();
     diameterProperty.LengthChanged();
     if (radiusHotSpots != null)
     {
         radiusHotSpots[0].Position = circle.Center + circle.MajorAxis;
         radiusHotSpots[1].Position = circle.Center - circle.MajorAxis;
         radiusHotSpots[2].Position = circle.Center + circle.MinorAxis;
         radiusHotSpots[3].Position = circle.Center - circle.MinorAxis;
         if (HotspotChangedEvent != null)
         {
             HotspotChangedEvent(radiusHotSpots[0], HotspotChangeMode.Moved);
             HotspotChangedEvent(radiusHotSpots[1], HotspotChangeMode.Moved);
             HotspotChangedEvent(radiusHotSpots[2], HotspotChangeMode.Moved);
             HotspotChangedEvent(radiusHotSpots[3], HotspotChangeMode.Moved);
         }
     }
     if (startAngleProperty != null)
     {
         startAngleProperty.AngleChanged();
         if (endAngleProperty != null)
         {
             endAngleProperty.AngleChanged();
         }
         startPointProperty.Refresh();
         if (endAngleProperty != null)
         {
             endPointProperty.Refresh();
         }
         startAngleHotSpot.Position = circle.StartPoint;
         if (endAngleProperty != null)
         {
             endAngleHotSpot.Position = circle.EndPoint;
         }
         if (HotspotChangedEvent != null)
         {
             HotspotChangedEvent(startAngleHotSpot, HotspotChangeMode.Moved);
             if (endAngleProperty != null)
             {
                 HotspotChangedEvent(endAngleHotSpot, HotspotChangeMode.Moved);
             }
         }
     }
     if (arcLengthProperty != null)
     {
         arcLengthProperty.Refresh();
     }
     if (directionProperty != null)
     {
         directionProperty.Refresh();
     }
 }
示例#4
0
        private void DimensionDidChange(IGeoObject Sender, GeoObjectChange Change)
        {
            if (ignoreChange)
            {
                return;               // es wird. z.B. gerade ein Punkt entfernt
            }
            // und die Properties müssen erst wieder neu Refresht werden

            if (HotspotChangedEvent != null)
            {   // mitführen der TextHotSpots. Die Hotspots der Punkte werden automatisch
                // mitgeführt, ebenso der für die DimLineRef
                for (int i = 0; i < textPosHotSpot.Length; ++i)
                {
                    textPos[i].DoubleChanged();
                    textPosHotSpot[i].Position = dimension.GetTextPosCoordinate(i, Frame.ActiveView.Projection);
                    HotspotChangedEvent(textPosHotSpot[i], HotspotChangeMode.Moved);
                }
                if (startAngle != null)
                {
                    startAngle.GeoVectorChanged();
                    endAngle.GeoVectorChanged();
                    startAngle.SetHotspotPosition(dimension.GetPoint(1));
                    endAngle.SetHotspotPosition(dimension.GetPoint(2));
                    HotspotChangedEvent(startAngleHotSpot, HotspotChangeMode.Moved);
                    HotspotChangedEvent(endAngleHotSpot, HotspotChangeMode.Moved);
                }
                if (centerProperty != null)
                {
                    centerProperty.GeoPointChanged(); // Refresh
                    HotspotChangedEvent(centerProperty, HotspotChangeMode.Moved);
                }
                if (radiusProperty != null)
                {
                    radiusProperty.DoubleChanged();
                }
            }
            int numprop = 1;

            if (dimension.DimType == Dimension.EDimType.DimPoints || dimension.DimType == Dimension.EDimType.DimCoord)
            {
                numprop = dimension.PointCount - 1;
            }
            if (numprop != dimText.Length)
            {
                Opened(false); // alle hotspots abmelden
                Init();
                if (propertyPage != null)
                {
                    propertyPage.Refresh(this);
                    propertyPage.OpenSubEntries(points, true);
                }
            }
        }
示例#5
0
        private IPropertyEntry[] attributeProperties; // Anzeigen für die Attribute (Ebene, Farbe u.s.w)

        public ShowPropertyPoint(Point point, IFrame frame) : base(frame)
        {
            this.point       = point;
            locationProperty = new GeoPointProperty("Point.Location", Frame, true);
            locationProperty.GetGeoPointEvent += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetLocation);
            locationProperty.SetGeoPointEvent += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetLocation);
            locationProperty.GeoPointChanged(); // Initialisierung
            locationProperty.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyLocationWithMouse);
            locationProperty.StateChangedEvent    += new StateChangedDelegate(OnStateChanged);

            attributeProperties = point.GetAttributeProperties(Frame);

            resourceId = "Point.Object";
        }
示例#6
0
 private void OnPointDidChange(IGeoObject Sender, GeoObjectChange Change)
 {
     locationProperty.GeoPointChanged();
 }