/// <summary> /// Handles the click event by opening the text tool dialog. /// </summary> /// <param name="e">EventArgs.</param> /// <param name="position">Mouse position.</param> /// <returns>The mouse state handler for handling the next mouse events.</returns> public override void OnClick(PointD3D position, MouseButtonEventArgs e) { base.OnClick(position, e); _cachedActiveLayer = _grac.ActiveLayer; _cachedActiveLayerTransformation = _cachedActiveLayer.TransformationFromRootToHere(); PointD3D hitPointOnLayerPlaneInLayerCoordinates; VectorD3D rotationsRadian; GetHitPointOnActiveLayerPlaneFacingTheCamera(_grac.Doc, _grac.ActiveLayer, position, out hitPointOnLayerPlaneInLayerCoordinates, out rotationsRadian); TextGraphic tgo = new TextGraphic(_grac.Doc.GetPropertyContext()); tgo.SetParentSize(_cachedActiveLayer.Size, false); tgo.Position = hitPointOnLayerPlaneInLayerCoordinates; tgo.RotationX = (rotationsRadian.X / Math.PI) * 180; tgo.RotationY = (rotationsRadian.Y / Math.PI) * 180; tgo.RotationZ = (rotationsRadian.Z / Math.PI) * 180; tgo.ParentObject = _grac.ActiveLayer; // deselect the text tool _grac.SetGraphToolFromInternal(GraphToolType.ObjectPointer); object tgoo = tgo; if (Current.Gui.ShowDialog(ref tgoo, "Text", false)) { tgo = (TextGraphic)tgoo; if (tgo != null && !tgo.Empty) { _grac.ActiveLayer.GraphObjects.Add(tgo); } } }
public void CopyFrom(TextGraphic from) { CopyFrom((GraphicBase)from); }
public TextGraphic(TextGraphic from) : base(from) // all is done here, since CopyFrom is virtual! { }
public void CopyFrom(TextGraphic from) { CopyFrom((GraphicBase)from); }
public TextGraphic(TextGraphic from) : base(from) // all is done here, since CopyFrom is virtual! { }